#include <gls_quad_storage.h>
|
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 GLuint | COLOR_SIZE = sizeof( glsColor ) |
| Size of a color in bytes.
|
|
static const void *const | VERT_OFFSET |
|
static const void *const | TEX_COORD_OFFSET |
|
static const void *const | COLOR_OFFSET |
|
◆ GlsQuadListVCT_2D()
◆ ~GlsQuadListVCT_2D()
◆ AddQuad2D()
void AddQuad2D |
( |
const float |
x1, |
|
|
const float |
y1, |
|
|
const float |
x2, |
|
|
const float |
y2 |
|
) |
| |
Add a quad defined by a 2D rectangle from x1,y1 to x2,y2
- Parameters
-
x1 | X coord of point 1 |
y1 | Y coord of point 1 |
x2 | X coord of point 2 |
y2 | Y coord of point 2 |
◆ Bake()
Bakes the quad list, creating VBOs within the GL context. The VBOs created by Bake are used when the object is later drawn with Draw
- Parameters
-
stateManager | The StateManager object to create the VBOs within |
◆ Draw()
void Draw |
( |
IGlsStateManager * |
stateManager, |
|
|
const bool |
enableColor, |
|
|
const bool |
enableTexture |
|
) |
| |
Draws this quad list
- Parameters
-
stateManager | OpenGL context to draw list in |
enableColor | Whether or not to use the per vertex colors when drawing |
enableTexture | Whether or not to use the texture when drawing |
◆ NumQuads()
unsigned int NumQuads |
( |
| ) |
|
|
inline |
- Returns
- Returns the number of quads in the list
◆ SetColor()
Set the current drawing color. When a quad is added, its vertex colors are set to the current color
- Parameters
-
◆ SetTexCoords()
void SetTexCoords |
( |
const float |
x1, |
|
|
const float |
y1, |
|
|
const float |
x2, |
|
|
const float |
y2 |
|
) |
| |
Set the current texture coordinates. When a quad is added, these texture coordinates will be used. x1,y1 will map to quad vertex[0] and x2,y2 will map to quad vertex[1]
- Parameters
-
x1 | X coord of point 1 |
y1 | Y coord of point 1 |
x2 | X coord of point 2 |
y2 | Y coord of point 2 |
◆ SetTexture()
Set the current texture. This texture will be used when drawing the quad list (if not NULL)
- Parameters
-
image | The texture to set, NULL for no texture |
◆ StartBuilding()
Put the quad list in list building mode. Process for using this quad list:
- Build the list
- Bake the list (creates VBOs)
- Draw the list
◆ _currentColor
Last color that was set. Used only while building a list
◆ _currentTex
Current texture coordinates supplied for current quad (Texture coordinates are not required to change per quad). Used only while building list.
◆ _numQuads
Number of quads in the list (total)
◆ COLOR_OFFSET
const void* const COLOR_OFFSET |
|
static |
Constant offsets to the primitive color attribute.
- Note
- Strange casting is to support OpenGL's repurposed functions that pass offsets as pointers.
◆ TEX_COORD_OFFSET
const void* const TEX_COORD_OFFSET |
|
static |
Constant offsets to the primitive texture coordinate attribute.
- Note
- Strange casting is to support OpenGL's repurposed functions that pass offsets as pointers.
◆ VERT_OFFSET
const void* const VERT_OFFSET |
|
static |
Constant offsets to the primitive vertex attribute.
- Note
- Strange casting is to support OpenGL's repurposed functions that pass offsets as pointers.
The documentation for this class was generated from the following file: