Skip to content

Instantly share code, notes, and snippets.

@Pwootage
Created January 5, 2013 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pwootage/4459197 to your computer and use it in GitHub Desktop.
Save Pwootage/4459197 to your computer and use it in GitHub Desktop.
Crash of SharedDrawable on certain windows platforms
org.lwjgl.LWJGLException: Could not create context (WGL_ARB_create_context)
at org.lwjgl.opengl.WindowsContextImplementation.nCreate(Native Method)
at org.lwjgl.opengl.WindowsContextImplementation.create(WindowsContextImplementation.java:50)
at org.lwjgl.opengl.ContextGL.<init>(ContextGL.java:132)
at org.lwjgl.opengl.DrawableGL.createSharedContext(DrawableGL.java:77)
at org.lwjgl.opengl.DrawableGL.createSharedContext(DrawableGL.java:41)
at org.lwjgl.opengl.SharedDrawable.<init>(SharedDrawable.java:50)
at CrashExample$1.run(CrashExample.java:25)
at java.lang.Thread.run(Unknown Source)
import javax.swing.JFrame;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.SharedDrawable;
public class CrashExample extends JFrame {
public static void main(String[] args) {
try {
Display.setDisplayMode(new DisplayMode(640, 480));
Display.create();
} catch (LWJGLException e) {
e.printStackTrace();
System.exit(0);
}
Thread t = new Thread(new Runnable() {
@Override
public void run() {
try {
//This line causes a crash on certain windows platforms
SharedDrawable sd = new SharedDrawable(Display.getDrawable());
} catch (LWJGLException e) {
e.printStackTrace();
System.exit(0);
}
}
});
t.start();
while (true) {
GL11.glViewport(0, 0, 640, 480);
GL11.glBegin(GL11.GL_TRIANGLES);
GL11.glVertex2f(1, -0.75f);
GL11.glVertex2f(-1, -0.75f);
GL11.glVertex2f(0, 1);
GL11.glEnd();
Display.update();
Display.sync(60);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment