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_selection
I did a simple program trying to confirm the version:
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?