YAGE  v0.1.1
Yet Another Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
window.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * window.h
3  *
4  * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
5  * MIT License, see LICENSE file for more details.
6  * ----------------------------------------------------------------------------
7  */
8 
12 #ifndef WINDOW_H
13 #define WINDOW_H
14 
15 #include <glad/glad.h>
16 
17 #include <GLFW/glfw3.h>
18 
19 #include <string>
20 
21 namespace yage
22 {
23 
24 // window flags that can change it's appearance
25 enum WindowFlags : unsigned {
26  SHOWN = 0x1,
27  HIDDEN = 0x2,
28  FULLSCREEN = 0x4,
29  BORDERLESS = 0x8,
30 };
31 
32 // window wrapper around GLFWwindow pointer
33 class Window
34 {
35 private:
37  GLFWwindow *window_ = nullptr;
38 
39 public:
40  Window();
41  Window(const Window &) = delete;
42  Window(Window &&) = delete;
44  ~Window();
45 
46  Window &operator=(const Window &) = delete;
47  Window &operator=(Window &&) = delete;
48 
50  void create(std::string window_name, int width, int height);
52  void swapBuffer();
54  void clearBuffer();
56  void hide();
58  void show();
59  bool shouldClose();
60  void pollEvents() const;
61 };
62 
63 } // namespace yage
64 
65 #endif
Definition: window.h:27
void swapBuffer()
swap the buffer
Definition: window.cpp:70
void hide()
hide windowProc
Definition: window.cpp:82
GLFWwindow * window_
window handle
Definition: window.h:37
Definition: window.h:33
bool shouldClose()
Definition: window.cpp:92
Definition: window.h:28
WindowFlags
Definition: window.h:25
~Window()
destroys the window handle
Definition: window.cpp:28
void show()
show window
Definition: window.cpp:87
void create(std::string window_name, int width, int height)
create the window, initialize the handle and update the width and height
Definition: window.cpp:34
Definition: window.h:26
void clearBuffer()
clear buffer
Definition: window.cpp:76
void pollEvents() const
Definition: window.cpp:97
Window & operator=(const Window &)=delete
Definition: window.h:29