aboutsummaryrefslogtreecommitdiffstats
path: root/yage/core/window.h
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-10-31 22:11:18 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-10-31 22:11:18 +0000
commitf776df6076725d14679b31168e3ede53c966182e (patch)
treeb843d7ef0d0722a1b3571ee09aa1345d19c60e7f /yage/core/window.h
parent1bb0ef8960c71ef505a351702bec54c01ba15e22 (diff)
downloadYAGE-f776df6076725d14679b31168e3ede53c966182e.tar.gz
YAGE-f776df6076725d14679b31168e3ede53c966182e.zip
renaming base folder
Diffstat (limited to 'yage/core/window.h')
-rw-r--r--yage/core/window.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/yage/core/window.h b/yage/core/window.h
new file mode 100644
index 00000000..84ba8303
--- /dev/null
+++ b/yage/core/window.h
@@ -0,0 +1,65 @@
+/* ----------------------------------------------------------------------------
+ * window.h
+ *
+ * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
+ * See file LICENSE for more details
+ * ----------------------------------------------------------------------------
+ */
+
+/** @file
+ */
+
+#ifndef WINDOW_H
+#define WINDOW_H
+
+#include <glad/glad.h>
+
+#include <GLFW/glfw3.h>
+
+#include <string>
+
+namespace yage
+{
+
+// window flags that can change it's appearance
+enum WindowFlags : unsigned {
+ SHOWN = 0x1,
+ HIDDEN = 0x2,
+ FULLSCREEN = 0x4,
+ BORDERLESS = 0x8,
+};
+
+// window wrapper around GLFWwindow pointer
+class Window
+{
+private:
+ /// window handle
+ GLFWwindow *window_ = nullptr;
+
+public:
+ Window();
+ Window(const Window &) = delete;
+ Window(Window &&) = delete;
+ /// destroys the window handle
+ ~Window();
+
+ Window &operator=(const Window &) = delete;
+ Window &operator=(Window &&) = delete;
+
+ /// create the window, initialize the handle and update the width and height
+ void create(std::string window_name, int width, int height);
+ /// swap the buffer
+ void swapBuffer();
+ /// clear buffer
+ void clearBuffer();
+ /// hide windowProc
+ void hide();
+ /// show window
+ void show();
+ bool shouldClose();
+ void pollEvents() const;
+};
+
+} // namespace yage
+
+#endif