Overte C++ Documentation
gl/src/gl/Config.h
1 //
2 // GPUConfig.h
3 // libraries/gpu/src/gpu
4 //
5 // Created by Sam Gateau on 12/4/14.
6 // Copyright 2013 High Fidelity, Inc.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #ifndef hifi_gpu_GPUConfig_h
13 #define hifi_gpu_GPUConfig_h
14 
15 #include <QtCore/QtGlobal>
16 
17 #if defined(USE_GLES)
18 // Minimum GL ES version required is 3.2
19 #define GL_MIN_VERSION_MAJOR 0x03
20 #define GL_MIN_VERSION_MINOR 0x02
21 #define GL_DEFAULT_VERSION_MAJOR GL_MIN_VERSION_MAJOR
22 #define GL_DEFAULT_VERSION_MINOR GL_MIN_VERSION_MINOR
23 #else
24 // Minimum desktop GL version required is 4.1
25 #define GL_MIN_VERSION_MAJOR 0x04
26 #define GL_MIN_VERSION_MINOR 0x01
27 #define GL_DEFAULT_VERSION_MAJOR 0x04
28 #define GL_DEFAULT_VERSION_MINOR 0x05
29 #endif
30 
31 #define MINIMUM_GL_VERSION ((GL_MIN_VERSION_MAJOR << 8) | GL_MIN_VERSION_MINOR)
32 
33 #include <glad/glad.h>
34 
35 #if defined(Q_OS_ANDROID)
36 #include <EGL/egl.h>
37 #else
38 
39 #ifndef GL_SLUMINANCE8_EXT
40 #define GL_SLUMINANCE8_EXT 0x8C47
41 #endif
42 
43 // Prevent inclusion of System GL headers
44 #define __glext_h_
45 #define __gl_h_
46 #define __gl3_h_
47 
48 #endif
49 
50 // Platform specific code to load the GL functions
51 namespace gl {
52  void initModuleGl();
53  int getSwapInterval();
54  void setSwapInterval(int swapInterval);
55  bool queryCurrentRendererIntegerMESA(int attr, unsigned int *value);
56 }
57 
58 #endif // hifi_gpu_GPUConfig_h