Don't use GL13 and ARB_vertex_shader constants in BaseReferences if they're not supported
This commit is contained in:
parent
1986b75e82
commit
ddfae1512d
|
@ -46,11 +46,21 @@ class BaseReferences {
|
|||
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() {
|
||||
|
|
|
@ -168,6 +168,7 @@ public class ContextGeneratorProcessorFactory implements AnnotationProcessorFact
|
|||
if (Utils.isFinal(interface_decl))
|
||||
ContextCapabilitiesGenerator.generateInitializer(writer, interface_decl);
|
||||
}
|
||||
writer.println("\t\ttracker = new StateTracker();");
|
||||
writer.println("\t}");
|
||||
writer.println("}");
|
||||
writer.close();
|
||||
|
|
Loading…
Reference in New Issue