YAGE
v0.1.1
Yet Another Game Engine
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
9
#ifndef WINDOW_H
10
#define WINDOW_H
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
SHOWN
= 0x1,
22
HIDDEN
= 0x2,
23
FULLSCREEN
= 0x4,
24
BORDERLESS
= 0x8,
25
};
26
27
// window wrapper around SDL_Window pointer
28
class
Window
29
{
30
private
:
32
SDL_Window *
window_
=
nullptr
;
33
34
public
:
35
Window
();
36
Window
(
const
Window
&) =
delete
;
37
Window
(
Window
&&) =
delete
;
39
~Window
();
40
41
Window
&
operator=
(
const
Window
&) =
delete
;
42
Window
&
operator=
(
Window
&&) =
delete
;
43
45
void
create
(
const
std::string &window_name,
int
width,
int
height,
46
unsigned
flags =
WindowFlags::SHOWN
);
48
void
swapBuffer
();
50
void
clearBuffer
();
51
};
52
53
}
// namespace yage
54
55
#endif
yage::HIDDEN
Definition:
window.h:22
yage::Window::Window
Window()
yage::Window::swapBuffer
void swapBuffer()
swap the buffer
Definition:
window.cpp:83
yage::Window
Definition:
window.h:28
yage::Window::create
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:25
yage::FULLSCREEN
Definition:
window.h:23
yage::WindowFlags
WindowFlags
Definition:
window.h:20
yage::Window::window_
SDL_Window * window_
window handle
Definition:
window.h:32
yage::Window::~Window
~Window()
destroys the window handle
Definition:
window.cpp:20
yage::SHOWN
Definition:
window.h:21
yage::Window::clearBuffer
void clearBuffer()
clear buffer
Definition:
window.cpp:89
yage
Project namespace.
Definition:
body.cpp:13
yage::Window::operator=
Window & operator=(const Window &)=delete
yage::BORDERLESS
Definition:
window.h:24
include
YAGE
window.h
Generated on Sat Sep 2 2017 12:35:08 for YAGE by
1.8.13