separation to vec.h, generic vector ops, camera class and its usage for spatial rendering

This commit is contained in:
2024-07-29 15:21:39 +03:00
parent 86d135281e
commit ff077c5d0d
12 changed files with 207 additions and 62 deletions

View File

@ -3,8 +3,8 @@
#define CIRCLES_H
#include "../util.h"
#include "internal_api.h"
#include "../context.h"
#include "internal_api.h"
#include <SDL2/SDL.h>
#include <stb_ds.h>

View File

@ -7,6 +7,7 @@
#include "../context.h"
#include "../util.h"
#include "quad_element_buffer.h"
#include "internal_api.h"
#include <stb_ds.h>

View File

@ -4,6 +4,7 @@
#include "../textures.h"
#include "../context.h"
#include "internal_api.h"
#include <stb_ds.h>
@ -66,6 +67,8 @@ static void draw_uncolored_space_traingle_batch(struct mesh_batch *batch,
t_rect srcrect = textures_get_srcrect(&ctx.texture_cache, texture_key);
t_rect dims = textures_get_dims(&ctx.texture_cache, texture_key);
/* TODO: fast path for uvs mapped directly on srcrect corners? */
const float wr = (float)srcrect.w / (float)dims.w;
const float hr = (float)srcrect.h / (float)dims.h;
const float xr = (float)srcrect.x / (float)dims.w;