YAGE
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 
19 // window flags that can change it's appearance
20 enum WindowFlags : unsigned
21 {
22  SHOWN=0x1,
23  HIDDEN=0x2,
24  FULLSCREEN=0x4,
25  BORDERLESS=0x8,
26 };
27 
28 // window wrapper around SDL_Window pointer
29 class Window
30 {
31 public: // member variables
32 private:
33  // window handle
34  SDL_Window *window_=nullptr;
35 
36 public: // member functions
37  Window();
38  // destroys the window handle
39  ~Window();
40 
41  // create the window, initialize the handle and update the width and height
42  void create(const std::string &window_name, int width, int height, unsigned flags=WindowFlags::SHOWN);
43  // swap the buffer
44  void swapBuffer();
45  // clear buffer
46  void clearBuffer();
47 private:
48 };
49 
50 } // yage
51 
52 #endif
Definition: window.hpp:29
Definition: camera2d.hpp:17