sdl and opengl contexts
This commit is contained in:
19
src/main.cpp
19
src/main.cpp
@@ -0,0 +1,19 @@
|
||||
#include "engine/sdl.hpp"
|
||||
#include "engine/opengl.hpp"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
SDLWindow window("My SDL Application", 800, 600);
|
||||
if (!window.isRunning()) { return -1; }
|
||||
OpenGLContext glContext(window);
|
||||
if (!glContext.isInitialized()) { return -1; }
|
||||
|
||||
window.setPosition(SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
|
||||
window.showWindow();
|
||||
while (window.isRunning()) {
|
||||
window.pollEvents();
|
||||
// Application logic and rendering would go here
|
||||
glContext.swapBuffers();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user