KiCad PCB EDA Suite
kiglew.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
28 #ifndef KIGLEW_H_
29 #define KIGLEW_H_
30 
31 // Pull in the configuration options for wxWidgets
32 #include <wx/platform.h>
33 
34 // Apple, in their infinite wisdom, has decided to mark OpenGL as deprecated.
35 // Luckily we can silence warnings about its deprecation. This is needed on the GLEW
36 // includes since they transitively include the OpenGL headers.
37 #define GL_SILENCE_DEPRECATION 1
38 
39 #ifdef __WXGTK__
40 
41  #ifdef KICAD_USE_EGL
42 
43  #if wxUSE_GLCANVAS_EGL
44  // wxWidgets was compiled with the EGL canvas, so use the EGL header for GLEW
45  #include <GL/eglew.h>
46  #else
47  #error "KICAD_USE_EGL can only be used when wxWidgets is compiled with the EGL canvas"
48  #endif
49 
50  #else // KICAD_USE_EGL
51 
52  #if wxUSE_GLCANVAS_EGL
53  #error "KICAD_USE_EGL must be defined since wxWidgets has been compiled with the EGL canvas"
54  #else
55  // wxWidgets wasn't compiled with the EGL canvas, so use the X11 GLEW
56  #include <GL/glxew.h>
57  #endif
58 
59  #endif // KICAD_USE_EGL
60 
61 #else // __WXGTK__
62 
63  // Non-GTK platforms only need the normal GLEW include
64  #include <GL/glew.h>
65 
66 #endif // __WXGTK__
67 
68 #endif // KIGLEW_H_