Example #1
0
  public void thing() {

    glFrontFace(GL_CW);
    glCullFace(GL_BACK);

    glEnable(GL_TEXTURE_2D);
    glEnable(GL_CULL_FACE);
    glEnable(GL_DEPTH_TEST);
    glActiveTexture(GL_TEXTURE0);

    GL11.glViewport(0, 0, window.getCanvas().getWidth(), window.getCanvas().getHeight());

    scene.init(this);
    // these variables are here purely for ease of reading
    // i could just pass in the lastTime and time into update.
    // delta is necessary to not see any Jumps if the framerates gets lower(if you have a framerate
    // of 60 and do something like move(5) it will move 5 units 60 times per seconds
    // while if you have 30 fps it would only update 30 times per second so if you do move(5 *
    // delta) it doesnt matter what fps you have the object will move the same distance;
    float lastTime = (float) System.nanoTime() / (float) 1000000000L;
    float delta = 0;

    while (running) {
      float time = (float) System.nanoTime() / (float) 1000000000L;
      delta = time - lastTime;
      update(delta);
      delta = 0;
      render();
      lastTime = time;
    }
    destroy();
  }
  public void onSurfaceCreated(GL10 $gl, EGLConfig eglConfig) {
    Log.i(Min3d.TAG, "Renderer.onSurfaceCreated()");

    RenderCaps.setRenderCaps($gl);

    setGl($gl);

    reset();

    _scene.init();
  }
Example #3
0
 public void add(int index, Scene scene) {
   super.add(index, scene);
   if (scene.objects == null) scene.init();
 }
 public void setScene(Scene s) {
   if (scene != null) scene.dispose();
   scene = s;
   scene.pixels = pixels;
   if (scene != null) scene.init();
 }
Example #5
0
 public boolean add(Scene scene) {
   boolean ret = super.add(scene);
   if (scene.objects == null) scene.init();
   return ret;
 }