Added a font registry, a text rendering helper, and an FPS counter function

This commit is contained in:
2026-05-06 11:12:42 -04:00
parent 284ffd7b4a
commit c3847160da
9 changed files with 81 additions and 19 deletions

View File

@@ -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_