Changed BaseReferences to use GL20.GL_MAX_TEXTURE_IMAGE_UNITS when available (GL13.GL_MAX_TEXTURE_UNITS is deprecated).

Catch and log OpenGL errors during context creation, instead of throwing an exception.
This commit is contained in:
Ioannis Tsakpinis 2010-02-10 11:22:16 +00:00
parent 47714e4bea
commit 7ef37e9858
2 changed files with 9 additions and 2 deletions

View File

@ -58,7 +58,10 @@ class BaseReferences {
glVertexAttribPointer_buffer = new Buffer[max_vertex_attribs];
int max_texture_units;
if (caps.OpenGL13 || caps.GL_ARB_multitexture) {
if (caps.OpenGL20) {
GL11.glGetInteger(GL20.GL_MAX_TEXTURE_IMAGE_UNITS, temp);
max_texture_units = temp.get(0);
} else if (caps.OpenGL13 || caps.GL_ARB_multitexture) {
GL11.glGetInteger(GL13.GL_MAX_TEXTURE_UNITS, temp);
max_texture_units = temp.get(0);
} else

View File

@ -881,7 +881,11 @@ public final class Display {
private static void makeCurrentAndSetSwapInterval() throws LWJGLException {
makeCurrent();
Util.checkGLError();
try {
Util.checkGLError();
} catch (OpenGLException e) {
LWJGLUtil.log("OpenGL error during context creation: " + e.getMessage());
}
setSwapInterval(swap_interval);
}