49 lines
1.2 KiB
C
49 lines
1.2 KiB
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include "pxl8_mesh.h"
|
||
|
|
#include "pxl8_types.h"
|
||
|
|
#include "pxl8_vxl.h"
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
extern "C" {
|
||
|
|
#endif
|
||
|
|
|
||
|
|
typedef struct pxl8_vxl_render_state {
|
||
|
|
bool wireframe;
|
||
|
|
} pxl8_vxl_render_state;
|
||
|
|
|
||
|
|
pxl8_vxl_render_state* pxl8_vxl_render_state_create(void);
|
||
|
|
void pxl8_vxl_render_state_destroy(pxl8_vxl_render_state* state);
|
||
|
|
void pxl8_vxl_set_wireframe(pxl8_vxl_render_state* state, bool wireframe);
|
||
|
|
|
||
|
|
typedef struct pxl8_vxl_mesh_config {
|
||
|
|
bool ambient_occlusion;
|
||
|
|
bool vertex_heights;
|
||
|
|
f32 ao_strength;
|
||
|
|
f32 texture_scale;
|
||
|
|
i32 chunk_x;
|
||
|
|
i32 chunk_y;
|
||
|
|
i32 chunk_z;
|
||
|
|
u64 seed;
|
||
|
|
} pxl8_vxl_mesh_config;
|
||
|
|
|
||
|
|
#define PXL8_VXL_MESH_CONFIG_DEFAULT ((pxl8_vxl_mesh_config){ \
|
||
|
|
.ambient_occlusion = true, \
|
||
|
|
.vertex_heights = true, \
|
||
|
|
.ao_strength = 0.2f, \
|
||
|
|
.texture_scale = 1.0f, \
|
||
|
|
.chunk_x = 0, \
|
||
|
|
.chunk_y = 0, \
|
||
|
|
.chunk_z = 0, \
|
||
|
|
.seed = 12345 \
|
||
|
|
})
|
||
|
|
|
||
|
|
pxl8_mesh* pxl8_vxl_build_mesh(const pxl8_vxl_chunk* chunk,
|
||
|
|
const pxl8_vxl_chunk** neighbors,
|
||
|
|
const pxl8_vxl_block_registry* registry,
|
||
|
|
const pxl8_vxl_mesh_config* config);
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
}
|
||
|
|
#endif
|