DisplayMode change not working.

So I am trying to add full-screen to my app and when I change to full screen like this.


try 
    	{
			Display.setDisplayMode(Display.getDesktopDisplayMode());
                        Display.setFullscreen(true);
		} catch (LWJGLException e) 
		{
			e.printStackTrace();
		}
    	GL11.glViewport(0,0,Display.getWidth(),Display.getHeight());
    	GL11.glMatrixMode(GL11.GL_PROJECTION);
    	GL11.glLoadIdentity();
    	GL11.glOrtho(0,Display.getWidth(),Display.getHeight(),0,-1,1);

It goes to fullscreen and all but nothing shows up. I know it is still updating everything because of some System.out.print testing and the location of everything is the same. The mouse cords are right as well but nothing gets drawn.

Any ideas? :-\

You forgot to set the matrix mode back to GL_MODELVIEW afterwards :slight_smile:

Cas :slight_smile:

Yup that fixed it. Heh the above code was ra4king’s suggestion. Next time I may not listen to him. :stuck_out_tongue:
Or maybe next time I will read more tutorials.

O_o I don’t use GL_MODELVIEW when setting to full screen yet it works for me, interesting…

And yeah, don’t fully trust me with OpenGL suggestions, I’m still an absolute n00b at that. ;D

Using the ModelView matrix has nothing to do with going to full screen, it’s that all his further commands for translating and rotating and such were being applied to the projection matrix.