]> git.localhorst.tv Git - tacos.git/blobdiff - src/app/window.cpp
basic floor idea
[tacos.git] / src / app / window.cpp
diff --git a/src/app/window.cpp b/src/app/window.cpp
deleted file mode 100644 (file)
index ff7a7e1..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#include "window.hpp"
-
-#include "error.hpp"
-
-#include <stdexcept>
-#include <string>
-#include <GL/glew.h>
-
-
-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<const char *>(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);
-}
-
-
-}