Reputation: 64
I having trouble with lwjgl getting a display to open. This worked before I upgraded to windows 10. (I had windows 7 before).
here is the error from the console
org.lwjgl.LWJGLException: Pixel format not accelerated
at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)
at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)
at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:247)
at org.lwjgl.opengl.Display.createWindow(Display.java:306)
at org.lwjgl.opengl.Display.create(Display.java:848)
at org.lwjgl.opengl.Display.create(Display.java:797)
at com.asasse.game3d.renderengine.DisplayManager.createDisplay(DisplayManager.java:23)
at com.asasse.game3d.enginetester.MainGameLoop.main(MainGameLoop.java:22)
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 com.asasse.game3d.renderengine.DisplayManager.createDisplay(DisplayManager.java:31)
at com.asasse.game3d.enginetester.MainGameLoop.main(MainGameLoop.java:22)
here if my code from my project thas's causing the error
final ContextAttribs attribs = new ContextAttribs(3, 1).withForwardCompatible(true);
try {
Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
Display.create(new PixelFormat(), attribs);
} catch (final LWJGLException e) {
e.printStackTrace();
}
GL11.glViewport(0, 0, WIDTH, HEIGHT);
the width is 1280 and the height is 720
Upvotes: 0
Views: 757
Reputation: 1037
try using this instead:
ContextAttribs attribs = new ContextAttribs(3,3)
.withForwardCompatible(true)
.withProfileCore(true);
try {
Display.setDisplayMode(new DisplayMode(WIDTH,HEIGHT));
Display.create(new PixelFormat(),attribs);
} catch (LWJGLException e) {
e.printStackTrace();
}
My guess is that your version is too low for some calculation and therefore threw an Exception.
If that didn't work, it might be that your Graphics Driver is outdated for Windows 10. Try upgrading your driver. (you can see your driver by typing dxdiag after pressing windows + R
)
Upvotes: 1