Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/OpenGl_GlNative.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (c) 2021 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef OpenGl_GlNative_HeaderFile
0015 #define OpenGl_GlNative_HeaderFile
0016 
0017 // required for correct APIENTRY definition
0018 #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
0019   #define WIN32_LEAN_AND_MEAN
0020   #include <windows.h>
0021 #endif
0022 
0023 #ifndef APIENTRY
0024   #define APIENTRY
0025 #endif
0026 #ifndef APIENTRYP
0027   #define APIENTRYP APIENTRY *
0028 #endif
0029 #ifndef GLAPI
0030   #define GLAPI extern
0031 #endif
0032 
0033 #ifndef GL_APICALL
0034   #define GL_APICALL GLAPI
0035 #endif
0036 
0037 // exclude modern definitions and system-provided glext.h, should be defined before gl.h inclusion
0038 #ifndef GL_GLEXT_LEGACY
0039   #define GL_GLEXT_LEGACY
0040 #endif
0041 #ifndef GLX_GLXEXT_LEGACY
0042   #define GLX_GLXEXT_LEGACY
0043 #endif
0044 
0045 // include main OpenGL header provided with system
0046 #if defined(__APPLE__)
0047   #import <TargetConditionals.h>
0048   // macOS 10.4 deprecated OpenGL framework - suppress useless warnings
0049   #define GL_SILENCE_DEPRECATION
0050   #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
0051     #include <OpenGLES/ES3/gl.h>
0052   #else
0053     #include <OpenGL/gl.h>
0054   #endif
0055   #define __X_GL_H // prevent chaotic gl.h inclusions to avoid compile errors
0056 #elif defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__)
0057   #if defined(_WIN32)
0058     // Angle OpenGL ES headers do not define function prototypes even for core functions,
0059     // however OCCT is expected to be linked against libGLESv2
0060     #define GL_GLEXT_PROTOTYPES
0061   #endif
0062   #include <GLES3/gl3.h>
0063 #else
0064   #include <GL/gl.h>
0065 #endif
0066 
0067 #endif // OpenGl_GlNative_HeaderFile