56 lines
1.5 KiB
C
56 lines
1.5 KiB
C
#ifndef GLOBALS_H
|
|
#define GLOBALS_H
|
|
#include "ts_event.h"
|
|
#include "state_menu.h"
|
|
#include "../data.h"
|
|
#include "llist.h"
|
|
|
|
struct Table *g_settings;
|
|
|
|
int g_running;
|
|
|
|
struct LList *g_modules_list;
|
|
|
|
/* video-related globals */
|
|
void *g_screen; // void pointer for SDL_Surface or others, set by interface
|
|
int g_video_width;
|
|
int g_video_height;
|
|
int g_video_fullscreen; // 0 = windowed, 1 = fullscreen
|
|
|
|
/* timer and physics related globals */
|
|
int g_start_time; // start time from interfaceInit
|
|
int g_current_time; // internally used time, set at beginning of interfaceRun
|
|
int g_last_time; // set at end of interfaceRun using g_current_time
|
|
int g_delta; // global delta time for each interfaceRun call
|
|
int g_tickrate; // global update tickrate
|
|
int64_t g_accumulator; // global accumulator of delta (for multiple processing if FPS is low)
|
|
|
|
/* function pointers */
|
|
void (*g_initState)();
|
|
void (*g_freeState)();
|
|
void (*g_handleState)(struct TSEvent);
|
|
void (*g_processState)(int delta);
|
|
void (*g_renderState)();
|
|
|
|
void (*g_r_setupElement)(struct Element *element);
|
|
void (*g_r_cleanElement)(struct Element *element);
|
|
|
|
/* drawing function pointers */
|
|
void (*g_r_Init)();
|
|
void (*g_r_Reinit)();
|
|
void (*g_r_Close)();
|
|
void (*g_renderElements)(struct ElementList *list);
|
|
void (*g_renderElement)(struct Element *element);
|
|
void (*g_renderSprite)(void *sheet, void *surface, int id, int x, int y);
|
|
void (*g_renderScreen)();
|
|
void (*g_clearScreen)();
|
|
|
|
void *g_font_large;
|
|
void *g_font_medium;
|
|
|
|
//struct Font *g_font_large;
|
|
//struct Font *g_font_medium;
|
|
|
|
void *menu_bg;
|
|
#endif
|