Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while(!Display.isCloseRequested()) {
- if(Display.wasResized()) {
- System.out.println(Display.getWidth() + " " + Display.getHeight());
- glOrtho(0, Display.getWidth(), Display.getHeight(), 0, -1, 1);
- }
- glClearColor(0, 0, 1, 1);
- glClear(GL_COLOR_BUFFER_BIT);
- if(Keyboard.isKeyDown(Keyboard.KEY_RIGHT))
- x++;
- else if(Keyboard.isKeyDown(Keyboard.KEY_LEFT))
- x--;
- if(Keyboard.isKeyDown(Keyboard.KEY_DOWN))
- y++;
- else if(Keyboard.isKeyDown(Keyboard.KEY_UP))
- y--;
- glColor3f(1, 0, 0);
- glBegin(GL_TRIANGLES);
- glVertex2f(x, y);
- glVertex2f(x + 50, y);
- glVertex2f(x + 30, y + 30);
- glEnd();
- Display.update();
- Display.sync(60);
- }
Add Comment
Please, Sign In to add comment