Exemplo n.º 1
0
 @Override
 public void render() {
   if (loading && assets.update()) doneLoading();
   camController.update();
   Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
   Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
   modelBatch.begin(cam);
   modelBatch.render(instances, environment);
   modelBatch.end();
 }
Exemplo n.º 2
0
  @Override
  public void render() {
    camController.update();

    Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);

    modelBatch.begin(cam);
    modelBatch.render(renderable);
    modelBatch.end();
  }
Exemplo n.º 3
0
  @Override
  public void render() {
    camController.update();

    Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);

    modelBatch.begin(cam);
    for (ModelInstance instance : instances) modelBatch.render(instance, shader);
    modelBatch.end();
  }
Exemplo n.º 4
0
  @Override
  public void render() {
    camController.update();

    Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);

    modelBatch.begin(cam);
    modelBatch.render(instances, environment);
    if (space != null) modelBatch.render(space);
    modelBatch.end();
  }
Exemplo n.º 5
0
 @Override
 public void render() {
   // Respond to user events and update the camera
   cameraController.update();
   // Clear the viewport
   // Gdx.gl.glViewport(0, 0, screenWidth, screenHeight);
   Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
   Gdx.gl.glClearColor(0.8f, 0.8f, 0.8f, 1.0f);
   // Draw all model instances using the camera
   modelBatch.begin(camera);
   modelBatch.render(instances, environment);
   modelBatch.end();
 }
Exemplo n.º 6
0
  @Override
  public void render() {
    if (loading && assets.update()) doneLoading();
    camController.update();

    Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight());
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);

    modelBatch.begin(cam);
    for (ModelInstance instance : instances) modelBatch.render(instance, lights);
    if (space != null) modelBatch.render(space);
    modelBatch.end();
  }
Exemplo n.º 7
0
  @Override
  public void render() {
    camController.update();

    Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight());
    Gdx.gl.glClearColor(0, 0, 0, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);

    shadowLight.begin(Vector3.Zero, cam.direction);
    shadowBatch.begin(shadowLight.getCamera());
    shadowBatch.render(instance);
    shadowBatch.end();
    shadowLight.end();

    modelBatch.begin(cam);
    modelBatch.render(instance, environment);
    modelBatch.end();
  }
Exemplo n.º 8
0
  @Override
  public void render() {
    final float delta = Math.min(1f / 30f, Gdx.graphics.getDeltaTime());

    if (!collision) {
      ball.transform.translate(0f, -delta, 0f);
      ballObject.setWorldTransform(ball.transform);

      collision = checkCollision();
    }

    camController.update();

    Gdx.gl.glClearColor(0.3f, 0.3f, 0.3f, 1.f);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);

    modelBatch.begin(cam);
    modelBatch.render(instances, environment);
    modelBatch.end();
  }