More rendering subsystem breakout, added a physics subsystem, everything now fires from akgl_game_update() for the user

This commit is contained in:
2026-05-25 21:29:18 -04:00
parent 6314ad7f26
commit d87c5d2c20
13 changed files with 276 additions and 176 deletions

View File

@@ -2,10 +2,11 @@
#define _AKGL_GAME_H_
#include <stdint.h>
#include "types.h"
#include <SDL3_mixer/SDL_mixer.h>
#include "types.h"
#include "tilemap.h"
#include "renderer.h"
#include "physics.h"
#define AKGL_VERSION "0.1.0"
@@ -33,6 +34,7 @@ typedef struct {
char name[256];
char uri[256];
akgl_GameState state;
SDL_Mutex *statelock;
int16_t fps;
SDL_Time gameStartTime;
SDL_Time lastIterTime;
@@ -49,8 +51,10 @@ extern MIX_Track *akgl_tracks[AKGL_GAME_AUDIO_MAX_TRACKS];
extern SDL_FRect camera;
extern akgl_Game game;
extern akgl_RenderBackend renderer;
extern akgl_PhysicsBackend physics;
#define AKGL_BITMASK_HAS(x, y) (x & y) == y
#define AKGL_BITMASK_HASNOT(x, y) (x & y) != y
#define AKGL_BITMASK_ADD(x, y) x |= y
#define AKGL_BITMASK_DEL(x, y) x &= ~(y)
#define AKGL_BITMASK_CLEAR(x) x = 0;
@@ -61,5 +65,8 @@ void akgl_game_updateFPS();
akerr_ErrorContext AKERR_NOIGNORE *akgl_game_save(char *fpath);
akerr_ErrorContext AKERR_NOIGNORE *akgl_game_load(char *fpath);
void akgl_game_lowfps(void);
akerr_ErrorContext AKERR_NOIGNORE *akgl_game_state_lock(void);
akerr_ErrorContext AKERR_NOIGNORE *akgl_game_state_unlock(void);
akerr_ErrorContext AKERR_NOIGNORE *akgl_game_update(akgl_Iterator *opflags);
#endif //_AKGL_GAME_H_