vtk_glad.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef vtk_glad_h
4 #define vtk_glad_h
5 
6 /* Mobile device support. */
7 #define VTK_MODULE_vtkglad_GLES3 0
8 
9 #if VTK_MODULE_vtkglad_GLES3
10 #include <GLES3/gl3.h>
11 #elif TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
12 #include <OpenGLES/ES3/gl.h>
13 #else
14 #include <vtkglad/include/glad/gl.h>
15 #endif
16 
17 /* some fixes for both ES 2 and 3 */
18 #if defined(GL_ES_VERSION_3_0) || defined(GL_ES_VERSION_2_0)
19 #define GL_BACK_LEFT GL_BACK
20 #define GL_BACK_RIGHT GL_BACK
21 #define GL_FRONT_LEFT GL_FRONT
22 #define GL_FRONT_RIGHT GL_FRONT
23 
24 /* this sends all the data each time as opposed to allowing a subset */
25 #define glMultiDrawElements(mode, counts, type, indicies, primcount) \
26  for (size_t eCount = 0; eCount < primcount; ++eCount) \
27  { \
28  glDrawElements(mode, *(counts + eCount), type, (GLvoid*)(indicies[eCount])); \
29  }
30 #endif
31 
32 /*** deal with some GLES 3.0 specific issues ***/
33 #ifdef GL_ES_VERSION_3_0
34 #define GLAD_GL_ARB_vertex_array_object 1
35 #define GLAD_GL_ARB_instanced_arrays 1
36 #endif
37 
38 #endif // vtk_glad_h