Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  DisplayMode change not working.  (Read 359 times)
0 Members and 1 Guest are viewing this topic.
Offline StumpyStrust

Full Member
**

Posts: 103
Medals: 1



« on: 2012-01-21 03:33:05 »

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

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
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?  Undecided
Offline princec
« League of Dukes »

JGO Kernel
*****

Posts: 8076
Medals: 91


Eh? Who? What? ... Me?


« Reply #1 on: 2012-01-21 05:37:44 »

You forgot to set the matrix mode back to GL_MODELVIEW afterwards Smiley

Cas Smiley

Offline StumpyStrust

Full Member
**

Posts: 103
Medals: 1



« Reply #2 on: 2012-01-21 14:34:25 »

Yup that fixed it. Heh the above code was ra4king's suggestion. Next time I may not listen to him.  Tongue
Or maybe next time I will read more tutorials.
Games published by our own members! Go get 'em!
Offline ra4king

JGO Kernel
*****

Posts: 3153
Medals: 196


I'm the King!


« Reply #3 on: 2012-01-21 17:21:23 »

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. Grin

Offline sproingie

JGO Strike Force
***

Posts: 894
Medals: 55



« Reply #4 on: 2012-01-21 19:00:26 »

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.
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.103 seconds with 20 queries.