I am working on an lwjgl project that has the following code:
public class DisplayManager {
private static final int WIDTH = 1280;
private static final int HEIGHT = 720;
private static final int FPS_CAP = 120;
public static void createDisplay() {
ContextAttribs attribs = new ContextAttribs(3,2).withForwardCompatible(true).withProfileCore(true);
try {
Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
Display.create(new PixelFormat(), attribs);
} catch (LWJGLException ex) {
Logger.getLogger(DisplayManager.class.getName()).log(Level.SEVERE, null, ex);
}
GL11.glViewport(0,0,WIDTH,HEIGHT);
}
public static void updateDisplay() {
Display.sync(FPS_CAP);
Display.update();
}
public static void closeDisplay() {
Display.destroy();
}
}
I am getting the following error message:
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.(ContextGL.java:132) at org.lwjgl.opengl.Display.create(Display.java:850) at org.lwjgl.opengl.Display.create(Display.java:797) at javaapplication15.DisplayManager.createDisplay(DisplayManager.java:34) at javaapplication15.engineTester.MainGameLoop.main(MainGameLoop.java:21)
Exception in thread "main" java.lang.RuntimeException: No OpenGL context found in the current thread. at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124) at org.lwjgl.opengl.GL11.glViewport(GL11.java:3261) at javaapplication15.DisplayManager.createDisplay(DisplayManager.java:41) at javaapplication15.engineTester.MainGameLoop.main(MainGameLoop.java:21) Java Result: 1