-
-
Notifications
You must be signed in to change notification settings - Fork 988
/
context.hpp
51 lines (38 loc) · 1.11 KB
/
context.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Copyright (C) 2017 by the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
#pragma once
#ifdef USE_GL_RENDERING
#include "sdl/window.hpp"
#include <GL/glew.h>
#include <GL/gl.h>
namespace gl
{
/** Encapsulates the management of an OpenGL context for the current window. */
class context
{
public:
context(const context&) = delete;
context& operator=(const context&) = delete;
/**
* Constructor
*
* @param window The SDL window to attach a context to.
*/
context(sdl::window* window);
~context();
private:
/** Sets any relevant flags for the GL context. */
void set_context_flags();
/** The window's OpenGL context. */
SDL_GLContext gl_context_;
};
} // namespace gl
#endif // USE_GL_RENDERING