This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct A { | |
| int size; | |
| int capacity; | |
| T *data; | |
| }; | |
| typedef struct A A; | |
| void A_(Create)(A *array, int capacity); | |
| void A_(Destroy)(A *array); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum { BMAX = 32, BCUT = BMAX / 2, BHEIGHT = 6 }; | |
| typedef uint8_t BIndex; | |
| struct BNode { | |
| BIndex length; | |
| Key keys[BMAX]; | |
| union { | |
| BNode *children[BMAX]; | |
| Value values[BMAX]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void DrawMesh(Gob_Mesh *mesh) { | |
| glVertexPointer(3, GL_FLOAT, mesh->positions.stride, GOB_BUFFER(mesh->positions.buffer)->data + mesh->positions.start); | |
| char *index_buffer = GOB_BUFFER(mesh->indices.buffer)->data; | |
| uint8_t index_size = mesh->indices.index_size; | |
| GLenum index_type = (index_size == 2) ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT; | |
| for (size_t i = 0; i < mesh->sections_count; i++) { | |
| glDrawElements(GL_TRIANGLES, mesh->sections[i].index_count, index_type, index_buffer + index_size * mesh->sections[i].index_start); | |
| } | |
| } |
OlderNewer