#include "main/glheader.h"
Data Structures | |
| struct | GLvector4f |
| Wrap all the information about vectors up in a struct. More... | |
Defines | |
| #define | VEC_DIRTY_0 0x1 |
| #define | VEC_DIRTY_1 0x2 |
| #define | VEC_DIRTY_2 0x4 |
| #define | VEC_DIRTY_3 0x8 |
| #define | VEC_MALLOC 0x10 |
| #define | VEC_NOT_WRITEABLE 0x40 |
| #define | VEC_BAD_STRIDE 0x100 |
| #define | VEC_SIZE_1 VEC_DIRTY_0 |
| #define | VEC_SIZE_2 (VEC_DIRTY_0|VEC_DIRTY_1) |
| #define | VEC_SIZE_3 (VEC_DIRTY_0|VEC_DIRTY_1|VEC_DIRTY_2) |
| #define | VEC_SIZE_4 (VEC_DIRTY_0|VEC_DIRTY_1|VEC_DIRTY_2|VEC_DIRTY_3) |
| #define | VEC_ELT(v, type, i) ( (type *) ( ((GLbyte *) ((v)->data)) + (i) * (v)->stride) ) |
| Given vector <v>, return a pointer (cast to <type *> to the -th element. | |
Functions | |
| void | _mesa_vector4f_init (GLvector4f *v, GLbitfield flags, GLfloat(*storage)[4]) |
| Initialize GLvector objects. | |
| void | _mesa_vector4f_alloc (GLvector4f *v, GLbitfield flags, GLuint count, GLuint alignment) |
| Initialize GLvector objects and allocate storage. | |
| void | _mesa_vector4f_free (GLvector4f *v) |
| Vector deallocation. | |
| void | _mesa_vector4f_print (const GLvector4f *v, const GLubyte *, GLboolean) |
| For debugging. | |
| void | _mesa_vector4f_clean_elem (GLvector4f *vec, GLuint nr, GLuint elt) |
| Given a vector [count][4] of floats, set all the [][elt] values to 0 (if elt = 0, 1, 2) or 1.0 (if elt = 3). | |
| #define VEC_BAD_STRIDE 0x100 |
| #define VEC_DIRTY_0 0x1 |
| #define VEC_DIRTY_1 0x2 |
| #define VEC_DIRTY_2 0x4 |
| #define VEC_DIRTY_3 0x8 |
| #define VEC_ELT | ( | v, | |||
| type, | |||||
| i | ) | ( (type *) ( ((GLbyte *) ((v)->data)) + (i) * (v)->stride) ) |
Given vector <v>, return a pointer (cast to <type *> to the -th element.
End up doing a lot of slow imuls if not careful.
| #define VEC_MALLOC 0x10 |
| #define VEC_NOT_WRITEABLE 0x40 |
| #define VEC_SIZE_1 VEC_DIRTY_0 |
| #define VEC_SIZE_2 (VEC_DIRTY_0|VEC_DIRTY_1) |
| #define VEC_SIZE_3 (VEC_DIRTY_0|VEC_DIRTY_1|VEC_DIRTY_2) |
| #define VEC_SIZE_4 (VEC_DIRTY_0|VEC_DIRTY_1|VEC_DIRTY_2|VEC_DIRTY_3) |
| void _mesa_vector4f_alloc | ( | GLvector4f * | v, | |
| GLbitfield | flags, | |||
| GLuint | count, | |||
| GLuint | alignment | |||
| ) |
Initialize GLvector objects and allocate storage.
| v | the vector object | |
| flags | bitwise-OR of VEC_* flags | |
| count | number of elements to allocate in vector | |
| alignment | desired memory alignment for the data (in bytes) |
| void _mesa_vector4f_clean_elem | ( | GLvector4f * | vec, | |
| GLuint | nr, | |||
| GLuint | elt | |||
| ) |
Given a vector [count][4] of floats, set all the [][elt] values to 0 (if elt = 0, 1, 2) or 1.0 (if elt = 3).
| void _mesa_vector4f_free | ( | GLvector4f * | v | ) |
Vector deallocation.
Free whatever memory is pointed to by the vector's storage field if the VEC_MALLOC flag is set. DO NOT free the GLvector object itself, though.
| void _mesa_vector4f_init | ( | GLvector4f * | v, | |
| GLbitfield | flags, | |||
| GLfloat * | storage[4] | |||
| ) |
Initialize GLvector objects.
| v | the vector object to initialize. | |
| flags | bitwise-OR of VEC_* flags | |
| storage | pointer to storage for the vector's data |
| void _mesa_vector4f_print | ( | const GLvector4f * | v, | |
| const GLubyte * | , | |||
| GLboolean | ||||
| ) |
For debugging.
1.5.4