]> git.localhorst.tv Git - blank.git/blobdiff - src/init.cpp
remove unused (explicit) destructors
[blank.git] / src / init.cpp
index 20f4fe4e6c0693b7e2e235eabc4173a316ed9215..2c1c73ad6155e0aae9654f9fa9a58f6c93477fe2 100644 (file)
@@ -62,10 +62,6 @@ InitGL::InitGL() {
        }
 }
 
-InitGL::~InitGL() {
-
-}
-
 
 Window::Window()
 : handle(SDL_CreateWindow(
@@ -83,6 +79,26 @@ Window::~Window() {
        SDL_DestroyWindow(handle);
 }
 
+void Window::GrabInput() {
+       SDL_SetWindowGrab(handle, SDL_TRUE);
+}
+
+void Window::ReleaseInput() {
+       SDL_SetWindowGrab(handle, SDL_FALSE);
+}
+
+void Window::GrabMouse() {
+       if (SDL_SetRelativeMouseMode(SDL_TRUE) != 0) {
+               sdl_error("SDL_SetRelativeMouseMode");
+       }
+}
+
+void Window::ReleaseMouse() {
+       if (SDL_SetRelativeMouseMode(SDL_FALSE) != 0) {
+               sdl_error("SDL_SetRelativeMouseMode");
+       }
+}
+
 GLContext Window::CreateContext() {
        return GLContext(handle);
 }
@@ -122,6 +138,19 @@ void GLContext::EnableVSync() {
        }
 }
 
+void GLContext::EnableDepthTest() {
+       glEnable(GL_DEPTH_TEST);
+       glDepthFunc(GL_LESS);
+}
+
+void GLContext::EnableBackfaceCulling() {
+       glEnable(GL_CULL_FACE);
+}
+
+void GLContext::Clear() {
+       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+}
+
 
 InitGLEW::InitGLEW() {
        glewExperimental = GL_TRUE;
@@ -138,8 +167,4 @@ InitGLEW::InitGLEW() {
        }
 }
 
-InitGLEW::~InitGLEW() {
-
-}
-
 }