sdl and opengl contexts

This commit is contained in:
2025-11-23 10:10:57 +00:00
parent bed8e5e363
commit d5ac791a1a
6 changed files with 218 additions and 12 deletions

28
inc/engine/opengl.hpp Normal file
View File

@@ -0,0 +1,28 @@
#ifndef OPENGL_HPP
#define OPENGL_HPP
// Includes
#include <SDL3/SDL_opengl.h>
#include "engine/sdl.hpp"
// OpenGL Context Class
class OpenGLContext {
public:
OpenGLContext(SDLWindow& window);
~OpenGLContext();
bool isInitialized() const;
void makeCurrent();
void swapBuffers();
float getFrameTime();
private:
SDLWindow& window;
SDL_GLContext glContext;
Uint32 lastTime;
float frameTime;
};
#endif