[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz gfx/jni/GzzGL-jni.cxx gzz/client/GraphicsAP...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz gfx/jni/GzzGL-jni.cxx gzz/client/GraphicsAP... |
Date: |
Thu, 05 Dec 2002 04:29:44 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/12/05 04:29:43
Modified files:
gfx/jni : GzzGL-jni.cxx
gzz/client : GraphicsAPI.java
gzz/client/awt : AWTScreen.java
gzz/client/gl : GLScreen.java
gzz/gfx/gl : GL.java
Log message:
More refactoring for off-screen
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/jni/GzzGL-jni.cxx.diff?tr1=1.67&tr2=1.68&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/client/GraphicsAPI.java.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/client/awt/AWTScreen.java.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/client/gl/GLScreen.java.diff?tr1=1.39&tr2=1.40&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GL.java.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
Patches:
Index: gzz/gfx/jni/GzzGL-jni.cxx
diff -u gzz/gfx/jni/GzzGL-jni.cxx:1.67 gzz/gfx/jni/GzzGL-jni.cxx:1.68
--- gzz/gfx/jni/GzzGL-jni.cxx:1.67 Thu Dec 5 03:08:11 2002
+++ gzz/gfx/jni/GzzGL-jni.cxx Thu Dec 5 04:29:43 2002
@@ -274,6 +274,13 @@
return 0;
}
+// RenderingSurface
+
+JNIEXPORT jint JNICALL Java_gzz_gfx_gl_GL_createRenderingSurfaceImpl
+ (JNIEnv *env, jclass, jint w, jint h) {
+ Os::RenderingSurface *win = ws->openStableOffScreen(w, h);
+ return windows.add(win);
+}
// Window
Index: gzz/gzz/client/GraphicsAPI.java
diff -u gzz/gzz/client/GraphicsAPI.java:1.24
gzz/gzz/client/GraphicsAPI.java:1.25
--- gzz/gzz/client/GraphicsAPI.java:1.24 Mon Oct 14 14:15:19 2002
+++ gzz/gzz/client/GraphicsAPI.java Thu Dec 5 04:29:43 2002
@@ -88,26 +88,19 @@
*/
public abstract TextStyle getTextStyle(String family, int style, int size);
- /** An interface for windows visible on the screen.
+ /** An interface for generic rendering surfaces.
*/
- static public abstract class Window {
-
+ static public interface RenderingSurface {
/** Get the current size of the window.
*/
- abstract public Dimension getSize();
-
- /** Try to set the location and size of the window.
- * Not guaranteed to succeed.
- */
- abstract public void setLocation(int x, int y, int w, int h) ;
-
+ Dimension getSize();
/** Render the still image of the vobscreen.
*/
- abstract public void renderStill(VobScene vs, float lod);
+ void renderStill(VobScene vs, float lod);
/** Render the interpolated form between the two vobscenes.
*/
- abstract public void renderAnim(VobScene from, VobScene to, float
fract, float lod, boolean showFinal);
+ void renderAnim(VobScene from, VobScene to, float fract, float lod,
boolean showFinal);
/** Create a new vobscene of the appropriate type, with current window
* size as size.
@@ -115,39 +108,66 @@
* to clear the window etc., since vobscenes can be used as
* viewports.
*/
- public VobScene createVobScene() {
- return createVobScene(getSize());
- }
+ VobScene createVobScene() ;
+
/** Create a new vobscene of the appropriate type for this window.
*/
- public abstract VobScene createVobScene(Dimension size) ;
+ VobScene createVobScene(Dimension size) ;
+
+ /** Read pixels from the screen.
+ * @return An array of size w*h, of A, R, G, B from
+ * highest to lowest bit. (BGRA)
+ */
+ int[] readPixels(int x, int y, int w, int h) ;
+ }
+
+ /** An interface for windows visible on the screen.
+ */
+ static public interface Window extends RenderingSurface {
+
+ /** Try to set the location and size of the window.
+ * Not guaranteed to succeed.
+ */
+ void setLocation(int x, int y, int w, int h) ;
/** Set the event handler for the window.
*/
- abstract public void registerBinder(Binder s);
+ void registerBinder(Binder s);
/** Add a timeout: Binder.timeout() is called after
* given number of milliseconds.
*/
- public void addTimeout(int ms, Object o) {
- throw new UnsupportedOperationException("Not in this gfxapi");
- }
+ void addTimeout(int ms, Object o);
+
+ /** Get the GraphicsAPI this window is associated with.
+ */
+ GraphicsAPI getGraphicsAPI();
- public Window(GraphicsAPI api) {
+ }
+
+
+ static public abstract class AbstractRenderingSurface implements
RenderingSurface {
+ private final GraphicsAPI gfxapi;
+ public AbstractRenderingSurface(GraphicsAPI api) {
this.gfxapi = api;
}
- private final GraphicsAPI gfxapi;
+ public GraphicsAPI getGraphicsAPI() { return gfxapi; }
+ public VobScene createVobScene() {
+ return createVobScene(getSize());
+ }
+ }
+
+ static public abstract class AbstractWindow extends
AbstractRenderingSurface implements Window {
+ public AbstractWindow(GraphicsAPI api) {
+ super(api);
+ }
+
+ public void addTimeout(int ms, Object o) {
+ throw new UnsupportedOperationException("Not in this gfxapi");
+ }
- /** Read pixels from the screen.
- * @return An array of size w*h, of A, R, G, B from
- * highest to lowest bit. (BGRA)
- */
- public abstract int[] readPixels(int x, int y, int w, int h) ;
- /** Get the GraphicsAPI this window is associated with.
- */
- public GraphicsAPI getGraphicsAPI() { return gfxapi; }
}
}
Index: gzz/gzz/client/awt/AWTScreen.java
diff -u gzz/gzz/client/awt/AWTScreen.java:1.26
gzz/gzz/client/awt/AWTScreen.java:1.27
--- gzz/gzz/client/awt/AWTScreen.java:1.26 Tue Nov 12 04:37:56 2002
+++ gzz/gzz/client/awt/AWTScreen.java Thu Dec 5 04:29:43 2002
@@ -35,9 +35,9 @@
/** A single output window.
*/
public abstract class AWTScreen
- extends GraphicsAPI.Window
+ extends GraphicsAPI.AbstractWindow
implements MouseListener, MouseMotionListener, Obs,
JUpdateManager.EventProcessor {
- public static final String rcsid = "$Id: AWTScreen.java,v 1.26 2002/11/12
09:37:56 humppake Exp $";
+ public static final String rcsid = "$Id: AWTScreen.java,v 1.27 2002/12/05
09:29:43 tjl Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.out.println(s); }
Index: gzz/gzz/client/gl/GLScreen.java
diff -u gzz/gzz/client/gl/GLScreen.java:1.39
gzz/gzz/client/gl/GLScreen.java:1.40
--- gzz/gzz/client/gl/GLScreen.java:1.39 Sat Nov 9 15:19:26 2002
+++ gzz/gzz/client/gl/GLScreen.java Thu Dec 5 04:29:43 2002
@@ -34,8 +34,8 @@
import java.util.HashMap;
-public class GLScreen extends GraphicsAPI.Window {
-public static final String rcsid = "$Id: GLScreen.java,v 1.39 2002/11/09
20:19:26 tjl Exp $";
+public class GLScreen extends GraphicsAPI.AbstractWindow {
+public static final String rcsid = "$Id: GLScreen.java,v 1.40 2002/12/05
09:29:43 tjl Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
Index: gzz/gzz/gfx/gl/GL.java
diff -u gzz/gzz/gfx/gl/GL.java:1.26 gzz/gzz/gfx/gl/GL.java:1.27
--- gzz/gzz/gfx/gl/GL.java:1.26 Thu Dec 5 03:08:11 2002
+++ gzz/gzz/gfx/gl/GL.java Thu Dec 5 04:29:43 2002
@@ -322,6 +322,10 @@
*/
public void release() { impl_Window_release(getId()); }
}
+ static public RenderingSurface createStableRenderingSurface(int w, int h) {
+ return new RenderingSurface(createStableRenderingSurfaceImpl(w, h));
+ }
+ static private native int createStableRenderingSurfaceImpl(int w, int h);
//--------- Window
/** An on-screen GLX window into which graphics can be drawn.
*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz gfx/jni/GzzGL-jni.cxx gzz/client/GraphicsAP...,
Tuomas J. Lukka <=