Example #1
0
 private void drawRect(int x, int y, int width, int height, float matrix[]) {
   GL11 gl = mGL;
   gl.glPushMatrix();
   gl.glMultMatrixf(toGLMatrix(matrix), 0);
   putRectangle(x, y, width, height, mXyBuffer, mXyPointer);
   gl.glDrawArrays(GL11.GL_TRIANGLE_STRIP, 0, 4);
   gl.glPopMatrix();
 }
Example #2
0
  private void textureRect(float x, float y, float width, float height) {
    GL11 gl = mGL;

    saveTransform();
    translate(x, y);
    scale(width, height, 1);

    gl.glLoadMatrixf(mMatrixValues, 0);
    gl.glDrawArrays(GL11.GL_TRIANGLE_STRIP, OFFSET_FILL_RECT, 4);

    restoreTransform();
    mCountTextureRect++;
  }
Example #3
0
  public void fillRect(float x, float y, float width, float height, int color) {
    mGLState.setColorMode(color, mAlpha);
    GL11 gl = mGL;

    saveTransform();
    translate(x, y);
    scale(width, height, 1);

    gl.glLoadMatrixf(mMatrixValues, 0);
    gl.glDrawArrays(GL11.GL_TRIANGLE_STRIP, OFFSET_FILL_RECT, 4);

    restoreTransform();
    mCountFillRect++;
  }
Example #4
0
  public void drawLine(float x1, float y1, float x2, float y2, GLPaint paint) {
    GL11 gl = mGL;

    mGLState.setColorMode(paint.getColor(), mAlpha);
    mGLState.setLineWidth(paint.getLineWidth());

    saveTransform();
    translate(x1, y1);
    scale(x2 - x1, y2 - y1, 1);

    gl.glLoadMatrixf(mMatrixValues, 0);
    gl.glDrawArrays(GL11.GL_LINE_STRIP, OFFSET_DRAW_LINE, 2);

    restoreTransform();
    mCountDrawLine++;
  }
Example #5
0
  public void drawRect(float x, float y, float width, float height, GLPaint paint) {
    GL11 gl = mGL;

    mGLState.setColorMode(paint.getColor(), mAlpha);
    mGLState.setLineWidth(paint.getLineWidth());

    saveTransform();
    translate(x, y);
    scale(width, height, 1);

    gl.glLoadMatrixf(mMatrixValues, 0);
    gl.glDrawArrays(GL11.GL_LINE_LOOP, OFFSET_DRAW_RECT, 4);

    restoreTransform();
    mCountDrawLine++;
  }