Geogram
Version 1.9.1-rc
A programming library of geometric algorithms
|
Stores all the buffers used to implement the immediate-mode interface. More...
#include <geogram_gfx/GLUP/GLUP_context.h>
Public Types | |
enum | { NB_IMMEDIATE_BUFFERS = 4 } |
Public Member Functions | |
ImmediateState (index_t *nb_vertices_per_primitive) | |
ImmediateState constructor. More... | |
~ImmediateState () | |
ImmediateState destructor. | |
GLuint & | VAO () |
Gets the Vertex Array Object. More... | |
void | copy_element (index_t to, index_t from) |
Copies an element, i.e. all the attributes attached to a vertex. More... | |
void | begin (GLUPprimitive primitive, index_t max_current_vertex=0) |
Configures the immediate state for rendering primitives of a given type. More... | |
void | next_vertex () |
Advances to the next vertex. More... | |
bool | buffers_are_full () |
Tests whether the buffers are full. More... | |
void | reset (index_t new_current_vertex=0) |
Resets the current vertex index. More... | |
GLUPprimitive | primitive () const |
Gets the primitive currently rendered, i.e. the argument to the latest invocation of begin() | |
index_t | nb_vertices () const |
Gets the number of vertices stored in the buffers. | |
index_t | nb_primitives () const |
Gets the number of primitives stored in the buffers. | |
index_t | max_current_vertex () const |
Gets the maximum number of vertices in the buffer before the buffer is flushed. More... | |
void | set_current_vertex (index_t v) |
Sets the current vertex. More... | |
Public Attributes | |
ImmediateBuffer | buffer [NB_IMMEDIATE_BUFFERS] |
Stores all the buffers used to implement the immediate-mode interface.
Definition at line 545 of file GLUP_context.h.
|
inline |
ImmediateState constructor.
[in] | nb_vertices_per_primitive | a pointer to an array of index_t of size GLUP_NB_PRIMITIVES that indicates for each primitive the number of vertices (3 for GLUP_TRIANGLES, 4 for GLUP_QUADS etc...). |
Definition at line 553 of file GLUP_context.h.
|
inline |
Configures the immediate state for rendering primitives of a given type.
[in] | primitive | type of the primitives to be rendered |
[in] | max_current_vertex | optional maximum index of a vertex index in immediate buffer before flushing. Computed from primitive if unspecified. It is used by primitives that need additional vertices to be generated in the immediate buffer (e.g., GLUP_THICK_LINES in GLUP_ES profile). |
Definition at line 612 of file GLUP_context.h.
|
inline |
Tests whether the buffers are full.
When buffers are full, their contents need to be sent to OpenGL before calling reset(). These operations are done by the Context.
Definition at line 644 of file GLUP_context.h.
Copies an element, i.e. all the attributes attached to a vertex.
[in] | to | index of the destination vertex |
[in] | from | index of the source vertex |
Only attributes that are enabled are copied.
Definition at line 595 of file GLUP_context.h.
|
inline |
Gets the maximum number of vertices in the buffer before the buffer is flushed.
This number depends on the number of vertices per primitive.
Definition at line 687 of file GLUP_context.h.
|
inline |
Advances to the next vertex.
This copies all the current values of all enabled attributes to the current vertex position.
Definition at line 631 of file GLUP_context.h.
|
inline |
Resets the current vertex index.
[in] | new_current_vertex | optional new value of the current vertex. |
Definition at line 653 of file GLUP_context.h.
|
inline |
Sets the current vertex.
This defines the number of stored vertices in this buffer.
[in] | v | the index of the current vertex. |
Definition at line 697 of file GLUP_context.h.
|
inline |
Gets the Vertex Array Object.
Definition at line 584 of file GLUP_context.h.