Advertisement
Guest User

Untitled

a guest
May 27th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.10 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.setTitle(displayName);
  16.             Display.create();
  17.        
  18.        
  19.        
  20.         // Create default display of 640x480
  21. //      Display.create();
  22.  
  23.         GL11.glEnable(GL11.GL_DEPTH_TEST);
  24.        
  25.         // Put the window into orthographic projection mode with 1:1 pixel ratio.
  26.         // We haven't used GLU here to do this to avoid an unnecessary dependency.
  27.         GL11.glMatrixMode(GL11.GL_PROJECTION);
  28.         GL11.glLoadIdentity();
  29.         GLU.gluPerspective(45, 1.0f, 10.f, 4000);
  30.  
  31.         GL11.glMatrixMode(GL11.GL_MODELVIEW);
  32.         GL11.glLoadIdentity();
  33.        
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement