|
maug
Quick and dirty C mini-augmentation library.
|
Abstraction layer header for retro systems. More...

Topics | |
| RetroFlat Example | |
| An extremely simple single-file annotated example program written with the RetroFlat API. | |
| RetroFlat Compilation | |
| Makefile examples and compiler considerations for using RetroFlat. | |
| Maug_retroflt_color | |
| RetroFlat API Return Values | |
| Standardized return values from RetroFlat API functions. | |
| RetroFlat Drawing API | |
| Functions for drawing primitives on-screen. | |
| RetroFlat Message API | |
| These flags can be passed to retroflat_message() to indicate the type of message being conveyed. | |
| 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 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. | |
| RetroSound API | |
| Abstraction layer header for sound on retro systems. | |
| RetroFlat Viewport API | |
| A flexible API to facilitate tile-based views using hardware acceleration where available. | |
| Retro3D API | |
| RetroGUI API | |
| Tools for drawing interactive GUI elements in a RetroFlat program. | |
| RetroFlat Window API | |
| Builds on RetroGUI API to allow for multiple windows. | |
| RetroGXCache API | |
| RetroTile API | |
| Functions and structures for working with tilemaps/grids. | |
Files | |
| file | retroflt.h |
| Abstraction layer header for retro systems. | |
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_BITMAP_TRACE_LVL 0 |
| #define | RETROINPUT_TRACE_LVL 0 |
| #define | RETROFLAT_FLAGS_RUNNING 0x01 |
| Flag indicating that retroflat_loop() should continue executing. | |
| #define | RETROFLAT_FLAGS_UNLOCK_FPS 0x02 |
| Flag indicating FPS should not be capped. | |
| #define | RETROFLAT_FLAGS_KEY_REPEAT 0x04 |
| Flag indicating keyboard repeat is enabled. | |
| #define | RETROFLAT_FLAGS_SCREENSAVER 0x08 |
| Flag indicating the current application is running as a screensaver. | |
| #define | RETROFLAT_FLAGS_WAIT_FOR_FPS 0x20 |
| Do not execute any more inter-frame loops until next frame. | |
| #define | RETROFLAT_DEFAULT_SCREEN_W 320 |
| #define | RETROFLAT_DEFAULT_SCREEN_H 200 |
| #define | retroflat_on_resize(w, h) |
| #define | retroflat_wait_for_frame() |
| #define | retroflat_is_waiting_for_frame() |
| #define | PXXY_FMT SIZE_T_FMT |
| #define | PXXY_MAX SIZE_MAX |
| #define | RETRO2D_TRACE_LVL 0 |
| #define | retroflat_system_task() |
| Platform-specific task that should be called on every iteration of the generic loop. This prevents having to define a platform-specific loop just to add a single call. | |
| #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 MERROR_RETVAL(* | retroflat_proc_resize_t) (uint16_t new_w, uint16_t new_h, void *data) |
| typedef void(* | retroflat_loop_iter) (void *data) |
| Prototype for the main loop function passed to retroflat_loop(). | |
| typedef size_t | retroflat_pxxy_t |
| Type used for surface pixel coordinates. | |
| 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. | |
| MERROR_RETVAL | retroflat_build_filename_path (const char *filename_in, const char *filename_ext, char *buffer_out, size_t buffer_out_sz, uint8_t flags) |
| 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(). | |
| RETROFLAT_IN_KEY | retroflat_repeat_input (RETROFLAT_IN_KEY key_out, struct RETROFLAT_INPUT *input, RETROFLAT_IN_KEY *prev_input, int *prev_delay) |
| 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_STATE *SEG_MGLOBAL | g_retroflat_state |
| #define | RETROSND_ARGS_FLAG_LIST_DEVS 0x01 |
Abstraction layer header for retro systems.
| #define RETROFLAT_COLOR_TABLE_CONSTS | ( | idx, | |
| name_l, | |||
| name_u, | |||
| r, | |||
| g, | |||
| b, | |||
| cgac, | |||
| cgad ) |
|
Flag indicating keyboard repeat is enabled.
|
Flag indicating that retroflat_loop() should continue executing.
|
Flag indicating the current application is running as a screensaver.
|
Flag indicating FPS should not be capped.
|
Get current value of RETROFLAT_STATE::heartbeat_frame.
|
Set parameters for the RETROFLAT_STATE::heartbeat_frame.
| len | Number of ms between updates to RETROFLAT_STATE::heartbeat_frame. |
| max | Value of RETROFLAT_STATE::heartbeat_frame on which to reset to 0. |
|
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_is_waiting_for_frame | ( | ) |
| #define retroflat_on_resize | ( | w, | |
| h ) |
| #define retroflat_wait_for_frame | ( | ) |
| typedef size_t retroflat_pxxy_t |
Type used for surface pixel coordinates.
| 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_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).
| on_resize_in | Procedure to call when window is resized. |
| data_in | Data 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.
| 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().
| retval | Return value from retroflat_init(), so we know what layers are in what state. |