diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2018-01-08 14:09:43 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2018-01-08 14:09:43 +0000 |
commit | c514e44b73b3fc4db492e4bd333fa223c6c1eef5 (patch) | |
tree | bb1cc421392f263531b82ad1a67454eb351bbd74 /yage/core/window.cpp | |
parent | 0a42123b150e06f28ae82e460e854984c2dc9648 (diff) | |
download | YAGE-c514e44b73b3fc4db492e4bd333fa223c6c1eef5.tar.gz YAGE-c514e44b73b3fc4db492e4bd333fa223c6c1eef5.zip |
[Engine] Adding entity/component system
Diffstat (limited to 'yage/core/window.cpp')
-rw-r--r-- | yage/core/window.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/yage/core/window.cpp b/yage/core/window.cpp index 711e1294..84cd66d7 100644 --- a/yage/core/window.cpp +++ b/yage/core/window.cpp @@ -9,8 +9,8 @@ #include "window.h" #include "../data/input.h" -#include <glad/glad.h> #include <GLFW/glfw3.h> +#include <glad/glad.h> #include <stdexcept> @@ -19,7 +19,8 @@ using std::runtime_error; namespace yage { -namespace { +namespace +{ void key_callback(GLFWwindow *window, int key, int scanCode, int action, int mods) @@ -71,13 +72,9 @@ void Window::create(std::string window_name, int width, int height) // set vsync on glfwSwapInterval(1); - // set the clear colour to black - glClearColor(0.18f, 0.18f, 0.18f, 1.f); // set alpha blending glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - // set the clear depth - glClearDepth(1.f); } void Window::swapBuffer() @@ -88,6 +85,10 @@ void Window::swapBuffer() void Window::clearBuffer() { + // set the clear colour to black + glClearColor(0.18f, 0.18f, 0.18f, 1.f); + // set the clear depth + glClearDepth(1.f); // clears buffer with clear colour glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } |