Added a font registry, a text rendering helper, and an FPS counter function
This commit is contained in:
@@ -4,6 +4,12 @@
|
||||
#include <SDL3_mixer/SDL_mixer.h>
|
||||
#include "tilemap.h"
|
||||
|
||||
#define GAME_AUDIO_TRACK_BGM 1
|
||||
#define GAME_AUDIO_MAX_TRACKS 64
|
||||
|
||||
#define TIME_ONESEC_NS 1000000000
|
||||
#define TIME_ONESEC_MS 1000000
|
||||
|
||||
/* ==================== GAME STATE VARIABLES =================== */
|
||||
|
||||
typedef struct {
|
||||
@@ -23,11 +29,15 @@ typedef struct {
|
||||
int screenwidth;
|
||||
int screenheight;
|
||||
GameState state;
|
||||
int fps;
|
||||
SDL_Time gameStartTime;
|
||||
SDL_Time lastIterTime;
|
||||
SDL_Time lastFPSTime;
|
||||
int framesSinceUpdate;
|
||||
MIX_Mixer *mixer;
|
||||
MIX_Track *tracks[64];
|
||||
MIX_Track *tracks[GAME_AUDIO_MAX_TRACKS];
|
||||
} Game;
|
||||
|
||||
#define GAME_AUDIO_TRACK_BGM 1
|
||||
|
||||
extern SDL_Window *window;
|
||||
extern SDL_Renderer *renderer;
|
||||
@@ -42,5 +52,6 @@ extern Game game;
|
||||
#define BITMASK_CLEAR(x) x = 0;
|
||||
|
||||
akerr_ErrorContext AKERR_NOIGNORE *GAME_init();
|
||||
void GAME_updateFPS();
|
||||
|
||||
#endif //_GAME_H_
|
||||
|
||||
Reference in New Issue
Block a user