diff options
-rw-r--r-- | make/build.xml | 2 | ||||
-rw-r--r-- | src/demos/cg/runtime_ogl/cgGL_vertex_example.java | 9 | ||||
-rw-r--r-- | src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java | 13 | ||||
-rwxr-xr-x | src/demos/hdr/ARBFPPipeline.java | 64 | ||||
-rwxr-xr-x | src/demos/hdr/CgPipeline.java | 50 | ||||
-rwxr-xr-x | src/demos/hdr/HDR.java | 117 | ||||
-rwxr-xr-x | src/demos/hdr/HDRTexture.java | 24 |
7 files changed, 142 insertions, 137 deletions
diff --git a/make/build.xml b/make/build.xml index c9c7b3b..f5cd571 100644 --- a/make/build.xml +++ b/make/build.xml @@ -131,7 +131,7 @@ <pathelement location="${simple-xml.jar}" /> </path> <!-- For the time being we exclude the VertexArrayRange and HDR demos, which rely on NVIDIA-specific extensions --> - <javac destdir="${classes}" excludes="${jogl.cg.excludes},demos/nurbs/**,jbullet/**,demos/hdr/**,demos/vertexArrayRange/**" source="1.4" target="1.4" debug="true" debuglevel="source,lines"> + <javac destdir="${classes}" excludes="${jogl.cg.excludes},demos/nurbs/**,jbullet/**,demos/vertexArrayRange/**" source="1.4" target="1.4" debug="true" debuglevel="source,lines"> <src path="${src}" /> <classpath refid="jogl-demos.classpath" /> </javac> diff --git a/src/demos/cg/runtime_ogl/cgGL_vertex_example.java b/src/demos/cg/runtime_ogl/cgGL_vertex_example.java index aded2d2..3a0504f 100644 --- a/src/demos/cg/runtime_ogl/cgGL_vertex_example.java +++ b/src/demos/cg/runtime_ogl/cgGL_vertex_example.java @@ -35,6 +35,7 @@ package demos.cg.runtime_ogl; import com.sun.opengl.cg.*; import javax.media.opengl.*; +import javax.media.opengl.awt.*; import javax.media.opengl.glu.*; import java.awt.*; @@ -103,7 +104,7 @@ public class cgGL_vertex_example implements GLEventListener } - private void DrawCube(GL gl) + private void DrawCube(GL2 gl) { int i; @@ -131,7 +132,7 @@ public class cgGL_vertex_example implements GLEventListener */ for(i = 0; i < 6; i++) { - gl.glBegin(GL.GL_QUADS); + gl.glBegin(gl.GL_QUADS); gl.glNormal3f(CubeNormals[i][0], CubeNormals[i][1], CubeNormals[i][0]); CgGL.cgGLSetParameter3f(TestColorParam, 1.0f, 0.0f, 0.0f); @@ -161,7 +162,7 @@ public class cgGL_vertex_example implements GLEventListener public void display(GLAutoDrawable drawable) { - GL gl = drawable.getGL(); + GL2 gl = drawable.getGL().getGL2(); gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); DrawCube(gl); //glutSwapBuffers(); @@ -227,7 +228,7 @@ public class cgGL_vertex_example implements GLEventListener TestColorParam = CgGL.cgGetNamedParameter(Program, "IN.TestColor"); CheckCgError(); } - GL gl = drawable.getGL(); + GL2 gl = drawable.getGL().getGL2(); InitializeCube(CubeVertices); 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 50cae18..98075d9 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 @@ -35,6 +35,7 @@ package demos.cg.runtime_ogl_vertex_fragment; import com.sun.opengl.cg.*; import javax.media.opengl.*; +import javax.media.opengl.awt.*; import javax.media.opengl.glu.*; import com.sun.opengl.util.*; import com.sun.opengl.util.*; @@ -99,7 +100,7 @@ public class runtime_ogl_vertex_fragment implements GLEventListener // Use debug pipeline // drawable.setGL(new DebugGL(drawable.getGL())); - GL gl = drawable.getGL(); + GL2 gl = drawable.getGL().getGL2(); // Basic Cg setup; register a callback function for any errors // and create an initial context @@ -134,7 +135,7 @@ public class runtime_ogl_vertex_fragment implements GLEventListener public void display(GLAutoDrawable drawable) { - GL gl = drawable.getGL(); + GL2 gl = drawable.getGL().getGL2(); // The usual OpenGL stuff to clear the screen and set up viewing. gl.glClearColor(.25f, .25f, .25f, 1.0f); @@ -272,7 +273,7 @@ public class runtime_ogl_vertex_fragment implements GLEventListener CgGL.cgGLLoadProgram(fragmentProgram); } - void LoadTextures(GL gl) + void LoadTextures(GL2 gl) { // There is only one texture needed here--we'll set up a basic // checkerboard--which is used to modulate the diffuse channel in the @@ -282,7 +283,7 @@ public class runtime_ogl_vertex_fragment implements GLEventListener // Basic OpenGL texture state setup gl.glBindTexture(GL.GL_TEXTURE_2D, handle[0]); - gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_GENERATE_MIPMAP_SGIS, GL.GL_TRUE); + gl.glTexParameteri(GL.GL_TEXTURE_2D, gl.GL_GENERATE_MIPMAP, GL.GL_TRUE); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_LINEAR); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP_TO_EDGE); @@ -322,7 +323,7 @@ public class runtime_ogl_vertex_fragment implements GLEventListener private static FloatBuffer P, N, uv; private static IntBuffer indices; - void DrawGeometry(GL gl) + void DrawGeometry(GL2 gl) { // Cache the sphere positions, normals, texture coordinates, and // vertex indices in a local array; we only need to fill them in the @@ -396,7 +397,7 @@ public class runtime_ogl_vertex_fragment implements GLEventListener CgGL.cgGLEnableTextureParameter(param); // And now, draw the geometry. - gl.glDrawElements(GL.GL_TRIANGLES, 3*nTris, GL.GL_UNSIGNED_INT, indices); + gl.glDrawElements(GL.GL_TRIANGLES, 3*nTris, gl.GL_UNSIGNED_INT, indices); // Be a good citizen and disable the various bindings we set up above. param = CgGL.cgGetNamedParameter(vertexProgram, "Pobject"); diff --git a/src/demos/hdr/ARBFPPipeline.java b/src/demos/hdr/ARBFPPipeline.java index be98982..04ae00b 100755 --- a/src/demos/hdr/ARBFPPipeline.java +++ b/src/demos/hdr/ARBFPPipeline.java @@ -21,51 +21,51 @@ public class ARBFPPipeline implements Pipeline { } public void initFloatingPointTexture(GL2 gl, int textureObject, int w, int h) { - gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE, textureObject); - gl.glCopyTexImage2D(GL2.GL_TEXTURE_RECTANGLE, 0, textureFormat, 0, 0, w, h, 0); + gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE_ARB, textureObject); + gl.glCopyTexImage2D(GL2.GL_TEXTURE_RECTANGLE_ARB, 0, textureFormat, 0, 0, w, h, 0); } public void initTexture(GL2 gl, int textureObject, int w, int h) { - gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE, textureObject); - gl.glCopyTexImage2D(GL2.GL_TEXTURE_RECTANGLE, 0, GL2.GL_RGBA, 0, 0, w, h, 0); + gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE_ARB, textureObject); + gl.glCopyTexImage2D(GL2.GL_TEXTURE_RECTANGLE_ARB, 0, GL2.GL_RGBA, 0, 0, w, h, 0); } public void copyToTexture(GL2 gl, int textureObject, int w, int h) { - gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE, textureObject); - gl.glCopyTexSubImage2D(GL2.GL_TEXTURE_RECTANGLE, 0, 0, 0, 0, 0, w, h); + gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE_ARB, textureObject); + gl.glCopyTexSubImage2D(GL2.GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, 0, 0, w, h); } public void bindTexture(GL2 gl, int textureObject) { - gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE, textureObject); + gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE_ARB, textureObject); } private List programs = new ArrayList(); public int loadVertexProgram(GL2 gl, String filename) throws IOException { - return loadProgram(gl, filename, GL2.GL_VERTEX_PROGRAM); + return loadProgram(gl, filename, GL2.GL_VERTEX_PROGRAM_ARB); } public int loadFragmentProgram(GL2 gl, String filename) throws IOException { - return loadProgram(gl, filename, GL2.GL_FRAGMENT_PROGRAM); + return loadProgram(gl, filename, GL2.GL_FRAGMENT_PROGRAM_ARB); } private int loadProgram(GL2 gl, String fileName, int profile) throws IOException { String programBuffer = FileUtils.loadStreamIntoString(getClass().getClassLoader().getResourceAsStream(fileName)); int[] tmpInt = new int[1]; - gl.glGenPrograms(1, tmpInt, 0); + gl.glGenProgramsARB(1, tmpInt, 0); int res = tmpInt[0]; - gl.glBindProgram(profile, res); - gl.glProgramString(profile, GL2.GL_PROGRAM_FORMAT_ASCII, programBuffer.length(), programBuffer); + gl.glBindProgramARB(profile, res); + gl.glProgramStringARB(profile, GL2.GL_PROGRAM_FORMAT_ASCII_ARB, programBuffer.length(), programBuffer); int[] errPos = new int[1]; - gl.glGetIntegerv(GL2.GL_PROGRAM_ERROR_POSITION, errPos, 0); + gl.glGetIntegerv(GL2.GL_PROGRAM_ERROR_POSITION_ARB, errPos, 0); if (errPos[0] >= 0) { String kind = "Program"; - if (profile == GL2.GL_VERTEX_PROGRAM) { + if (profile == GL2.GL_VERTEX_PROGRAM_ARB) { kind = "Vertex program"; - } else if (profile == GL2.GL_FRAGMENT_PROGRAM) { + } else if (profile == GL2.GL_FRAGMENT_PROGRAM_ARB) { kind = "Fragment program"; } System.out.println(kind + " failed to load:"); - String errMsg = gl.glGetString(GL2.GL_PROGRAM_ERROR_STRING); + String errMsg = gl.glGetString(GL2.GL_PROGRAM_ERROR_STRING_ARB); if (errMsg == null) { System.out.println("[No error message available]"); } else { @@ -79,10 +79,10 @@ public class ARBFPPipeline implements Pipeline { System.out.println(programBuffer.substring(errPos[0], endPos)); throw new GLException("Error loading " + kind); } else { - if (profile == GL2.GL_FRAGMENT_PROGRAM) { + if (profile == GL2.GL_FRAGMENT_PROGRAM_ARB) { int[] isNative = new int[1]; - gl.glGetProgramiv(GL2.GL_FRAGMENT_PROGRAM, - GL2.GL_PROGRAM_UNDER_NATIVE_LIMITS, + gl.glGetProgramiv(GL2.GL_FRAGMENT_PROGRAM_ARB, + GL2.GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, isNative, 0); if (isNative[0] != 1) { System.out.println("WARNING: fragment program is over native resource limits"); @@ -94,21 +94,21 @@ public class ARBFPPipeline implements Pipeline { } public void enableVertexProgram(GL2 gl, int program) { - gl.glBindProgram(GL2.GL_VERTEX_PROGRAM, program); - gl.glEnable(GL2.GL_VERTEX_PROGRAM); + gl.glBindProgramARB(GL2.GL_VERTEX_PROGRAM_ARB, program); + gl.glEnable(GL2.GL_VERTEX_PROGRAM_ARB); } public void enableFragmentProgram(GL2 gl, int program) { - gl.glBindProgram(GL2.GL_FRAGMENT_PROGRAM, program); - gl.glEnable(GL2.GL_FRAGMENT_PROGRAM); + gl.glBindProgramARB(GL2.GL_FRAGMENT_PROGRAM_ARB, program); + gl.glEnable(GL2.GL_FRAGMENT_PROGRAM_ARB); } public void disableVertexProgram(GL2 gl) { - gl.glDisable(GL2.GL_VERTEX_PROGRAM); + gl.glDisable(GL2.GL_VERTEX_PROGRAM_ARB); } public void disableFragmentProgram(GL2 gl) { - gl.glDisable(GL2.GL_FRAGMENT_PROGRAM); + gl.glDisable(GL2.GL_FRAGMENT_PROGRAM_ARB); } public int getNamedParameter(int program, String name) { @@ -117,32 +117,32 @@ public class ARBFPPipeline implements Pipeline { public void setVertexProgramParameter1f(GL2 gl, int param, float val) { if (param < 0) return; - gl.glProgramLocalParameter4f(GL2.GL_VERTEX_PROGRAM, param, val, 0, 0, 0); + gl.glProgramLocalParameter4fARB(GL2.GL_VERTEX_PROGRAM_ARB, param, val, 0, 0, 0); } public void setVertexProgramParameter3f(GL2 gl, int param, float x, float y, float z) { if (param < 0) return; - gl.glProgramLocalParameter4f(GL2.GL_VERTEX_PROGRAM, param, x, y, z, 0); + gl.glProgramLocalParameter4fARB(GL2.GL_VERTEX_PROGRAM_ARB, param, x, y, z, 0); } public void setVertexProgramParameter4f(GL2 gl, int param, float x, float y, float z, float w) { if (param < 0) return; - gl.glProgramLocalParameter4f(GL2.GL_VERTEX_PROGRAM, param, x, y, z, w); + gl.glProgramLocalParameter4fARB(GL2.GL_VERTEX_PROGRAM_ARB, param, x, y, z, w); } public void setFragmentProgramParameter1f(GL2 gl, int param, float val) { if (param < 0) return; - gl.glProgramLocalParameter4f(GL2.GL_FRAGMENT_PROGRAM, param, val, 0, 0, 0); + gl.glProgramLocalParameter4fARB(GL2.GL_FRAGMENT_PROGRAM_ARB, param, val, 0, 0, 0); } public void setFragmentProgramParameter3f(GL2 gl, int param, float x, float y, float z) { if (param < 0) return; - gl.glProgramLocalParameter4f(GL2.GL_FRAGMENT_PROGRAM, param, x, y, z, 0); + gl.glProgramLocalParameter4fARB(GL2.GL_FRAGMENT_PROGRAM_ARB, param, x, y, z, 0); } public void setFragmentProgramParameter4f(GL2 gl, int param, float x, float y, float z, float w) { if (param < 0) return; - gl.glProgramLocalParameter4f(GL2.GL_FRAGMENT_PROGRAM, param, x, y, z, w); + gl.glProgramLocalParameter4fARB(GL2.GL_FRAGMENT_PROGRAM_ARB, param, x, y, z, w); } public void trackModelViewProjectionMatrix(GL2 gl, int param) { @@ -170,7 +170,7 @@ public class ARBFPPipeline implements Pipeline { public void setMatrixParameterfc(GL2 gl, int param, float[] matrix) { // Correct for row-major vs. column-major differences for (int i = 0; i < 4; i++) { - gl.glProgramLocalParameter4f(GL2.GL_VERTEX_PROGRAM, param + i, matrix[i], matrix[4+i], matrix[8+i], matrix[12+i]); + gl.glProgramLocalParameter4fARB(GL2.GL_VERTEX_PROGRAM_ARB, param + i, matrix[i], matrix[4+i], matrix[8+i], matrix[12+i]); } } } diff --git a/src/demos/hdr/CgPipeline.java b/src/demos/hdr/CgPipeline.java index 4bc472b..56906f1 100755 --- a/src/demos/hdr/CgPipeline.java +++ b/src/demos/hdr/CgPipeline.java @@ -13,31 +13,31 @@ public class CgPipeline implements Pipeline { context = CgGL.cgCreateContext(); } - public void initFloatingPointTexture(GL gl, int textureObject, int w, int h) { - gl.glBindTexture(GL.GL_TEXTURE_RECTANGLE_NV, textureObject); - gl.glCopyTexImage2D(GL.GL_TEXTURE_RECTANGLE_NV, 0, GL.GL_FLOAT_RGBA16_NV, 0, 0, w, h, 0); + public void initFloatingPointTexture(GL2 gl, int textureObject, int w, int h) { + gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE_ARB, textureObject); + gl.glCopyTexImage2D(GL2.GL_TEXTURE_RECTANGLE_ARB, 0, GL2.GL_FLOAT_RGBA16_NV, 0, 0, w, h, 0); } - public void initTexture(GL gl, int textureObject, int w, int h) { - gl.glBindTexture(GL.GL_TEXTURE_RECTANGLE_NV, textureObject); - gl.glCopyTexImage2D(GL.GL_TEXTURE_RECTANGLE_NV, 0, GL.GL_RGBA, 0, 0, w, h, 0); + public void initTexture(GL2 gl, int textureObject, int w, int h) { + gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE_ARB, textureObject); + gl.glCopyTexImage2D(GL2.GL_TEXTURE_RECTANGLE_ARB, 0, GL.GL_RGBA, 0, 0, w, h, 0); } - public void copyToTexture(GL gl, int textureObject, int w, int h) { - gl.glBindTexture(GL.GL_TEXTURE_RECTANGLE_NV, textureObject); - gl.glCopyTexSubImage2D(GL.GL_TEXTURE_RECTANGLE_NV, 0, 0, 0, 0, 0, w, h); + public void copyToTexture(GL2 gl, int textureObject, int w, int h) { + gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE_ARB, textureObject); + gl.glCopyTexSubImage2D(GL2.GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, 0, 0, w, h); } - public void bindTexture(GL gl, int textureObject) { - gl.glBindTexture(GL.GL_TEXTURE_RECTANGLE_NV, textureObject); + public void bindTexture(GL2 gl, int textureObject) { + gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE_ARB, textureObject); } private List programs = new ArrayList(); - public int loadVertexProgram(GL gl, String filename) throws IOException { + public int loadVertexProgram(GL2 gl, String filename) throws IOException { return loadProgram(filename, CgGL.CG_PROFILE_ARBVP1); } - public int loadFragmentProgram(GL gl, String filename) throws IOException { + public int loadFragmentProgram(GL2 gl, String filename) throws IOException { return loadProgram(filename, CgGL.CG_PROFILE_ARBFP1); } @@ -52,21 +52,21 @@ public class CgPipeline implements Pipeline { return res; } - public void enableVertexProgram(GL gl, int program) { + public void enableVertexProgram(GL2 gl, int program) { CgGL.cgGLBindProgram((CGprogram) programs.get(program)); CgGL.cgGLEnableProfile(CgGL.CG_PROFILE_ARBVP1); } - public void enableFragmentProgram(GL gl, int program) { + public void enableFragmentProgram(GL2 gl, int program) { CgGL.cgGLBindProgram((CGprogram) programs.get(program)); CgGL.cgGLEnableProfile(CgGL.CG_PROFILE_ARBFP1); } - public void disableVertexProgram(GL gl) { + public void disableVertexProgram(GL2 gl) { CgGL.cgGLDisableProfile(CgGL.CG_PROFILE_ARBVP1); } - public void disableFragmentProgram(GL gl) { + public void disableFragmentProgram(GL2 gl) { CgGL.cgGLDisableProfile(CgGL.CG_PROFILE_ARBFP1); } @@ -79,35 +79,35 @@ public class CgPipeline implements Pipeline { return res; } - public void setVertexProgramParameter1f(GL gl, int param, float val) { + public void setVertexProgramParameter1f(GL2 gl, int param, float val) { CgGL.cgGLSetParameter1f((CGparameter) parameters.get(param), val); } - public void setVertexProgramParameter3f(GL gl, int param, float x, float y, float z) { + public void setVertexProgramParameter3f(GL2 gl, int param, float x, float y, float z) { CgGL.cgGLSetParameter3f((CGparameter) parameters.get(param), x, y, z); } - public void setVertexProgramParameter4f(GL gl, int param, float x, float y, float z, float w) { + public void setVertexProgramParameter4f(GL2 gl, int param, float x, float y, float z, float w) { CgGL.cgGLSetParameter4f((CGparameter) parameters.get(param), x, y, z, w); } - public void setFragmentProgramParameter1f(GL gl, int param, float val) { + public void setFragmentProgramParameter1f(GL2 gl, int param, float val) { CgGL.cgGLSetParameter1f((CGparameter) parameters.get(param), val); } - public void setFragmentProgramParameter3f(GL gl, int param, float x, float y, float z) { + public void setFragmentProgramParameter3f(GL2 gl, int param, float x, float y, float z) { CgGL.cgGLSetParameter3f((CGparameter) parameters.get(param), x, y, z); } - public void setFragmentProgramParameter4f(GL gl, int param, float x, float y, float z, float w) { + public void setFragmentProgramParameter4f(GL2 gl, int param, float x, float y, float z, float w) { CgGL.cgGLSetParameter4f((CGparameter) parameters.get(param), x, y, z, w); } - public void trackModelViewProjectionMatrix(GL gl, int param) { + public void trackModelViewProjectionMatrix(GL2 gl, int param) { CgGL.cgGLSetStateMatrixParameter((CGparameter) parameters.get(param), CgGL.CG_GL_MODELVIEW_PROJECTION_MATRIX, CgGL.CG_GL_MATRIX_IDENTITY); } - public void setMatrixParameterfc(GL gl, int param, float[] matrix) { + public void setMatrixParameterfc(GL2 gl, int param, float[] matrix) { CgGL.cgGLSetMatrixParameterfc((CGparameter) parameters.get(param), matrix, 0); } } diff --git a/src/demos/hdr/HDR.java b/src/demos/hdr/HDR.java index 14eb63b..087be00 100755 --- a/src/demos/hdr/HDR.java +++ b/src/demos/hdr/HDR.java @@ -1,6 +1,7 @@ package demos.hdr; -import com.sun.opengl.util.glut.gl2.GLUTgl2; +import com.sun.opengl.util.Animator; +import com.sun.opengl.util.gl2.GLUT; import demos.common.Demo; import demos.common.DemoListener; import demos.util.DurationTimer; @@ -36,9 +37,10 @@ import javax.media.opengl.GLDrawableFactory; import javax.media.opengl.GLEventListener; import javax.media.opengl.GLException; import javax.media.opengl.GLPbuffer; +import javax.media.opengl.GLProfile; +import javax.media.opengl.awt.AWTGLAutoDrawable; import javax.media.opengl.awt.GLCanvas; import javax.media.opengl.glu.GLU; -import javax.media.opengl.util.Animator; import javax.swing.JOptionPane; @@ -65,7 +67,7 @@ public class HDR extends Demo { private ObjReader model; private Pipeline pipeline; - private GLUTgl2 glut = new GLUTgl2(); + private GLUT glut = new GLUT(); private boolean[] b = new boolean[256]; @@ -100,8 +102,6 @@ public class HDR extends Demo { private int gamma_tex; private int vignette_tex; - private int textureTarget; // Either GL_TEXTURE_RECTANGLE or GL_TEXTURE_RECTANGLE_EXT/ARB - private GLPbuffer pbuffer; private GLPbuffer blur_pbuffer; private GLPbuffer blur2_pbuffer; @@ -258,7 +258,7 @@ public class HDR extends Demo { // public void shutdownDemo() { - ManipManager.getManipManager().unregisterWindow(drawable); + ManipManager.getManipManager().unregisterWindow((AWTGLAutoDrawable) drawable); drawable.removeGLEventListener(this); super.shutdownDemo(); } @@ -280,20 +280,19 @@ public class HDR extends Demo { GL2 gl = drawable.getGL().getGL2(); checkExtension(gl, "GL_VERSION_1_3"); // For multitexture - checkExtension(gl, "GL_pbuffer"); - checkExtension(gl, "GL_vertex_program"); - checkExtension(gl, "GL_fragment_program"); - if (!gl.isExtensionAvailable("GL_texture_rectangle") && - !gl.isExtensionAvailable("GL_EXT_texture_rectangle") && - !gl.isExtensionAvailable("GL_texture_rectangle")) { - // NOTE: it turns out the constants associated with these extensions are all identical - unavailableExtension("Texture rectangle extension not available (need one of GL_texture_rectangle, GL_EXT_texture_rectangle or GL_texture_rectangle"); + checkExtension(gl, "GL_ARB_pbuffer"); + checkExtension(gl, "GL_ARB_vertex_program"); + checkExtension(gl, "GL_ARB_fragment_program"); + if (!gl.isExtensionAvailable("GL_ARB_texture_rectangle") && + !gl.isExtensionAvailable("GL_EXT_texture_rectangle")) { + // NOTE: it turns out the constants associated with these extensions are identical + unavailableExtension("Texture rectangle extension not available (need either GL_ARB_texture_rectangle or GL_EXT_texture_rectangle"); } - if (!gl.isExtensionAvailable("GL_float_buffer") && + if (!gl.isExtensionAvailable("GL_NV_float_buffer") && !gl.isExtensionAvailable("GL_ATI_texture_float") && !gl.isExtensionAvailable("GL_APPLE_float_pixels")) { - unavailableExtension("Floating-point textures not available (need one of GL_float_buffer, GL_ATI_texture_float, or GL_APPLE_float_pixels"); + unavailableExtension("Floating-point textures not available (need one of GL_NV_float_buffer, GL_ATI_texture_float, or GL_APPLE_float_pixels"); } setOrthoProjection(gl, 0, 0, win_w, win_h); @@ -307,7 +306,7 @@ public class HDR extends Demo { // Workaround for apparent bug when not using render-to-texture-rectangle int floatDepthBits = 1; - GLCapabilities caps = new GLCapabilities(); + GLCapabilities caps = new GLCapabilities(null); caps.setDoubleBuffered(false); caps.setPbufferFloatingPointBuffers(true); caps.setRedBits(floatBits); @@ -316,7 +315,7 @@ public class HDR extends Demo { caps.setAlphaBits(floatAlphaBits); caps.setDepthBits(floatDepthBits); int[] tmp = new int[1]; - if (!GLDrawableFactory.getFactory().canCreateGLPbuffer()) { + if (!GLDrawableFactory.getFactory(GLProfile.GetProfileDefault()).canCreateGLPbuffer()) { unavailableExtension("Can not create pbuffer"); } if (pbuffer != null) { @@ -337,15 +336,15 @@ public class HDR extends Demo { } GLContext parentContext = drawable.getContext(); - pbuffer = GLDrawableFactory.getFactory().createGLPbuffer(caps, null, pbuffer_w, pbuffer_h, parentContext); + pbuffer = GLDrawableFactory.getFactory(GLProfile.GetProfileDefault()).createGLPbuffer(caps, null, pbuffer_w, pbuffer_h, parentContext); pbuffer.addGLEventListener(new PbufferListener()); gl.glGenTextures(1, tmp, 0); pbuffer_tex = tmp[0]; - blur_pbuffer = GLDrawableFactory.getFactory().createGLPbuffer(caps, null, blur_w, blur_h, parentContext); + blur_pbuffer = GLDrawableFactory.getFactory(GLProfile.GetProfileDefault()).createGLPbuffer(caps, null, blur_w, blur_h, parentContext); blur_pbuffer.addGLEventListener(new BlurPbufferListener()); gl.glGenTextures(1, tmp, 0); blur_pbuffer_tex = tmp[0]; - blur2_pbuffer = GLDrawableFactory.getFactory().createGLPbuffer(caps, null, blur_w, blur_h, parentContext); + blur2_pbuffer = GLDrawableFactory.getFactory(GLProfile.GetProfileDefault()).createGLPbuffer(caps, null, blur_w, blur_h, parentContext); blur2_pbuffer.addGLEventListener(new Blur2PbufferListener()); gl.glGenTextures(1, tmp, 0); blur2_pbuffer_tex = tmp[0]; @@ -354,7 +353,7 @@ public class HDR extends Demo { caps.setGreenBits(8); caps.setBlueBits(8); caps.setDepthBits(24); - tonemap_pbuffer = GLDrawableFactory.getFactory().createGLPbuffer(caps, null, pbuffer_w, pbuffer_h, parentContext); + tonemap_pbuffer = GLDrawableFactory.getFactory(GLProfile.GetProfileDefault()).createGLPbuffer(caps, null, pbuffer_w, pbuffer_h, parentContext); tonemap_pbuffer.addGLEventListener(new TonemapPbufferListener()); gl.glGenTextures(1, tmp, 0); tonemap_pbuffer_tex = tmp[0]; @@ -363,13 +362,13 @@ public class HDR extends Demo { // Register the window with the ManipManager ManipManager manager = ManipManager.getManipManager(); - manager.registerWindow(drawable); + manager.registerWindow((AWTGLAutoDrawable) drawable); this.drawable = drawable; viewer = new ExaminerViewer(MouseButtonHelper.numMouseButtons()); viewer.setAutoRedrawMode(false); viewer.setNoAltKeyMode(true); - viewer.attach(drawable, new BSphereProvider() { + viewer.attach((AWTGLAutoDrawable) drawable, new BSphereProvider() { public BSphere getBoundingSphere() { return new BSphere(new Vec3f(0, 0, 0), 1.0f); } @@ -437,16 +436,16 @@ public class HDR extends Demo { tonemap_pbuffer.display(); // display in window - gl.glEnable(GL2.GL_TEXTURE_RECTANGLE); + gl.glEnable(GL2.GL_TEXTURE_RECTANGLE_ARB); gl.glActiveTexture(GL2.GL_TEXTURE0); - gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE, tonemap_pbuffer_tex); + gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE_ARB, tonemap_pbuffer_tex); if (b['n']) { - gl.glTexParameteri( GL2.GL_TEXTURE_RECTANGLE, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR); + gl.glTexParameteri( GL2.GL_TEXTURE_RECTANGLE_ARB, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR); } else { - gl.glTexParameteri( GL2.GL_TEXTURE_RECTANGLE, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_NEAREST); + gl.glTexParameteri( GL2.GL_TEXTURE_RECTANGLE_ARB, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_NEAREST); } drawQuadRect4(gl, win_w, win_h, pbuffer_w, pbuffer_h); - gl.glDisable(GL2.GL_TEXTURE_RECTANGLE); + gl.glDisable(GL2.GL_TEXTURE_RECTANGLE_ARB); // Try to avoid swamping the CPU on Linux Thread.yield(); @@ -557,11 +556,11 @@ public class HDR extends Demo { gl.glGenTextures(1, tmp, 0); int texid = tmp[0]; - gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE, texid); - gl.glTexParameteri(GL2.GL_TEXTURE_RECTANGLE, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_NEAREST); - gl.glTexParameteri(GL2.GL_TEXTURE_RECTANGLE, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_NEAREST); - gl.glTexParameteri(GL2.GL_TEXTURE_RECTANGLE, GL2.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP_TO_EDGE); - gl.glTexParameteri(GL2.GL_TEXTURE_RECTANGLE, GL2.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP_TO_EDGE); + gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE_ARB, texid); + gl.glTexParameteri(GL2.GL_TEXTURE_RECTANGLE_ARB, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_NEAREST); + gl.glTexParameteri(GL2.GL_TEXTURE_RECTANGLE_ARB, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_NEAREST); + gl.glTexParameteri(GL2.GL_TEXTURE_RECTANGLE_ARB, GL2.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP_TO_EDGE); + gl.glTexParameteri(GL2.GL_TEXTURE_RECTANGLE_ARB, GL2.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP_TO_EDGE); gl.glPixelStorei(GL2.GL_UNPACK_ALIGNMENT, 1); @@ -585,7 +584,7 @@ public class HDR extends Demo { } } - gl.glTexImage2D(GL2.GL_TEXTURE_RECTANGLE, 0, GL2.GL_LUMINANCE, xsiz, ysiz, 0, GL2.GL_LUMINANCE, GL2.GL_FLOAT, FloatBuffer.wrap(img)); + gl.glTexImage2D(GL2.GL_TEXTURE_RECTANGLE_ARB, 0, GL2.GL_LUMINANCE, xsiz, ysiz, 0, GL2.GL_LUMINANCE, GL2.GL_FLOAT, FloatBuffer.wrap(img)); return texid; } @@ -614,7 +613,7 @@ public class HDR extends Demo { System.err.println("Creating HILO cubemap"); hdr_tex = hdr.createCubemapHILO(gl, true); hdr_tex2 = hdr.createCubemapHILO(gl, false); - texmode = GL2.GL_FLOAT_RGBA16; + texmode = GL2.GL_FLOAT_RGBA16_NV; hilo = true; break; case GLPbuffer.APPLE_FLOAT: @@ -655,6 +654,7 @@ public class HDR extends Demo { // Unused routines public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void dispose(GLAutoDrawable drawable) {} //---------------------------------------------------------------------- // Internals only below this point @@ -675,7 +675,7 @@ public class HDR extends Demo { if (b['m']) { gl.glEnable(GL2.GL_MULTISAMPLE); - gl.glHint(GL2.GL_MULTISAMPLE_FILTER_HINT, GL2.GL_NICEST); + gl.glHint(GL2.GL_MULTISAMPLE_FILTER_HINT_NV, GL2.GL_NICEST); } else { gl.glDisable(GL2.GL_MULTISAMPLE); } @@ -803,7 +803,7 @@ public class HDR extends Demo { GL2 gl = drawable.getGL().getGL2(); // horizontal blur - gl.glBindProgram(GL2.GL_FRAGMENT_PROGRAM, blurh_fprog); + gl.glBindProgramARB(GL2.GL_FRAGMENT_PROGRAM_ARB, blurh_fprog); gl.glActiveTexture(GL2.GL_TEXTURE0); pipeline.bindTexture(gl, blur2_pbuffer_tex); glowPass(gl); @@ -814,6 +814,7 @@ public class HDR extends Demo { // Unused routines public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void dispose(GLAutoDrawable drawable) {} } class Blur2PbufferListener implements GLEventListener { @@ -840,14 +841,14 @@ public class HDR extends Demo { pipeline.enableFragmentProgram(gl, shrink_fprog); setOrthoProjection(gl, 0, 0, blur_w, blur_h); gl.glActiveTexture(GL2.GL_TEXTURE0); - gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE, pbuffer_tex); + gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE_ARB, pbuffer_tex); drawQuadRect2(gl, blur_w, blur_h, pbuffer_w, pbuffer_h); pipeline.disableFragmentProgram(gl); } else if (blur2Pass == BLUR2_VERT_BLUR_PASS) { // vertical blur - gl.glBindProgram(GL2.GL_FRAGMENT_PROGRAM, blurv_fprog); + gl.glBindProgramARB(GL2.GL_FRAGMENT_PROGRAM_ARB, blurv_fprog); gl.glActiveTexture(GL2.GL_TEXTURE0); pipeline.bindTexture(gl, blur_pbuffer_tex); glowPass(gl); @@ -862,6 +863,7 @@ public class HDR extends Demo { // Unused routines public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void dispose(GLAutoDrawable drawable) {} } class TonemapPbufferListener implements GLEventListener { @@ -884,6 +886,7 @@ public class HDR extends Demo { // Unused routines public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void dispose(GLAutoDrawable drawable) {} } //---------------------------------------------------------------------- @@ -914,12 +917,12 @@ public class HDR extends Demo { // blur floating point image private void glowPass(GL2 gl) { gl.glDisable(GL2.GL_DEPTH_TEST); - gl.glEnable(GL2.GL_FRAGMENT_PROGRAM); + gl.glEnable(GL2.GL_FRAGMENT_PROGRAM_ARB); setOrthoProjection(gl, 0, 0, blur_w, blur_h); drawQuadRect(gl, blur_w, blur_h); - gl.glDisable(GL2.GL_FRAGMENT_PROGRAM); + gl.glDisable(GL2.GL_FRAGMENT_PROGRAM_ARB); } private void drawQuadRect(GL2 gl, int w, int h) { @@ -1019,11 +1022,11 @@ public class HDR extends Demo { gl.glFinish(); gl.glActiveTexture(GL2.GL_TEXTURE0); - gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE, pbuffer_tex); + gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE_ARB, pbuffer_tex); gl.glActiveTexture(GL2.GL_TEXTURE1); if (blur2_pbuffer != null) { - gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE, blur2_pbuffer_tex); + gl.glBindTexture(GL2.GL_TEXTURE_RECTANGLE_ARB, blur2_pbuffer_tex); } gl.glActiveTexture(GL2.GL_TEXTURE2); @@ -1119,33 +1122,33 @@ public class HDR extends Demo { private void initBlurCode(GL2 gl, int blurWidth) { // generate blur code String blurCode = generateBlurCodeFP2(blurWidth, false); - blurh_fprog = loadProgram(gl, GL2.GL_FRAGMENT_PROGRAM, blurCode); + blurh_fprog = loadProgram(gl, GL2.GL_FRAGMENT_PROGRAM_ARB, blurCode); // printf("%s\n", blurCode); blurCode = generateBlurCodeFP2(blurWidth, true); - blurv_fprog = loadProgram(gl, GL2.GL_FRAGMENT_PROGRAM, blurCode); + blurv_fprog = loadProgram(gl, GL2.GL_FRAGMENT_PROGRAM_ARB, blurCode); // printf("%s\n", blurCode); } private int loadProgram(GL2 gl, int target, String code) { int prog_id; int[] tmp = new int[1]; - gl.glGenPrograms(1, tmp, 0); + gl.glGenProgramsARB(1, tmp, 0); prog_id = tmp[0]; - gl.glBindProgram(target, prog_id); + gl.glBindProgramARB(target, prog_id); int size = code.length(); - gl.glProgramString(target, GL2.GL_PROGRAM_FORMAT_ASCII, code.length(), code); + gl.glProgramStringARB(target, GL2.GL_PROGRAM_FORMAT_ASCII_ARB, code.length(), code); int[] errPos = new int[1]; - gl.glGetIntegerv(GL2.GL_PROGRAM_ERROR_POSITION, errPos, 0); + gl.glGetIntegerv(GL2.GL_PROGRAM_ERROR_POSITION_ARB, errPos, 0); if (errPos[0] >= 0) { String kind = "Program"; - if (target == GL2.GL_VERTEX_PROGRAM) { + if (target == GL2.GL_VERTEX_PROGRAM_ARB) { kind = "Vertex program"; - } else if (target == GL2.GL_FRAGMENT_PROGRAM) { + } else if (target == GL2.GL_FRAGMENT_PROGRAM_ARB) { kind = "Fragment program"; } System.out.println(kind + " failed to load:"); - String errMsg = gl.glGetString(GL2.GL_PROGRAM_ERROR_STRING); + String errMsg = gl.glGetString(GL2.GL_PROGRAM_ERROR_STRING_ARB); if (errMsg == null) { System.out.println("[No error message available]"); } else { @@ -1159,10 +1162,10 @@ public class HDR extends Demo { System.out.println(code.substring(errPos[0], endPos)); throw new GLException("Error loading " + kind); } else { - if (target == GL2.GL_FRAGMENT_PROGRAM) { + if (target == GL2.GL_FRAGMENT_PROGRAM_ARB) { int[] isNative = new int[1]; - gl.glGetProgramiv( GL2.GL_FRAGMENT_PROGRAM, - GL2.GL_PROGRAM_UNDER_NATIVE_LIMITS, + gl.glGetProgramiv( GL2.GL_FRAGMENT_PROGRAM_ARB, + GL2.GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, isNative, 0 ); if (isNative[0] != 1) { System.out.println("WARNING: fragment program is over native resource limits"); @@ -1249,7 +1252,7 @@ public class HDR extends Demo { return buf.toString(); } - private void applyTransform(GL gl, Mat4f mat) { + private void applyTransform(GL2 gl, Mat4f mat) { float[] data = new float[16]; mat.getColumnMajorData(data); gl.glMultMatrixf(data, 0); diff --git a/src/demos/hdr/HDRTexture.java b/src/demos/hdr/HDRTexture.java index bf6bb71..e21c898 100755 --- a/src/demos/hdr/HDRTexture.java +++ b/src/demos/hdr/HDRTexture.java @@ -106,7 +106,7 @@ public class HDRTexture { gl.glTexParameteri(m_target, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP_TO_EDGE); gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1); - gl.glTexParameteri(m_target, GL.GL_GENERATE_MIPMAP_SGIS, GL.GL_TRUE); + gl.glTexParameteri(m_target, GL2ES1.GL_GENERATE_MIPMAP, GL.GL_TRUE); gl.glTexImage2D(m_target, 0, GL.GL_RGBA, m_width, m_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, ByteBuffer.wrap(m_data)); return texid; @@ -126,7 +126,7 @@ public class HDRTexture { gl.glTexParameteri(m_target, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP_TO_EDGE); gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1); - gl.glTexParameteri(m_target, GL.GL_GENERATE_MIPMAP_SGIS, GL.GL_TRUE); + gl.glTexParameteri(m_target, GL2ES1.GL_GENERATE_MIPMAP, GL.GL_TRUE); float[] img = new float [m_width * m_height * 2]; int src = 0; @@ -144,7 +144,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, FloatBuffer.wrap(img)); + gl.glTexImage2D(m_target, 0, GL2.GL_HILO16_NV, m_width, m_height, 0, GL2.GL_HILO_NV, GL.GL_FLOAT, FloatBuffer.wrap(img)); return texid; } @@ -163,7 +163,7 @@ public class HDRTexture { gl.glBindTexture(m_target, texid); gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1); - gl.glTexParameteri(m_target, GL.GL_GENERATE_MIPMAP_SGIS, GL.GL_TRUE); + gl.glTexParameteri(m_target, GL2ES1.GL_GENERATE_MIPMAP, GL.GL_TRUE); // gl.glTexParameteri(m_target, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR); // gl.glTexParameteri(m_target, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_LINEAR); @@ -268,7 +268,7 @@ public class HDRTexture { gl.glBindTexture(m_target, texid); gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1); - gl.glTexParameteri(m_target, GL.GL_GENERATE_MIPMAP_SGIS, GL.GL_TRUE); + gl.glTexParameteri(m_target, GL2ES1.GL_GENERATE_MIPMAP, GL.GL_TRUE); gl.glTexParameteri(m_target, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR); gl.glTexParameteri(m_target, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_LINEAR); @@ -291,7 +291,7 @@ public class HDRTexture { } } } - gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, FloatBuffer.wrap(face)); + gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL2.GL_HILO16_NV, face_width, face_height, 0, GL2.GL_HILO_NV, GL.GL_FLOAT, FloatBuffer.wrap(face)); // positive X ptr = 0; @@ -307,7 +307,7 @@ public class HDRTexture { } } } - gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, FloatBuffer.wrap(face)); + gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL2.GL_HILO16_NV, face_width, face_height, 0, GL2.GL_HILO_NV, GL.GL_FLOAT, FloatBuffer.wrap(face)); // negative Z ptr = 0; @@ -323,7 +323,7 @@ public class HDRTexture { } } } - gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, FloatBuffer.wrap(face)); + gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL2.GL_HILO16_NV, face_width, face_height, 0, GL2.GL_HILO_NV, GL.GL_FLOAT, FloatBuffer.wrap(face)); // negative X ptr = 0; @@ -339,7 +339,7 @@ public class HDRTexture { } } } - gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, FloatBuffer.wrap(face)); + gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL2.GL_HILO16_NV, face_width, face_height, 0, GL2.GL_HILO_NV, GL.GL_FLOAT, FloatBuffer.wrap(face)); // negative Y ptr = 0; @@ -355,7 +355,7 @@ public class HDRTexture { } } } - gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, FloatBuffer.wrap(face)); + gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL2.GL_HILO16_NV, face_width, face_height, 0, GL2.GL_HILO_NV, GL.GL_FLOAT, FloatBuffer.wrap(face)); // positive Z ptr = 0; @@ -371,7 +371,7 @@ public class HDRTexture { } } } - gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL.GL_HILO16_NV, face_width, face_height, 0, GL.GL_HILO_NV, GL.GL_FLOAT, FloatBuffer.wrap(face)); + gl.glTexImage2D(GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL2.GL_HILO16_NV, face_width, face_height, 0, GL2.GL_HILO_NV, GL.GL_FLOAT, FloatBuffer.wrap(face)); return texid; } @@ -389,7 +389,7 @@ public class HDRTexture { gl.glBindTexture(m_target, texid); gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1); - gl.glTexParameteri(m_target, GL.GL_GENERATE_MIPMAP_SGIS, GL.GL_TRUE); + gl.glTexParameteri(m_target, GL2ES1.GL_GENERATE_MIPMAP, GL.GL_TRUE); gl.glTexParameteri(m_target, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR); gl.glTexParameteri(m_target, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_LINEAR); |