1 /*
2  * Copyright (C) 2006-2020 by the Widelands Development Team
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  *
18  */
19 
20 #ifndef WL_GRAPHIC_GL_INITIALIZE_H
21 #define WL_GRAPHIC_GL_INITIALIZE_H
22 
23 #include <SDL_video.h>
24 
25 #include "graphic/gl/system_headers.h"
26 
27 namespace Gl {
28 
29 // Initializes OpenGL. Creates a context for 'window' using SDL and loads the
30 // GL library. Fills in 'max_texture_size' and returns the created SDL_Context
31 // which must be closed by the caller.
32 // If we are built against glbinding, 'trace' will set up tracing for
33 // OpenGL and output every single opengl call ever made, together with it's
34 // arguments, return values and the result from glGetError.
35 enum class Trace {
36 	kYes,
37 	kNo,
38 };
39 SDL_GLContext initialize(const Trace& trace, SDL_Window* window, GLint* max_texture_size);
40 
41 }  // namespace Gl
42 
43 #endif  // end of include guard: WL_GRAPHIC_GL_INITIALIZE_H
44