示例#1
0
  private void initialise() {
    DisplayMode mode = new DisplayMode(WIDTH, HEIGHT);
    Display.setTitle(TITLE);

    input = new InputHandler();
    display = new CodeDisplay(input);

    try {
      Display.setDisplayMode(mode);
      Display.setResizable(false);
      Display.create();

      if (!GLContext.getCapabilities().OpenGL33)
        System.err.printf("You must have at least OpenGL 3.3 to run this program\n");
    } catch (LWJGLException e) {
      e.printStackTrace();
      System.exit(-1);
    }

    // Set clear color

    glShadeModel(GL_SMOOTH);
    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

    glEnable(GL_DEPTH_TEST);
    glDepthFunc(GL_LEQUAL); // Less than or equal
    glClearDepth(1.0);

    establishProjectionMatrix();

    // glEnable(GL_LIGHTING);
    // glEnable(GL_LIGHT0);
  }
示例#2
0
  public void start() {
    System.out.println("SplitMan starting...");
    try {
      Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
      Display.setResizable(false);
      Display.setVSyncEnabled(true);
      Display.setTitle("SplitMan");
      Display.create();
    } catch (Exception e) {
      e.printStackTrace();
      Display.destroy();
      System.exit(1);
    }
    WIDTH = Display.getWidth();
    HEIGHT = Display.getHeight();
    System.out.println("Display: " + WIDTH + " x " + HEIGHT);

    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadIdentity();
    GL11.glOrtho(0, WIDTH, HEIGHT, 0, 1, -1);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);

    Resources.load();

    setScreen(new GuiGame());
    System.out.println("SplitMan started");
  }
示例#3
0
文件: LLC.java 项目: JackdDvice/LLC
  /** Setups the Display */
  private void initDisplay() throws LWJGLException {
    Display.setDisplayMode(standartDisplayMode);
    Display.setResizable(true);
    Display.setVSyncEnabled(true);
    Display.setTitle("LLC - " + VERSION);
    Display.create();

    Keyboard.create();
    Mouse.create();
  }
  public CpuPositionOffset() {
    elapsedTime = 0;
    newData = BufferUtils.createFloatBuffer(vertexDataAry.length);
    try {
      Display.setDisplayMode(new DisplayMode(500, 500));
      Display.setResizable(true);
      Display.setTitle("CPU Position Offset");

      Display.create();
    } catch (LWJGLException e) {
      e.printStackTrace();
      System.exit(0);
    }

    this.positionBufferObject = initializeVertexBuffer();
    this.program = initializeProgram();
  }
示例#5
0
 public static void setResizable(boolean resizable) {
   Display.setResizable(resizable);
 }