gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gfx demo/irregu3.py jni/GzzGL-jni.cxx libca...


From: Janne V. Kujala
Subject: [Gzz-commits] gzz/gfx demo/irregu3.py jni/GzzGL-jni.cxx libca...
Date: Fri, 01 Nov 2002 06:24:11 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Janne V. Kujala <address@hidden>        02/11/01 06:24:11

Modified files:
        gfx/demo       : irregu3.py 
        gfx/jni        : GzzGL-jni.cxx 
        gfx/libcallgl  : callgl.hxx 

Log message:
        Replace GL.VertexProgramNV with a general GL.Program class

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/irregu3.py.diff?tr1=1.36&tr2=1.37&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/jni/GzzGL-jni.cxx.diff?tr1=1.57&tr2=1.58&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcallgl/callgl.hxx.diff?tr1=1.21&tr2=1.22&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/irregu3.py
diff -u gzz/gfx/demo/irregu3.py:1.36 gzz/gfx/demo/irregu3.py:1.37
--- gzz/gfx/demo/irregu3.py:1.36        Thu Oct 31 12:35:54 2002
+++ gzz/gfx/demo/irregu3.py     Fri Nov  1 06:24:11 2002
@@ -66,7 +66,7 @@
         radius = 2
         dh = [ sqrt(radius**2 - d**2) for d in range(0,radius+1) ]
 
-        code = """!!FP1.0;
+        code = """!!FP1.0
         # Inputs:
         # f[TEX0].xy texture coordinates
         # f[TEX0].z  displacement
@@ -105,7 +105,12 @@
         code += """
         # Add displacement and use as output color
         ADD o[COLR], R1, f[TEX0].z;
+
+        END
         """
+
+        global fragprog
+        fragprog = GL.createProgram(code)
     
     if profile == "NV_SHAD":
         print "Using 2-vector HILO displacement texture with 
GL_NV_texture_shader"
Index: gzz/gfx/jni/GzzGL-jni.cxx
diff -u gzz/gfx/jni/GzzGL-jni.cxx:1.57 gzz/gfx/jni/GzzGL-jni.cxx:1.58
--- gzz/gfx/jni/GzzGL-jni.cxx:1.57      Fri Nov  1 03:05:13 2002
+++ gzz/gfx/jni/GzzGL-jni.cxx   Fri Nov  1 06:24:11 2002
@@ -636,8 +636,8 @@
 }
 
 
-// VertexProgramNV
-JNIEXPORT jint JNICALL Java_gzz_gfx_gl_GL_impl_1createVertexProgramNV
+// OpenGL Program
+JNIEXPORT jint JNICALL Java_gzz_gfx_gl_GL_impl_1createProgram
   (JNIEnv *, jclass) {
       setWindow();
       GLuint ret;
@@ -649,7 +649,7 @@
       return ret;
 }
 
-JNIEXPORT void JNICALL Java_gzz_gfx_gl_GL_impl_1deleteVertexProgramNV
+JNIEXPORT void JNICALL Java_gzz_gfx_gl_GL_impl_1deleteProgram
   (JNIEnv *, jclass, jint id) {
 #ifdef GL_VERTEX_PROGRAM_NV
       setWindow();
@@ -659,14 +659,12 @@
 #endif
 }
 
-JNIEXPORT jint JNICALL Java_gzz_gfx_gl_GL_impl_1VertexProgramNV_1load
+JNIEXPORT jint JNICALL Java_gzz_gfx_gl_GL_impl_1Program_1load
   (JNIEnv *env, jclass, jint id, jstring prog) {
 #ifdef GL_VERTEX_PROGRAM_NV
       setWindow();
       std::string prog_utf = jstr2stdstr(env, prog);
-      glLoadProgramNV(GL_VERTEX_PROGRAM_NV, id, 
-               strlen(prog_utf.c_str()), (const GLubyte *)prog_utf.c_str());
-      GLERR
+      CallGL::loadProgram(id, prog_utf);
       releaseWindow();
 #endif
       return 1;
Index: gzz/gfx/libcallgl/callgl.hxx
diff -u gzz/gfx/libcallgl/callgl.hxx:1.21 gzz/gfx/libcallgl/callgl.hxx:1.22
--- gzz/gfx/libcallgl/callgl.hxx:1.21   Fri Nov  1 06:03:17 2002
+++ gzz/gfx/libcallgl/callgl.hxx        Fri Nov  1 06:24:11 2002
@@ -179,7 +179,7 @@
     /** An instance of an NVIDIA program loaded into the driver.
      * The NVProg objects are immutable with value semantics.
      * Example:
-     *                 NVProg<GL_VERTEX_PROGRAM_NV> code("!!VP1.0;MOV o[HPOS], 
v[OPOS];END");
+     *                 NVProg<GL_VERTEX_PROGRAM_NV> code("!!VP1.0 MOV 
o[HPOS],v[OPOS];END");
      */
     template <GLuint TARGET>
     class NVProg {




reply via email to

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