Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.denis.main.TitleScreen;
- import org.lwjgl.LWJGLException;
- import org.lwjgl.opengl.Display;
- import org.lwjgl.opengl.DisplayMode;
- import org.lwjgl.opengl.GL11;
- public class TitleScreenMain {
- public void MainMenu(String nomeMenu, int width, int height)
- {
- initGL(nomeMenu, width, height);
- // Init Oggetti:
- Rettangolo playRect = new Rettangolo();
- Rettangolo newRect = new Rettangolo();
- // Fine Init Oggetti.
- while (!Display.isCloseRequested())
- {
- // rendering
- GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
- playRect.creaRettangolo(100, 100, 300, 100);
- newRect.creaRettangolo(100, 300, 400, 100);
- // Fine Rendering.
- Display.update();
- Display.sync(60);
- }
- Display.destroy();
- }
- public void initGL(String nomeMenu, int width, int height)
- {
- try
- {
- Display.setDisplayMode(new DisplayMode(width, height));
- Display.setTitle(nomeMenu);
- Display.create();
- }
- catch (LWJGLException e)
- {
- e.printStackTrace();
- }
- // Init OpenGL:
- GL11.glMatrixMode(GL11.GL_PROJECTION);
- GL11.glLoadIdentity();
- GL11.glOrtho(0, 640, 480, 0, 1, -1);
- GL11.glMatrixMode(GL11.GL_MODELVIEW);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement