Hi
I'm trying to learn modern OpenGL using LWJGL, but it seems that it uses the wrong graphics card.
By using GPU Caps Viewer I get the info that my main card has OpenGL 4.2.
But creating a Display gives "Could not create context (WGL_ARB_create_context)". on "Display.create(pixelFormat, contextAtrributes);"
From this example:
http://www.lwjgl.org/wiki/index.php?title=Version_selectionI did a simple program trying to confirm the version:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| import org.lwjgl.LWJGLException; import org.lwjgl.opengl.ContextCapabilities; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode; import org.lwjgl.opengl.GLContext;
public class OldOpenGL { public void start() { try { Display.setDisplayMode(new DisplayMode(800, 600)); Display.create(); version(); } catch (LWJGLException e) { e.printStackTrace(); System.exit(0); } while (!Display.isCloseRequested()) { Display.update(); } Display.destroy(); }
public static void main(String[] argv) { OldOpenGL displayExample = new OldOpenGL(); displayExample.start(); } public void version() { ContextCapabilities c =GLContext.getCapabilities(); if(c.GL_ARB_compatibility) { System.out.println("ARB"); } if(c.OpenGL32) { System.out.println("3.2!"); } else if(c.OpenGL20) { System.out.println("2.0"); } else { System.out.println("No OpenGL"); }
} } |
And it prints out "ARB" and "2.0".
So my guess is that it uses the graphics on the CPU.
It has:
Intel HD Graphics 3000 and NVS 4200M (and GPS Caps Viewer says the both have OpenGL 4.2)
I change so the Nvidia settings so java uses the performance-mode, but still no luck.
Any sugestions?