Guest User

Untitled

a guest
Feb 22nd, 2014
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. public void init(GLAutoDrawable drawable) {
  2. GL2 gl = drawable.getGL().getGL2();
  3. gl.setSwapInterval(0);
  4. gl.glEnable(GL2.GL_DEPTH_TEST);
  5. gl.glDepthFunc(GL2.GL_LEQUAL);
  6.  
  7. System.out.println("##############< Info >#################");
  8. System.out.println("GL_VENDOR: " + gl.glGetString(GL2.GL_VENDOR));
  9. System.out.println("GL_RENDERER: " + gl.glGetString(GL2.GL_RENDERER));
  10. System.out.println("GL_VERSION: " + gl.glGetString(GL2.GL_VERSION));
  11. System.out.println("##############</Info >#################");
  12. }
  13.  
  14. public void display(GLAutoDrawable drawable) {
  15. GL2 gl = drawable.getGL().getGL2();
  16.  
  17. gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
  18.  
  19. breite = frame.getWidth();
  20. höhe = frame.getHeight();
  21.  
  22. gl.glViewport(0, 0, breite, höhe);
  23. gl.glMatrixMode(GL2.GL_PROJECTION);
  24. gl.glLoadIdentity();
  25.  
  26. glu.gluPerspective(60, (float)breite / höhe, 0, p.range());
  27. glu.gluLookAt ( camera_x,camera_y,camera_z,
  28. lookat_x ,lookat_y , lookat_z,
  29. 0.0 , 0.0, -1) ;
  30. gl.glMatrixMode(GL2.GL_MODELVIEW);
  31.  
  32. player.render(gl);
  33.  
  34. level.render(level.LevelTiles(), player.posX(), player.posY(), gl);
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment