|
| 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 () |
|
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
void AllocateNextTriangle |
( |
| ) |
|
|
protected |
Allocate the next triangle in the set of ordered, connected triangles
Finish building strip and bake it to a VBO
- Parameters
-
stateManager | StateManager object to issue GL commands to |
- Precondition
- _stripified == false
-
_stripified == true
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
unsigned int GetNumTriangles |
( |
| ) |
|
|
inline |
Returns the number of triangles in this strip
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
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 |
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
Convert the set of ordered, connected triangles in this object into tristrip
- Precondition
- _stripified == false
-
_stripified == true
Current texture coordinates supplied for current triangle (Texture coordinates are not required to change per triangle) Used only while building list.
unsigned int _numTriangles |
|
protected |
The number of triangles in the strip
True if triangles have been created into a strip
The number of vertices in the strip
Texture to use when drawing strip. NULL if untextured
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.
VBO Handle for this triangle strip
const GLuint VERT_OFFSET = 0 |
|
static |
Constant offsets to the primitive vertex attributes.
const GLuint VERT_SIZE = sizeof( V2f ) |
|
static |
Constant sizes of the primitive vertex attributes
The documentation for this class was generated from the following file: