YAGE  0.02
Yet Another Game Engine
window.hpp
1 /* ----------------------------------------------------------------------------
2  * window.hpp
3  *
4  * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
5  * See file LICENSE for more details
6  * ----------------------------------------------------------------------------
7  */
8 
9 #ifndef WINDOW_HPP
10 #define WINDOW_HPP
11 
12 #include <SDL2/SDL.h>
13 
14 #include <string>
15 
16 namespace yage {
17 
18 // window flags that can change it's appearance
19 enum WindowFlags : unsigned {
20  SHOWN = 0x1,
21  HIDDEN = 0x2,
22  FULLSCREEN = 0x4,
23  BORDERLESS = 0x8,
24 };
25 
26 // window wrapper around SDL_Window pointer
27 class Window {
28 private:
30  SDL_Window* window_ = nullptr;
31 
32 public:
33  Window();
34  Window(const Window&) = delete;
35  Window(Window&&) = delete;
37  ~Window();
38 
39  Window& operator=(const Window&) = delete;
40  Window& operator=(Window&&) = delete;
41 
43  void create(const std::string& window_name, int width, int height,
44  unsigned flags = WindowFlags::SHOWN);
46  void swapBuffer();
48  void clearBuffer();
49 };
50 
51 } // namespace yage
52 
53 #endif
Definition: camera2d.hpp:17