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) {
|
BaseReferences(ContextCapabilities caps) {
|
||||||
IntBuffer temp = caps.scratch_int_buffer;
|
IntBuffer temp = caps.scratch_int_buffer;
|
||||||
|
|
||||||
|
int max_vertex_attribs;
|
||||||
|
if (caps.GL_ARB_vertex_shader) {
|
||||||
GL11.glGetInteger(ARBVertexShader.GL_MAX_VERTEX_ATTRIBS_ARB, temp);
|
GL11.glGetInteger(ARBVertexShader.GL_MAX_VERTEX_ATTRIBS_ARB, temp);
|
||||||
glVertexAttribPointer_buffer = new Buffer[temp.get(0)];
|
max_vertex_attribs = temp.get(0);
|
||||||
|
} else
|
||||||
|
max_vertex_attribs = 0;
|
||||||
|
glVertexAttribPointer_buffer = new Buffer[max_vertex_attribs];
|
||||||
|
|
||||||
|
int max_texture_units;
|
||||||
|
if (caps.OpenGL13) {
|
||||||
GL11.glGetInteger(GL13.GL_MAX_TEXTURE_UNITS, temp);
|
GL11.glGetInteger(GL13.GL_MAX_TEXTURE_UNITS, temp);
|
||||||
glTexCoordPointer_buffer = new Buffer[temp.get(0)];
|
max_texture_units = temp.get(0);
|
||||||
|
} else
|
||||||
|
max_texture_units = 0;
|
||||||
|
glTexCoordPointer_buffer = new Buffer[max_texture_units];
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear() {
|
void clear() {
|
||||||
|
|
|
@ -168,6 +168,7 @@ public class ContextGeneratorProcessorFactory implements AnnotationProcessorFact
|
||||||
if (Utils.isFinal(interface_decl))
|
if (Utils.isFinal(interface_decl))
|
||||||
ContextCapabilitiesGenerator.generateInitializer(writer, interface_decl);
|
ContextCapabilitiesGenerator.generateInitializer(writer, interface_decl);
|
||||||
}
|
}
|
||||||
|
writer.println("\t\ttracker = new StateTracker();");
|
||||||
writer.println("\t}");
|
writer.println("\t}");
|
||||||
writer.println("}");
|
writer.println("}");
|
||||||
writer.close();
|
writer.close();
|
||||||
|
|
Loading…
Reference in New Issue