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 
10 #pragma once
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() = default;
38  Window(Window const &) = delete;
39  Window(Window &&) = delete;
41  ~Window();
42 
43  Window &operator=(Window const &) = 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) const;
60 };
61 
62 } // namespace yage
Definition: window.h:24
void swapBuffer()
swap the buffer
Definition: window.cpp:76
void hide()
hide windowProc
Definition: window.cpp:92
Window()=default
Definition: window.h:30
bool shouldClose()
Definition: window.cpp:102
Definition: window.h:25
WindowFlags
Definition: window.h:22
~Window()
destroys the window handle
Definition: window.cpp:38
void show()
show window
Definition: window.cpp:97
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:43
bool keyPressed(key k) const
Definition: window.cpp:112
Definition: window.h:23
key
Definition: input.h:25
void clearBuffer()
clear buffer
Definition: window.cpp:82
Window & operator=(Window const &)=delete
void pollEvents() const
Definition: window.cpp:107
Definition: window.h:26