wip gfx refactor
This commit is contained in:
parent
0c0aa792c1
commit
e92748c2d9
42 changed files with 2998 additions and 2824 deletions
|
|
@ -4,39 +4,20 @@
|
|||
#include "pxl8_lights.h"
|
||||
#include "pxl8_math.h"
|
||||
#include "pxl8_mesh.h"
|
||||
#include "pxl8_shader.h"
|
||||
#include "pxl8_types.h"
|
||||
|
||||
typedef struct pxl8_bsp pxl8_bsp;
|
||||
typedef struct pxl8_gfx pxl8_gfx;
|
||||
|
||||
typedef struct pxl8_3d_uniforms {
|
||||
u8 ambient;
|
||||
pxl8_vec3 celestial_dir;
|
||||
f32 celestial_intensity;
|
||||
u8 fog_color;
|
||||
f32 fog_density;
|
||||
f32 time;
|
||||
} pxl8_3d_uniforms;
|
||||
|
||||
typedef struct pxl8_3d_frame_desc {
|
||||
const pxl8_bsp* bsp;
|
||||
const pxl8_3d_camera* camera;
|
||||
const pxl8_lights* lights;
|
||||
const pxl8_sdf* sdf;
|
||||
pxl8_3d_uniforms uniforms;
|
||||
} pxl8_3d_frame_desc;
|
||||
|
||||
typedef struct pxl8_3d_frame {
|
||||
const pxl8_bsp* bsp;
|
||||
pxl8_vec3 camera_dir;
|
||||
pxl8_vec3 camera_pos;
|
||||
f32 far_clip;
|
||||
const pxl8_light* lights;
|
||||
u32 lights_count;
|
||||
f32 near_clip;
|
||||
pxl8_mat4 projection;
|
||||
const pxl8_sdf* sdf;
|
||||
pxl8_3d_uniforms uniforms;
|
||||
pxl8_shader_uniforms uniforms;
|
||||
pxl8_mat4 view;
|
||||
} pxl8_3d_frame;
|
||||
|
||||
|
|
@ -45,8 +26,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
void pxl8_3d_set_bsp(pxl8_gfx* gfx, const pxl8_bsp* bsp);
|
||||
void pxl8_3d_set_sdf(pxl8_gfx* gfx, const pxl8_sdf* sdf);
|
||||
void pxl8_3d_begin_frame(pxl8_gfx* gfx, const pxl8_3d_camera* camera, const pxl8_lights* lights, const pxl8_3d_uniforms* uniforms);
|
||||
void pxl8_3d_begin_frame(pxl8_gfx* gfx, const pxl8_3d_camera* camera, const pxl8_lights* lights, const pxl8_shader_uniforms* uniforms);
|
||||
void pxl8_3d_clear(pxl8_gfx* gfx, u8 color);
|
||||
void pxl8_3d_clear_depth(pxl8_gfx* gfx);
|
||||
void pxl8_3d_draw_line(pxl8_gfx* gfx, pxl8_vec3 v0, pxl8_vec3 v1, u8 color);
|
||||
|
|
@ -57,7 +37,7 @@ const pxl8_frustum* pxl8_3d_get_frustum(pxl8_gfx* gfx);
|
|||
const pxl8_mat4* pxl8_3d_get_view_proj(pxl8_gfx* gfx);
|
||||
u32 pxl8_3d_project_points(pxl8_gfx* gfx, const pxl8_vec3* in, pxl8_vec3* out, u32 count, const pxl8_mat4* transform);
|
||||
|
||||
pxl8_3d_frame pxl8_3d_frame_from_camera(const pxl8_3d_camera* camera, const pxl8_3d_uniforms* uniforms);
|
||||
pxl8_3d_frame pxl8_3d_frame_from_camera(const pxl8_3d_camera* camera, const pxl8_shader_uniforms* uniforms);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue