LWJGL
May 23, 2012, 03:07:01 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.8.3 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: IllegalStateException: No context is current  (Read 527 times)
fred_em
Newbie
*
Posts: 6


« on: November 10, 2011, 08:05:37 »

Hi,

The following sample code works:

Code:
Display.create(); // create context with LWJGL

if (GLContext.getCapabilities().GL_AMD_debug_output)
{
    AMDDebugOutput.glDebugMessageCallbackAMD(new AMDDebugOutputCallback(
       new AMDDebugOutputCallback.Handler()
       {
           public void handleMessage(final int id, final int category, final int severity, final String message)
  {
              [...]
           }
       }));
}

In my situation, I am not getting the GL context from Display.create().
The context is created and made active by another native library:

Code:

// The following call calls wglMakeCurrent().
SomeObject.someNativeMethodThatCallsWglMakeCurrent();

GLContext.useContext(someGlobalObject);

/*
At this point I *can* use LWJGL functions like glBindBuffer and so on.
However, AMDDebugOutput.glDebugMessageCallbackAMD() raises the following exception:

java.lang.IllegalStateException: No context is current.
at org.lwjgl.opengl.CallbackUtil.registerContextCallback(CallbackUtil.java:91)
at org.lwjgl.opengl.CallbackUtil.registerContextCallbackAMD(CallbackUtil.java:154)
at org.lwjgl.opengl.AMDDebugOutput.glDebugMessageCallbackAMD(AMDDebugOutput.java:80)

Why ?
*/


Any idea? I'm stuck.

Thanks,
Fred
Logged
spasi
Nerdus Imperius
*****
Posts: 643



WWW
« Reply #1 on: November 10, 2011, 10:46:15 »

Try the next nightly build, it should be fixed now.
Logged

fred_em
Newbie
*
Posts: 6


« Reply #2 on: November 17, 2011, 01:41:24 »

It works fine with LWJGL 2.8.2.
Thanks.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!