コード例 #1
0
ファイル: Engine.java プロジェクト: Ragar0ck/Eindwerk-Java
  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();
  }
コード例 #2
0
  public void onSurfaceCreated(GL10 $gl, EGLConfig eglConfig) {
    Log.i(Min3d.TAG, "Renderer.onSurfaceCreated()");

    RenderCaps.setRenderCaps($gl);

    setGl($gl);

    reset();

    _scene.init();
  }
コード例 #3
0
ファイル: Bdx.java プロジェクト: colepram/bdx
 public void add(int index, Scene scene) {
   super.add(index, scene);
   if (scene.objects == null) scene.init();
 }
コード例 #4
0
 public void setScene(Scene s) {
   if (scene != null) scene.dispose();
   scene = s;
   scene.pixels = pixels;
   if (scene != null) scene.init();
 }
コード例 #5
0
ファイル: Bdx.java プロジェクト: colepram/bdx
 public boolean add(Scene scene) {
   boolean ret = super.add(scene);
   if (scene.objects == null) scene.init();
   return ret;
 }