1
0
Fork 0
2018-soft-3d-renderer/Source/Platform.hpp

39 lines
638 B
C++
Raw Normal View History

2019-08-10 00:03:10 +00:00
#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);