SAVE_FLAG_ALL, SAVE_FLAG_ALPHA, SAVE_FLAG_MATRIX
Constructor and Description |
---|
GLES20Canvas() |
Modifier and Type | Method and Description |
---|---|
void |
beginRenderTarget(RawTexture texture) |
static void |
checkError() |
void |
clearBuffer() |
void |
clearBuffer(float[] argb) |
void |
deleteBuffer(int bufferId) |
void |
deleteRecycledResources() |
void |
drawLine(float x1,
float y1,
float x2,
float y2,
GLPaint paint) |
void |
drawMesh(BasicTexture texture,
int x,
int y,
int xyBuffer,
int uvBuffer,
int indexBuffer,
int indexCount) |
void |
drawMixed(BasicTexture texture,
int toColor,
float ratio,
int x,
int y,
int w,
int h) |
void |
drawMixed(BasicTexture texture,
int toColor,
float ratio,
RectF source,
RectF target) |
void |
drawRect(float x,
float y,
float width,
float height,
GLPaint paint) |
void |
drawTexture(BasicTexture texture,
float[] textureTransform,
int x,
int y,
int w,
int h) |
void |
drawTexture(BasicTexture texture,
int x,
int y,
int width,
int height) |
void |
drawTexture(BasicTexture texture,
RectF source,
RectF target) |
void |
dumpStatisticsAndClear() |
void |
endRenderTarget() |
void |
fillRect(float x,
float y,
float width,
float height,
int color) |
float |
getAlpha() |
void |
getBounds(Rect bounds,
int x,
int y,
int width,
int height)
Gets the bounds given by x, y, width, and height as well as the internal
matrix state.
|
GLId |
getGLId() |
void |
initializeTexture(BasicTexture texture,
Bitmap bitmap)
Initializes the texture to a size by calling texImage2D on it.
|
void |
initializeTextureSize(BasicTexture texture,
int format,
int type)
Initializes the texture to a size by calling texImage2D on it.
|
void |
multiplyAlpha(float alpha) |
void |
multiplyMatrix(float[] matrix,
int offset) |
void |
recoverFromLightCycle()
After LightCycle makes GL calls, this method is called to restore the GL
configuration to the one expected by GLCanvas.
|
void |
restore() |
void |
rotate(float angle,
float x,
float y,
float z) |
void |
save() |
void |
save(int saveFlags) |
void |
scale(float sx,
float sy,
float sz) |
void |
setAlpha(float alpha) |
void |
setSize(int width,
int height) |
void |
setTextureParameters(BasicTexture texture)
Sets texture parameters to use GL_CLAMP_TO_EDGE for both
GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T.
|
void |
texSubImage2D(BasicTexture texture,
int xOffset,
int yOffset,
Bitmap bitmap,
int format,
int type)
Calls glTexSubImage2D to upload a bitmap to the texture.
|
void |
translate(float x,
float y) |
void |
translate(float x,
float y,
float z) |
boolean |
unloadTexture(BasicTexture texture) |
int |
uploadBuffer(ByteBuffer buf)
Generates buffers and uploads the element array buffer data.
|
int |
uploadBuffer(FloatBuffer buf)
Generates buffers and uploads the buffer data.
|
public void clearBuffer()
clearBuffer
in interface GLCanvas
public void clearBuffer(float[] argb)
clearBuffer
in interface GLCanvas
public void multiplyAlpha(float alpha)
multiplyAlpha
in interface GLCanvas
public void translate(float x, float y, float z)
public void rotate(float angle, float x, float y, float z)
public void multiplyMatrix(float[] matrix, int offset)
multiplyMatrix
in interface GLCanvas
public void drawLine(float x1, float y1, float x2, float y2, GLPaint paint)
public void drawRect(float x, float y, float width, float height, GLPaint paint)
public void fillRect(float x, float y, float width, float height, int color)
public void drawTexture(BasicTexture texture, int x, int y, int width, int height)
drawTexture
in interface GLCanvas
public void drawTexture(BasicTexture texture, RectF source, RectF target)
drawTexture
in interface GLCanvas
public void drawTexture(BasicTexture texture, float[] textureTransform, int x, int y, int w, int h)
drawTexture
in interface GLCanvas
public void drawMesh(BasicTexture texture, int x, int y, int xyBuffer, int uvBuffer, int indexBuffer, int indexCount)
public void drawMixed(BasicTexture texture, int toColor, float ratio, int x, int y, int w, int h)
public void drawMixed(BasicTexture texture, int toColor, float ratio, RectF source, RectF target)
public boolean unloadTexture(BasicTexture texture)
unloadTexture
in interface GLCanvas
public void deleteBuffer(int bufferId)
deleteBuffer
in interface GLCanvas
public void deleteRecycledResources()
deleteRecycledResources
in interface GLCanvas
public void dumpStatisticsAndClear()
dumpStatisticsAndClear
in interface GLCanvas
public void endRenderTarget()
endRenderTarget
in interface GLCanvas
public void beginRenderTarget(RawTexture texture)
beginRenderTarget
in interface GLCanvas
public void setTextureParameters(BasicTexture texture)
GLCanvas
setTextureParameters
in interface GLCanvas
texture
- The texture to set parameters on.public void initializeTextureSize(BasicTexture texture, int format, int type)
GLCanvas
initializeTextureSize
in interface GLCanvas
texture
- The texture to initialize the size.format
- The texture format (e.g. GL_RGBA)type
- The texture type (e.g. GL_UNSIGNED_BYTE)public void initializeTexture(BasicTexture texture, Bitmap bitmap)
GLCanvas
initializeTexture
in interface GLCanvas
texture
- The texture to initialize the size.bitmap
- The bitmap to initialize the bitmap with.public void texSubImage2D(BasicTexture texture, int xOffset, int yOffset, Bitmap bitmap, int format, int type)
GLCanvas
texSubImage2D
in interface GLCanvas
texture
- The target texture to write to.xOffset
- Specifies a texel offset in the x direction within the
texture array.yOffset
- Specifies a texel offset in the y direction within the
texture array.format
- The texture format (e.g. GL_RGBA)type
- The texture type (e.g. GL_UNSIGNED_BYTE)public int uploadBuffer(FloatBuffer buf)
GLCanvas
uploadBuffer
in interface GLCanvas
buf
- The buffer to uploadpublic int uploadBuffer(ByteBuffer buf)
GLCanvas
uploadBuffer
in interface GLCanvas
buf
- The buffer to uploadpublic static void checkError()
public void recoverFromLightCycle()
GLCanvas
recoverFromLightCycle
in interface GLCanvas
public void getBounds(Rect bounds, int x, int y, int width, int height)
GLCanvas