2020-11-10 23:24:01 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2022-11-17 16:29:11 +00:00
|
|
|
* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
2020-11-10 23:24:01 +00:00
|
|
|
*
|
|
|
|
* 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; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This file is used for including the proper GLEW header for the platform.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KIGLEW_H_
|
|
|
|
#define KIGLEW_H_
|
|
|
|
|
|
|
|
// Pull in the configuration options for wxWidgets
|
2020-11-11 23:12:21 +00:00
|
|
|
#include <wx/platform.h>
|
2020-11-10 23:24:01 +00:00
|
|
|
|
|
|
|
// Apple, in their infinite wisdom, has decided to mark OpenGL as deprecated.
|
|
|
|
// Luckily we can silence warnings about its deprecation. This is needed on the GLEW
|
|
|
|
// includes since they transitively include the OpenGL headers.
|
|
|
|
#define GL_SILENCE_DEPRECATION 1
|
|
|
|
|
2024-06-01 01:14:48 +00:00
|
|
|
#if defined( __unix__ ) and not defined( __APPLE__ )
|
2020-11-10 23:24:01 +00:00
|
|
|
|
|
|
|
#ifdef KICAD_USE_EGL
|
|
|
|
|
2021-06-06 13:58:09 +00:00
|
|
|
#if wxUSE_GLCANVAS_EGL
|
2020-11-10 23:24:01 +00:00
|
|
|
// wxWidgets was compiled with the EGL canvas, so use the EGL header for GLEW
|
|
|
|
#include <GL/eglew.h>
|
|
|
|
#else
|
|
|
|
#error "KICAD_USE_EGL can only be used when wxWidgets is compiled with the EGL canvas"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#else // KICAD_USE_EGL
|
|
|
|
|
2021-06-06 13:58:09 +00:00
|
|
|
#if wxUSE_GLCANVAS_EGL
|
2020-11-10 23:24:01 +00:00
|
|
|
#error "KICAD_USE_EGL must be defined since wxWidgets has been compiled with the EGL canvas"
|
|
|
|
#else
|
|
|
|
// wxWidgets wasn't compiled with the EGL canvas, so use the X11 GLEW
|
|
|
|
#include <GL/glxew.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // KICAD_USE_EGL
|
|
|
|
|
2024-06-01 01:14:48 +00:00
|
|
|
#else // defined( __unix__ ) and not defined( __APPLE__ )
|
2020-11-10 23:24:01 +00:00
|
|
|
|
|
|
|
// Non-GTK platforms only need the normal GLEW include
|
|
|
|
#include <GL/glew.h>
|
|
|
|
|
2024-06-01 01:14:48 +00:00
|
|
|
#endif // defined( __unix__ ) and not defined( __APPLE__ )
|
2020-11-10 23:24:01 +00:00
|
|
|
|
2022-11-17 16:29:11 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
|
|
|
|
#include <GL/wglew.h>
|
|
|
|
|
|
|
|
#endif // _WIN32
|
|
|
|
|
2020-11-10 23:24:01 +00:00
|
|
|
#endif // KIGLEW_H_
|