YAGE  v0.1.1
Yet Another Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends 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> -- MIT License
5  * See file LICENSE for more details
6  * ----------------------------------------------------------------------------
7  */
8 
12 #ifndef WINDOW_H
13 #define WINDOW_H
14 
15 #include <GLFW/glfw3.h>
16 
17 #include <string>
18 
19 namespace yage
20 {
21 
22 // window flags that can change it's appearance
23 enum WindowFlags : unsigned {
24  SHOWN = 0x1,
25  HIDDEN = 0x2,
26  FULLSCREEN = 0x4,
27  BORDERLESS = 0x8,
28 };
29 
30 // window wrapper around GLFWwindow pointer
31 class Window
32 {
33 private:
35  GLFWwindow *window_ = nullptr;
36 
37 public:
38  Window();
39  Window(const Window &) = delete;
40  Window(Window &&) = delete;
42  ~Window();
43 
44  Window &operator=(const Window &) = delete;
45  Window &operator=(Window &&) = delete;
46 
48  void create(const std::string &window_name, int width, int height,
49  unsigned flags = WindowFlags::SHOWN);
51  void swapBuffer();
53  void clearBuffer();
54 };
55 
56 } // namespace yage
57 
58 #endif
Definition: window.h:25
void swapBuffer()
swap the buffer
Definition: window.cpp:52
GLFWwindow * window_
window handle
Definition: window.h:35
Definition: window.h:31
void create(const std::string &window_name, int width, int height, unsigned flags=WindowFlags::SHOWN)
create the window, initialize the handle and update the width and height
Definition: window.cpp:24
Definition: window.h:26
WindowFlags
Definition: window.h:23
~Window()
destroys the window handle
Definition: window.cpp:19
Definition: window.h:24
void clearBuffer()
clear buffer
Definition: window.cpp:58
Window & operator=(const Window &)=delete
Definition: window.h:27