#include <gls_triangle_storage.h>
|
| GlsTriangleStrip2D () |
|
virtual | ~GlsTriangleStrip2D () |
|
void | StartBuildingStrip () |
|
void | SetTexture (Image *image) |
|
void | SetTexCoords (const float x1, const float y1, const float x2, const float y2, const float x3, const float y3) |
|
void | AddTriangle2D (const float x1, const float y1, const float x2, const float y2, const float x3, const float y3) |
|
void | Bake (IGlsStateManager *stateManager) |
|
void | Draw (IGlsStateManager *stateManager, const bool enableTexture) |
|
unsigned int | GetNumTriangles () |
|
|
static const GLuint | VERT_SIZE = sizeof( V2f ) |
| Size of a vertex in bytes.
|
|
static const GLuint | TEX_SIZE = sizeof( V2f ) |
| Size of a texture coordinate in bytes.
|
|
static const void *const | VERT_OFFSET |
|
static const void *const | TEX_COORD_OFFSET |
|
The GlsTriangleStrip2D class. Wraps an OpenGL triangle strip drawable.
◆ GlsTriangleStrip2D()
◆ ~GlsTriangleStrip2D()
◆ AddTriangle2D()
void AddTriangle2D |
( |
const float |
x1, |
|
|
const float |
y1, |
|
|
const float |
x2, |
|
|
const float |
y2, |
|
|
const float |
x3, |
|
|
const float |
y3 |
|
) |
| |
Add the next triangle to the strip. Must be connected using previous two vertices of strip or be degenerate
- Parameters
-
x1 | X coord of vertex 1 |
y1 | Y coord of vertex 1 |
x2 | X coord of vertex 2 |
y2 | Y coord of vertex 2 |
x3 | X coord of vertex 3 |
y3 | Y coord of vertex 3 |
- Precondition
- _stripified == false
- Postcondition
- _numTriangles++, triangle is added to strip
◆ AllocateNextTriangle()
void AllocateNextTriangle |
( |
| ) |
|
|
protected |
Allocate the next triangle in the set of ordered, connected triangles
◆ Bake()
Finish building strip and bake it to a VBO
- Parameters
-
stateManager | StateManager object to issue GL commands to |
- Precondition
- _stripified == false
-
_stripified == true
◆ Draw()
Draw the triangle strip
- Parameters
-
stateManager | StateManager object to issue GL commands to |
enableTexture | True if strip will be drawn textured |
- Precondition
- _stripified == true
- Postcondition
- The strip is drawn
◆ GetNumTriangles()
unsigned int GetNumTriangles |
( |
| ) |
|
|
inline |
- Returns
- The number of triangles in this strip.
◆ SetTexCoords()
void SetTexCoords |
( |
const float |
x1, |
|
|
const float |
y1, |
|
|
const float |
x2, |
|
|
const float |
y2, |
|
|
const float |
x3, |
|
|
const float |
y3 |
|
) |
| |
Set the texture coordinates to be used for the next triangle that is added (or subsequent triangles if this is not called again
- Parameters
-
x1 | X coord of vertex 1 |
y1 | Y coord of vertex 1 |
x2 | X coord of vertex 2 |
y2 | Y coord of vertex 2 |
x3 | X coord of vertex 3 |
y3 | Y coord of vertex 3 |
- Precondition
- _texture != NULL && _stripified == false
- Postcondition
- _currentTex contains input values
◆ SetTexture()
void SetTexture |
( |
Image * |
image | ) |
|
Set the texture to be used for this triangle strip. The triangle strip may only have one texture, so it is an error to call this more than once after StartBuildingStrip() has been called.
- Precondition
- _texture == NULL && _stripified == false
- Postcondition
- _texture == img
- Parameters
-
image | The texture to assign, or NULL if no texture |
◆ StartBuildingStrip()
void StartBuildingStrip |
( |
| ) |
|
Sets this object into strip building mode. During strip building mode the user adds individual triangles to the strip When strip building mode is finished, the object will create a triangle strip from the individual triangles
- Precondition
- none
- Postcondition
- _stripified == false
◆ Stripify()
Convert the set of ordered, connected triangles in this object into tristrip
- Precondition
- _stripified == false
-
_stripified == true
◆ _currentTex
Current texture coordinates supplied for current triangle (Texture coordinates are not required to change per triangle) Used only while building list.
◆ _numTriangles
unsigned int _numTriangles |
|
protected |
The number of triangles in the strip
◆ _stripified
True if triangles have been created into a strip
◆ _stripSize
The number of vertices in the strip
◆ _texture
Texture to use when drawing strip. NULL if untextured
◆ _vboBufferSize
unsigned int _vboBufferSize |
|
protected |
Size of the VBO buffer. Cached to so that when a strip is cleared and reset we will only reallocate the VBO when its size changes.
◆ _vboHandle
VBO Handle for this triangle strip
◆ _vertData
◆ TEX_COORD_OFFSET
const void* const TEX_COORD_OFFSET |
|
static |
Constant offsets to the primitive texture coordinate attribute.
- Note
- Theoretically should be GLuints, but OpenGL's functions to pass integer offsets as pointers.
◆ VERT_OFFSET
const void* const VERT_OFFSET |
|
static |
Constant offsets to the primitive vertex attribute.
- Note
- Theoretically should be GLuints, but OpenGL's functions to pass integer offsets as pointers.
The documentation for this class was generated from the following file: