public class Drawable2d
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Drawable2d.Prefab
Enum values for constructor.
|
| Modifier and Type | Field and Description |
|---|---|
static java.nio.FloatBuffer |
FULL_RECTANGLE_BUF |
static float[] |
FULL_RECTANGLE_COORDS
A "full" square, extending from -1 to +1 in both dimensions.
|
static java.nio.FloatBuffer |
FULL_RECTANGLE_TEX_BUF |
static float[] |
FULL_RECTANGLE_TEX_COORDS |
static float[] |
FULL_RECTANGLE_TEX_COORDS_FLIP_HORIZONTAL |
static float[] |
FULL_RECTANGLE_TEX_COORDS_FLIP_VERTICAL |
static java.nio.FloatBuffer |
FULL_RECTANGLE_TEX_HORIZONTAL_FLIP_BUF |
static java.nio.FloatBuffer |
FULL_RECTANGLE_TEX_VERTICAL_FLIP_BUF |
| Constructor and Description |
|---|
Drawable2d() |
Drawable2d(Drawable2d.Prefab shape)
Prepares a drawable from a "pre-fabricated" shape definition.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCoordsPerVertex()
Returns the number of position coordinates per vertex.
|
java.nio.FloatBuffer |
getTexCoordArray()
Returns the array of texture coordinates.
|
int |
getTexCoordStride()
Returns the width, in bytes, of the data for each texture coordinate.
|
java.nio.FloatBuffer |
getVertexArray()
Returns the array of vertices.
|
int |
getVertexCount()
Returns the number of vertices stored in the vertex array.
|
int |
getVertexStride()
Returns the width, in bytes, of the data for each vertex.
|
java.lang.String |
toString() |
public static final float[] FULL_RECTANGLE_COORDS
The texture coordinates are Y-inverted relative to RECTANGLE. (This seems to work out right with external textures from SurfaceTexture.)
public static final float[] FULL_RECTANGLE_TEX_COORDS
public static final float[] FULL_RECTANGLE_TEX_COORDS_FLIP_HORIZONTAL
public static final float[] FULL_RECTANGLE_TEX_COORDS_FLIP_VERTICAL
public static final java.nio.FloatBuffer FULL_RECTANGLE_BUF
public static final java.nio.FloatBuffer FULL_RECTANGLE_TEX_BUF
public static final java.nio.FloatBuffer FULL_RECTANGLE_TEX_HORIZONTAL_FLIP_BUF
public static final java.nio.FloatBuffer FULL_RECTANGLE_TEX_VERTICAL_FLIP_BUF
public Drawable2d(Drawable2d.Prefab shape)
Does no EGL/GL operations, so this can be done at any time.
public Drawable2d()
public java.nio.FloatBuffer getVertexArray()
To avoid allocations, this returns internal state. The caller must not modify it.
public java.nio.FloatBuffer getTexCoordArray()
To avoid allocations, this returns internal state. The caller must not modify it.
public int getVertexCount()
public int getVertexStride()
public int getTexCoordStride()
public int getCoordsPerVertex()
public java.lang.String toString()
toString in class java.lang.Object