X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2Fwindow.cpp;fp=src%2Fapp%2Fwindow.cpp;h=0000000000000000000000000000000000000000;hb=dfe661278fe5fd69e821d530d50b78082d19ce54;hp=ff7a7e1d2dd7cd12401b9d339f849a731050d936;hpb=88073614253d3a9c678848a6e905c3794aa831ca;p=tacos.git diff --git a/src/app/window.cpp b/src/app/window.cpp deleted file mode 100644 index ff7a7e1..0000000 --- a/src/app/window.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "window.hpp" - -#include "error.hpp" - -#include -#include -#include - - -namespace tacos { - -Window::Window() { - window = SDL_CreateWindow( - "tacos", // title - SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, // position - 1440, 900, // size - SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE // flags - ); - if (!window) { - throw SDLError("SDL_CreateWindow"); - } - context = SDL_GL_CreateContext(window); - if (!context) { - SDL_DestroyWindow(window); - throw SDLError("SDL_GL_CreateContext"); - } - glewExperimental = GL_TRUE; - GLenum err = glewInit(); - if (err != GLEW_OK) { - SDL_GL_DeleteContext(context); - SDL_DestroyWindow(window); - std::string msg("glewInit: "); - msg += reinterpret_cast(glewGetErrorString(err)); - throw std::runtime_error(msg); - } -} - -Window::~Window() noexcept { - SDL_GL_DeleteContext(context); - SDL_DestroyWindow(window); -} - -void Window::Flip() noexcept { - SDL_GL_SwapWindow(window); -} - - -}