big rendering overhaul (cleaning and api abstraction)

This commit is contained in:
veclavtalica
2025-01-14 23:20:54 +03:00
parent b7cb37c06a
commit 5059802d09
25 changed files with 290 additions and 424 deletions

View File

@ -99,7 +99,7 @@ void render_circle(const CirclePrimitive *circle) {
command.vertices = (AttributeArrayPointer) {
.arity = 2,
.type = GL_FLOAT,
.type = TWN_FLOAT,
.stride = sizeof (Vec2),
.offset = 0,
.buffer = buffer
@ -112,7 +112,11 @@ void render_circle(const CirclePrimitive *circle) {
command.element_count = (num_vertices - 2) * 3;
command.range_end = (num_vertices - 2) * 3;
use_texture_mode(circle->color.a == 255 ? TEXTURE_MODE_OPAQUE : TEXTURE_MODE_GHOSTLY);
command.texture_mode = circle->color.a == 255 ? TEXTURE_MODE_OPAQUE : TEXTURE_MODE_GHOSTLY;
command.pipeline = PIPELINE_2D;
command.depth_range_high = depth_range_high;
command.depth_range_low = depth_range_low;
DeferredCommand final_command = {
.type = DEFERRED_COMMAND_TYPE_DRAW,