No OpenGL context found in the current thread, how do I fix this error?

后端 未结 5 651
不思量自难忘°
不思量自难忘° 2020-12-02 01:49

I\'m working on a card game, and currently have a good foundation but I\'m running into an error when I run it in eclipse. I\'m also using slick 2d.

Here is the erro

5条回答
  •  执笔经年
    2020-12-02 02:13

    This kind of error is common for LWJGL starters. The OpenGL context gets bound to a thread when it's been created. So you can only access this context from the same thread.

    As it does not look that you're working with different threads there might be another cause. Slick2D seems to need a valid OpenGL context for its Image class.

    So my first try would be to initialize an OpenGL context before initializing your card images.

提交回复
热议问题