generalization of deferred commands and any_gl rendering where appropriate

This commit is contained in:
veclavtalica
2025-01-03 21:01:26 +03:00
parent edcb7fc39c
commit 33471b4c46
8 changed files with 347 additions and 321 deletions

View File

@ -1,6 +1,8 @@
#include "twn_draw.h"
#include "twn_draw_c.h"
#include <stb_ds.h>
#include <stdbool.h>
static float start_cache, end_cache, density_cache;
@ -21,7 +23,17 @@ void apply_fog(void) {
if (!fog_used)
return;
finally_apply_fog(start_cache, end_cache, density_cache, color_cache);
DeferredCommand command = {
.type = DEFERRED_COMMAND_TYPE_APPLY_FOG,
.apply_fog = (DeferredCommandApplyFog){
.start = start_cache,
.end = end_cache,
.density = density_cache,
.color = color_cache
}
};
arrpush(deferred_commands, command);
}
@ -29,5 +41,9 @@ void pop_fog(void) {
if (!fog_used)
return;
finally_pop_fog();
DeferredCommand command = {
.type = DEFERRED_COMMAND_TYPE_POP_FOG,
};
arrpush(deferred_commands, command);
}