Hello Guest

java.lang.IllegalStateException: Function is not supported

  • 13 Replies
  • 23912 Views
java.lang.IllegalStateException: Function is not supported
« on: September 07, 2009, 23:10:15 »
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)

Code: [Select]
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:

Code: [Select]
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?
« Last Edit: September 07, 2009, 23:18:49 by lainmaster »

Re: java.lang.IllegalStateException: Function is not supported
« Reply #1 on: September 08, 2009, 09:29:10 »
It's a general bug in LWJGL 2.2. This happens for me on Display.create(), e.g. simply:
Code: [Select]
    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.

*

Offline Matzon

  • *****
  • 2242
Re: java.lang.IllegalStateException: Function is not supported
« Reply #2 on: September 08, 2009, 09:48:23 »
maybe spasi has some insight into this - I will try to ping him.

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: java.lang.IllegalStateException: Function is not supported
« Reply #3 on: September 08, 2009, 12:32:53 »
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.

Re: java.lang.IllegalStateException: Function is not supported
« Reply #4 on: September 08, 2009, 12:34:12 »
I'm sorry, but I'm rather lost. What am I to do?

*

Offline princec

  • *****
  • 1933
    • Puppygames
Re: java.lang.IllegalStateException: Function is not supported
« Reply #5 on: September 08, 2009, 12:40:28 »
Imminent 2.2.1 bugfix release scheduled ASAP...?

Cas :)

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: java.lang.IllegalStateException: Function is not supported
« Reply #6 on: September 08, 2009, 12:41:40 »
You can download a fresh build from https://www.newdawnsoftware.com/hudson/view/LWJGL/ (when it's up).
« Last Edit: September 08, 2009, 13:02:22 by spasi »

Re: java.lang.IllegalStateException: Function is not supported
« Reply #7 on: September 08, 2009, 12:43:08 »
Yay =) Since it works fine in Windows XP for me, I'm just gonna go on programming under XP for now.

*

Offline Matzon

  • *****
  • 2242
Re: java.lang.IllegalStateException: Function is not supported
« Reply #8 on: September 08, 2009, 13:45:23 »
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.

Re: java.lang.IllegalStateException: Function is not supported
« Reply #9 on: September 08, 2009, 14:11:10 »
What are the open issues that need work?
Download Cultris II, the fastest Tetris clone from http://gewaltig.net/

*

Offline Matzon

  • *****
  • 2242
Re: java.lang.IllegalStateException: Function is not supported
« Reply #10 on: September 08, 2009, 15:50:57 »
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.

*

Offline princec

  • *****
  • 1933
    • Puppygames
Re: java.lang.IllegalStateException: Function is not supported
« Reply #11 on: September 08, 2009, 16:54:06 »
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 :)

*

Offline kappa

  • *****
  • 1319
Re: java.lang.IllegalStateException: Function is not supported
« Reply #12 on: September 08, 2009, 17:40:07 »
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).


*

Offline Matzon

  • *****
  • 2242
Re: java.lang.IllegalStateException: Function is not supported
« Reply #13 on: September 08, 2009, 19:05:10 »
and again, I'd like to direct attention to: http://lwjgl.org/forum/index.php/topic,2994