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

39 lines
638 B
C++

#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);