9 #include "../voxtrees/tree.h"
14 typedef Uint32 square[16] __attribute__((aligned(16)));
16 #define VOX_TEXTURE_SIZE (32*32*32)
17 #define VOX_TEXTURE_SIDE 32
34 square *square_output;
35 unsigned int squares_num, ws;
37 unsigned int hs, quality;
81 #define VOX_QUALITY_BEST 0b00
91 #define VOX_QUALITY_FAST 0b01
100 #define VOX_QUALITY_ADAPTIVE 0b10
109 #define VOX_QUALITY_RAY_MERGE 0b0100
117 #define VOX_QUALITY_RAY_MERGE_ACCURATE 0b1000
122 #define VOX_QUALITY_RM_MASK 0b1100
127 #define VOX_QUALITY_MODE_MASK 0b11
130 #define VOX_QUALITY_RM_MAX 0b1000
131 #define VOX_QUALITY_MODE_MAX 0b10
VOX_EXPORT void vox_context_set_light_manager(struct vox_rnd_ctx *ctx, struct vox_light_manager *light_manager)
Light manager setter for renderer context.
VOX_EXPORT int vox_context_set_quality(struct vox_rnd_ctx *ctx, unsigned int quality)
Set quality of the renderer.
VOX_EXPORT void vox_context_set_camera(struct vox_rnd_ctx *ctx, struct vox_camera *camera)
Camera setter for renderer context.
VOX_EXPORT void vox_context_set_scene(struct vox_rnd_ctx *ctx, struct vox_node *scene)
Scene setter for renderer context.
VOX_EXPORT void vox_destroy_context(struct vox_rnd_ctx *ctx)
Free context after use.
VOX_EXPORT void vox_redraw(struct vox_rnd_ctx *ctx)
Redraw a window associated with this context.
VOX_EXPORT struct vox_rnd_ctx * vox_make_context_from_surface(SDL_Surface *surface)
Make a renderer context from SDL surface.
VOX_EXPORT struct vox_rnd_ctx * vox_make_context_and_window(unsigned int width, unsigned int height)
Create a window and attach context to it.
VOX_EXPORT void vox_render(struct vox_rnd_ctx *ctx)
Render a scene on SDL surface.
A generic camera class.
Definition: camera.h:135
Voxel tree/node data structure.
A renderer context.
Definition: renderer.h:45
struct vox_light_manager * light_manager
A light manager associated with the context.
Definition: renderer.h:66
SDL_Surface * surface
A surface the context will draw to.
Definition: renderer.h:49
SDL_Window * window
A window associated with the context, if any.
Definition: renderer.h:46
struct vox_node * scene
A scene associated with the context.
Definition: renderer.h:52
struct vox_camera * camera
A camera associated with the context.
Definition: renderer.h:59