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 
9 #ifndef YAGE_CORE_WINDOW_H
10 #define YAGE_CORE_WINDOW_H
11 
12 #include <string>
13 
14 class GLFWwindow;
15 
16 namespace yage
17 {
18 
19 enum class key;
20 
21 // window flags that can change it's appearance
22 enum WindowFlags : unsigned {
23  SHOWN = 0x1,
24  HIDDEN = 0x2,
25  FULLSCREEN = 0x4,
26  BORDERLESS = 0x8,
27 };
28 
29 // window wrapper around GLFWwindow pointer
30 class Window
31 {
32 private:
34  GLFWwindow *window_ = nullptr;
35 
36 public:
37  Window();
38  Window(const Window &) = delete;
39  Window(Window &&) = delete;
41  ~Window();
42 
43  Window &operator=(const Window &) = delete;
44  Window &operator=(Window &&) = delete;
45 
47  void create(std::string window_name, int width, int height);
49  void swapBuffer();
51  void clearBuffer();
53  void hide();
55  void show();
56  bool shouldClose();
57  void pollEvents() const;
58 
59  bool keyPressed(key k);
60 };
61 
62 } // namespace yage
63 
64 #endif
bool keyPressed(key k)
Definition: window.cpp:111
Definition: window.h:24
void swapBuffer()
swap the buffer
Definition: window.cpp:75
void hide()
hide windowProc
Definition: window.cpp:91
Definition: window.h:30
bool shouldClose()
Definition: window.cpp:101
Definition: window.h:25
WindowFlags
Definition: window.h:22
~Window()
destroys the window handle
Definition: window.cpp:39
void show()
show window
Definition: window.cpp:96
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:44
Definition: window.h:23
key
Definition: input.h:25
void clearBuffer()
clear buffer
Definition: window.cpp:81
void pollEvents() const
Definition: window.cpp:106
Window & operator=(const Window &)=delete
Definition: window.h:26