some OpenGL boilerplate

This commit is contained in:
Ben
2020-05-16 19:59:46 +01:00
parent 72a359bce7
commit 4e5a1bec24
10 changed files with 251 additions and 9 deletions

42
src/display.hpp Normal file
View File

@@ -0,0 +1,42 @@
#ifndef MINECRAFT_DISPLAY_H_
#define MINECRAFT_DISPLAY_H_
#include <string>
#include <logger.h>
#if _WIN32
#include <SDL.h>
#else
#include <SDL2/SDL.h>
#endif
#include <glad/glad.h>
#include <KHR/khrplatform.h>
class Display
{
public:
Display( int w, int h, std::string title );
void Input( SDL_Event* e );
void PrepareFrame();
void NextFrame();
bool IsWindowOpen = false;
bool IsMouseActive = true;
private:
Logger mLogger;
SDL_Window* mWindow = nullptr;
SDL_GLContext mGlContext = nullptr;
int mW, mH;
};
#endif