Ejemplo n.º 1
0
 /**
  * Sets the game width and height of the OpenGL surface The width will altered depending on screen
  * resolution
  *
  * @param width
  * @param height
  * @return final game width
  */
 public float setGameSize(float width, float height) {
   Graphics.determine(this);
   float aspect = width / height;
   gameWidth = width;
   gameHeight = height;
   if (Graphics.getAspectRatio() < aspect) {
     Debug.print("Thinner than expected");
   } else if (Graphics.getAspectRatio() > aspect) {
     Debug.print("Wider than expected");
   }
   gameWidth = Graphics.getAspectRatio() * gameHeight;
   return gameWidth;
 }
Ejemplo n.º 2
0
  private void createStatics() {
    Graphics.determine(this);
    Rokon.blendFunction = new BlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);

    Rokon.triangleStripBoxBuffer = new BufferObject(new float[] {0, 0, 1, 0, 0, 1, 1, 1});
    Rokon.lineLoopBoxBuffer = new BufferObject(new float[] {0, 0, 1, 0, 1, 1, 0, 1});

    Rokon.arrayVBO = new ArrayVBO(Rokon.triangleStripBoxBuffer, VBO.STATIC);
    Rokon.boxArrayVBO = new ArrayVBO(Rokon.lineLoopBoxBuffer, VBO.STATIC);

    Rokon.rectangle = new Polygon(new float[] {0, 0, 1, 0, 1, 1, 0, 1});
    Rokon.circle = new Polygon(new float[] {0, 0, 1, 0, 1, 1, 0, 1});

    OS.determineAPI();
  }