clang-format on /apps/demos/bunnymark files

This commit is contained in:
2024-10-08 01:20:42 +03:00
parent 78034b69f5
commit 5c91423fbb
7 changed files with 70 additions and 71 deletions

View File

@ -245,6 +245,8 @@ void use_texture_mode(TextureMode mode) {
VertexBufferBuilder build_vertex_buffer(VertexBuffer buffer, size_t bytes) {
glBindBuffer(GL_ARRAY_BUFFER, buffer);
glBufferData(GL_ARRAY_BUFFER, bytes, NULL, GL_STREAM_DRAW);
if (bytes == 0)
SDL_TriggerBreakpoint();
void *mapping = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
if (!mapping)
CRY("build_vertex_buffer", "Error mapping a vertex array buffer");
@ -282,7 +284,6 @@ void finally_render_sprites(const Primitive2D primitives[],
{
/* TODO: maybe do, dunno */
// glBindBuffer(GL_VERTEX_ARRAY, vertex_buffer);
(void)buffer;
GLsizei off;
GLsizei voff;

View File

@ -70,7 +70,6 @@ void clear_draw_buffer(void) {
(1.0f / 255) * 230,
(1.0f / 255) * 230, 1);
/* TODO: don't clear color when skybox is applied? */
glClear(GL_COLOR_BUFFER_BIT |
GL_DEPTH_BUFFER_BIT |
GL_STENCIL_BUFFER_BIT);

View File

@ -138,6 +138,7 @@ void render_sprites(const Primitive2D primitives[],
const size_t cur = batch.mode == TEXTURE_MODE_GHOSTLY ? i : batch.size - i - 1;
const SpritePrimitive sprite = primitives[cur].sprite;
/* TODO: try caching it */
const Rect srcrect =
textures_get_srcrect(&ctx.texture_cache, primitives[cur].sprite.texture_key);