You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
638 B
38 lines
638 B
#pragma once |
|
|
|
#include <SDL2/SDL.h> |
|
|
|
|
|
enum class PlatformStatus |
|
{ |
|
Error = -1, |
|
Ok, |
|
Quit |
|
}; |
|
|
|
|
|
// STRUCTURES |
|
struct Platform |
|
{ |
|
SDL_Window* window; |
|
SDL_Surface* surface; |
|
uint32_t input; |
|
uint32_t framerateMillis; |
|
uint32_t frameStartMillis; |
|
}; |
|
|
|
|
|
// FUNCTIONS |
|
PlatformStatus Platform_Init(Platform& platform, int width, int height); |
|
|
|
PlatformStatus 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);
|
|
|