Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches
GL.h
1/*
2 * Copyright (C) 2005-2019 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#pragma once
10
11#ifdef __cplusplus
12
13//==============================================================================
61
62#if HAS_GL
63#define GL_TYPE_STRING "GL"
64// always define GL_GLEXT_PROTOTYPES before include gl headers
65#if !defined(GL_GLEXT_PROTOTYPES)
66#define GL_GLEXT_PROTOTYPES
67#endif
68#if defined(TARGET_LINUX)
69#include <GL/gl.h>
70#include <GL/glext.h>
71#elif defined(TARGET_FREEBSD)
72#include <GL/gl.h>
73#elif defined(TARGET_DARWIN)
74#include <OpenGL/gl3.h>
75#include <OpenGL/gl3ext.h>
76#elif defined(WIN32)
77#error Use of GL under Windows is not possible
78#endif
79#elif HAS_GLES >= 2
80#define GL_TYPE_STRING "GLES"
81#if defined(WIN32)
82#if defined(HAS_ANGLE)
83#include <angle_gl.h>
84#else
85#error Use of GLES only be available under Windows by the use of angle
86#endif
87#elif defined(TARGET_DARWIN)
88#if HAS_GLES == 3
89#include <OpenGLES/ES3/gl.h>
90#include <OpenGLES/ES3/glext.h>
91#else
92#include <OpenGLES/ES2/gl.h>
93#include <OpenGLES/ES2/glext.h>
94#endif
95#else
96#if HAS_GLES == 3
97#include <GLES3/gl3.h>
98#else
99#include <GLES2/gl2.h>
100#include <GLES2/gl2ext.h>
101#endif
102#endif
103#endif
104
105#ifndef BUFFER_OFFSET
108#define BUFFER_OFFSET(i) ((char*)nullptr + (i))
109#endif
110
111#endif /* __cplusplus */