I get the following error when running my game under Windows 7 RC 7100. It works fine in XP. (Running from NetBeans 6.7 or 6.5, both give me the same)
java.lang.IllegalStateException: Function is not supported
at org.lwjgl.BufferChecks.checkFunctionAddress(BufferChecks.java:64)
at org.lwjgl.opengl.GL11.glGetError(GL11.java:1360)
at org.lwjgl.opengl.Util.checkGLError(Util.java:52)
at org.lwjgl.opengl.GL11.glGetString(GL11.java:1795)
at org.lwjgl.opengl.GLContext.getSupportedExtensions(GLContext.java:185)
at org.lwjgl.opengl.ContextCapabilities.initAllStubs(ContextCapabilities.java:3438)
at org.lwjgl.opengl.ContextCapabilities.<init>(ContextCapabilities.java:3684)
at org.lwjgl.opengl.GLContext.useContext(GLContext.java:328)
at org.lwjgl.opengl.Context.makeCurrent(Context.java:183)
at org.lwjgl.opengl.Display.makeCurrent(Display.java:713)
at org.lwjgl.opengl.Display.makeCurrentAndSetSwapInterval(Display.java:865)
at org.lwjgl.opengl.Display.create(Display.java:843)
at org.lwjgl.opengl.Display.create(Display.java:767)
at org.lwjgl.opengl.Display.create(Display.java:748)
at ecl.client.Main.initializeGears(Main.java:251)
at ecl.client.Main.run(Main.java:123)
at java.lang.Thread.run(Thread.java:619)
Exception in thread "Thread-0" java.lang.IllegalStateException: Function is not supported
at org.lwjgl.BufferChecks.checkFunctionAddress(BufferChecks.java:64)
at org.lwjgl.opengl.GL11.glEnable(GL11.java:1031)
at ecl.client.Main.initializeGears(Main.java:257)
at ecl.client.Main.run(Main.java:123)
at java.lang.Thread.run(Thread.java:619)
This is ecl.client.Main.run:
public void initializeGears(){
try {
if(_oCanvas != null){
Display.setParent(_oCanvas);
}else{
Display.setTitle(WINDOW_TITLE);
setDisplayMode(SCREEN_WIDTH, SCREEN_HEIGHT, _bFullscreen);
}
Display.create(); // ERROR HERE!!!! (Windows 7 only)
} catch (Exception ex) {
// _oClientThread.send(Messaging.publicChat(ex.getMessage()));
ex.printStackTrace();
}
Mouse.setGrabbed(false);
GL11.glEnable(GL11.GL_TEXTURE_2D); // Enable Texture Mapping
GL11_EnterOrtho();
// GLU.gluOrtho2D(0, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
GL11.glDepthMask(false);
// GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
// GL11.glPushAttrib(GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_ENABLE_BIT);
System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix);
System.err.println("OS: " + System.getProperty("os.name"));
System.err.println("Available Processors:" + java.lang.Runtime.getRuntime().availableProcessors());
System.err.println("Total Memory: " + ecl.util.Util.getSizeInPositiveBiggestUnit( Runtime.getRuntime().totalMemory()));
}
Maybe it's an issue with Windows 7? It used to work in Windows 7 RC 7100 - but I use XP mostly, so I did some months of development before I got to try it again in 7. And now it' doesn't wanna run =/
EDIT
Just noticed I'm using lwjgl 2.2 now. Last time it worked fine in 7, it was using 2.1! Can it be that?
It's a general bug in LWJGL 2.2. This happens for me on Display.create(), e.g. simply:
public static void main(String args[]) throws LWJGLException {
Display.create();
}
I've taken a closer look at it and in org.lwjgl.opengl.ContextCapabilities#initAllStubs(boolean) the call "Set supported_extensions = GLContext.getSupportedExtensions();" accesses some function pointers that have not yet been initialised (thus they are 0 and get reported as not supported). These function addresses are initialised a few lines later in "if (!GL11_initNativeFunctionAddresses(forwardCompatible))". It's probably an issue due to some new GL31 initialisations. In 2.1 the call to getSupportedExtensions was after GL11_initNativeFunctionAddresses so the necessary function addresses were already initialised.
The class ContextCapabilities seems to be automatically generated, so the generator (org.lwjgl.util.generator.ContextCapabilitiesGenerator#generateInitStubsPrologue(...)) would have to be fixed. Possibly by adding another special case for "GL11_glGetError_pointer". Seems a bit hackish though, but I haven't read through the whole generation process.
This only happens with lwjgl-debug.jar. lwjgl.jar works fine (at least for the short tests I ran, e.g. displaying a textured quad). I remember reading that lwjgl.jar has no error checks so it might work as glGetError will have been initialised afterwards.
maybe spasi has some insight into this - I will try to ping him.
Everything Ciardhubh said is correct. The glGetError pointer has been added to the list of functions necessary for context initialization (yes, it's an awkward hack) and the debug jar should work without problems now.
I'm sorry, but I'm rather lost. What am I to do?
Imminent 2.2.1 bugfix release scheduled ASAP...?
Cas :)
You can download a fresh build from https://www.newdawnsoftware.com/hudson/view/LWJGL/ (https://www.newdawnsoftware.com/hudson/view/LWJGL/) (when it's up).
Yay =) Since it works fine in Windows XP for me, I'm just gonna go on programming under XP for now.
doing a 2.2.1 release would probably require a 2.2 release? ;)
I've been holding back doing the release because there are still some issues left ... but since no one is picking up on those I guess we might as well ger 2.2 out the door.
What are the open issues that need work?
a cursory glance shows:
http://lwjgl.org/forum/index.php/topic,3045 (crash, new)
http://lwjgl.org/forum/index.php/topic,2941 (may be fixed by spasi by recent commit)
http://lwjgl.org/forum/index.php/topic,2613 (input)
http://lwjgl.org/forum/index.php/topic,2911 (input)
http://lwjgl.org/forum/index.php/topic,3012 (new feature - not holding release)
http://lwjgl.org/forum/index.php/topic,3032 (applet)
http://lwjgl.org/forum/index.php/topic,2761 (utf8)
on my list, the input and utf8 seems to be the most annoying ones.
The input ones are probably the most irritating. Not too bothered about UTF-8 as it has an easy workaround (use an AWT window for now).
Cas :)
another (input/applet) bug is the Mouse.setGrabbed(boolean) not working on Windows when using Display.setParent (important for applets, Minecraft dev was complaining about it).
and again, I'd like to direct attention to: http://lwjgl.org/forum/index.php/topic,2994