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++; }
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++; }