![]() |
naev 0.12.5
|
Handles OpenGL vbos. More...
#include "opengl.h"
Go to the source code of this file.
Data Structures | |
| struct | gl_vbo |
| Contains the VBO. More... | |
Macros | |
| #define | BUFFER_OFFSET(i) |
Enumerations | |
| enum | gl_vboType { NGL_VBO_NULL , NGL_VBO_STREAM , NGL_VBO_DYNAMIC , NGL_VBO_STATIC } |
| VBO types. More... | |
Functions | |
| static gl_vbo * | gl_vboCreate (GLenum target, GLsizei size, const void *data, GLenum usage) |
| Creates a VBO. | |
| int | gl_initVBO (void) |
| Initializes the OpenGL VBO subsystem. | |
| void | gl_exitVBO (void) |
| Exits the OpenGL VBO subsystem. | |
| void | gl_vboData (gl_vbo *vbo, GLsizei size, const void *data) |
| Reloads new data or grows the size of the vbo. | |
| void | gl_vboSubData (gl_vbo *vbo, GLint offset, GLsizei size, const void *data) |
| Loads some data into the VBO. | |
| gl_vbo * | gl_vboCreateStream (GLsizei size, const void *data) |
| Creates a stream vbo. | |
| gl_vbo * | gl_vboCreateDynamic (GLsizei size, const void *data) |
| Creates a dynamic vbo. | |
| gl_vbo * | gl_vboCreateStatic (GLsizei size, const void *data) |
| Creates a stream vbo. | |
| void * | gl_vboMap (gl_vbo *vbo) |
| Maps a buffer. | |
| void | gl_vboUnmap (gl_vbo *vbo) |
| Unmaps a buffer. | |
| void | gl_vboActivateAttribOffset (gl_vbo *vbo, GLuint index, GLuint offset, GLint size, GLenum type, GLsizei stride) |
| Activates a VBO's offset. | |
| void | gl_vboDestroy (gl_vbo *vbo) |
| Destroys a VBO. | |
Handles OpenGL vbos.
Definition in file opengl_vbo.c.
| #define BUFFER_OFFSET | ( | i | ) |
Taken from OpengL spec.
Definition at line 11 of file opengl_vbo.c.
| enum gl_vboType |
VBO types.
| Enumerator | |
|---|---|
| NGL_VBO_NULL | No VBO type. |
| NGL_VBO_STREAM | VBO streaming type. |
| NGL_VBO_DYNAMIC | VBO dynamic type. |
| NGL_VBO_STATIC | VBO static type. |
Definition at line 17 of file opengl_vbo.c.
| void gl_exitVBO | ( | void | ) |
Exits the OpenGL VBO subsystem.
Definition at line 53 of file opengl_vbo.c.
| int gl_initVBO | ( | void | ) |
Initializes the OpenGL VBO subsystem.
Definition at line 45 of file opengl_vbo.c.
| void gl_vboActivateAttribOffset | ( | gl_vbo * | vbo, |
| GLuint | index, | ||
| GLuint | offset, | ||
| GLint | size, | ||
| GLenum | type, | ||
| GLsizei | stride ) |
Activates a VBO's offset.
| vbo | VBO to activate. |
| index | Index of generic vertex attribute. |
| offset | Offset (in bytes). |
| size | Specifies components per point. |
| type | Type of data (usually GL_FLOAT). |
| stride | Offset between consecutive points. |
Definition at line 224 of file opengl_vbo.c.
|
static |
Creates a VBO.
Prototypes.
| target | Target to create to (usually GL_ARRAY_BUFFER). |
| size | Size of the buffer (in bytes). |
| data | The actual data to use. |
| usage | Usage to use. |
Definition at line 66 of file opengl_vbo.c.
| gl_vbo * gl_vboCreateDynamic | ( | GLsizei | size, |
| const void * | data ) |
Creates a dynamic vbo.
| size | Size of the dynamic vbo (multiply by sizeof(type)). |
| data | Data for the VBO. |
Definition at line 160 of file opengl_vbo.c.
| gl_vbo * gl_vboCreateStatic | ( | GLsizei | size, |
| const void * | data ) |
Creates a stream vbo.
| size | Size of the stream vbo (multiply by sizeof(type)). |
| data | Data for the VBO. |
Definition at line 177 of file opengl_vbo.c.
| gl_vbo * gl_vboCreateStream | ( | GLsizei | size, |
| const void * | data ) |
Creates a stream vbo.
| size | Size of the stream vbo (multiply by sizeof(type)). |
| data | Data for the VBO. |
Definition at line 143 of file opengl_vbo.c.
| void gl_vboData | ( | gl_vbo * | vbo, |
| GLsizei | size, | ||
| const void * | data ) |
Reloads new data or grows the size of the vbo.
| vbo | VBO to set new data of. |
| size | Size of new data. |
| data | New data. |
Definition at line 96 of file opengl_vbo.c.
| void gl_vboDestroy | ( | gl_vbo * | vbo | ) |
Destroys a VBO.
| vbo | VBO to destroy. (If NULL, function does nothing.) |
Definition at line 244 of file opengl_vbo.c.
| void * gl_vboMap | ( | gl_vbo * | vbo | ) |
Maps a buffer.
| vbo | VBO to map. |
Definition at line 194 of file opengl_vbo.c.
| void gl_vboSubData | ( | gl_vbo * | vbo, |
| GLint | offset, | ||
| GLsizei | size, | ||
| const void * | data ) |
Loads some data into the VBO.
| vbo | VBO to load data into. |
| offset | Offset location of the data (in bytes). |
| size | Size of the data (in bytes). |
| data | Pointer to the data. |
Definition at line 128 of file opengl_vbo.c.
| void gl_vboUnmap | ( | gl_vbo * | vbo | ) |