Rename library to AKGL (AKLabs Game Library)
This commit is contained in:
57
include/akgl/game.h
Normal file
57
include/akgl/game.h
Normal file
@@ -0,0 +1,57 @@
|
||||
#ifndef _AKGL_GAME_H_
|
||||
#define _AKGL_GAME_H_
|
||||
|
||||
#include <SDL3_mixer/SDL_mixer.h>
|
||||
#include "tilemap.h"
|
||||
|
||||
#define AKGL_GAME_AUDIO_TRACK_BGM 1
|
||||
#define AKGL_GAME_AUDIO_MAX_TRACKS 64
|
||||
|
||||
#define AKGL_TIME_ONESEC_NS 1000000000
|
||||
#define AKGL_TIME_ONESEC_MS 1000000
|
||||
|
||||
/* ==================== GAME STATE VARIABLES =================== */
|
||||
|
||||
typedef struct {
|
||||
float w;
|
||||
float h;
|
||||
SDL_Texture *texture;
|
||||
} akgl_Frame;
|
||||
|
||||
typedef struct {
|
||||
int flags;
|
||||
} akgl_GameState;
|
||||
|
||||
typedef struct {
|
||||
char name[256];
|
||||
char version[32];
|
||||
char uri[256];
|
||||
int screenwidth;
|
||||
int screenheight;
|
||||
akgl_GameState state;
|
||||
int fps;
|
||||
SDL_Time gameStartTime;
|
||||
SDL_Time lastIterTime;
|
||||
SDL_Time lastFPSTime;
|
||||
int framesSinceUpdate;
|
||||
MIX_Mixer *mixer;
|
||||
MIX_Track *tracks[AKGL_GAME_AUDIO_MAX_TRACKS];
|
||||
} akgl_Game;
|
||||
|
||||
|
||||
extern SDL_Window *window;
|
||||
extern SDL_Renderer *renderer;
|
||||
extern akgl_Tilemap gamemap;
|
||||
extern MIX_Audio *bgm;
|
||||
extern SDL_FRect camera;
|
||||
extern akgl_Game game;
|
||||
|
||||
#define AKGL_BITMASK_HAS(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;
|
||||
|
||||
akerr_ErrorContext AKERR_NOIGNORE *akgl_game_init();
|
||||
void akgl_game_updateFPS();
|
||||
|
||||
#endif //_AKGL_GAME_H_
|
||||
Reference in New Issue
Block a user