This page has been translated automatically.
Programming
Fundamentals
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
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Ffp Class

Interface for fixed function pipeline.

Ffp class in Unigine is differ from classic OpenGL FFP implementation. For example, Unigine Visualizer and Texture Buffers for Debugging are implemented by using Ffp. Ffp uses already implemented OpenGL and D3D11 shader programs (without creating materials, etc.) to render.

This interface enables to render basic geometric primitives. For example, it can be used to draw a project watermark.

See Also

  • Ffp samples that available in Unigine SDK Browser for C++ and C# APIs.

Ffp Class

Members


void setColor(unsigned int color)

Sets rendering color for the last added vertex.

You can use COLOR_* variables to set the color.

Arguments

  • unsigned int color - Color in ARGB8 format: (a << 24) | (r << 16) | (g << 8) | (b << 0).

void setColor(float r, float g, float b, float a)

Sets 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.

int isEnabled()

Return a value indicating if the Ffp is enabled.

Return value

Returns 1 if the Ffp is enabled; otherwise, 0.

void setMode(int mode)

Sets current Ffp mode.

Arguments

  • int mode - Current Ffp mode.

int getMode()

Returns current Ffp mode.

Return value

Current Ffp mode.

int getNumIndices()

Returns the number of indices in the current primitive batch.

Return value

The number of indices.

int getNumVertex()

Returns the number of vertices in the current primitive batch.

Return value

The number of vertices.

void setOrtho(int width, int height)

Sets orthographic projection to render the primitive.

For example, the render_show_textures console command renders textures via Ffp by using orthographic projection.

Arguments

  • int width - Primitive width.
  • int height - Primitive height.

void setTexCoord(float x, float y, float z = 0.0f, float w = 1.0f)

Sets 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 setTransform(mat4 transform)

Sets transformation matrix for the rendered primitive.

Arguments

  • mat4 transform - Transformation matrix.

mat4 getTransform()

Returns transformation matrix of the rendered primitive.

Return value

Transformation matrix.

void addIndex(int index)

Adds given index to Ffp.

Arguments

  • int index - Index of a vertex.

void addIndices(int i0, int i1)

Adds two given indices to Ffp.

Arguments

  • int i0 - The first index.
  • int i1 - The second index.

void addIndices(ushort[] indices, int vertex_offset)

Adds given indices array to Ffp with given vertex offset.

Arguments

  • ushort[] indices - The first index.
  • int vertex_offset - Vertex offset.

void addIndices(ushort[] indices)

Adds given indecis array to Ffp.

Arguments

  • ushort[] indices

void addIndices(int i0, int i1, int i2, int i3)

Adds four given indices to Ffp.

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)

Adds three given indices to Ffp.

Arguments

  • int i0 - The first index.
  • int i1 - The second index.
  • int i2 - The third index.

void addLines(int num)

Adds 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 addTriangleQuads(int num)

Adds 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.

void addTriangles(int num)

Adds 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 addVertex(Vertex[] vertex)

Adds given vertex array to Ffp.

Arguments

  • Vertex[] vertex - Vertex.

void addVertex(Vertex vertex)

Adds given vertex to Ffp.

Arguments

  • Vertex vertex - Vertex.

void addVertex(float x, float y, float z = 0.0f)

Adds a vertex with given coordinates to Ffp.

Arguments

  • float x - X coordinate of the vertex.
  • float y - Y coordinate of the vertex.
  • float z - Z coordinate of the vertex.

void beginLines()

Begins rendering of lines. Specify a list of vertex or index data between beginLines() and endLines().

void beginTriangles()

Begins rendering of triangles. Specify a list of primitives and vertex data between beginTriangles() and endTriangles().

void disable()

Disables Ffp rendering.

void enable(int mode = MODE_DEFAULT)

Enables Ffp rendering.

Arguments

  • int mode - Ffp mode.

void endLines()

Ends rendering of lines (i.e. draws the specified lines).

void endTriangles()

Ends rendering of triangles (i.e. draws the specified triangles).

void renderScreen()


int FFP_COLOR_BLACK

Description

Black color value: 0xff000000u

int FFP_COLOR_BLUE

Description

Blue color value: 0xff0000ffu

int FFP_COLOR_GREEN

Description

Blue color value: 0xff00ff00u

int FFP_COLOR_RED

Description

Blue color value: 0xffff0000u

int FFP_COLOR_WHITE

Description

Blue color value: 0xffffffffu

int FFP_MODE_CUBE

Description

Cubemap rendering mode.

int FFP_MODE_DEFAULT

Description

Default rendering mode.

int FFP_MODE_GRAD

Description

Gradient rendering mode.

int FFP_MODE_MULTISAMPLE_16

Description

Multisampling (x16) rendering mode.

int FFP_MODE_MULTISAMPLE_2

Description

Multisampling (x2) rendering mode.

int FFP_MODE_MULTISAMPLE_4

Description

Multisampling (x4) rendering mode.

int FFP_MODE_MULTISAMPLE_8

Description

Multisampling (x8) rendering mode.

int FFP_MODE_SHADOW

Description

Shadow rendering mode.

int FFP_MODE_SOLID

Description

Solid rendering mode.

int FFP_MODE_SPLASH

Description

Splash screen rendering mode.

int FFP_MODE_SRGB

Description

SRGB correction rendering mode.

int FFP_MODE_YUV

Description

YUV rendering mode.
Last update: 2017-07-03
Build: ()