コード例 #1
0
  @Override
  public void render() {
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);

    glPushMatrix();

    camera.applyMatrix();
    simpleRender();

    glPopMatrix();

    Display.update();
    Display.sync(60);
  }
コード例 #2
0
  @Override
  public void setup() {
    // Viewport
    glViewport(0, 0, width, height);

    // Enable something else
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

    // Enable three-dee
    glEnable(GL_DEPTH_TEST);

    // Enable textures
    glEnable(GL_TEXTURE_2D);

    // Blue sky
    glClearColor(93f / 255f, 155f / 255f, 217 / 255f, 0.0f);

    // Enable culling
    glEnable(GL_CULL_FACE);
    glCullFace(GL_BACK);

    // Allow alpha texturing (Does not enable it yet)
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    // Enable vertex buffer objects
    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_NORMAL_ARRAY);
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);

    TextureLib.loadDebugTexture();

    camera.setup();

    simpleSetup();
  }