Esempio n. 1
0
  @Override
  public void render() {
    GL10 gl = Gdx.graphics.getGL10();
    gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    gl.glClearColor(0.7f, 0.7f, 0.7f, 1);
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
    gl.glMatrixMode(GL10.GL_MODELVIEW);
    gl.glLoadIdentity();
    gl.glRotatef(angle, 0, 0, 1);
    angle += angleIncrement;
    gl.glEnable(GL10.GL_TEXTURE_2D);

    gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
    vertices.position(0);
    gl.glColorPointer(4, GL10.GL_FLOAT, BYTES_PER_VERTEX, vertices);

    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
    gl.glClientActiveTexture(GL10.GL_TEXTURE0);
    gl.glActiveTexture(GL10.GL_TEXTURE0);
    tex.bind();
    vertices.position(4);
    gl.glTexCoordPointer(2, GL10.GL_FLOAT, BYTES_PER_VERTEX, vertices);

    gl.glClientActiveTexture(GL10.GL_TEXTURE1);
    gl.glActiveTexture(GL10.GL_TEXTURE1);
    tex2.bind();
    vertices.position(6);
    gl.glTexCoordPointer(2, GL10.GL_FLOAT, BYTES_PER_VERTEX, vertices);

    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
    vertices.position(8);
    gl.glVertexPointer(3, GL10.GL_FLOAT, BYTES_PER_VERTEX, vertices);

    gl.glDrawArrays(GL10.GL_TRIANGLES, 0, 3);
  }
Esempio n. 2
0
 private void renderInsideStation(Application app) {
   GL10 gl = app.getGraphics().getGL10();
   gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
   gl.glViewport(0, 0, app.getGraphics().getWidth(), app.getGraphics().getHeight());
   gl.glEnable(GL10.GL_BLEND);
   gl.glDisable(GL10.GL_DITHER);
   gl.glEnable(GL10.GL_DEPTH_TEST);
   gl.glEnable(GL10.GL_CULL_FACE);
   setStaticProjectionAndCamera(app.getGraphics(), app, gl);
   setLighting(gl);
   gl.glEnable(GL10.GL_TEXTURE_2D);
   renderSky(gl);
   renderPlanet(gl, "sun", true, 1737f, Splash.planetmove - 150, 0, -2500, app);
   renderSky(gl);
   gl.glDisable(GL10.GL_DITHER);
   gl.glDisable(GL10.GL_CULL_FACE);
   // do alpha models after this
   renderStaticShip(gl, app);
   renderSun(gl, 70000f, -1600, 0, -4500, app);
   gl.glDisable(GL10.GL_TEXTURE_2D);
   renderHud(gl);
 }
Esempio n. 3
0
 @Override
 public void resize(int w, int h) {
   // set OpenGL viewport
   GL10 gl = Gdx.app.getGraphics().getGL10();
   gl.glViewport(0, 0, w, h);
 }