コード例 #1
0
ファイル: FloatTest.java プロジェクト: vidjogamer/libgdx_repo
  @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);
  }
コード例 #2
0
ファイル: SimpleTest.java プロジェクト: avgtivihd/bings-game
  @Override
  public void render() {
    GL10 gl = Gdx.app.getGraphics().getGL10();

    gl.glClearColor(r, g, b, 1);
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
  }
コード例 #3
0
  @Override
  public void render(float delta) {
    // TODO Auto-generated method stub

    if (Gdx.input.justTouched()) {
      guiCam.unproject(touch.set(Gdx.input.getX(), Gdx.input.getY(), 0));
      if (startbutton.contains(touch)) {
        maingame.setScreen(maingame.mainscene);
        return;
      }
    }

    GL10 gl = Gdx.graphics.getGL10();
    gl.glClearColor(0, 0, 0, 1);
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
    /*
     * Actualiza los parametros de la camara
     * y los enlaza al objeto de renderizado batcher
     * */
    guiCam.update();
    this.batcher.setProjectionMatrix(this.guiCam.combined);
    /*
     * Desactiva las trasnparencias
     * */
    batcher.disableBlending();
    batcher.begin();
    batcher.draw(Assets.background, 0, 0, 10, 15);
    batcher.end();
    batcher.enableBlending();
    batcher.begin();
    batcher.draw(Assets.title, 1, 6, 8, 8);
    batcher.draw(Assets.start, x, 3, 6, 3);
    x += c;
    batcher.end();
  }
コード例 #4
0
 @Override
 public void render(float delta, GL10 gl) {
   gl.glClearColor(1, 0, 0, 1);
   gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
 }