Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
vertexbuffer.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define glBegin   vertex_buffer_glBegin
 Here we overload the default OpenGL commands, in order to call the corresponding vertex buffer operations defined above.
 
#define glEnd   vertex_buffer_glEnd
 
#define glVertex2d   vertex_buffer_glVertex2d
 
#define glVertex2f   vertex_buffer_glVertex2d
 
#define glVertex3d   vertex_buffer_glVertex3d
 
#define glColor3f   vertex_buffer_glColor3f
 
#define glNormal3d   vertex_buffer_glNormal3d
 

Functions

static void vertex_buffer_push_index (unsigned int i)
 
void vertex_buffer_setup ()
 
void vertex_buffer_free ()
 
static void vertex_buffer_glBegin (unsigned int state)
 
static void vertex_buffer_glEnd ()
 
static void vertex_buffer_glColor3f (float r, float g, float b)
 
static void vertex_buffer_glNormal3d (double nx, double ny, double nz)
 
static void vertex_buffer_glVertex3d (double x, double y, double z)
 
static void vertex_buffer_glVertex2d (double x, double y)
 

Variables

struct { 
 
   Array *   position 
 
   Array *   normal 
 
   Array *   color 
 
   Array *   index 
 
   float   modelview [16] 
 
   int   type 
 
   int   dim 
 
   int   vertex 
 
   int   nvertex 
 
   bool   visible 
 
   int   line_loop 
 
   int   lines 
 
   int   line_strip 
 
   int   quads 
 
   int   polygon 
 
   int   fan 
 
   int   state 
 
VertexBuffer 
 

Macro Definition Documentation

◆ glBegin

Here we overload the default OpenGL commands, in order to call the corresponding vertex buffer operations defined above.

Definition at line 242 of file vertexbuffer.h.

◆ glColor3f

Definition at line 247 of file vertexbuffer.h.

◆ glEnd

Definition at line 243 of file vertexbuffer.h.

◆ glNormal3d

#define glNormal3d   vertex_buffer_glNormal3d

Definition at line 248 of file vertexbuffer.h.

◆ glVertex2d

#define glVertex2d   vertex_buffer_glVertex2d

Definition at line 244 of file vertexbuffer.h.

◆ glVertex2f

#define glVertex2f   vertex_buffer_glVertex2d

Definition at line 245 of file vertexbuffer.h.

◆ glVertex3d

#define glVertex3d   vertex_buffer_glVertex3d

Definition at line 246 of file vertexbuffer.h.

Function Documentation

◆ vertex_buffer_free()

void vertex_buffer_free ( )

Definition at line 51 of file vertexbuffer.h.

References array_free(), VertexBuffer, and x.

Referenced by display_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vertex_buffer_glBegin()

static void vertex_buffer_glBegin ( unsigned int  state)
static

Definition at line 63 of file vertexbuffer.h.

References get_view(), GL_LINE_LOOP, GL_LINE_STRIP, GL_LINES, GL_MODELVIEW_MATRIX, GL_POLYGON, GL_QUADS, GL_TRIANGLE_FAN, glBegin, glGetFloatv, i, q, state, swap, VertexBuffer, view(), and x.

Here is the call graph for this function:

◆ vertex_buffer_glColor3f()

static void vertex_buffer_glColor3f ( float  r,
float  g,
float  b 
)
static

Definition at line 190 of file vertexbuffer.h.

References array_append(), b, color, g, glColor3f, VertexBuffer, x, y, and z.

Here is the call graph for this function:

◆ vertex_buffer_glEnd()

static void vertex_buffer_glEnd ( )
static

Definition at line 114 of file vertexbuffer.h.

References assert, GL_LINE_LOOP, GL_LINE_STRIP, GL_LINES, GL_POLYGON, GL_QUADS, GL_TRIANGLE_FAN, glEnd, i, j, type, vertex_buffer_push_index(), and VertexBuffer.

Here is the call graph for this function:

◆ vertex_buffer_glNormal3d()

static void vertex_buffer_glNormal3d ( double  nx,
double  ny,
double  nz 
)
static

Definition at line 200 of file vertexbuffer.h.

References array_append(), glNormal3d, normal, VertexBuffer, x, y, and z.

Here is the call graph for this function:

◆ vertex_buffer_glVertex2d()

static void vertex_buffer_glVertex2d ( double  x,
double  y 
)
static

Definition at line 224 of file vertexbuffer.h.

References array_append(), glVertex3d, v, VertexBuffer, x, and y.

Here is the call graph for this function:

◆ vertex_buffer_glVertex3d()

static void vertex_buffer_glVertex3d ( double  x,
double  y,
double  z 
)
static

Definition at line 210 of file vertexbuffer.h.

References array_append(), glVertex3d, v, VertexBuffer, x, y, and z.

Here is the call graph for this function:

◆ vertex_buffer_push_index()

static void vertex_buffer_push_index ( unsigned int  i)
static

Definition at line 34 of file vertexbuffer.h.

References array_append(), i, and VertexBuffer.

Referenced by vertex_buffer_glEnd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vertex_buffer_setup()

void vertex_buffer_setup ( )

Definition at line 40 of file vertexbuffer.h.

References array_new(), and VertexBuffer.

Referenced by display_command().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ color

Array * color

Definition at line 18 of file vertexbuffer.h.

Referenced by draw_lines(), if(), if(), if(), if(), and vertex_buffer_glColor3f().

◆ dim

int dim

Definition at line 21 of file vertexbuffer.h.

Referenced by event_init(), and includes().

◆ fan

int fan

Definition at line 27 of file vertexbuffer.h.

◆ index

◆ line_loop

int line_loop

Definition at line 26 of file vertexbuffer.h.

◆ line_strip

int line_strip

Definition at line 26 of file vertexbuffer.h.

◆ lines

int lines

Definition at line 26 of file vertexbuffer.h.

Referenced by if(), and input_read_profiles().

◆ modelview

float modelview[16]

Definition at line 19 of file vertexbuffer.h.

◆ normal

◆ nvertex

int nvertex

Definition at line 22 of file vertexbuffer.h.

◆ polygon

int polygon

Definition at line 27 of file vertexbuffer.h.

◆ position

Array* position

Definition at line 18 of file vertexbuffer.h.

Referenced by event_acceleration().

◆ quads

int quads

Definition at line 27 of file vertexbuffer.h.

◆ state

int state

Definition at line 28 of file vertexbuffer.h.

Referenced by half_column(), and vertex_buffer_glBegin().

◆ type

int type

Definition at line 20 of file vertexbuffer.h.

Referenced by vertex_buffer_glEnd().

◆ vertex

int vertex

Definition at line 22 of file vertexbuffer.h.

◆ [struct]

struct { ... } VertexBuffer
Initial value:
= {
.visible = false,
.modelview = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }
}

Vertex buffers

They are used to store the vertex coordinates, normals and colors computed by the the OpenGL commands typically used by [draw.h]().

These vertex buffers are the minimal information required to render the objects.

In combination with the tiny implementation this allows to generate geometries using OpenGL commands but without any OpenGL library.

Referenced by display_command(), display_send(), foreach_visible(), vertex_buffer_free(), vertex_buffer_glBegin(), vertex_buffer_glColor3f(), vertex_buffer_glEnd(), vertex_buffer_glNormal3d(), vertex_buffer_glVertex2d(), vertex_buffer_glVertex3d(), vertex_buffer_push_index(), and vertex_buffer_setup().

◆ visible

bool visible

Definition at line 23 of file vertexbuffer.h.