maug
Quick and dirty C mini-augmentation library.
Loading...
Searching...
No Matches
retro3d.h
Go to the documentation of this file.
1
2#ifndef RETRO3D_H
3#define RETRO3D_H
4
11
12#ifndef RETRO3D_TRACE_LVL
13# define RETRO3D_TRACE_LVL 0
14#endif /* RETRO3D_TRACE_LVL */
15
20
26 uint8_t proj;
27 float rzoom;
28 float near_plane;
29 float far_plane;
30 size_t screen_px_w;
31 size_t screen_px_h;
32};
33
38
43#define RETRO3D_TEX_FLAG_GENERATE 0x01
44
49#define RETRO3D_TEX_FLAG_DESTROY 0x02
50
55#define RETRO3D_TEX_FLAG_DEACTIVATE 0x04
56 /* maug_retro3d_tex */
58
64#define RETRO3D_PROJ_ORTHO 0
65
71#define RETRO3D_PROJ_FRUSTUM 1
72
77
85 RETROFLAT_COLOR color, mfix_t fog_draw_dist, mfix_t fog_density );
86
87MERROR_RETVAL retro3d_platform_init();
88
89void retro3d_platform_shutdown();
90
96
101
107
116
122
124
130
131void retro3d_scene_translate( mfix_t x, mfix_t y, mfix_t z );
132
133void retro3d_scene_scale( mfix_t x, mfix_t y, mfix_t z );
134
139void retro3d_scene_rotate( mfix_t x, mfix_t y, mfix_t z );
140 /* maug_retro3d_trans */
142
148
153void retro3d_vx( mfix_t x, mfix_t y, mfix_t z, mfix_t s, mfix_t t );
154
160void retro3d_tri_begin( RETROFLAT_COLOR color, uint8_t flags );
161
167void retro3d_tri_begin_rgb( float r, float g, float b, uint8_t flags );
168
174 /* maug_retro3d_poly */
176
182
188 retroflat_blit_t* win, retroflat_pxxy_t x, retroflat_pxxy_t y );
189
194MERROR_RETVAL retro3d_texture_activate( retroflat_blit_t* tex, uint8_t flags );
195
204 retroflat_blit_t* tex, uint8_t flags );
205 /* maug_retro3d_tex */
207
208MERROR_RETVAL retro3d_check_errors( const char* desc );
209
210#define RETRO3D_TRI_FLAG_NORMAL_X 0x03
211
212#define RETRO3D_TRI_FLAG_NORMAL_Y 0x02
213
214#define RETRO3D_TRI_FLAG_NORMAL_Z 0x01
215
216#define RETRO3D_TRI_FLAG_NORMAL_NEG 0x04
217 /* maug_retro3d */
219 /* maug_retroflt */
221
222#endif /* !RETRO3D_H */
223
int MERROR_RETVAL
Return type indicating function returns a value from this list.
Definition merror.h:19
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...
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 re...
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_...
void retro3d_tri_end()
Complete a triangle opened with retro3d_tri_begin(). This MUST be called after drawing three vertices...
void retro3d_scene_init()
Commence drawing a new scene/frame.
void retro3d_scene_open_node()
Denote the beginning of a new scene node, or group of polygons inside the current scene/frame.
size_t retro3d_scene_complete()
Finish drawing the current scene/frame and display it on-screen.
void retro3d_scene_close_node()
Denote the end of the current scene node opened with retro3d_scene_open_node().
MERROR_RETVAL retro3d_texture_platform_refresh(retroflat_blit_t *tex, uint8_t flags)
Perform engine-specific refresh actions on the texture.
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_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....
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_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.
int8_t RETROFLAT_COLOR
Defines an index in the platform-specific color-table.
Definition retroflt.h:325
size_t retroflat_pxxy_t
Type used for surface pixel coordinates.
Definition retroflt.h:870
Definition retro3d.h:21
uint8_t proj
The desired projection method. Can be RETRO3D_PROJ_ORTHO or RETRO3D_PROJ_FRUSTUM.
Definition retro3d.h:26