Added some defineable types

This commit is contained in:
2021-02-23 08:28:20 +11:00
parent 4f02128553
commit 700a1b8c7f
7 changed files with 55 additions and 33 deletions

View File

@ -11,7 +11,10 @@
#include "../platform.h"
/** Information about the current game context. */
typedef void game_t;
#ifndef GAMETYPE_T
#define GAMETYPE_T void
#endif
typedef GAMETYPE_T game_t;
/**
* Initialize the game context.

View File

@ -8,6 +8,7 @@
#include <stdint.h>
#include <malloc.h>
#include "../util/list/list.h"
#include "../platform.h"
/////////////////////////////////// CONSTANTS //////////////////////////////////
#define INPUT_NULL (inputbind_t)0x00
@ -19,7 +20,7 @@
* e.g. "Jump" or "Walk Forward".
*/
typedef uint8_t inputbind_t;
typedef void inputsource_t;
typedef platforminput_t inputsource_t;
/**
* Structure for the entire input mapping.

View File

@ -7,6 +7,12 @@
#include <malloc.h>
#include <stdint.h>
#ifndef PLATFORMINPUT_T
#define PLATFORMINPUT_T void
#endif
/** Definition for the platform's input source */
typedef PLATFORMINPUT_T platforminput_t;
/**
* Contains information about the running platform. Essentially this is just
* some context as to what is running the game engine itself. It's mostly for
@ -19,4 +25,8 @@ typedef struct {
/** Dimensions of the screen (in pixels) */
uint32_t screenWidth, screenHeight;
int32_t inputSourceCount;
float *inputValues;
platforminput_t *inputSource;
} platform_t;