I’ve copied code nearly exactly from several of the tutorials I’ve seen on this site. The only problem is anytime I try to do a gl.create() I get the following exception:
java.lang.Exception: Mode not supported by hardware
at org.lwjgl.opengl.BaseGL.nCreate(Native Method)
at org.lwjgl.opengl.BaseGL.doCreate(Unknown Source)
at org.lwjgl.opengl.GL.doCreate(Unknown Source)
at org.lwjgl.Window.create(Unknown Source)
at com.rn.artillery.Tutorial.initialize(Tutorial.java:37)
at com.rn.artillery.Tutorial.execute(Tutorial.java:23)
at com.rn.artillery.Tutorial.main(Tutorial.java:245)
Here’s the relevant code:
private void initialize()
{
try
{
mode=findDisplayMode(800,600,16);
System.out.println(mode.width+","+mode.height+","+mode.bpp+","+mode.freq);
gl=new GL("Test", 50,50,mode.width,mode.height,mode.bpp,0,0,0);
gl.create();
glu=new GLU(gl);
glInit();
Keyboard.create();
quadPosition = new Vector2f(100f,100f);
quadVelocity = new Vector2f(1.0f,1.0f);
}
catch (Exception e)
{
e.printStackTrace();
}
}
private DisplayMode findDisplayMode(int width, int height, int bpp)
{
DisplayMode[] modes = Display.getAvailableDisplayModes();
for(int loop=0; loop<modes.length; loop++)
{
if(modes[loop].width==width
&& modes[loop].height==height
&& modes[loop].bpp>=bpp
&& modes[loop].freq==60)
return modes[loop];
}
return null;
}
Any help anybody? I KNOW the particular mode IS supported, so I don’t think that’s it. Sorry for a newless clewbie type question, but this has got me stumped.


