Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void init(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
- gl.setSwapInterval(0);
- gl.glEnable(GL2.GL_DEPTH_TEST);
- gl.glDepthFunc(GL2.GL_LEQUAL);
- System.out.println("##############< Info >#################");
- System.out.println("GL_VENDOR: " + gl.glGetString(GL2.GL_VENDOR));
- System.out.println("GL_RENDERER: " + gl.glGetString(GL2.GL_RENDERER));
- System.out.println("GL_VERSION: " + gl.glGetString(GL2.GL_VERSION));
- System.out.println("##############</Info >#################");
- }
- public void display(GLAutoDrawable drawable) {
- GL2 gl = drawable.getGL().getGL2();
- gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
- breite = frame.getWidth();
- höhe = frame.getHeight();
- gl.glViewport(0, 0, breite, höhe);
- gl.glMatrixMode(GL2.GL_PROJECTION);
- gl.glLoadIdentity();
- glu.gluPerspective(60, (float)breite / höhe, 0, p.range());
- glu.gluLookAt ( camera_x,camera_y,camera_z,
- lookat_x ,lookat_y , lookat_z,
- 0.0 , 0.0, -1) ;
- gl.glMatrixMode(GL2.GL_MODELVIEW);
- player.render(gl);
- level.render(level.LevelTiles(), player.posX(), player.posY(), gl);
- }
Advertisement
Add Comment
Please, Sign In to add comment