Ffp Class
Interface for fixed function pipeline. This interface enables to render basic geometric primitives. For example, it can be used to draw a project watermark.
To use this class, include the UnigineFfp.h file.
Ffp Class
Members
void renderScreen ()
void addIndices (int i0, int i1)
Add two indices.Arguments
- int i0 - The first index.
- int i1 - The second index.
void addIndices (ushort[] indices, int vertex_offset)
Add two indices.Arguments
- ushort[] indices - The first index.
- int vertex_offset - The second index.
void setOrtho (int width, int height)
Set orthographic projection to render the primitive.Arguments
- int width - Primitive width.
- int height - Primitive height.
void addIndices (ushort[] indices)
Add two indices.Arguments
- ushort[] indices
int getMode ()
Set current Ffp mode.Return value
Current Ffp mode.void endTriangles ()
End rendering of triangles (i.e. draw the specified triangles).int isEnabled ()
Return a value indicating if the Ffp is enabled.Return value
Return 1 if the Ffp is enabled; otherwise, 0 is returned.void addVertex (Vertex[] vertex)
Add a vertex.Arguments
- Vertex[] vertex - Vertex.
void addLines (int num)
Add a specified number of lines. This method does not add vertices; instead, it allocates indices, for which vertices should be then created with addVertex(). Indices will point to vertices starting from the last added vertex.Arguments
- int num - The number of lines.
void setTransform (mat4 transform)
Set transformation matrix for the rendered primitive.Arguments
- mat4 transform - Transformation matrix.
void enable (int mode = MODE_DEFAULT)
Enable Ffp rendering.Arguments
- int mode - Ffp mode.
void setColor (unsigned int color)
Set rendering color for the last added vertex.Arguments
- unsigned int color - Color in ARGB8 format: (a << 24) | (r << 16) | (g << 8) | (b << 0).
int getNumIndices ()
Get the number of indices in the current primitive batch.Return value
The number of indices.void setColor (float r, float g, float b, float a)
Set rendering color for the last added vertex.Arguments
- float r - Red color component.
- float g - Green color component.
- float b - Blue color component.
- float a - Alpha color component.
void beginTriangles ()
Begin rendering of triangles. Specify a list of primitives and vertex data between beginTriangles() and endTriangles().void addTriangleQuads (int num)
Add a specified number of quads. This method does not add vertices; instead, it allocates indices, for which vertices should be then created with addVertex(). Indices will point to vertices starting from the last added vertex.Arguments
- int num - The number of quads.
int getNumVertex ()
Get the number of vertices in the current primitive batch.Return value
The number of vertices.void endLines ()
End rendering of lines (i.e. draw the specified lines).mat4 getTransform ()
Get transformation matrix of the rendered primitive.Return value
Transformation matrix.void setMode (int mode)
Set current Ffp mode.Arguments
- int mode - Current Ffp mode.
void disable ()
Disable Ffp rendering.void setTexCoord (float x, float y, float z = 0.0f, float w = 1.0f)
Set texture coordinates for the last added vertex.Arguments
- float x - X texture coordinate.
- float y - Y texture coordinate.
- float z - Z texture coordinate.
- float w - W texture coordinate.
void addTriangles (int num)
Add a specified number of triangles. This method does not add vertices; instead, it allocates indices, for which vertices should be then created with addVertex(). Indices will point to vertices starting from the last added vertex.Arguments
- int num - The number of triangles.
void beginLines ()
Begin rendering of lines. Specify a list of vertex or index data between beginLines() and endLines().void addIndices (int i0, int i1, int i2, int i3)
Add two indices.Arguments
- int i0 - The first index.
- int i1 - The second index.
- int i2 - The third index.
- int i3 - The fourth index.
void addIndices (int i0, int i1, int i2)
Add two indices.Arguments
- int i0 - The first index.
- int i1 - The second index.
- int i2 - The third index.
void addIndex (int index)
Add an index.Arguments
- int index - Index of a vertex.
void addVertex (Vertex vertex)
Add a vertex.Arguments
- Vertex vertex - Vertex.
void addVertex (float x, float y, float z = 0.0f)
Add a vertex.Arguments
- float x - X coordinate of the vertex.
- float y - Y coordinate of the vertex.
- float z - Z coordinate of the vertex.
int FFP_MODE_DEFAULT
int FFP_MODE_MULTISAMPLE_2
int FFP_MODE_MULTISAMPLE_4
int FFP_MODE_MULTISAMPLE_8
int FFP_MODE_MULTISAMPLE_16
int FFP_MODE_SHADOW
int FFP_MODE_SPLASH
int FFP_MODE_SOLID
int FFP_MODE_CUBE
int FFP_MODE_GRAD
int FFP_MODE_SRGB
int FFP_MODE_YUV
int FFP_COLOR_RED
int FFP_COLOR_GREEN
int FFP_COLOR_BLUE
int FFP_COLOR_BLACK
int FFP_COLOR_WHITE
Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)