This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::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.

Related classes:
Unigine::Ffp::Vertex

Unigine::Ffp Class

Members


virtual ~Ffp ()

Virtual destructor.

static Ffp * get ()

Return a pointer to the existing Ffp.

Return value

Pointer to the existing ffp.

virtual void setMode (int mode) const =0

Set current Ffp mode.

Arguments

  • int mode - Current Ffp mode.

virtual int getMode () const =0

Set current Ffp mode.

Return value

Current Ffp mode.

virtual int isEnabled () const =0

Return a value indicating if the Ffp is enabled.

Return value

Return 1 if the Ffp is enabled; otherwise, 0 is returned.

virtual void enable (int mode) const =0

Enable Ffp rendering.

Arguments

  • int mode - Ffp mode.

virtual void disable () const =0

Disable Ffp rendering.

virtual void setOrtho (int width, int height) const =0

Set orthographic projection to render the primitive.

Arguments

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

virtual void setTransform (const mat4 & transform) const =0

Set transformation matrix for the rendered primitive.

Arguments

  • const mat4 & transform - Transformation matrix.

virtual mat4 getTransform () const =0

Get transformation matrix of the rendered primitive.

Return value

Transformation matrix.

virtual void beginLines () const =0

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

virtual void endLines () const =0

End rendering of lines (i.e. draw the specified lines).

virtual void beginTriangles () const =0

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

virtual void endTriangles () const =0

End rendering of triangles (i.e. draw the specified triangles).

virtual int getNumVertex () const =0

Get the number of vertices in the current primitive batch.

Return value

The number of vertices.

virtual void addVertex (const Vertex & vertex) const =0

Add a vertex.

Arguments

  • const Vertex & vertex - Vertex.

virtual void addVertex (const Vertex * vertex, int num_vertex) const =0

Add a vertices array.

Arguments

  • const Vertex * vertex - Vertices array pointer.
  • int num_vertex - The number of vertices.

virtual void addVertex (float x, float y, float z) const =0

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.

virtual void setTexCoord (float x, float y, float z, float w) const =0

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.

virtual void setColor (float r, float g, float b, float a) const =0

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.

virtual void setColor (unsigned int color) const =0

Set rendering color for the last added vertex.

Arguments

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

virtual int getNumIndices () const =0

Get the number of indices in the current primitive batch.

Return value

The number of indices.

virtual void addIndex (int index) const =0

Add an index.

Arguments

  • int index - Index of a vertex.

virtual void addIndices (int i0, int i1) const =0

Add two indices.

Arguments

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

virtual void addIndices (int i0, int i1, int i2) const =0

Add three indices.

Arguments

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

virtual void addIndices (int i0, int i1, int i2, int i3) const =0

Add four indices.

Arguments

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

virtual void addIndices (const unsigned short * indices, int num_indices) const =0

Add indices array.

Arguments

  • const unsigned short * indices - Indices array pointer.
  • int num_indices - The number of indices.

virtual void addIndices (const unsigned short * indices, int num_indices, int vertex_offset) const =0

Add indices array.

Arguments

  • const unsigned short * indices - Indices array pointer.
  • int num_indices - The number of indices.
  • int vertex_offset - The vertex index offset.

virtual void addLines (int num) const =0

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.

virtual void addTriangles (int num) const =0

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.

virtual void addTriangleQuads (int num) const =0

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.

Unigine::Ffp::anonymous_6 Enumeration

MODE_DEFAULT = 0
MODE_MULTISAMPLE_2
MODE_MULTISAMPLE_4
MODE_MULTISAMPLE_8
MODE_MULTISAMPLE_16
MODE_SHADOW
MODE_SPLASH
MODE_SOLID
MODE_CUBE
MODE_GRAD
MODE_SRGB
MODE_YUV

Unigine::Ffp::anonymous_7 Enumeration

COLOR_RED = 0xffff0000u
COLOR_GREEN = 0xff00ff00u
COLOR_BLUE = 0xff0000ffu
COLOR_BLACK = 0xff000000u
COLOR_WHITE = 0xffffffffu
Last update: 2017-07-03
Build: ()