Advertisement
Guest User

Untitled

a guest
May 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.14 KB | None | 0 0
  1.     public static void setDisplay( java.lang.String displayName, java.lang.Integer width, java.lang.Integer height , java.lang.Boolean fullscreen ) throws LWJGLException{
  2.  
  3. //      Display.setTitle(displayName);
  4. //      Display.setFullscreen(fullscreen);
  5.  
  6.         // Enable vsync if we can (due to how OpenGL works, it cannot be guarenteed to always work)
  7. //      Display.setVSyncEnabled(true);
  8.  
  9.         DisplayMode dmode = new DisplayMode(width,height);
  10.         Display.setDisplayMode(dmode);
  11.  
  12.            
  13.             Display.setFullscreen(fullscreen);
  14.            
  15.             Display.setDisplayMode(displayMode);
  16.             Display.setTitle(displayName);
  17.             Display.create();
  18.        
  19.        
  20.        
  21.         // Create default display of 640x480
  22. //      Display.create();
  23.  
  24.         GL11.glEnable(GL11.GL_DEPTH_TEST);
  25.        
  26.         // Put the window into orthographic projection mode with 1:1 pixel ratio.
  27.         // We haven't used GLU here to do this to avoid an unnecessary dependency.
  28.         GL11.glMatrixMode(GL11.GL_PROJECTION);
  29.         GL11.glLoadIdentity();
  30.         GLU.gluPerspective(45, 1.0f, 10.f, 4000);
  31.  
  32.         GL11.glMatrixMode(GL11.GL_MODELVIEW);
  33.         GL11.glLoadIdentity();
  34.        
  35.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement