• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes
12 views

Problem :

I am working on a card game, and currently running into an error when I run it in eclipse. I am also using slick 2d.

Here is the error

java.lang.runtimeexception: no opengl context found in the current thread.

by (6.9k points)  

1 Answer

0 votes

Solution :

Depending on which LWJGL you're using, init your Display as shown bellow:

LWJGL 3 

if (!glfwInit()) {
   throw new IllegalStateException("Can't init GLFW");
}

LWJGL 2:

try {
   Display.setDisplayMode(new DisplayMode(800, 600));
   Display.create();
} catch (LWJGLException ex) {
   Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}

Please dont forget Display.create() .

Further Readings:

https://github.com/nifty-gui/nifty-gui/issues/111

by (21.9k points)  
edited by
...