diff options
author | Kenneth Russel <[email protected]> | 2005-07-08 16:03:14 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-07-08 16:03:14 +0000 |
commit | affb27f968fb3cb7902146ad7b521b7b24d18fe5 (patch) | |
tree | f9aa81f35a16c15726f3df234ef78b60dbd9ccb0 /src/demos/cg | |
parent | 3cce9fefe99b2a9fe7372c5be21ba7a49f98bf66 (diff) |
Fixed Windows port after changes to GlueGen to include array offsets.
Ported all demos to new API. Temporarily added back in GLU entry
points taking primitive arrays as the underlying APIs (in particular,
glTexImage2D) do not yet support non-direct Buffers. Changed C code
generation to only add in array offset if array is non-null. Fixed bug
in GLU tesselator demo's vertex callback.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@99 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/cg')
-rw-r--r-- | src/demos/cg/runtime_ogl/cgGL_vertex_example.java | 4 | ||||
-rw-r--r-- | src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/demos/cg/runtime_ogl/cgGL_vertex_example.java b/src/demos/cg/runtime_ogl/cgGL_vertex_example.java index f1f41dd..2a43fd6 100644 --- a/src/demos/cg/runtime_ogl/cgGL_vertex_example.java +++ b/src/demos/cg/runtime_ogl/cgGL_vertex_example.java @@ -228,8 +228,8 @@ public class cgGL_vertex_example implements GLEventListener InitializeCube(CubeVertices); /* Enable a single OpenGL light. */ - gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, LightDiffuse); - gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, LightPosition); + gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, LightDiffuse, 0); + gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, LightPosition, 0); gl.glEnable(GL.GL_LIGHT0); if (false) { // #if 0 gl.glEnable(GL.GL_LIGHTING); diff --git a/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java b/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java index 0c389e1..57693b4 100644 --- a/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java +++ b/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java @@ -168,15 +168,15 @@ public class runtime_ogl_vertex_fragment implements GLEventListener // vertex shader could be modified so that these were uniform for // better efficiency, but this gives us flexibility for the future. float Kd[] = { .7f, .2f, .2f }, Ks[] = { .9f, .9f, .9f }; - CgGL.cgGLSetParameter3fv(CgGL.cgGetNamedParameter(vertexProgram, "diffuse"), Kd); - CgGL.cgGLSetParameter3fv(CgGL.cgGetNamedParameter(vertexProgram, "specular"), Ks); + CgGL.cgGLSetParameter3fv(CgGL.cgGetNamedParameter(vertexProgram, "diffuse"), Kd, 0); + CgGL.cgGLSetParameter3fv(CgGL.cgGetNamedParameter(vertexProgram, "specular"), Ks, 0); // Now bind uniform parameters to fragment shader float lightPos[] = { 3, 2, -3 }; - CgGL.cgGLSetParameter3fv(CgGL.cgGetNamedParameter(fragmentProgram, "Plight"), lightPos); + CgGL.cgGLSetParameter3fv(CgGL.cgGetNamedParameter(fragmentProgram, "Plight"), lightPos, 0); float lightColor[] = { 1, 1, 1 }; CgGL.cgGLSetParameter3fv(CgGL.cgGetNamedParameter(fragmentProgram, "lightColor"), - lightColor); + lightColor, 0); CgGL.cgGLSetParameter1f(CgGL.cgGetNamedParameter(fragmentProgram, "shininess"), 40); // And finally, enable the approprate texture for fragment shader; the @@ -273,7 +273,7 @@ public class runtime_ogl_vertex_fragment implements GLEventListener // checkerboard--which is used to modulate the diffuse channel in the // fragment shader. int[] handle = new int[1]; - gl.glGenTextures(1, handle); + gl.glGenTextures(1, handle, 0); // Basic OpenGL texture state setup gl.glBindTexture(GL.GL_TEXTURE_2D, handle[0]); @@ -303,7 +303,7 @@ public class runtime_ogl_vertex_fragment implements GLEventListener } } - gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, RES, RES, 0, GL.GL_RGBA, GL.GL_FLOAT, data); + gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, RES, RES, 0, GL.GL_RGBA, GL.GL_FLOAT, data, 0); // Tell Cg which texture handle should be associated with the sampler2D // parameter to the fragment shader. |