maug
Quick and dirty C mini-augmentation library.
Loading...
Searching...
No Matches
retro3d.h File Reference

Lower-level retargetable 3D engine wrapper. More...

Go to the source code of this file.

Data Structures

struct  RETRO3D_PROJ_ARGS
 

Macros

#define RETRO3D_TRACE_LVL   0
 
#define RETRO3D_TEX_FLAG_GENERATE   0x01
 Flag for retro3d_texture_platform_refresh() indicating the platform should generate a new texture, rather than updating the existing.
 
#define RETRO3D_TEX_FLAG_DESTROY   0x02
 Flag for retro3d_texture_platform_refresh() indicating the platform should destroy a texture, rather than updating the existing.
 
#define RETRO3D_TEX_FLAG_DEACTIVATE   0x04
 Flag for retro3d_texture_activate() indicating the platform should deactivate the current texture, rather than activating a new one.
 
#define RETRO3D_TRI_FLAG_NORMAL_X   0x03
 
#define RETRO3D_TRI_FLAG_NORMAL_Y   0x02
 
#define RETRO3D_TRI_FLAG_NORMAL_Z   0x01
 
#define RETRO3D_TRI_FLAG_NORMAL_NEG   0x04
 

Functions

void retro3d_init_projection (struct RETRO3D_PROJ_ARGS *args)
 Setup projection properties to subsequently drawn scenes/frames.
 
void retro3d_init_bg (RETROFLAT_COLOR color, mfix_t fog_draw_dist, mfix_t fog_density)
 Setup background and fog (when supported) for subsequently drawn scenes.
 
MERROR_RETVAL retro3d_platform_init ()
 
void retro3d_platform_shutdown ()
 
void retro3d_scene_init ()
 Commence drawing a new scene/frame.
 
size_t retro3d_scene_complete ()
 Finish drawing the current scene/frame and display it on-screen.
 
void retro3d_scene_open_node ()
 Denote the beginning of a new scene node, or group of polygons inside the current scene/frame.
 
void retro3d_scene_close_node ()
 Denote the end of the current scene node opened with retro3d_scene_open_node().
 
void retro3d_scene_translate (mfix_t x, mfix_t y, mfix_t z)
 
void retro3d_scene_scale (mfix_t x, mfix_t y, mfix_t z)
 
void retro3d_scene_rotate (mfix_t x, mfix_t y, mfix_t z)
 Rotate the current scene node the given number of degrees on the X, Y, or Z axis.
 
void retro3d_vx (mfix_t x, mfix_t y, mfix_t z, mfix_t s, mfix_t t)
 Create a vertex at the designated location. Must be called inside of retro3d_tri_begin() and retro3d_tri_end().
 
void retro3d_tri_begin (RETROFLAT_COLOR color, uint8_t flags)
 Begins drawing a polygon/triangle using predefined Maug_retroflt_color. Follow with three calls to retro3d_vx() and a call to retro3d_tri_end().
 
void retro3d_tri_begin_rgb (float r, float g, float b, uint8_t flags)
 Begins drawing a polygon/triangle with the given custom RGB color. Follow with three calls to retro3d_vx() and a call to retro3d_tri_end().
 
void retro3d_tri_end ()
 Complete a triangle opened with retro3d_tri_begin(). This MUST be called after drawing three vertices.
 
MERROR_RETVAL retro3d_draw_window (retroflat_blit_t *win, retroflat_pxxy_t x, retroflat_pxxy_t y)
 Draw a bitmap 2D "window" in ortho view proportionally on screen. (e.g. for displaying a UI.)
 
MERROR_RETVAL retro3d_texture_activate (retroflat_blit_t *tex, uint8_t flags)
 Activates the given texture so the next polygon will be drawn with it.
 
MERROR_RETVAL retro3d_texture_platform_refresh (retroflat_blit_t *tex, uint8_t flags)
 Perform engine-specific refresh actions on the texture.
 
MERROR_RETVAL retro3d_check_errors (const char *desc)
 

Detailed Description

Lower-level retargetable 3D engine wrapper.