summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/demos/cg/runtime_ogl/cgGL_vertex_example.java4
-rw-r--r--src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java12
-rwxr-xr-xsrc/demos/fullscreen/GearsFullscreen.java10
-rwxr-xr-xsrc/demos/fullscreen/GearsFullscreen2.java10
-rwxr-xr-xsrc/demos/fullscreen/JGearsFullscreen.java10
-rw-r--r--src/demos/gears/Gears.java10
-rwxr-xr-xsrc/demos/hdr/ARBFPPipeline.java10
-rwxr-xr-xsrc/demos/hdr/CgPipeline.java2
-rwxr-xr-xsrc/demos/hdr/HDR.java32
-rwxr-xr-xsrc/demos/hdr/HDRTexture.java50
-rw-r--r--src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java22
-rw-r--r--src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java92
-rw-r--r--src/demos/jgears/JGears.java10
-rwxr-xr-xsrc/demos/jrefract/JRefract.java22
-rw-r--r--src/demos/proceduralTexturePhysics/Water.java56
-rw-r--r--src/demos/tess/Tess.java32
-rwxr-xr-xsrc/demos/testContextDestruction/TestContextDestruction.java4
-rw-r--r--src/demos/testContextSharing/TestContextSharing.java4
-rw-r--r--src/demos/util/ObjReader.java2
-rw-r--r--src/demos/vertexArrayRange/VertexArrayRange.java18
-rw-r--r--src/demos/vertexBufferObject/VertexBufferObject.java22
-rw-r--r--src/demos/vertexProgRefract/VertexProgRefract.java12
-rw-r--r--src/demos/vertexProgWarp/VertexProgWarp.java2
-rw-r--r--src/gleem/ExaminerViewer.java4
-rw-r--r--src/gleem/TestExaminerViewer.java6
-rw-r--r--src/gleem/TestHandleBox.java6
-rw-r--r--src/gleem/TestMultiWin.java6
-rw-r--r--src/gleem/TestTranslate1.java6
-rw-r--r--src/gleem/TestTranslate2.java6
29 files changed, 241 insertions, 241 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.
diff --git a/src/demos/fullscreen/GearsFullscreen.java b/src/demos/fullscreen/GearsFullscreen.java
index d8971fb..6c48ef0 100755
--- a/src/demos/fullscreen/GearsFullscreen.java
+++ b/src/demos/fullscreen/GearsFullscreen.java
@@ -127,7 +127,7 @@ public class GearsFullscreen {
float green[] = { 0.0f, 0.8f, 0.2f, 1.0f };
float blue[] = { 0.2f, 0.2f, 1.0f, 1.0f };
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos, 0);
gl.glEnable(GL.GL_CULL_FACE);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);
@@ -136,19 +136,19 @@ public class GearsFullscreen {
/* make the gears */
gear1 = gl.glGenLists(1);
gl.glNewList(gear1, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red, 0);
gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f);
gl.glEndList();
gear2 = gl.glGenLists(1);
gl.glNewList(gear2, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, green);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, green, 0);
gear(gl, 0.5f, 2.0f, 2.0f, 10, 0.7f);
gl.glEndList();
gear3 = gl.glGenLists(1);
gl.glNewList(gear3, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, blue);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, blue, 0);
gear(gl, 1.3f, 2.0f, 0.5f, 10, 0.7f);
gl.glEndList();
@@ -188,7 +188,7 @@ public class GearsFullscreen {
0, 0, 1, 0,
0, 0, 0, 1
};
- gl.glLoadTransposeMatrixfARB(identityTranspose);
+ gl.glLoadTransposeMatrixfARB(identityTranspose, 0);
}
gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
gl.glMatrixMode(GL.GL_MODELVIEW);
diff --git a/src/demos/fullscreen/GearsFullscreen2.java b/src/demos/fullscreen/GearsFullscreen2.java
index 5ed02f8..d7502cf 100755
--- a/src/demos/fullscreen/GearsFullscreen2.java
+++ b/src/demos/fullscreen/GearsFullscreen2.java
@@ -149,7 +149,7 @@ public class GearsFullscreen2 {
float green[] = { 0.0f, 0.8f, 0.2f, 1.0f };
float blue[] = { 0.2f, 0.2f, 1.0f, 1.0f };
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos, 0);
gl.glEnable(GL.GL_CULL_FACE);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);
@@ -158,19 +158,19 @@ public class GearsFullscreen2 {
/* make the gears */
gear1 = gl.glGenLists(1);
gl.glNewList(gear1, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red, 0);
gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f);
gl.glEndList();
gear2 = gl.glGenLists(1);
gl.glNewList(gear2, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, green);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, green, 0);
gear(gl, 0.5f, 2.0f, 2.0f, 10, 0.7f);
gl.glEndList();
gear3 = gl.glGenLists(1);
gl.glNewList(gear3, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, blue);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, blue, 0);
gear(gl, 1.3f, 2.0f, 0.5f, 10, 0.7f);
gl.glEndList();
@@ -210,7 +210,7 @@ public class GearsFullscreen2 {
0, 0, 1, 0,
0, 0, 0, 1
};
- gl.glLoadTransposeMatrixfARB(identityTranspose);
+ gl.glLoadTransposeMatrixfARB(identityTranspose, 0);
}
gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
gl.glMatrixMode(GL.GL_MODELVIEW);
diff --git a/src/demos/fullscreen/JGearsFullscreen.java b/src/demos/fullscreen/JGearsFullscreen.java
index 84c79b7..6b68667 100755
--- a/src/demos/fullscreen/JGearsFullscreen.java
+++ b/src/demos/fullscreen/JGearsFullscreen.java
@@ -154,7 +154,7 @@ public class JGearsFullscreen {
float green[] = { 0.0f, 0.8f, 0.2f, 1.0f };
float blue[] = { 0.2f, 0.2f, 1.0f, 1.0f };
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos, 0);
gl.glEnable(GL.GL_CULL_FACE);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);
@@ -163,19 +163,19 @@ public class JGearsFullscreen {
/* make the gears */
gear1 = gl.glGenLists(1);
gl.glNewList(gear1, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red, 0);
gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f);
gl.glEndList();
gear2 = gl.glGenLists(1);
gl.glNewList(gear2, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, green);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, green, 0);
gear(gl, 0.5f, 2.0f, 2.0f, 10, 0.7f);
gl.glEndList();
gear3 = gl.glGenLists(1);
gl.glNewList(gear3, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, blue);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, blue, 0);
gear(gl, 1.3f, 2.0f, 0.5f, 10, 0.7f);
gl.glEndList();
@@ -223,7 +223,7 @@ public class JGearsFullscreen {
0, 0, 1, 0,
0, 0, 0, 1
};
- gl.glLoadTransposeMatrixfARB(identityTranspose);
+ gl.glLoadTransposeMatrixfARB(identityTranspose, 0);
}
gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
gl.glMatrixMode(GL.GL_MODELVIEW);
diff --git a/src/demos/gears/Gears.java b/src/demos/gears/Gears.java
index da8fdba..c007004 100644
--- a/src/demos/gears/Gears.java
+++ b/src/demos/gears/Gears.java
@@ -61,7 +61,7 @@ public class Gears {
float green[] = { 0.0f, 0.8f, 0.2f, 1.0f };
float blue[] = { 0.2f, 0.2f, 1.0f, 1.0f };
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos, 0);
gl.glEnable(GL.GL_CULL_FACE);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);
@@ -70,19 +70,19 @@ public class Gears {
/* make the gears */
gear1 = gl.glGenLists(1);
gl.glNewList(gear1, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red, 0);
gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f);
gl.glEndList();
gear2 = gl.glGenLists(1);
gl.glNewList(gear2, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, green);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, green, 0);
gear(gl, 0.5f, 2.0f, 2.0f, 10, 0.7f);
gl.glEndList();
gear3 = gl.glGenLists(1);
gl.glNewList(gear3, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, blue);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, blue, 0);
gear(gl, 1.3f, 2.0f, 0.5f, 10, 0.7f);
gl.glEndList();
@@ -116,7 +116,7 @@ public class Gears {
0, 0, 1, 0,
0, 0, 0, 1
};
- gl.glLoadTransposeMatrixfARB(identityTranspose);
+ gl.glLoadTransposeMatrixfARB(identityTranspose, 0);
}
gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
gl.glMatrixMode(GL.GL_MODELVIEW);
diff --git a/src/demos/hdr/ARBFPPipeline.java b/src/demos/hdr/ARBFPPipeline.java
index e13b9f7..d7a13be 100755
--- a/src/demos/hdr/ARBFPPipeline.java
+++ b/src/demos/hdr/ARBFPPipeline.java
@@ -46,12 +46,12 @@ public class ARBFPPipeline implements Pipeline {
private int loadProgram(GL gl, String fileName, int profile) throws IOException {
String programBuffer = FileUtils.loadStreamIntoString(getClass().getClassLoader().getResourceAsStream(fileName));
int[] tmpInt = new int[1];
- gl.glGenProgramsARB(1, tmpInt);
+ gl.glGenProgramsARB(1, tmpInt, 0);
int res = tmpInt[0];
gl.glBindProgramARB(profile, res);
gl.glProgramStringARB(profile, GL.GL_PROGRAM_FORMAT_ASCII_ARB, programBuffer.length(), programBuffer);
int[] errPos = new int[1];
- gl.glGetIntegerv(GL.GL_PROGRAM_ERROR_POSITION_ARB, errPos);
+ gl.glGetIntegerv(GL.GL_PROGRAM_ERROR_POSITION_ARB, errPos, 0);
if (errPos[0] >= 0) {
String kind = "Program";
if (profile == GL.GL_VERTEX_PROGRAM_ARB) {
@@ -78,7 +78,7 @@ public class ARBFPPipeline implements Pipeline {
int[] isNative = new int[1];
gl.glGetProgramivARB(GL.GL_FRAGMENT_PROGRAM_ARB,
GL.GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB,
- isNative);
+ isNative, 0);
if (isNative[0] != 1) {
System.out.println("WARNING: fragment program is over native resource limits");
Thread.dumpStack();
@@ -146,8 +146,8 @@ public class ARBFPPipeline implements Pipeline {
float[] mvp = new float[16];
// Get matrices
- gl.glGetFloatv(GL.GL_PROJECTION_MATRIX, projection);
- gl.glGetFloatv(GL.GL_MODELVIEW_MATRIX, modelView);
+ gl.glGetFloatv(GL.GL_PROJECTION_MATRIX, projection, 0);
+ gl.glGetFloatv(GL.GL_MODELVIEW_MATRIX, modelView, 0);
// Multiply together
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
diff --git a/src/demos/hdr/CgPipeline.java b/src/demos/hdr/CgPipeline.java
index 2f3a9f5..5956967 100755
--- a/src/demos/hdr/CgPipeline.java
+++ b/src/demos/hdr/CgPipeline.java
@@ -108,6 +108,6 @@ public class CgPipeline implements Pipeline {
}
public void setMatrixParameterfc(GL gl, int param, float[] matrix) {
- CgGL.cgGLSetMatrixParameterfc((CGparameter) parameters.get(param), matrix);
+ CgGL.cgGLSetMatrixParameterfc((CGparameter) parameters.get(param), matrix, 0);
}
}
diff --git a/src/demos/hdr/HDR.java b/src/demos/hdr/HDR.java
index 2e650fc..76b66ac 100755
--- a/src/demos/hdr/HDR.java
+++ b/src/demos/hdr/HDR.java
@@ -252,15 +252,15 @@ public class HDR {
int[] tmp = new int[1];
pbuffer = drawable.createOffscreenDrawable(caps, pbuffer_w, pbuffer_h);
pbuffer.addGLEventListener(new PbufferListener());
- gl.glGenTextures(1, tmp);
+ gl.glGenTextures(1, tmp, 0);
pbuffer_tex = tmp[0];
blur_pbuffer = drawable.createOffscreenDrawable(caps, blur_w, blur_h);
blur_pbuffer.addGLEventListener(new BlurPbufferListener());
- gl.glGenTextures(1, tmp);
+ gl.glGenTextures(1, tmp, 0);
blur_pbuffer_tex = tmp[0];
blur2_pbuffer = drawable.createOffscreenDrawable(caps, blur_w, blur_h);
blur2_pbuffer.addGLEventListener(new Blur2PbufferListener());
- gl.glGenTextures(1, tmp);
+ gl.glGenTextures(1, tmp, 0);
blur2_pbuffer_tex = tmp[0];
caps.setOffscreenFloatingPointBuffers(false);
caps.setRedBits(8);
@@ -269,7 +269,7 @@ public class HDR {
caps.setDepthBits(24);
tonemap_pbuffer = drawable.createOffscreenDrawable(caps, pbuffer_w, pbuffer_h);
tonemap_pbuffer.addGLEventListener(new TonemapPbufferListener());
- gl.glGenTextures(1, tmp);
+ gl.glGenTextures(1, tmp, 0);
tonemap_pbuffer_tex = tmp[0];
drawable.addKeyListener(new KeyAdapter() {
@@ -433,7 +433,7 @@ public class HDR {
// create gamma lookup table texture
private int createGammaTexture(GL gl, int size, float gamma) {
int[] tmp = new int[1];
- gl.glGenTextures(1, tmp);
+ gl.glGenTextures(1, tmp, 0);
int texid = tmp[0];
int target = GL.GL_TEXTURE_1D;
@@ -451,7 +451,7 @@ public class HDR {
img[i] = (float) Math.pow(x, gamma);
}
- gl.glTexImage1D(target, 0, GL.GL_LUMINANCE, size, 0, GL.GL_LUMINANCE, GL.GL_FLOAT, img);
+ gl.glTexImage1D(target, 0, GL.GL_LUMINANCE, size, 0, GL.GL_LUMINANCE, GL.GL_FLOAT, img, 0);
return texid;
}
@@ -460,7 +460,7 @@ public class HDR {
// based on Debevec's pflare.c
int createVignetteTexture(GL gl, int xsiz, int ysiz, float r0, float r1) {
int[] tmp = new int[1];
- gl.glGenTextures(1, tmp);
+ gl.glGenTextures(1, tmp, 0);
int texid = tmp[0];
gl.glBindTexture(GL.GL_TEXTURE_RECTANGLE_NV, texid);
@@ -491,7 +491,7 @@ public class HDR {
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_RECTANGLE_NV, 0, GL.GL_LUMINANCE, xsiz, ysiz, 0, GL.GL_LUMINANCE, GL.GL_FLOAT, img);
+ gl.glTexImage2D(GL.GL_TEXTURE_RECTANGLE_NV, 0, GL.GL_LUMINANCE, xsiz, ysiz, 0, GL.GL_LUMINANCE, GL.GL_FLOAT, img, 0);
return texid;
}
@@ -679,7 +679,7 @@ public class HDR {
gl.glVertexPointer(3, GL.GL_FLOAT, 0, model.getVertices());
gl.glNormalPointer(GL.GL_FLOAT, 0, model.getVertexNormals());
int[] indices = model.getFaceIndices();
- gl.glDrawElements(GL.GL_TRIANGLES, indices.length, GL.GL_UNSIGNED_INT, indices);
+ gl.glDrawElements(GL.GL_TRIANGLES, indices.length, GL.GL_UNSIGNED_INT, indices, 0);
gl.glDisableClientState(GL.GL_VERTEX_ARRAY);
gl.glDisableClientState(GL.GL_NORMAL_ARRAY);
break;
@@ -891,9 +891,9 @@ public class HDR {
float[] s_plane = { 1.0f, 0.0f, 0.0f, 0.0f };
float[] t_plane = { 0.0f, 1.0f, 0.0f, 0.0f };
float[] r_plane = { 0.0f, 0.0f, 1.0f, 0.0f };
- gl.glTexGenfv(GL.GL_S, GL.GL_OBJECT_PLANE, s_plane);
- gl.glTexGenfv(GL.GL_T, GL.GL_OBJECT_PLANE, t_plane);
- gl.glTexGenfv(GL.GL_R, GL.GL_OBJECT_PLANE, r_plane);
+ gl.glTexGenfv(GL.GL_S, GL.GL_OBJECT_PLANE, s_plane, 0);
+ gl.glTexGenfv(GL.GL_T, GL.GL_OBJECT_PLANE, t_plane, 0);
+ gl.glTexGenfv(GL.GL_R, GL.GL_OBJECT_PLANE, r_plane, 0);
gl.glPopMatrix();
gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_OBJECT_LINEAR);
gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_OBJECT_LINEAR);
@@ -1032,13 +1032,13 @@ public class HDR {
private int loadProgram(GL gl, int target, String code) {
int prog_id;
int[] tmp = new int[1];
- gl.glGenProgramsARB(1, tmp);
+ gl.glGenProgramsARB(1, tmp, 0);
prog_id = tmp[0];
gl.glBindProgramARB(target, prog_id);
int size = code.length();
gl.glProgramStringARB(target, GL.GL_PROGRAM_FORMAT_ASCII_ARB, code.length(), code);
int[] errPos = new int[1];
- gl.glGetIntegerv(GL.GL_PROGRAM_ERROR_POSITION_ARB, errPos);
+ gl.glGetIntegerv(GL.GL_PROGRAM_ERROR_POSITION_ARB, errPos, 0);
if (errPos[0] >= 0) {
String kind = "Program";
if (target == GL.GL_VERTEX_PROGRAM_ARB) {
@@ -1065,7 +1065,7 @@ public class HDR {
int[] isNative = new int[1];
gl.glGetProgramivARB(GL.GL_FRAGMENT_PROGRAM_ARB,
GL.GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB,
- isNative);
+ isNative, 0);
if (isNative[0] != 1) {
System.out.println("WARNING: fragment program is over native resource limits");
Thread.dumpStack();
@@ -1154,7 +1154,7 @@ public class HDR {
private void applyTransform(GL gl, Mat4f mat) {
float[] data = new float[16];
mat.getColumnMajorData(data);
- gl.glMultMatrixf(data);
+ gl.glMultMatrixf(data, 0);
}
private void usage() {
diff --git a/src/demos/hdr/HDRTexture.java b/src/demos/hdr/HDRTexture.java
index fcaac11..f5cf829 100755
--- a/src/demos/hdr/HDRTexture.java
+++ b/src/demos/hdr/HDRTexture.java
@@ -94,7 +94,7 @@ public class HDRTexture {
public int create2DTextureRGBE(GL gl, int targetTextureType) {
m_target = targetTextureType;
int[] tmp = new int[1];
- gl.glGenTextures(1, tmp);
+ gl.glGenTextures(1, tmp, 0);
int texid = tmp[1];
gl.glBindTexture(m_target, texid);
@@ -106,7 +106,7 @@ public class HDRTexture {
gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1);
gl.glTexParameteri(m_target, GL.GL_GENERATE_MIPMAP_SGIS, GL.GL_TRUE);
- gl.glTexImage2D(m_target, 0, GL.GL_RGBA, m_width, m_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, m_data);
+ gl.glTexImage2D(m_target, 0, GL.GL_RGBA, m_width, m_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, m_data, 0);
return texid;
}
@@ -114,7 +114,7 @@ public class HDRTexture {
public int create2DTextureHILO(GL gl, int targetTextureType, boolean rg) {
m_target = targetTextureType;
int[] tmp = new int[1];
- gl.glGenTextures(1, tmp);
+ gl.glGenTextures(1, tmp, 0);
int texid = tmp[0];
gl.glBindTexture(m_target, texid);
@@ -143,7 +143,7 @@ public class HDRTexture {
}
}
- gl.glTexImage2D(m_target, 0, GL.GL_HILO16_NV, m_width, m_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, img);
+ gl.glTexImage2D(m_target, 0, GL.GL_HILO16_NV, m_width, m_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, img, 0);
return texid;
}
@@ -157,7 +157,7 @@ public class HDRTexture {
m_target = GL.GL_TEXTURE_CUBE_MAP_ARB;
int[] tmp = new int[1];
- gl.glGenTextures(1, tmp);
+ gl.glGenTextures(1, tmp, 0);
int texid = tmp[0];
gl.glBindTexture(m_target, texid);
@@ -184,7 +184,7 @@ public class HDRTexture {
face[ptr++] = m_data[src++];
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, 0, GL.GL_RGBA, face_width, face_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, 0, GL.GL_RGBA, face_width, face_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, face, 0);
// positive X
ptr = 0;
@@ -197,7 +197,7 @@ public class HDRTexture {
face[ptr++] = m_data[src++];
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, 0, GL.GL_RGBA, face_width, face_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, 0, GL.GL_RGBA, face_width, face_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, face, 0);
// negative Z
ptr = 0;
@@ -210,7 +210,7 @@ public class HDRTexture {
face[ptr++] = m_data[src++];
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, 0, GL.GL_RGBA, face_width, face_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, 0, GL.GL_RGBA, face_width, face_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, face, 0);
// negative X
ptr = 0;
@@ -223,7 +223,7 @@ public class HDRTexture {
face[ptr++] = m_data[src++];
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, 0, GL.GL_RGBA, face_width, face_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, 0, GL.GL_RGBA, face_width, face_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, face, 0);
// negative Y
ptr = 0;
@@ -236,7 +236,7 @@ public class HDRTexture {
face[ptr++] = m_data[src++];
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, 0, GL.GL_RGBA, face_width, face_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, 0, GL.GL_RGBA, face_width, face_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, face, 0);
// positive Z
ptr = 0;
@@ -249,7 +249,7 @@ public class HDRTexture {
face[ptr++] = m_data[src++];
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, 0, GL.GL_RGBA, face_width, face_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, 0, GL.GL_RGBA, face_width, face_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, face, 0);
return texid;
}
@@ -262,7 +262,7 @@ public class HDRTexture {
m_target = GL.GL_TEXTURE_CUBE_MAP_ARB;
int[] tmp = new int[1];
- gl.glGenTextures(1, tmp);
+ gl.glGenTextures(1, tmp, 0);
int texid = tmp[0];
gl.glBindTexture(m_target, texid);
@@ -290,7 +290,7 @@ public class HDRTexture {
}
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, face, 0);
// positive X
ptr = 0;
@@ -306,7 +306,7 @@ public class HDRTexture {
}
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, face, 0);
// negative Z
ptr = 0;
@@ -322,7 +322,7 @@ public class HDRTexture {
}
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, face, 0);
// negative X
ptr = 0;
@@ -338,7 +338,7 @@ public class HDRTexture {
}
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, face, 0);
// negative Y
ptr = 0;
@@ -354,7 +354,7 @@ public class HDRTexture {
}
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, face, 0);
// positive Z
ptr = 0;
@@ -370,7 +370,7 @@ public class HDRTexture {
}
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, face, 0);
return texid;
}
@@ -383,7 +383,7 @@ public class HDRTexture {
m_target = GL.GL_TEXTURE_CUBE_MAP_ARB;
int[] tmp = new int[1];
- gl.glGenTextures(1, tmp);
+ gl.glGenTextures(1, tmp, 0);
int texid = tmp[0];
gl.glBindTexture(m_target, texid);
@@ -407,7 +407,7 @@ public class HDRTexture {
face[ptr++] = m_floatdata[src + 2];
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, 0, format, face_width, face_height, 0, GL.GL_RGB, GL.GL_FLOAT, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, 0, format, face_width, face_height, 0, GL.GL_RGB, GL.GL_FLOAT, face, 0);
// positive X
ptr = 0;
@@ -419,7 +419,7 @@ public class HDRTexture {
face[ptr++] = m_floatdata[src + 2];
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, 0, format, face_width, face_height, 0, GL.GL_RGB, GL.GL_FLOAT, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, 0, format, face_width, face_height, 0, GL.GL_RGB, GL.GL_FLOAT, face, 0);
// negative Z
ptr = 0;
@@ -431,7 +431,7 @@ public class HDRTexture {
face[ptr++] = m_floatdata[src + 2];
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, 0, format, face_width, face_height, 0, GL.GL_RGB, GL.GL_FLOAT, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, 0, format, face_width, face_height, 0, GL.GL_RGB, GL.GL_FLOAT, face, 0);
// negative X
ptr = 0;
@@ -443,7 +443,7 @@ public class HDRTexture {
face[ptr++] = m_floatdata[src + 2];
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, 0, format, face_width, face_height, 0, GL.GL_RGB, GL.GL_FLOAT, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, 0, format, face_width, face_height, 0, GL.GL_RGB, GL.GL_FLOAT, face, 0);
// negative Y
ptr = 0;
@@ -455,7 +455,7 @@ public class HDRTexture {
face[ptr++] = m_floatdata[src + 2];
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, 0, format, face_width, face_height, 0, GL.GL_RGB, GL.GL_FLOAT, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, 0, format, face_width, face_height, 0, GL.GL_RGB, GL.GL_FLOAT, face, 0);
// positive Z
ptr = 0;
@@ -467,7 +467,7 @@ public class HDRTexture {
face[ptr++] = m_floatdata[src + 2];
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, 0, format, face_width, face_height, 0, GL.GL_RGB, GL.GL_FLOAT, face);
+ gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, 0, format, face_width, face_height, 0, GL.GL_RGB, GL.GL_FLOAT, face, 0);
return texid;
}
diff --git a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java
index f97e875..f757a9a 100644
--- a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java
+++ b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java
@@ -225,9 +225,9 @@ public class HWShadowmapsSimple {
gl.glEndList();
gl.glEnable(GL.GL_LIGHT0);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, light_ambient);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, light_intensity);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, light_intensity);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, light_ambient, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, light_intensity, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, light_intensity, 0);
gl.glEnable(GL.GL_DEPTH_TEST);
@@ -383,7 +383,7 @@ public class HWShadowmapsSimple {
gl.glEnable(GL.GL_DEPTH_TEST);
int[] depth_bits = new int[1];
- gl.glGetIntegerv(GL.GL_DEPTH_BITS, depth_bits);
+ gl.glGetIntegerv(GL.GL_DEPTH_BITS, depth_bits, 0);
if (depth_bits[0] == 16) depth_format = GL.GL_DEPTH_COMPONENT16_ARB;
else depth_format = GL.GL_DEPTH_COMPONENT24_ARB;
@@ -391,7 +391,7 @@ public class HWShadowmapsSimple {
light_view_depth = genTexture(gl);
gl.glBindTexture(GL.GL_TEXTURE_2D, light_view_depth);
gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, depth_format, TEX_SIZE, TEX_SIZE, 0,
- GL.GL_DEPTH_COMPONENT, GL.GL_UNSIGNED_INT, (byte[]) null);
+ GL.GL_DEPTH_COMPONENT, GL.GL_UNSIGNED_INT, (byte[]) null, 0);
set_light_view_texture_parameters(gl);
fullyInitialized = true;
@@ -434,7 +434,7 @@ public class HWShadowmapsSimple {
private int genTexture(GL gl) {
int[] tmp = new int[1];
- gl.glGenTextures(1, tmp);
+ gl.glGenTextures(1, tmp, 0);
return tmp[0];
}
@@ -511,7 +511,7 @@ public class HWShadowmapsSimple {
float[] row = new float[4];
for(int i = 0; i < 4; i++) {
getRow(m, i, row);
- gl.glTexGenfv(coord[i], plane_type, row);
+ gl.glTexGenfv(coord[i], plane_type, row, 0);
}
}
@@ -606,7 +606,7 @@ public class HWShadowmapsSimple {
gl.glLoadIdentity();
applyTransform(gl, cameraInverseTransform);
applyTransform(gl, spotlightTransform);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, light_pos);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, light_pos, 0);
gl.glPopMatrix();
// spot image
@@ -653,7 +653,7 @@ public class HWShadowmapsSimple {
gl.glLoadIdentity();
applyTransform(gl, cameraInverseTransform);
applyTransform(gl, spotlightTransform);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, light_pos);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, light_pos, 0);
gl.glPopMatrix();
// spot image
@@ -731,7 +731,7 @@ public class HWShadowmapsSimple {
// place light
gl.glPushMatrix();
gl.glLoadIdentity();
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, light_pos);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, light_pos, 0);
gl.glPopMatrix();
// spot image
@@ -779,7 +779,7 @@ public class HWShadowmapsSimple {
private static void applyTransform(GL gl, Mat4f xform) {
float[] data = new float[16];
xform.getColumnMajorData(data);
- gl.glMultMatrixf(data);
+ gl.glMultMatrixf(data, 0);
}
private static Mat4f perspectiveInverse(float fovy, float aspect, float zNear, float zFar) {
diff --git a/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java b/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java
index f091c11..990b8c0 100644
--- a/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java
+++ b/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java
@@ -171,14 +171,14 @@ public class InfiniteShadowVolumes {
gl.glEnable(GL.GL_NORMALIZE);
gl.glLightModeli(GL.GL_LIGHT_MODEL_TWO_SIDE, GL.GL_FALSE);
float[] ambient = new float[] {0.3f, 0.3f, 0.3f, 1};
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient, 0);
faceDisplayList = gl.glGenLists(1);
gl.glNewList(faceDisplayList, GL.GL_COMPILE);
drawMesh(gl, 20, 40);
gl.glEndList();
int[] tmp = new int[1];
- gl.glGenTextures(1, tmp);
+ gl.glGenTextures(1, tmp, 0);
wallTexObject = tmp[0];
gl.glBindTexture(GL.GL_TEXTURE_2D, wallTexObject);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_GENERATE_MIPMAP_SGIS, GL.GL_TRUE);
@@ -193,7 +193,7 @@ public class InfiniteShadowVolumes {
tex[i+j*32] = .9f;
}
}
- gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, 32, 32, 0, GL.GL_LUMINANCE, GL.GL_FLOAT, tex);
+ gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, 32, 32, 0, GL.GL_LUMINANCE, GL.GL_FLOAT, tex, 0);
initModel();
@@ -416,12 +416,12 @@ public class InfiniteShadowVolumes {
double[] neg_y = new double[] { 0, 1, 0, 1};
double[] pos_z = new double[] { 0, 0,-1, 1};
double[] neg_z = new double[] { 0, 0, 1, 1};
- gl.glClipPlane(GL.GL_CLIP_PLANE0, pos_x);
- gl.glClipPlane(GL.GL_CLIP_PLANE1, neg_x);
- gl.glClipPlane(GL.GL_CLIP_PLANE2, pos_y);
- gl.glClipPlane(GL.GL_CLIP_PLANE3, neg_y);
- gl.glClipPlane(GL.GL_CLIP_PLANE4, pos_z);
- gl.glClipPlane(GL.GL_CLIP_PLANE5, neg_z);
+ gl.glClipPlane(GL.GL_CLIP_PLANE0, pos_x, 0);
+ gl.glClipPlane(GL.GL_CLIP_PLANE1, neg_x, 0);
+ gl.glClipPlane(GL.GL_CLIP_PLANE2, pos_y, 0);
+ gl.glClipPlane(GL.GL_CLIP_PLANE3, neg_y, 0);
+ gl.glClipPlane(GL.GL_CLIP_PLANE4, pos_z, 0);
+ gl.glClipPlane(GL.GL_CLIP_PLANE5, neg_z, 0);
gl.glEnable(GL.GL_CLIP_PLANE0);
gl.glEnable(GL.GL_CLIP_PLANE1);
gl.glEnable(GL.GL_CLIP_PLANE2);
@@ -435,8 +435,8 @@ public class InfiniteShadowVolumes {
// FIXME
// camera.apply_inverse_transform();
// light.apply_transform();
- gl.glMultMatrixf(getData(lightManipXform));
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, getData(light_position));
+ gl.glMultMatrixf(getData(lightManipXform), 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, getData(light_position), 0);
gl.glPopMatrix();
gl.glEnable(GL.GL_LIGHT0);
@@ -796,7 +796,7 @@ public class InfiniteShadowVolumes {
MD2.PositionNormal[] vpn = m[mindex].interp_frame.pn;
gl.glPushMatrix();
- gl.glMultMatrixf(getData(objectManipXform));
+ gl.glMultMatrixf(getData(objectManipXform), 0);
gl.glBegin(GL.GL_TRIANGLES);
for (int i = 0; i < m[mindex].mod.tri.length; i++) {
if (m[mindex].mod.tri[i].kill)
@@ -830,15 +830,15 @@ public class InfiniteShadowVolumes {
float[] dim = new float[] {.2f,.2f,.2f,.2f};
float[] diffuse = new float[4];
float[] specular = new float[4];
- gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, getData(m[mindex].ambient));
- gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, getData(m[mindex].diffuse));
- gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, getData(m[mindex].specular));
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, getData(m[mindex].ambient), 0);
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, getData(m[mindex].diffuse), 0);
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, getData(m[mindex].specular), 0);
gl.glMaterialf(GL.GL_FRONT_AND_BACK, GL.GL_SHININESS, m[mindex].shininess);
if (!do_diffuse) {
- gl.glGetLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, dim);
- gl.glGetLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, specular);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, zero);
+ gl.glGetLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, dim, 0);
+ gl.glGetLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, specular, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, zero, 0);
} else {
gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE);
gl.glEnable(GL.GL_BLEND);
@@ -848,7 +848,7 @@ public class InfiniteShadowVolumes {
gl.glDepthFunc(GL.GL_EQUAL);
}
gl.glPushMatrix();
- gl.glMultMatrixf(getData(objectManipXform));
+ gl.glMultMatrixf(getData(objectManipXform), 0);
gl.glEnable(GL.GL_LIGHTING);
gl.glPolygonOffset(0,-2);
@@ -870,12 +870,12 @@ public class InfiniteShadowVolumes {
gl.glDisable(GL.GL_LIGHTING);
gl.glPopMatrix();
- gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, new float[] { 0.8f, 0.8f, 0.8f, 1});
- gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, new float[] { 0.3f, 0.3f, 0.3f, 1});
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, new float[] { 0.8f, 0.8f, 0.8f, 1}, 0);
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, new float[] { 0.3f, 0.3f, 0.3f, 1}, 0);
if (!do_diffuse) {
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, specular);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, specular, 0);
} else {
gl.glDisable(GL.GL_BLEND);
//glDisable(GL.GL_STENCIL_TEST);
@@ -951,24 +951,24 @@ public class InfiniteShadowVolumes {
float[] diffuse = new float[4];
float[] specular = new float[4];
- gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, a);
- gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, new float[] {0.8f, 0.8f, 0.8f, 1});
- gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, new float[] {0.4f, 0.4f, 0.4f, 1});
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, a, 0);
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, new float[] {0.8f, 0.8f, 0.8f, 1}, 0);
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, new float[] {0.4f, 0.4f, 0.4f, 1}, 0);
gl.glMaterialf(GL.GL_FRONT_AND_BACK, GL.GL_SHININESS, 64.0f);
if (!do_diffuse) {
- gl.glGetLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, d1);
- gl.glGetLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, specular);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, zero);
+ gl.glGetLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, d1, 0);
+ gl.glGetLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, specular, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, zero, 0);
gl.glStencilFunc(GL.GL_ALWAYS, 128, ~0);
} else {
- gl.glGetLightfv(GL.GL_LIGHT0, GL.GL_EMISSION, emission);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_EMISSION, zero);
- gl.glGetLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, zero);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, d2);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, s);
+ gl.glGetLightfv(GL.GL_LIGHT0, GL.GL_EMISSION, emission, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_EMISSION, zero, 0);
+ gl.glGetLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, zero, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, d2, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, s, 0);
gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE);
gl.glEnable(GL.GL_BLEND);
@@ -990,11 +990,11 @@ public class InfiniteShadowVolumes {
gl.glPopMatrix();
if (!do_diffuse) {
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, specular);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_SPECULAR, specular, 0);
} else {
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_EMISSION, emission);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_EMISSION, emission, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient, 0);
gl.glDisable(GL.GL_BLEND);
gl.glDepthFunc(GL.GL_LESS);
@@ -1024,7 +1024,7 @@ public class InfiniteShadowVolumes {
ml.xformVec(light_position, olight);
gl.glPushMatrix();
- gl.glMultMatrixf(getData(objectManipXform));
+ gl.glMultMatrixf(getData(objectManipXform), 0);
MD2.Frame f = m[mindex].interp_frame;
@@ -1153,7 +1153,7 @@ public class InfiniteShadowVolumes {
private void drawLight(GL gl, GLU glu) {
gl.glColor3f(1,1,0);
gl.glPushMatrix();
- gl.glMultMatrixf(getData(lightManipXform));
+ gl.glMultMatrixf(getData(lightManipXform), 0);
gl.glScalef(light_object_scale, light_object_scale, light_object_scale);
if (b['L']) {
glut.glutSolidSphere(glu, .01f, 20, 10);
@@ -1168,7 +1168,7 @@ public class InfiniteShadowVolumes {
m = m.mul(perspectiveInverse(30, 1, 0.001f, 0.04f));
gl.glRotatef(180, 1, 0, 0);
gl.glTranslatef(0,0,-0.02f);
- gl.glMultMatrixf(getData(m));
+ gl.glMultMatrixf(getData(m), 0);
glut.glutSolidCube(gl, 2);
}
gl.glPopMatrix();
@@ -1239,13 +1239,13 @@ public class InfiniteShadowVolumes {
private void applyInfinitePerspective(GL gl, ExaminerViewer v) {
CameraParameters parms = v.getCameraParameters();
float aspect = parms.getImagePlaneAspectRatio();
- gl.glMultMatrixf(getData(infinitePerspective(parms.getVertFOV(), aspect, v.getZNear())));
+ gl.glMultMatrixf(getData(infinitePerspective(parms.getVertFOV(), aspect, v.getZNear())), 0);
}
private void applyInfinitePerspectiveInverse(GL gl, ExaminerViewer v) {
CameraParameters parms = v.getCameraParameters();
float aspect = parms.getImagePlaneAspectRatio();
- gl.glMultMatrixf(getData(infinitePerspectiveInverse(parms.getVertFOV(), aspect, v.getZNear())));
+ gl.glMultMatrixf(getData(infinitePerspectiveInverse(parms.getVertFOV(), aspect, v.getZNear())), 0);
}
private Mat4f perspectiveInverse(float fovy, float aspect, float zNear, float zFar) {
diff --git a/src/demos/jgears/JGears.java b/src/demos/jgears/JGears.java
index 59e6c79..91704f5 100644
--- a/src/demos/jgears/JGears.java
+++ b/src/demos/jgears/JGears.java
@@ -82,7 +82,7 @@ public class JGears {
float green[] = { 0.0f, 0.8f, 0.2f, 1.0f };
float blue[] = { 0.2f, 0.2f, 1.0f, 1.0f };
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos, 0);
gl.glEnable(GL.GL_CULL_FACE);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);
@@ -91,19 +91,19 @@ public class JGears {
/* make the gears */
gear1 = gl.glGenLists(1);
gl.glNewList(gear1, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red, 0);
gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f);
gl.glEndList();
gear2 = gl.glGenLists(1);
gl.glNewList(gear2, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, green);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, green, 0);
gear(gl, 0.5f, 2.0f, 2.0f, 10, 0.7f);
gl.glEndList();
gear3 = gl.glGenLists(1);
gl.glNewList(gear3, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, blue);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, blue, 0);
gear(gl, 1.3f, 2.0f, 0.5f, 10, 0.7f);
gl.glEndList();
@@ -137,7 +137,7 @@ public class JGears {
0, 0, 1, 0,
0, 0, 0, 1
};
- gl.glLoadTransposeMatrixfARB(identityTranspose);
+ gl.glLoadTransposeMatrixfARB(identityTranspose, 0);
}
gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
gl.glMatrixMode(GL.GL_MODELVIEW);
diff --git a/src/demos/jrefract/JRefract.java b/src/demos/jrefract/JRefract.java
index e842eba..4775073 100755
--- a/src/demos/jrefract/JRefract.java
+++ b/src/demos/jrefract/JRefract.java
@@ -374,7 +374,7 @@ public class JRefract {
b[' '] = true; // animate by default
int[] vtxProgTmp = new int[1];
- gl.glGenProgramsARB(1, vtxProgTmp);
+ gl.glGenProgramsARB(1, vtxProgTmp, 0);
vtxProg = vtxProgTmp[0];
gl.glBindProgramARB (GL.GL_VERTEX_PROGRAM_ARB, vtxProg);
gl.glProgramStringARB(GL.GL_VERTEX_PROGRAM_ARB, GL.GL_PROGRAM_FORMAT_ASCII_ARB, transformRefract.length(), transformRefract);
@@ -387,7 +387,7 @@ public class JRefract {
gl.glProgramEnvParameter4fARB(GL.GL_VERTEX_PROGRAM_ARB, 3, 0.0f, 1.0f, 2.0f, 3.0f); // misc constants
int[] cubemapTmp = new int[1];
- gl.glGenTextures(1, cubemapTmp);
+ gl.glGenTextures(1, cubemapTmp, 0);
cubemap = cubemapTmp[0];
gl.glBindTexture(GL.GL_TEXTURE_CUBE_MAP_ARB, cubemap);
@@ -654,7 +654,7 @@ public class JRefract {
GL.GL_UNSIGNED_BYTE, data);
} else {
gl.glTexImage2D(target, 0, GL.GL_RGB, img.getWidth(), img.getHeight(), 0,
- GL.GL_RGB, GL.GL_UNSIGNED_BYTE, data);
+ GL.GL_RGB, GL.GL_UNSIGNED_BYTE, data, 0);
}
break;
}
@@ -666,7 +666,7 @@ public class JRefract {
GL.GL_UNSIGNED_BYTE, data);
} else {
gl.glTexImage2D(target, 0, GL.GL_RGB, img.getWidth(), img.getHeight(), 0,
- GL.GL_RGB, GL.GL_UNSIGNED_BYTE, data);
+ GL.GL_RGB, GL.GL_UNSIGNED_BYTE, data, 0);
}
break;
}
@@ -716,7 +716,7 @@ public class JRefract {
private void initFragmentProgram(GL gl) {
int[] fragProgTmp = new int[1];
- gl.glGenProgramsARB(1, fragProgTmp);
+ gl.glGenProgramsARB(1, fragProgTmp, 0);
fragProg = fragProgTmp[0];
String combineFragProg =
"!!ARBfp1.0\n" +
@@ -737,7 +737,7 @@ public class JRefract {
gl.glProgramStringARB(GL.GL_FRAGMENT_PROGRAM_ARB, GL.GL_PROGRAM_FORMAT_ASCII_ARB,
combineFragProg.length(), combineFragProg);
int[] errPos = new int[1];
- gl.glGetIntegerv(GL.GL_PROGRAM_ERROR_POSITION_ARB, errPos);
+ gl.glGetIntegerv(GL.GL_PROGRAM_ERROR_POSITION_ARB, errPos, 0);
if (errPos[0] >= 0) {
System.out.println("Fragment program failed to load:");
String errMsg = gl.glGetString(GL.GL_PROGRAM_ERROR_STRING_ARB);
@@ -936,7 +936,7 @@ public class JRefract {
float green[] = { 0.0f, 0.8f, 0.2f, 1.0f };
float blue[] = { 0.2f, 0.2f, 1.0f, 1.0f };
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos, 0);
gl.glEnable(GL.GL_CULL_FACE);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);
@@ -945,19 +945,19 @@ public class JRefract {
/* make the gears */
gear1 = gl.glGenLists(1);
gl.glNewList(gear1, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red, 0);
gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f);
gl.glEndList();
gear2 = gl.glGenLists(1);
gl.glNewList(gear2, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, green);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, green, 0);
gear(gl, 0.5f, 2.0f, 2.0f, 10, 0.7f);
gl.glEndList();
gear3 = gl.glGenLists(1);
gl.glNewList(gear3, GL.GL_COMPILE);
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, blue);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, blue, 0);
gear(gl, 1.3f, 2.0f, 0.5f, 10, 0.7f);
gl.glEndList();
@@ -991,7 +991,7 @@ public class JRefract {
0, 0, 1, 0,
0, 0, 0, 1
};
- gl.glLoadTransposeMatrixfARB(identityTranspose);
+ gl.glLoadTransposeMatrixfARB(identityTranspose, 0);
}
gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
gl.glMatrixMode(GL.GL_MODELVIEW);
diff --git a/src/demos/proceduralTexturePhysics/Water.java b/src/demos/proceduralTexturePhysics/Water.java
index 0522c70..56357fb 100644
--- a/src/demos/proceduralTexturePhysics/Water.java
+++ b/src/demos/proceduralTexturePhysics/Water.java
@@ -501,7 +501,7 @@ public class Water {
///////////////////////////////////////////////////////////////////////////
int[] tmpInt = new int[1];
- gl.glGenProgramsARB(1, tmpInt);
+ gl.glGenProgramsARB(1, tmpInt, 0);
vertexProgramID = tmpInt[0];
gl.glBindProgramARB(GL.GL_VERTEX_PROGRAM_ARB, vertexProgramID);
@@ -581,7 +581,7 @@ public class Water {
// set up constants (not currently used in the vertex program, though)
float[] rCVConsts = new float[] { 0, 0.5f, 1.0f, 2.0f };
- gl.glProgramEnvParameter4fvARB(GL.GL_VERTEX_PROGRAM_ARB, CV_CONSTS_1, rCVConsts);
+ gl.glProgramEnvParameter4fvARB(GL.GL_VERTEX_PROGRAM_ARB, CV_CONSTS_1, rCVConsts, 0);
loadProgram(gl, GL.GL_VERTEX_PROGRAM_ARB, programBuffer);
@@ -929,12 +929,12 @@ public class Water {
// Red mask first
float[] pixMasks = new float[] { normalSTScale, 0.0f, 0.0f, 0.0f };
- gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 0, pixMasks);
+ gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 0, pixMasks, 0);
// Now green mask & scale:
pixMasks[0] = 0.0f;
pixMasks[1] = normalSTScale;
- gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 1, pixMasks);
+ gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 1, pixMasks, 0);
gl.glCallList(displayListIDs[CA_FRAGMENT_PROGRAM_CREATE_NORMAL_MAP]);
@@ -1002,7 +1002,8 @@ public class Water {
0,
image.getGLFormat(),
GL.GL_UNSIGNED_BYTE,
- image.getData());
+ image.getData(),
+ 0);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP_TO_EDGE);
@@ -1045,7 +1046,8 @@ public class Water {
0,
image.getGLFormat(),
GL.GL_UNSIGNED_BYTE,
- image.getData());
+ image.getData(),
+ 0);
}
}
@@ -1060,8 +1062,8 @@ public class Water {
TGAImage spin = loadImage(spinFilename);
TGAImage droplet = loadImage(dropletFilename);
- gl.glGenTextures(CA_NUM_STATIC_TEXTURES, staticTextureIDs);
- gl.glGenTextures(CA_NUM_DYNAMIC_TEXTURES, dynamicTextureIDs); // also create intermediate texture object
+ gl.glGenTextures(CA_NUM_STATIC_TEXTURES, staticTextureIDs, 0);
+ gl.glGenTextures(CA_NUM_DYNAMIC_TEXTURES, dynamicTextureIDs, 0); // also create intermediate texture object
// upload the initial map texture
createTextureObject(gl, staticTextureIDs[CA_TEXTURE_INITIAL_MAP], initialMap, true);
@@ -1147,10 +1149,10 @@ public class Water {
float type2Offset[] = { type2OffsetX[i], type2OffsetY[i], 0.0f, 0.0f };
float type4Offset[] = { type4OffsetX[i], type4OffsetY[i], 0.0f, 0.0f };
- gl.glProgramEnvParameter4fvARB(GL.GL_VERTEX_PROGRAM_ARB, CV_UV_T0_NO_OFFSET + 5 * i, noOffset);
- gl.glProgramEnvParameter4fvARB(GL.GL_VERTEX_PROGRAM_ARB, CV_UV_T0_TYPE1 + 5 * i, type1Offset);
- gl.glProgramEnvParameter4fvARB(GL.GL_VERTEX_PROGRAM_ARB, CV_UV_T0_TYPE2 + 5 * i, type2Offset);
- gl.glProgramEnvParameter4fvARB(GL.GL_VERTEX_PROGRAM_ARB, CV_UV_T0_TYPE4 + 5 * i, type4Offset);
+ gl.glProgramEnvParameter4fvARB(GL.GL_VERTEX_PROGRAM_ARB, CV_UV_T0_NO_OFFSET + 5 * i, noOffset, 0);
+ gl.glProgramEnvParameter4fvARB(GL.GL_VERTEX_PROGRAM_ARB, CV_UV_T0_TYPE1 + 5 * i, type1Offset, 0);
+ gl.glProgramEnvParameter4fvARB(GL.GL_VERTEX_PROGRAM_ARB, CV_UV_T0_TYPE2 + 5 * i, type2Offset, 0);
+ gl.glProgramEnvParameter4fvARB(GL.GL_VERTEX_PROGRAM_ARB, CV_UV_T0_TYPE4 + 5 * i, type4Offset, 0);
}
}
@@ -1170,7 +1172,7 @@ public class Water {
for (int i = 0; i < 4; ++i) {
offsets[0] = blurDist * ( type3OffsetX[i]);
offsets[1] = blurDist * ( type3OffsetY[i]);
- gl.glProgramEnvParameter4fvARB(GL.GL_VERTEX_PROGRAM_ARB, CV_UV_T0_TYPE3 + 5 * i, offsets);
+ gl.glProgramEnvParameter4fvARB(GL.GL_VERTEX_PROGRAM_ARB, CV_UV_T0_TYPE3 + 5 * i, offsets, 0);
}
}
@@ -1254,7 +1256,7 @@ public class Water {
float[] const0 = new float[] { 0.5f, 0.5f, 0.5f, 1.0f };
int[] tmpInt = new int[1];
- gl.glGenProgramsARB(1, tmpInt);
+ gl.glGenProgramsARB(1, tmpInt, 0);
int fragProg = tmpInt[0];
gl.glBindProgramARB(GL.GL_FRAGMENT_PROGRAM_ARB, fragProg);
@@ -1281,7 +1283,7 @@ public class Water {
loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
gl.glNewList(displayListID, GL.GL_COMPILE);
- gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 0, const0);
+ gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 0, const0, 0);
gl.glBindProgramARB(GL.GL_FRAGMENT_PROGRAM_ARB, fragProg);
gl.glEnable(GL.GL_FRAGMENT_PROGRAM_ARB);
gl.glEndList();
@@ -1381,7 +1383,7 @@ public class Water {
float[] const0 = new float[] { 0.5f, 0.5f, 0.5f, 1.0f };
int[] tmpInt = new int[1];
- gl.glGenProgramsARB(1, tmpInt);
+ gl.glGenProgramsARB(1, tmpInt, 0);
int fragProg = tmpInt[0];
gl.glBindProgramARB(GL.GL_FRAGMENT_PROGRAM_ARB, fragProg);
@@ -1425,7 +1427,7 @@ public class Water {
loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
gl.glNewList(displayListID, GL.GL_COMPILE);
- gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 0, const0);
+ gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 0, const0, 0);
gl.glBindProgramARB(GL.GL_FRAGMENT_PROGRAM_ARB, fragProg);
gl.glEnable(GL.GL_FRAGMENT_PROGRAM_ARB);
gl.glEndList();
@@ -1468,7 +1470,7 @@ public class Water {
// }
int[] tmpInt = new int[1];
- gl.glGenProgramsARB(1, tmpInt);
+ gl.glGenProgramsARB(1, tmpInt, 0);
int fragProg = tmpInt[0];
gl.glBindProgramARB(GL.GL_FRAGMENT_PROGRAM_ARB, fragProg);
@@ -1540,7 +1542,7 @@ public class Water {
float[] const1 = new float[] { 0.5f, 0.5f, 0.5f, 1.0f };
int[] tmpInt = new int[1];
- gl.glGenProgramsARB(1, tmpInt);
+ gl.glGenProgramsARB(1, tmpInt, 0);
int fragProg = tmpInt[0];
gl.glBindProgramARB(GL.GL_FRAGMENT_PROGRAM_ARB, fragProg);
@@ -1566,8 +1568,8 @@ public class Water {
loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
gl.glNewList(displayListID, GL.GL_COMPILE);
- gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 0, const0);
- gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 1, const1);
+ gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 0, const0, 0);
+ gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 1, const1, 0);
gl.glBindProgramARB(GL.GL_FRAGMENT_PROGRAM_ARB, fragProg);
gl.glEnable(GL.GL_FRAGMENT_PROGRAM_ARB);
gl.glEndList();
@@ -1619,7 +1621,7 @@ public class Water {
float[] const0 = new float[] { 0.5f, 0.5f, 0.5f, 1.0f };
int[] tmpInt = new int[1];
- gl.glGenProgramsARB(1, tmpInt);
+ gl.glGenProgramsARB(1, tmpInt, 0);
int fragProg = tmpInt[0];
gl.glBindProgramARB(GL.GL_FRAGMENT_PROGRAM_ARB, fragProg);
@@ -1644,7 +1646,7 @@ public class Water {
loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
gl.glNewList(displayListID, GL.GL_COMPILE);
- gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 0, const0);
+ gl.glProgramEnvParameter4fvARB(GL.GL_FRAGMENT_PROGRAM_ARB, 0, const0, 0);
gl.glBindProgramARB(GL.GL_FRAGMENT_PROGRAM_ARB, fragProg);
gl.glEnable(GL.GL_FRAGMENT_PROGRAM_ARB);
gl.glEndList();
@@ -1736,7 +1738,7 @@ public class Water {
float[] const0 = new float[] { 0.5f, 0.5f, 0.5f, 1.0f };
int[] tmpInt = new int[1];
- gl.glGenProgramsARB(1, tmpInt);
+ gl.glGenProgramsARB(1, tmpInt, 0);
int fragProg = tmpInt[0];
gl.glBindProgramARB(GL.GL_FRAGMENT_PROGRAM_ARB, fragProg);
@@ -1811,7 +1813,7 @@ public class Water {
// of a visual difference so they are skipped as well.
int[] tmpInt = new int[1];
- gl.glGenProgramsARB(1, tmpInt);
+ gl.glGenProgramsARB(1, tmpInt, 0);
int fragProg = tmpInt[0];
gl.glBindProgramARB(GL.GL_FRAGMENT_PROGRAM_ARB, fragProg);
@@ -1848,7 +1850,7 @@ public class Water {
String programBuffer) {
gl.glProgramStringARB(target, GL.GL_PROGRAM_FORMAT_ASCII_ARB, programBuffer.length(), programBuffer);
int[] errPos = new int[1];
- gl.glGetIntegerv(GL.GL_PROGRAM_ERROR_POSITION_ARB, errPos);
+ gl.glGetIntegerv(GL.GL_PROGRAM_ERROR_POSITION_ARB, errPos, 0);
if (errPos[0] >= 0) {
String kind = "Program";
if (target == GL.GL_VERTEX_PROGRAM_ARB) {
@@ -1875,7 +1877,7 @@ public class Water {
int[] isNative = new int[1];
gl.glGetProgramivARB(GL.GL_FRAGMENT_PROGRAM_ARB,
GL.GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB,
- isNative);
+ isNative, 0);
if (isNative[0] != 1) {
System.out.println("WARNING: fragment program is over native resource limits");
Thread.dumpStack();
diff --git a/src/demos/tess/Tess.java b/src/demos/tess/Tess.java
index ccbd7a6..43a52ae 100644
--- a/src/demos/tess/Tess.java
+++ b/src/demos/tess/Tess.java
@@ -135,15 +135,15 @@ public class Tess {
gl.glShadeModel(GL.GL_FLAT);
glu.gluTessBeginPolygon(tobj, null);
glu.gluTessBeginContour(tobj);
- glu.gluTessVertex(tobj, rect[0], rect[0]);
- glu.gluTessVertex(tobj, rect[1], rect[1]);
- glu.gluTessVertex(tobj, rect[2], rect[2]);
- glu.gluTessVertex(tobj, rect[3], rect[3]);
+ glu.gluTessVertex(tobj, rect[0], 0, rect[0]);
+ glu.gluTessVertex(tobj, rect[1], 0, rect[1]);
+ glu.gluTessVertex(tobj, rect[2], 0, rect[2]);
+ glu.gluTessVertex(tobj, rect[3], 0, rect[3]);
glu.gluTessEndContour(tobj);
glu.gluTessBeginContour(tobj);
- glu.gluTessVertex(tobj, tri[0], tri[0]);
- glu.gluTessVertex(tobj, tri[1], tri[1]);
- glu.gluTessVertex(tobj, tri[2], tri[2]);
+ glu.gluTessVertex(tobj, tri[0], 0, tri[0]);
+ glu.gluTessVertex(tobj, tri[1], 0, tri[1]);
+ glu.gluTessVertex(tobj, tri[2], 0, tri[2]);
glu.gluTessEndContour(tobj);
glu.gluTessEndPolygon(tobj);
gl.glEndList();
@@ -159,11 +159,11 @@ public class Tess {
glu.gluTessProperty(tobj, GLU.GLU_TESS_WINDING_RULE, GLU.GLU_TESS_WINDING_POSITIVE);
glu.gluTessBeginPolygon(tobj, null);
glu.gluTessBeginContour(tobj);
- glu.gluTessVertex(tobj, star[0], star[0]);
- glu.gluTessVertex(tobj, star[1], star[1]);
- glu.gluTessVertex(tobj, star[2], star[2]);
- glu.gluTessVertex(tobj, star[3], star[3]);
- glu.gluTessVertex(tobj, star[4], star[4]);
+ glu.gluTessVertex(tobj, star[0], 0, star[0]);
+ glu.gluTessVertex(tobj, star[1], 0, star[1]);
+ glu.gluTessVertex(tobj, star[2], 0, star[2]);
+ glu.gluTessVertex(tobj, star[3], 0, star[3]);
+ glu.gluTessVertex(tobj, star[4], 0, star[4]);
glu.gluTessEndContour(tobj);
glu.gluTessEndPolygon(tobj);
gl.glEndList();
@@ -213,13 +213,9 @@ public class Tess {
if (data instanceof double[]) {
double[] d = (double[]) data;
if (d.length == 6) {
- double[] d2 = {d[0], d[1], d[2]};
- gl.glVertex3dv(d2);
- d2 = new double[]{d[3], d[4], d[5]};
- gl.glColor3dv(d2);
- } else if (d.length == 3) {
- gl.glVertex3dv(d);
+ gl.glColor3dv(d, 3);
}
+ gl.glVertex3dv(d, 0);
}
}
diff --git a/src/demos/testContextDestruction/TestContextDestruction.java b/src/demos/testContextDestruction/TestContextDestruction.java
index bfc0801..fd9dd6e 100755
--- a/src/demos/testContextDestruction/TestContextDestruction.java
+++ b/src/demos/testContextDestruction/TestContextDestruction.java
@@ -183,7 +183,7 @@ public class TestContextDestruction {
GL gl = drawable.getGL();
float pos[] = { 5.0f, 5.0f, 10.0f, 0.0f };
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos, 0);
gl.glEnable(GL.GL_CULL_FACE);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);
@@ -239,7 +239,7 @@ public class TestContextDestruction {
gearDisplayList = gl.glGenLists(1);
gl.glNewList(gearDisplayList, GL.GL_COMPILE);
float red[] = { 0.8f, 0.1f, 0.0f, 1.0f };
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red, 0);
gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f);
gl.glEndList();
}
diff --git a/src/demos/testContextSharing/TestContextSharing.java b/src/demos/testContextSharing/TestContextSharing.java
index 569fa50..272c363 100644
--- a/src/demos/testContextSharing/TestContextSharing.java
+++ b/src/demos/testContextSharing/TestContextSharing.java
@@ -102,7 +102,7 @@ public class TestContextSharing {
GL gl = drawable.getGL();
float pos[] = { 5.0f, 5.0f, 10.0f, 0.0f };
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos, 0);
gl.glEnable(GL.GL_CULL_FACE);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);
@@ -147,7 +147,7 @@ public class TestContextSharing {
gearDisplayList = gl.glGenLists(1);
gl.glNewList(gearDisplayList, GL.GL_COMPILE);
float red[] = { 0.8f, 0.1f, 0.0f, 1.0f };
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red, 0);
gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f);
gl.glEndList();
}
diff --git a/src/demos/util/ObjReader.java b/src/demos/util/ObjReader.java
index f8a6cec..6638b61 100644
--- a/src/demos/util/ObjReader.java
+++ b/src/demos/util/ObjReader.java
@@ -312,8 +312,10 @@ public class ObjReader {
newIndices.trim();
vertices = BufferUtils.newFloatBuffer(newVertices.size());
vertices.put(newVertices.getData());
+ vertices.rewind();
normals = BufferUtils.newFloatBuffer(newVertexNormals.size());
normals.put(newVertexNormals.getData());
+ normals.rewind();
faceIndices = newIndices;
tmpVertices = null;
tmpVertexNormals = null;
diff --git a/src/demos/vertexArrayRange/VertexArrayRange.java b/src/demos/vertexArrayRange/VertexArrayRange.java
index 5252f0e..fee4280 100644
--- a/src/demos/vertexArrayRange/VertexArrayRange.java
+++ b/src/demos/vertexArrayRange/VertexArrayRange.java
@@ -306,12 +306,12 @@ public class VertexArrayRange {
gl.glEnable(GL.GL_LIGHT0);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_NORMALIZE);
- gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, new float[] {.1f, .1f, 0, 1});
- gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, new float[] {.6f, .6f, .1f, 1});
- gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, new float[] { 1, 1, .75f, 1});
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, new float[] {.1f, .1f, 0, 1}, 0);
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, new float[] {.6f, .6f, .1f, 1}, 0);
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, new float[] { 1, 1, .75f, 1}, 0);
gl.glMaterialf(GL.GL_FRONT_AND_BACK, GL.GL_SHININESS, 128.f);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] { .5f, 0, .5f, 0});
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] { .5f, 0, .5f, 0}, 0);
gl.glLightModeli(GL.GL_LIGHT_MODEL_LOCAL_VIEWER, 0);
// NOTE: it looks like GLUT (or something else) sets up the
@@ -358,7 +358,7 @@ public class VertexArrayRange {
int[] fences = new int[1];
for (int i = 0; i < numBuffers; i++) {
buffers[i] = new VarBuffer();
- gl.glGenFencesNV(1, fences);
+ gl.glGenFencesNV(1, fences, 0);
buffers[i].fence = fences[0];
}
}
@@ -513,10 +513,10 @@ public class VertexArrayRange {
if (toggleLightingModel) {
if(getFlag('i')) {
// infinite light
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] { .5f, 0, .5f, 0 });
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] { .5f, 0, .5f, 0 }, 0);
gl.glLightModeli(GL.GL_LIGHT_MODEL_LOCAL_VIEWER, 0);
} else {
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] { .5f, 0, -.5f,1 });
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] { .5f, 0, -.5f, 1 }, 0);
gl.glLightModeli(GL.GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
}
toggleLightingModel = false;
@@ -537,7 +537,7 @@ public class VertexArrayRange {
0, 0, 1, 0,
0, 0, -1, 1
};
- gl.glLoadMatrixf(modelViewMatrix);
+ gl.glLoadMatrixf(modelViewMatrix, 0);
// FIXME: add mouse interaction
// camera.apply_inverse_transform();
@@ -618,7 +618,7 @@ public class VertexArrayRange {
for (int i = 0; i < elements.length; i++) {
++numDrawElementsCalls;
- gl.glDrawElements(primitive, elements[i].length, GL.GL_UNSIGNED_INT, elements[i]);
+ gl.glDrawElements(primitive, elements[i].length, GL.GL_UNSIGNED_INT, elements[i], 0);
if(getFlag('f')) {
gl.glFlush();
}
diff --git a/src/demos/vertexBufferObject/VertexBufferObject.java b/src/demos/vertexBufferObject/VertexBufferObject.java
index 02bae92..060fd62 100644
--- a/src/demos/vertexBufferObject/VertexBufferObject.java
+++ b/src/demos/vertexBufferObject/VertexBufferObject.java
@@ -301,12 +301,12 @@ public class VertexBufferObject {
gl.glEnable(GL.GL_LIGHT0);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_NORMALIZE);
- gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, new float[] {.1f, .1f, 0, 1});
- gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, new float[] {.6f, .6f, .1f, 1});
- gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, new float[] { 1, 1, .75f, 1});
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, new float[] {.1f, .1f, 0, 1}, 0);
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, new float[] {.6f, .6f, .1f, 1}, 0);
+ gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, new float[] { 1, 1, .75f, 1}, 0);
gl.glMaterialf(GL.GL_FRONT_AND_BACK, GL.GL_SHININESS, 128.f);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] { .5f, 0, .5f, 0});
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] { .5f, 0, .5f, 0}, 0);
gl.glLightModeli(GL.GL_LIGHT_MODEL_LOCAL_VIEWER, 0);
// NOTE: it looks like GLUT (or something else) sets up the
@@ -501,10 +501,10 @@ public class VertexBufferObject {
if (toggleLightingModel) {
if(getFlag('i')) {
// infinite light
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] { .5f, 0, .5f, 0 });
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] { .5f, 0, .5f, 0 }, 0);
gl.glLightModeli(GL.GL_LIGHT_MODEL_LOCAL_VIEWER, 0);
} else {
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] { .5f, 0, -.5f,1 });
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] { .5f, 0, -.5f,1 }, 0);
gl.glLightModeli(GL.GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
}
toggleLightingModel = false;
@@ -525,7 +525,7 @@ public class VertexBufferObject {
0, 0, 1, 0,
0, 0, -1, 1
};
- gl.glLoadMatrixf(modelViewMatrix);
+ gl.glLoadMatrixf(modelViewMatrix, 0);
// FIXME: add mouse interaction
// camera.apply_inverse_transform();
@@ -646,7 +646,7 @@ public class VertexBufferObject {
} else {
for (int i = 0; i < elements.length; i++) {
++numDrawElementsCalls;
- gl.glDrawElements(primitive, elements[i].length, GL.GL_UNSIGNED_INT, elements[i]);
+ gl.glDrawElements(primitive, elements[i].length, GL.GL_UNSIGNED_INT, elements[i], 0);
if(getFlag('f')) {
gl.glFlush();
}
@@ -687,7 +687,7 @@ public class VertexBufferObject {
bigArraySystem = setupBuffer(ByteBuffer.allocateDirect(bufferSize));
int[] tmp = new int[1];
- gl.glGenBuffersARB(1, tmp);
+ gl.glGenBuffersARB(1, tmp, 0);
bigBufferObject = tmp[0];
gl.glBindBufferARB(GL.GL_ARRAY_BUFFER_ARB, bigBufferObject);
// Initialize data store of buffer object
@@ -741,12 +741,12 @@ public class VertexBufferObject {
}
}
int[] tmp = new int[1];
- gl.glGenBuffersARB(1, tmp);
+ gl.glGenBuffersARB(1, tmp, 0);
elementBufferObject = tmp[0];
gl.glBindBufferARB(GL.GL_ELEMENT_ARRAY_BUFFER_ARB, elementBufferObject);
gl.glBufferDataARB(GL.GL_ELEMENT_ARRAY_BUFFER_ARB,
linearElements.length * BufferUtils.SIZEOF_INT,
- linearElements,
+ linearElements, 0,
GL.GL_STATIC_DRAW_ARB);
gl.glBindBufferARB(GL.GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
}
diff --git a/src/demos/vertexProgRefract/VertexProgRefract.java b/src/demos/vertexProgRefract/VertexProgRefract.java
index e9c6905..6e5a85d 100644
--- a/src/demos/vertexProgRefract/VertexProgRefract.java
+++ b/src/demos/vertexProgRefract/VertexProgRefract.java
@@ -260,7 +260,7 @@ public class VertexProgRefract {
b[' '] = true; // animate by default
int[] vtxProgTmp = new int[1];
- gl.glGenProgramsARB(1, vtxProgTmp);
+ gl.glGenProgramsARB(1, vtxProgTmp, 0);
vtxProg = vtxProgTmp[0];
gl.glBindProgramARB (GL.GL_VERTEX_PROGRAM_ARB, vtxProg);
gl.glProgramStringARB(GL.GL_VERTEX_PROGRAM_ARB, GL.GL_PROGRAM_FORMAT_ASCII_ARB, transformRefract.length(), transformRefract);
@@ -273,7 +273,7 @@ public class VertexProgRefract {
gl.glProgramEnvParameter4fARB(GL.GL_VERTEX_PROGRAM_ARB, 3, 0.0f, 1.0f, 2.0f, 3.0f); // misc constants
int[] cubemapTmp = new int[1];
- gl.glGenTextures(1, cubemapTmp);
+ gl.glGenTextures(1, cubemapTmp, 0);
cubemap = cubemapTmp[0];
gl.glBindTexture(GL.GL_TEXTURE_CUBE_MAP_ARB, cubemap);
@@ -523,7 +523,7 @@ public class VertexProgRefract {
GL.GL_UNSIGNED_BYTE, data);
} else {
gl.glTexImage2D(target, 0, GL.GL_RGB, img.getWidth(), img.getHeight(), 0,
- GL.GL_RGB, GL.GL_UNSIGNED_BYTE, data);
+ GL.GL_RGB, GL.GL_UNSIGNED_BYTE, data, 0);
}
break;
}
@@ -535,7 +535,7 @@ public class VertexProgRefract {
GL.GL_UNSIGNED_BYTE, data);
} else {
gl.glTexImage2D(target, 0, GL.GL_RGB, img.getWidth(), img.getHeight(), 0,
- GL.GL_RGB, GL.GL_UNSIGNED_BYTE, data);
+ GL.GL_RGB, GL.GL_UNSIGNED_BYTE, data, 0);
}
break;
}
@@ -585,7 +585,7 @@ public class VertexProgRefract {
private void initFragmentProgram(GL gl) {
int[] fragProgTmp = new int[1];
- gl.glGenProgramsARB(1, fragProgTmp);
+ gl.glGenProgramsARB(1, fragProgTmp, 0);
fragProg = fragProgTmp[0];
String combineFragProg =
"!!ARBfp1.0\n" +
@@ -606,7 +606,7 @@ public class VertexProgRefract {
gl.glProgramStringARB(GL.GL_FRAGMENT_PROGRAM_ARB, GL.GL_PROGRAM_FORMAT_ASCII_ARB,
combineFragProg.length(), combineFragProg);
int[] errPos = new int[1];
- gl.glGetIntegerv(GL.GL_PROGRAM_ERROR_POSITION_ARB, errPos);
+ gl.glGetIntegerv(GL.GL_PROGRAM_ERROR_POSITION_ARB, errPos, 0);
if (errPos[0] >= 0) {
System.out.println("Fragment program failed to load:");
String errMsg = gl.glGetString(GL.GL_PROGRAM_ERROR_STRING_ARB);
diff --git a/src/demos/vertexProgWarp/VertexProgWarp.java b/src/demos/vertexProgWarp/VertexProgWarp.java
index 3361755..bacecab 100644
--- a/src/demos/vertexProgWarp/VertexProgWarp.java
+++ b/src/demos/vertexProgWarp/VertexProgWarp.java
@@ -150,7 +150,7 @@ public class VertexProgWarp {
for(int i=0; i<NUM_PROGS; i++) {
int[] vtxProgTmp = new int[1];
- gl.glGenProgramsARB(1, vtxProgTmp);
+ gl.glGenProgramsARB(1, vtxProgTmp, 0);
programs[i] = vtxProgTmp[0];
gl.glBindProgramARB(GL.GL_VERTEX_PROGRAM_ARB, programs[i]);
gl.glProgramStringARB(GL.GL_VERTEX_PROGRAM_ARB, GL.GL_PROGRAM_FORMAT_ASCII_ARB, programTexts[i].length(), programTexts[i]);
diff --git a/src/gleem/ExaminerViewer.java b/src/gleem/ExaminerViewer.java
index 2cb2f05..9760165 100644
--- a/src/gleem/ExaminerViewer.java
+++ b/src/gleem/ExaminerViewer.java
@@ -581,11 +581,11 @@ public class ExaminerViewer {
gl.glMatrixMode(GL.GL_MODELVIEW);
float[] data = new float[16];
params.getModelviewMatrix().getColumnMajorData(data);
- gl.glLoadMatrixf(data);
+ gl.glLoadMatrixf(data, 0);
gl.glMatrixMode(GL.GL_PROJECTION);
params.getProjectionMatrix().getColumnMajorData(data);
- gl.glLoadMatrixf(data);
+ gl.glLoadMatrixf(data, 0);
}
private void recalcInverseRotation(GL gl) {
diff --git a/src/gleem/TestExaminerViewer.java b/src/gleem/TestExaminerViewer.java
index 55d0283..3ba68e4 100644
--- a/src/gleem/TestExaminerViewer.java
+++ b/src/gleem/TestExaminerViewer.java
@@ -85,9 +85,9 @@ public class TestExaminerViewer {
float[] lightPosition = new float[] {1, 1, 1, 0};
float[] ambient = new float[] { 0.0f, 0.0f, 0.0f, 1.0f };
float[] diffuse = new float[] { 1.0f, 1.0f, 1.0f, 1.0f };
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lightPosition);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lightPosition, 0);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);
diff --git a/src/gleem/TestHandleBox.java b/src/gleem/TestHandleBox.java
index adf8e32..0761c8b 100644
--- a/src/gleem/TestHandleBox.java
+++ b/src/gleem/TestHandleBox.java
@@ -63,9 +63,9 @@ public class TestHandleBox {
float[] lightPosition = new float[] {1, 1, 1, 0};
float[] ambient = new float[] { 0.0f, 0.0f, 0.0f, 1.0f };
float[] diffuse = new float[] { 1.0f, 1.0f, 1.0f, 1.0f };
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lightPosition);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lightPosition, 0);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);
diff --git a/src/gleem/TestMultiWin.java b/src/gleem/TestMultiWin.java
index ce2c257..4b9fa58 100644
--- a/src/gleem/TestMultiWin.java
+++ b/src/gleem/TestMultiWin.java
@@ -87,9 +87,9 @@ public class TestMultiWin {
float[] lightPosition = new float[] {1, 1, 1, 0};
float[] ambient = new float[] { 0.0f, 0.0f, 0.0f, 1.0f };
float[] diffuse = new float[] { 1.0f, 1.0f, 1.0f, 1.0f };
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lightPosition);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lightPosition, 0);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);
diff --git a/src/gleem/TestTranslate1.java b/src/gleem/TestTranslate1.java
index 131fa0c..79fb4ca 100644
--- a/src/gleem/TestTranslate1.java
+++ b/src/gleem/TestTranslate1.java
@@ -63,9 +63,9 @@ public class TestTranslate1 {
float[] lightPosition = new float[] {1, 1, 1, 0};
float[] ambient = new float[] { 0.0f, 0.0f, 0.0f, 1.0f };
float[] diffuse = new float[] { 1.0f, 1.0f, 1.0f, 1.0f };
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lightPosition);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lightPosition, 0);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);
diff --git a/src/gleem/TestTranslate2.java b/src/gleem/TestTranslate2.java
index 1789575..0906d8f 100644
--- a/src/gleem/TestTranslate2.java
+++ b/src/gleem/TestTranslate2.java
@@ -63,9 +63,9 @@ public class TestTranslate2 {
float[] lightPosition = new float[] {1, 1, 1, 0};
float[] ambient = new float[] { 0.0f, 0.0f, 0.0f, 1.0f };
float[] diffuse = new float[] { 1.0f, 1.0f, 1.0f, 1.0f };
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse);
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lightPosition);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, ambient, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, diffuse, 0);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, lightPosition, 0);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);