31 lines
911 B
C
31 lines
911 B
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include "pxl8_bsp.h"
|
||
|
|
#include "pxl8_gfx.h"
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
extern "C" {
|
||
|
|
#endif
|
||
|
|
|
||
|
|
typedef struct pxl8_bsp_render_state {
|
||
|
|
pxl8_gfx_material* materials;
|
||
|
|
u8* render_face_flags;
|
||
|
|
u32 num_materials;
|
||
|
|
u32 num_faces;
|
||
|
|
} pxl8_bsp_render_state;
|
||
|
|
|
||
|
|
pxl8_bsp_render_state* pxl8_bsp_render_state_create(u32 num_faces);
|
||
|
|
void pxl8_bsp_render_state_destroy(pxl8_bsp_render_state* state);
|
||
|
|
|
||
|
|
void pxl8_bsp_render(pxl8_gfx* gfx, const pxl8_bsp* bsp,
|
||
|
|
pxl8_bsp_render_state* state, pxl8_vec3 camera_pos);
|
||
|
|
void pxl8_bsp_render_face(pxl8_gfx* gfx, const pxl8_bsp* bsp, u32 face_id,
|
||
|
|
const pxl8_gfx_material* material);
|
||
|
|
void pxl8_bsp_set_material(pxl8_bsp_render_state* state, u16 material_id,
|
||
|
|
const pxl8_gfx_material* material);
|
||
|
|
void pxl8_bsp_set_wireframe(pxl8_bsp_render_state* state, bool wireframe);
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
}
|
||
|
|
#endif
|