maug
Quick and dirty C mini-augmentation library.
Loading...
Searching...
No Matches
Maug_retro3d_util
Collaboration diagram for Maug_retro3d_util:

Topics

 RetroFlat Viewport API
 A flexible API to facilitate tile-based views using hardware acceleration where available.
 
 RetroFlat VDP API
 Video Display Processor tools for modifying display output.
 
 RetroFlat Bitmap API
 Tools for loading bitmaps from disk and drawing them on-screen.
 
 RetroFlat Drawing API
 Functions for drawing primitives on-screen.
 
 RetroFlat Input API
 Functions and constants for polling and interpreting user input.
 
 RetroFlat Direction API
 Macros and constants for definition cardinal directions in screen and world space.
 

Data Structures

struct  RETROFLAT_3DTEX
 
struct  RETROFLAT_ARGS
 Struct containing configuration values for a RetroFlat program. More...
 
struct  RETROFLAT_STATE
 Global singleton containing state for the current platform. More...
 

Macros

#define retroflat_heartbeat_set(len, max)
 Set parameters for the RETROFLAT_STATE::heartbeat_frame.
 
#define retroflat_heartbeat()
 Get current value of RETROFLAT_STATE::heartbeat_frame.
 
#define retroflat_heartbeat_update()
 Check and update RETROFLAT_STATE::heartbeat_frame. This should be called in the API HAL on every iteration of the main loop (this is done automatically in the generic main loop).
 
#define RETROFLAT_COLOR_TABLE_CONSTS(idx, name_l, name_u, r, g, b, cgac, cgad)
 

Typedefs

typedef maug_ms_t retroflat_ms_t
 

Functions

MERROR_RETVAL retroflat_loop (retroflat_loop_iter frame_iter, retroflat_loop_iter loop_iter, void *data)
 This should be called once in the main body of the program in order to enter the main loop. The main loop will continuously call loop_iter with data as an argument until retroflat_quit() is called.
 
void retroflat_message (uint8_t flags, const char *title, const char *format,...)
 Display a message in a dialog box and/or on stderr.
 
MERROR_RETVAL retroflat_init (int argc, char *argv[], struct RETROFLAT_ARGS *args)
 Initialize RetroFlat and its underlying layers. This should be called once at the beginning of the program and should quit if the return value indicates any failures.
 
void retroflat_shutdown (int retval)
 Deinitialize RetroFlat and its underlying layers. This should be called once at the end of the program, after retroflat_loop().
 
void retroflat_set_title (const char *format,...)
 
retroflat_ms_t retroflat_get_ms ()
 
uint32_t retroflat_get_rand ()
 
char retroflat_vk_to_ascii (RETROFLAT_IN_KEY k, uint8_t flags)
 
void retroflat_set_proc_resize (retroflat_proc_resize_t on_resize_in, void *data_in)
 Set the procedure to call when the window is resized (on platforms that support resizing).
 
void retroflat_resize_v ()
 Platform-specific function to resize virtual screen to match physical window size.
 

Variables

MAUG_CONST char *SEG_MCONST gc_retroflat_color_names []
 
struct RETROFLAT_STATEg_retroflat_state
 

Detailed Description

Macro Definition Documentation

◆ RETROFLAT_COLOR_TABLE_CONSTS

#define RETROFLAT_COLOR_TABLE_CONSTS ( idx,
name_l,
name_u,
r,
g,
b,
cgac,
cgad )
Value:
extern MAUG_CONST RETROFLAT_COLOR RETROFLAT_COLOR_ ## name_u;
int8_t RETROFLAT_COLOR
Defines an index in the platform-specific color-table.
Definition retroflt.h:325

◆ retroflat_heartbeat

#define retroflat_heartbeat ( )
related
Value:
(g_retroflat_state->heartbeat_frame)

Get current value of RETROFLAT_STATE::heartbeat_frame.

◆ retroflat_heartbeat_set

#define retroflat_heartbeat_set ( len,
max )
related
Value:
g_retroflat_state->heartbeat_max = max; \
g_retroflat_state->heartbeat_len = len;

Set parameters for the RETROFLAT_STATE::heartbeat_frame.

Parameters
lenNumber of ms between updates to RETROFLAT_STATE::heartbeat_frame.
maxValue of RETROFLAT_STATE::heartbeat_frame on which to reset to 0.

◆ retroflat_heartbeat_update

#define retroflat_heartbeat_update ( )
related
Value:
/* Update the heartbeat animation frame. */ \
if( g_retroflat_state->heartbeat_next <= retroflat_get_ms() ) { \
g_retroflat_state->heartbeat_frame++; \
if( \
g_retroflat_state->heartbeat_frame >= \
g_retroflat_state->heartbeat_max \
) { \
g_retroflat_state->heartbeat_frame = 0; \
} \
g_retroflat_state->heartbeat_next = \
retroflat_get_ms() + g_retroflat_state->heartbeat_len; \
}

Check and update RETROFLAT_STATE::heartbeat_frame. This should be called in the API HAL on every iteration of the main loop (this is done automatically in the generic main loop).

Function Documentation

◆ retroflat_init()

MERROR_RETVAL retroflat_init ( int argc,
char * argv[],
struct RETROFLAT_ARGS * args )

Initialize RetroFlat and its underlying layers. This should be called once at the beginning of the program and should quit if the return value indicates any failures.

Returns
RETROFLAT_OK if there were no problems or other RetroFlat API Return Values if there were.

◆ retroflat_message()

void retroflat_message ( uint8_t flags,
const char * title,
const char * format,
... )

Display a message in a dialog box and/or on stderr.

Parameters
titleA string with the title to use for a dialog box.
formatA format string to be passed to vsnprintf().
Todo
This should display a dialog box on every platform if possible.

◆ retroflat_set_proc_resize()

void retroflat_set_proc_resize ( retroflat_proc_resize_t on_resize_in,
void * data_in )

Set the procedure to call when the window is resized (on platforms that support resizing).

Parameters
on_resize_inProcedure to call when window is resized.
data_inData to pass to on_resize_in.

If this is not set, no procedure is called. Some platforms may stretch the "virtual" screen to fill the physical window.

◆ retroflat_shutdown()

void retroflat_shutdown ( int retval)

Deinitialize RetroFlat and its underlying layers. This should be called once at the end of the program, after retroflat_loop().

Parameters
retvalReturn value from retroflat_init(), so we know what layers are in what state.