Create basic engine

This commit is contained in:
2025-01-02 01:16:37 +00:00
parent c02068f1ba
commit b14d2f292a
5 changed files with 101 additions and 25 deletions

View File

@@ -0,0 +1,34 @@
/*
* Copyright (c) Camden Dixie O'Brien
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifndef ENGINE_HOOKS_H
#define ENGINE_HOOKS_H
#include <SDL2/SDL.h>
typedef struct {
struct {
const char *title;
unsigned w, h;
} win;
size_t memsize;
} engineconf_t;
typedef enum {
GAMESTATUS_OK,
GAMESTATUS_QUIT,
} gamestatus_t;
extern const engineconf_t game_conf;
void game_init(int argc, char *argv[], void *mem, SDL_Renderer *renderer);
void game_teardown(void *mem);
gamestatus_t game_evthandle(void *mem, const SDL_Event *evt);
gamestatus_t game_update(void *mem, unsigned dt);
void game_render(const void *mem, SDL_Renderer *renderer, long unsigned t);
#endif