45 lines
713 B
C
45 lines
713 B
C
|
#ifndef PLATFORM_H
|
||
|
|
||
|
#include <SDL2/SDL.h>
|
||
|
|
||
|
|
||
|
// ENUMERATIONS
|
||
|
enum Platform_Status
|
||
|
{
|
||
|
PLATFORM_ERROR = -1,
|
||
|
PLATFORM_OK,
|
||
|
PLATFORM_QUIT
|
||
|
};
|
||
|
|
||
|
|
||
|
// STRUCTURES
|
||
|
struct Platform
|
||
|
{
|
||
|
SDL_Window *window;
|
||
|
SDL_Surface *surface;
|
||
|
uint32_t input;
|
||
|
uint32_t framerateMillis;
|
||
|
uint32_t frameStartMillis;
|
||
|
};
|
||
|
|
||
|
|
||
|
// FUNCTIONS
|
||
|
int Platform_Init(Platform &platform, int width, int height);
|
||
|
|
||
|
int Platform_CheckForEvents(Platform &platform);
|
||
|
|
||
|
void Platform_ClearWindow(Platform &platform);
|
||
|
|
||
|
void Platform_UpdateWindow(Platform &platform);
|
||
|
|
||
|
void Platform_GetFrameTime(Platform &platform);
|
||
|
|
||
|
void Platform_SyncToFramerate(Platform &platform);
|
||
|
|
||
|
void Platform_Shutdown(Platform &platform);
|
||
|
|
||
|
|
||
|
#define PLATFORM_H
|
||
|
#endif
|
||
|
|