Geogram Version 1.8.5
A programming library of geometric algorithms
Loading...
Searching...
No Matches
GLUP::ImmediateState Class Reference

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 ()
 ImmediateState constructor.
 
 ~ImmediateState ()
 ImmediateState destructor.
 
GLuint & VAO ()
 Gets the Vertex Array Object.
 
void copy_element (index_t to, index_t from)
 Copies an element, i.e. all the attributes attached to a vertex.
 
void begin (GLUPprimitive primitive)
 Configures the immediate state for rendering primitives of a given type.
 
void next_vertex ()
 Advances to the next vertex.
 
bool buffers_are_full ()
 Tests whether the buffers are full.
 
void reset ()
 Resets the current vertex index to zero.
 
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.
 
void set_current_vertex (index_t v)
 Sets the current vertex.
 

Public Attributes

ImmediateBuffer buffer [NB_IMMEDIATE_BUFFERS]
 

Detailed Description

Stores all the buffers used to implement the immediate-mode interface.

Definition at line 526 of file GLUP_context.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Definition at line 668 of file GLUP_context.h.

Constructor & Destructor Documentation

◆ ImmediateState()

GLUP::ImmediateState::ImmediateState ( )
inline

ImmediateState constructor.

Definition at line 531 of file GLUP_context.h.

◆ ~ImmediateState()

GLUP::ImmediateState::~ImmediateState ( )
inline

ImmediateState destructor.

Definition at line 549 of file GLUP_context.h.

Member Function Documentation

◆ begin()

void GLUP::ImmediateState::begin ( GLUPprimitive  primitive)
inline

Configures the immediate state for rendering primitives of a given type.

Parameters
[in]primitivetype of the primitives to be rendered

Definition at line 584 of file GLUP_context.h.

◆ buffers_are_full()

bool GLUP::ImmediateState::buffers_are_full ( )
inline

Tests whether the buffers are full.

When buffers are fulled, their contents need to be sent to OpenGL before calling reset(). These operations are done by the Context.

Definition at line 612 of file GLUP_context.h.

◆ copy_element()

void GLUP::ImmediateState::copy_element ( index_t  to,
index_t  from 
)
inline

Copies an element, i.e. all the attributes attached to a vertex.

Parameters
[in]toindex of the destination vertex
[in]fromindex of the source vertex

Only attributes that are enabled are copied.

Definition at line 572 of file GLUP_context.h.

◆ max_current_vertex()

index_t GLUP::ImmediateState::max_current_vertex ( ) const
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 653 of file GLUP_context.h.

◆ nb_primitives()

index_t GLUP::ImmediateState::nb_primitives ( ) const
inline

Gets the number of primitives stored in the buffers.

Definition at line 641 of file GLUP_context.h.

◆ nb_vertices()

index_t GLUP::ImmediateState::nb_vertices ( ) const
inline

Gets the number of vertices stored in the buffers.

Definition at line 634 of file GLUP_context.h.

◆ next_vertex()

void GLUP::ImmediateState::next_vertex ( )
inline

Advances to the next vertex.

This copies all the current values of all enabled attributes to the current vertex position.

Definition at line 599 of file GLUP_context.h.

◆ primitive()

GLUPprimitive GLUP::ImmediateState::primitive ( ) const
inline

Gets the primitive currently rendered, i.e. the argument to the latest invocation of begin()

Definition at line 627 of file GLUP_context.h.

◆ reset()

void GLUP::ImmediateState::reset ( )
inline

Resets the current vertex index to zero.

Definition at line 619 of file GLUP_context.h.

◆ set_current_vertex()

void GLUP::ImmediateState::set_current_vertex ( index_t  v)
inline

Sets the current vertex.

This defines the number of stored vertices in this buffer.

Parameters
[in]vthe index of the current vertex.

Definition at line 663 of file GLUP_context.h.

◆ VAO()

GLuint & GLUP::ImmediateState::VAO ( )
inline

Gets the Vertex Array Object.

Returns
a modifiable reference to the Id of the Vertex Array Object. Can be 0 if no VAO is used.

Definition at line 561 of file GLUP_context.h.

Member Data Documentation

◆ buffer

ImmediateBuffer GLUP::ImmediateState::buffer[NB_IMMEDIATE_BUFFERS]

Definition at line 669 of file GLUP_context.h.


The documentation for this class was generated from the following file: