fenfire-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ff-cvs] libvob org/nongnu/libvob/gl/GL.java org/nongnu/...


From: Tuomas J. Lukka
Subject: [ff-cvs] libvob org/nongnu/libvob/gl/GL.java org/nongnu/...
Date: Mon, 22 Sep 2003 03:24:55 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Tuomas J. Lukka <address@hidden>        03/09/22 03:24:54

Modified files:
        org/nongnu/libvob/gl: GL.java basicrender.test 
        src/jni        : Main.cxx 
        test/tools     : gfx.py 

Log message:
        Arch sync

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/gl/GL.java.diff?tr1=1.23&tr2=1.24&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/gl/basicrender.test.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Main.cxx.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/test/tools/gfx.py.diff?tr1=1.11&tr2=1.12&r1=text&r2=text

Patches:
Index: libvob/org/nongnu/libvob/gl/GL.java
diff -u libvob/org/nongnu/libvob/gl/GL.java:1.23 
libvob/org/nongnu/libvob/gl/GL.java:1.24
--- libvob/org/nongnu/libvob/gl/GL.java:1.23    Sun Sep 21 09:35:06 2003
+++ libvob/org/nongnu/libvob/gl/GL.java Mon Sep 22 03:24:53 2003
@@ -659,12 +659,12 @@
        /** Start compiling the display list.
         * @deprecated Use CallGL
         */
-       public void startCompile(Window w) { GL.startCompile(getId(), 
+       public void startCompile(RenderingSurface w) { GL.startCompile(getId(), 
                                                    w.getId()); }
        /** Start compiling the display list.
         * @deprecated Use CallGL
         */
-       public void endCompile(Window w) { GL.endCompile(getId(), 
+       public void endCompile(RenderingSurface w) { GL.endCompile(getId(), 
                                                    w.getId()); }
 
        /** Compile the given string using the CallGL library
@@ -675,7 +675,7 @@
 
        /** Call the display list in the given window.
         */
-       public void call(Window w) { GL.impl_DisplayList_call(getId(), 
w.getId()); }
+       public void call(RenderingSurface w) { 
GL.impl_DisplayList_call(getId(), w.getId()); }
        /** Call the display list in the default context.
         */
        public void call() { GL.impl_DisplayList_call0(getId()); }
@@ -746,7 +746,7 @@
         * @param x,y The coordinates to set raster position to.
         *              This is a bit kludgy...
         */
-       public void drawPixels(Window win,
+       public void drawPixels(RenderingSurface win,
                int x, int y, float z, int width, int height,
                String format, String type) {
            impl_ByteVector_drawPixels(getId(), win.getId(),
@@ -880,7 +880,7 @@
 
     /** CallGL the given string in the given window.
      */
-    public static void call(String s, Window w) {
+    public static void call(String s, RenderingSurface w) {
        call(s, w.getId());
     }
     private static native void call(String s, int id) ;
Index: libvob/org/nongnu/libvob/gl/basicrender.test
diff -u libvob/org/nongnu/libvob/gl/basicrender.test:1.1 
libvob/org/nongnu/libvob/gl/basicrender.test:1.2
--- libvob/org/nongnu/libvob/gl/basicrender.test:1.1    Mon Sep  8 00:51:57 2003
+++ libvob/org/nongnu/libvob/gl/basicrender.test        Mon Sep 22 03:24:53 2003
@@ -27,6 +27,8 @@
 
 from test.tools.gfx import *
 
+import vob
+
 def testBgTriangle():
     vs = getvs()
     vs.map.put(vob.vobs.SolidBackdropVob(Color.red))
@@ -42,5 +44,39 @@
     render(vs)
     checkAvgColor(10, 10, 2, 2, (255, 0, 0), 2)
     checkAvgColor(110, 110, 2, 2, (0, 255, 0), 2)
+
+def testGLCalls():
+    """Check that immediate GL calls with and without
+    windows work.
+    """
+    vs = getvs()
+    # Don't use Solidbackdrop as it sets Color.
+    vs.map.put(vob.gl.GLCache.getCallList("""
+       ClearColor 0 0 0 0
+       Clear COLOR_BUFFER_BIT DEPTH_BUFFER_BIT
+       Disable TEXTURE_2D
+       Begin TRIANGLES
+       Vertex 100 100
+       Vertex 100 200
+       Vertex 200 100
+       End
+    """))
+    vob.gl.GL.call("Color 1 1 0\n", 
vob.putil.demowindow.w.getRenderingSurface())
+    render(vs)
+    checkAvgColor(110, 110, 2, 2, (255, 255, 0), 2)
+    vob.gl.GL.call("Color 0 0 1\n", 
vob.putil.demowindow.w.getRenderingSurface())
+    render(vs)
+    checkAvgColor(110, 110, 2, 2, (0, 0, 255), 2)
+
+    # This should, in principle, work ,
+    # but it appears not to - the current colors
+    # appear not to be saved across windows in NV drivers 44.96.
+    ####
+    # vob.gl.GL.call("Color 1 1 0\n")
+    # render(vs)
+    # checkAvgColor(110, 110, 2, 2, (255, 255, 0), 2)
+    # vob.gl.GL.call("Color 0 0 1\n")
+    # render(vs)
+    # checkAvgColor(110, 110, 2, 2, (0, 0, 255), 2)
 
 # : vim: set syntax=python :
Index: libvob/src/jni/Main.cxx
diff -u libvob/src/jni/Main.cxx:1.24 libvob/src/jni/Main.cxx:1.25
--- libvob/src/jni/Main.cxx:1.24        Sun Sep 21 09:35:06 2003
+++ libvob/src/jni/Main.cxx     Mon Sep 22 03:24:53 2003
@@ -698,8 +698,9 @@
 
 // Real program immediate execution
 
-jf(void, call)
+JNIEXPORT void JNICALL Java_org_nongnu_libvob_gl_GL_call__Ljava_lang_String_2I
   (JNIEnv *env, jclass, jstring code, jint window) {
+      DBG(dbg) << "call(s,w)\n";
       std::string utf = jstr2stdstr(env, code);
       DBG(dbg) << "got str\n";
       setWindow(window);
@@ -708,8 +709,9 @@
       DBG(dbg) << "called\n";
   }
 
-jf(void, call0)
+JNIEXPORT void JNICALL Java_org_nongnu_libvob_gl_GL_call__Ljava_lang_String_2
   (JNIEnv *env, jclass, jstring code) {
+      DBG(dbg) << "call(s)\n";
       std::string utf = jstr2stdstr(env, code);
       DBG(dbg) << "got str\n";
       CallGL::callGL(utf.c_str());
Index: libvob/test/tools/gfx.py
diff -u libvob/test/tools/gfx.py:1.11 libvob/test/tools/gfx.py:1.12
--- libvob/test/tools/gfx.py:1.11       Wed May 14 18:03:30 2003
+++ libvob/test/tools/gfx.py    Mon Sep 22 03:24:54 2003
@@ -25,7 +25,7 @@
 
 from java.awt import Color
 
-from org.nongnu import libvob as vob
+import vob
 
 _didRender = 0
 
@@ -60,6 +60,8 @@
     win = _realwin
 
 print "GW: ",win
+
+vob.putil.demowindow.w = win
 
 def failUnless(b, msg=None):
     if not b:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]