From: <eli...@us...> - 2007-06-06 12:07:53
|
Revision: 2843 http://svn.sourceforge.net/java-game-lib/?rev=2843&view=rev Author: elias_naur Date: 2007-06-06 05:07:45 -0700 (Wed, 06 Jun 2007) Log Message: ----------- Don't use GL13 and ARB_vertex_shader constants in BaseReferences if they're not supported Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java trunk/LWJGL/src/java/org/lwjgl/util/generator/ContextGeneratorProcessorFactory.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java 2007-06-06 09:01:09 UTC (rev 2842) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java 2007-06-06 12:07:45 UTC (rev 2843) @@ -46,11 +46,21 @@ BaseReferences(ContextCapabilities caps) { IntBuffer temp = caps.scratch_int_buffer; - GL11.glGetInteger(ARBVertexShader.GL_MAX_VERTEX_ATTRIBS_ARB, temp); - glVertexAttribPointer_buffer = new Buffer[temp.get(0)]; + int max_vertex_attribs; + if (caps.GL_ARB_vertex_shader) { + GL11.glGetInteger(ARBVertexShader.GL_MAX_VERTEX_ATTRIBS_ARB, temp); + max_vertex_attribs = temp.get(0); + } else + max_vertex_attribs = 0; + glVertexAttribPointer_buffer = new Buffer[max_vertex_attribs]; - GL11.glGetInteger(GL13.GL_MAX_TEXTURE_UNITS, temp); - glTexCoordPointer_buffer = new Buffer[temp.get(0)]; + int max_texture_units; + if (caps.OpenGL13) { + GL11.glGetInteger(GL13.GL_MAX_TEXTURE_UNITS, temp); + max_texture_units = temp.get(0); + } else + max_texture_units = 0; + glTexCoordPointer_buffer = new Buffer[max_texture_units]; } void clear() { Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/ContextGeneratorProcessorFactory.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/ContextGeneratorProcessorFactory.java 2007-06-06 09:01:09 UTC (rev 2842) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/ContextGeneratorProcessorFactory.java 2007-06-06 12:07:45 UTC (rev 2843) @@ -168,6 +168,7 @@ if (Utils.isFinal(interface_decl)) ContextCapabilitiesGenerator.generateInitializer(writer, interface_decl); } + writer.println("\t\ttracker = new StateTracker();"); writer.println("\t}"); writer.println("}"); writer.close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |