Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Bounds-Related Classes
Containers
Controls-Related Classes
Core Library
Engine-Related Classes
GUI-Related Classes
Node-Related Classes
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Utility Classes

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 (const Ffp::Vertex[] & vertex)

Add a vertex.

Arguments

  • const Ffp::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 (const Math::mat4 & transform)

Set transformation matrix for the rendered primitive.

Arguments

  • const Math::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).

Math::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 (const Ffp::Vertex & vertex)

Add a vertex.

Arguments

  • const Ffp::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 MODE_DEFAULT

int MODE_MULTISAMPLE_2

int MODE_MULTISAMPLE_4

int MODE_MULTISAMPLE_8

int MODE_MULTISAMPLE_16

int MODE_SHADOW

int MODE_SPLASH

int MODE_SOLID

int MODE_CUBE

int MODE_GRAD

int MODE_SRGB

int MODE_YUV

int COLOR_RED

int COLOR_GREEN

int COLOR_BLUE

int COLOR_BLACK

int COLOR_WHITE

Last update: 2017-07-03