aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/window.cpp b/src/window.cpp
index ac2304c9..dc2a743a 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -58,7 +58,10 @@ void Window::create(const std::string &window_name, int width, int height, unsig
// set vsync on instead of custom fps limiting
SDL_GL_SetSwapInterval(1);
// set the clear color to black
- glClearColor(0.f, 0.f, 0.f, 1.f);
+ glClearColor(0.f, 0.5f, 0.f, 1.f);
+ // set alpha blending
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
void Window::swapBuffer()
@@ -66,5 +69,13 @@ void Window::swapBuffer()
// swap the window buffer
SDL_GL_SwapWindow(window_);
}
+
+void Window::clearBuffer()
+{
+ // set the clear depth
+ glClearDepth(1.f);
+ // clears buffer with clear color
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+}
} // yage