Abstraction layer header for retro systems.
More...
|
| file | retroflt.h |
| | Abstraction layer header for retro systems.
|
| |
|
|
#define | RETROFLAT_BITMAP_TRACE_LVL 0 |
| |
|
#define | RETROINPUT_TRACE_LVL 0 |
| |
|
#define | RETROFLAT_DEFAULT_SCREEN_W 320 |
| |
|
#define | RETROFLAT_DEFAULT_SCREEN_H 200 |
| |
|
#define | RETROFLAT_DEFAULT_SCREEN_SCALE 1 |
| |
| #define | retroflat_on_resize(w, h) |
| |
|
#define | retroflat_wait_for_frame() (g_retroflat_state->retroflat_flags |= RETROFLAT_STATE_FLAG_WAIT_FOR_FPS) |
| |
| #define | retroflat_is_waiting_for_frame() |
| |
| #define | retroflat_outside_rect(x, y, rx, ry, rw, rh) |
| |
|
#define | PXXY_FMT "%d" |
| |
|
#define | PXXY_MAX INT16_MAX |
| |
|
#define | RETRO2D_TRACE_LVL 0 |
| |
|
#define | RETRO2D_DRAW_TRACE_LVL 0 |
| |
|
#define | RETRO2D_LOCK_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_get_assets_path() (g_retroflat_state->assets_path) |
| |
|
#define | RETROFLAT_COLOR_TABLE_CONSTS(idx, name_l, name_u, r, g, b, cgac, cgad) extern MAUG_CONST RETROFLAT_COLOR SEG_MCONST RETROFLAT_COLOR_ ## name_u; |
| |
|
|
typedef void(* | retroflat_loop_iter) (void *data) |
| | Prototype for the main loop function passed to retroflat_loop().
|
| |
| typedef int16_t | retroflat_pxxy_t |
| | Type used for surface pixel coordinates. More...
|
| |
|
typedef maug_ms_t | retroflat_ms_t |
| |
|
typedef void(* | retroflat_timer_cb_t) (retroflat_ms_t time, void *data) |
| |
|
|
uint32_t | retroflat_get_rand (void) |
| |
|
retroflat_ms_t | retroflat_get_ms (void) |
| |
|
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 maug_path 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. More...
|
| |
| 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(). More...
|
| |
|
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,...) |
| |
|
char | retroflat_vk_to_ascii (RETROFLAT_IN_KEY k, uint8_t flags) |
| |
|
|
MAUG_CONST char *SEG_MCONST | gc_retroflat_color_names [] |
| |
|
struct RETROFLAT_STATE *SEG_MGLOBAL | g_retroflat_state |
| |
Abstraction layer header for retro systems.
◆ retroflat_is_waiting_for_frame
| #define retroflat_is_waiting_for_frame |
( |
| ) |
|
Value:
uint8_t retroflat_flags
maug_retroflt_flags indicating current system status.
Definition: retroflt.h:1140
#define RETROFLAT_STATE_FLAG_WAIT_FOR_FPS
Do not execute any more inter-frame loops until next frame.
Definition: retroflt.h:426
◆ retroflat_on_resize
| #define retroflat_on_resize |
( |
|
w, |
|
|
|
h |
|
) |
| |
Value:
g_retroflat_state->screen_h = (h);
size_t screen_w
The screen width as seen by the system, after scaling.
Definition: retroflt.h:1196
◆ retroflat_outside_rect
| #define retroflat_outside_rect |
( |
|
x, |
|
|
|
y, |
|
|
|
rx, |
|
|
|
ry, |
|
|
|
rw, |
|
|
|
rh |
|
) |
| |
Value: ((unsigned int)(x - rx) >= (unsigned int)rw || \
(unsigned int)(y - ry) >= (unsigned int)rh)
◆ retroflat_pxxy_t
Type used for surface pixel coordinates.
- Todo:
- Make this signed when most of the library uses it. Right now, it causes too many issues with passed references.
◆ retroflat_init()
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_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
-
| retval | Return value from retroflat_init(), so we know what layers are in what state. |