major gfx refactor
This commit is contained in:
parent
0c0aa792c1
commit
3c3e961995
58 changed files with 3681 additions and 2982 deletions
|
|
@ -44,6 +44,8 @@ static const char* pxl8_ffi_cdefs =
|
|||
"void pxl8_set_colormap(pxl8_colormap* cm, const u8* data, u32 size);\n"
|
||||
"void pxl8_gfx_ensure_blend_tables(pxl8_gfx* gfx);\n"
|
||||
"i32 pxl8_gfx_get_width(pxl8_gfx* ctx);\n"
|
||||
"void pxl8_gfx_set_wireframe(pxl8_gfx* gfx, bool enabled);\n"
|
||||
"bool pxl8_gfx_get_wireframe(const pxl8_gfx* gfx);\n"
|
||||
"void pxl8_2d_circle(pxl8_gfx* ctx, i32 x, i32 y, i32 r, u32 color);\n"
|
||||
"void pxl8_2d_circle_fill(pxl8_gfx* ctx, i32 x, i32 y, i32 r, u32 color);\n"
|
||||
"void pxl8_2d_clear(pxl8_gfx* ctx, u32 color);\n"
|
||||
|
|
@ -197,6 +199,7 @@ static const char* pxl8_ffi_cdefs =
|
|||
"void pxl8_anim_stop(pxl8_anim* anim);\n"
|
||||
"void pxl8_anim_update(pxl8_anim* anim, f32 dt);\n"
|
||||
"\n"
|
||||
"typedef union { struct { float x, y; }; struct { float yaw, pitch; }; float v[2]; } pxl8_vec2;\n"
|
||||
"typedef struct { float x, y, z; } pxl8_vec3;\n"
|
||||
"typedef struct { float x, y, z, w; } pxl8_vec4;\n"
|
||||
"typedef struct { float m[16]; } pxl8_mat4;\n"
|
||||
|
|
@ -244,31 +247,7 @@ static const char* pxl8_ffi_cdefs =
|
|||
"typedef struct pxl8_projected_point { i32 x; i32 y; f32 depth; bool visible; } pxl8_projected_point;\n"
|
||||
"pxl8_projected_point pxl8_3d_camera_world_to_screen(const pxl8_3d_camera* cam, pxl8_vec3 world_pos, u32 screen_width, u32 screen_height);\n"
|
||||
"\n"
|
||||
"typedef enum pxl8_gfx_effect { PXL8_GFX_EFFECT_GLOWS = 0 } pxl8_gfx_effect;\n"
|
||||
"\n"
|
||||
"typedef enum pxl8_glow_shape { PXL8_GLOW_CIRCLE = 0, PXL8_GLOW_DIAMOND = 1, PXL8_GLOW_SHAFT = 2 } pxl8_glow_shape;\n"
|
||||
"\n"
|
||||
"typedef struct pxl8_glow {\n"
|
||||
" u8 color;\n"
|
||||
" u16 depth;\n"
|
||||
" u8 height;\n"
|
||||
" u16 intensity;\n"
|
||||
" u8 radius;\n"
|
||||
" pxl8_glow_shape shape;\n"
|
||||
" i16 x;\n"
|
||||
" i16 y;\n"
|
||||
"} pxl8_glow;\n"
|
||||
"\n"
|
||||
"void pxl8_gfx_apply_effect(pxl8_gfx* gfx, pxl8_gfx_effect effect, const void* params, u32 count);\n"
|
||||
"void pxl8_gfx_blend_tables_update(pxl8_gfx* gfx);\n"
|
||||
"\n"
|
||||
"typedef struct pxl8_glows pxl8_glows;\n"
|
||||
"pxl8_glows* pxl8_glows_create(u32 capacity);\n"
|
||||
"void pxl8_glows_destroy(pxl8_glows* glows);\n"
|
||||
"void pxl8_glows_add(pxl8_glows* glows, i16 x, i16 y, u8 radius, u16 intensity, u8 color, u8 shape);\n"
|
||||
"void pxl8_glows_clear(pxl8_glows* glows);\n"
|
||||
"u32 pxl8_glows_count(const pxl8_glows* glows);\n"
|
||||
"void pxl8_glows_render(pxl8_glows* glows, pxl8_gfx* gfx);\n"
|
||||
"void pxl8_gfx_colormap_update(pxl8_gfx* gfx);\n"
|
||||
"\n"
|
||||
"void pxl8_3d_begin_frame(pxl8_gfx* gfx, const pxl8_3d_camera* camera, const pxl8_lights* lights, const pxl8_3d_uniforms* uniforms);\n"
|
||||
|
|
@ -293,10 +272,8 @@ static const char* pxl8_ffi_cdefs =
|
|||
" bool dither;\n"
|
||||
" bool double_sided;\n"
|
||||
" bool dynamic_lighting;\n"
|
||||
" bool emissive;\n"
|
||||
" bool per_pixel;\n"
|
||||
" bool vertex_color_passthrough;\n"
|
||||
" bool wireframe;\n"
|
||||
" f32 emissive_intensity;\n"
|
||||
"} pxl8_gfx_material;\n"
|
||||
"\n"
|
||||
"typedef struct pxl8_vertex {\n"
|
||||
|
|
@ -446,7 +423,6 @@ static const char* pxl8_ffi_cdefs =
|
|||
"pxl8_ray pxl8_world_sweep(const pxl8_world* world, pxl8_vec3 from, pxl8_vec3 to, float radius);\n"
|
||||
"void pxl8_world_render(pxl8_world* world, pxl8_gfx* gfx, pxl8_vec3 camera_pos);\n"
|
||||
"void pxl8_world_set_bsp_material(pxl8_world* world, u16 material_id, const pxl8_gfx_material* material);\n"
|
||||
"void pxl8_world_set_wireframe(pxl8_world* world, bool enabled);\n"
|
||||
"i32 pxl8_world_get_render_distance(const pxl8_world* world);\n"
|
||||
"void pxl8_world_set_render_distance(pxl8_world* world, i32 distance);\n"
|
||||
"i32 pxl8_world_get_sim_distance(const pxl8_world* world);\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue