Skip to content

Commit c5b4e1a

Browse files
committed
refactor in external dependencies and fixing include in example program
1 parent 2e3ed80 commit c5b4e1a

File tree

6 files changed

+8184
-197
lines changed

6 files changed

+8184
-197
lines changed

ext/glad.h renamed to ext/glad/gl.h

+58-36
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/**
2-
* Loader generated by glad 2.0.4 on Sun Mar 12 16:52:54 2023
3-
*
4-
* SPDX-License-Identifier: (WTFPL OR CC0-1.0) AND Apache-2.0
2+
* Loader generated by glad 2.0.0-beta on Tue Aug 24 22:51:07 2021
53
*
64
* Generator: C/C++
75
* Specification: gl
@@ -16,6 +14,7 @@
1614
* - HEADER_ONLY = True
1715
* - LOADER = False
1816
* - MX = False
17+
* - MX_GLOBAL = False
1918
* - ON_DEMAND = False
2019
*
2120
* Commandline:
@@ -26,6 +25,9 @@
2625
*
2726
*/
2827

28+
#ifndef GLAD_GL
29+
#define GLAD_GL
30+
2931
#ifndef GLAD_GL_H_
3032
#define GLAD_GL_H_
3133

@@ -116,8 +118,6 @@ extern "C" {
116118
#define GLAD_GNUC_EXTENSION
117119
#endif
118120

119-
#define GLAD_UNUSED(x) (void)(x)
120-
121121
#ifndef GLAD_API_CALL
122122
#if defined(GLAD_API_CALL_EXPORT)
123123
#if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__)
@@ -164,7 +164,7 @@ extern "C" {
164164
#define GLAD_VERSION_MAJOR(version) (version / 10000)
165165
#define GLAD_VERSION_MINOR(version) (version % 10000)
166166

167-
#define GLAD_GENERATOR_VERSION "2.0.4"
167+
#define GLAD_GENERATOR_VERSION "2.0.0-beta"
168168

169169
typedef void (*GLADapiproc)(void);
170170

@@ -1637,20 +1637,6 @@ typedef int64_t khronos_int64_t;
16371637
typedef uint64_t khronos_uint64_t;
16381638
#define KHRONOS_SUPPORT_INT64 1
16391639
#define KHRONOS_SUPPORT_FLOAT 1
1640-
/*
1641-
* To support platform where unsigned long cannot be used interchangeably with
1642-
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
1643-
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
1644-
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
1645-
* unsigned long long or similar (this results in different C++ name mangling).
1646-
* To avoid changes for existing platforms, we restrict usage of intptr_t to
1647-
* platforms where the size of a pointer is larger than the size of long.
1648-
*/
1649-
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
1650-
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
1651-
#define KHRONOS_USE_INTPTR_T
1652-
#endif
1653-
#endif
16541640

16551641
#elif defined(__VMS ) || defined(__sgi)
16561642

@@ -1733,21 +1719,14 @@ typedef unsigned short int khronos_uint16_t;
17331719
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
17341720
* to be the only LLP64 architecture in current use.
17351721
*/
1736-
#ifdef KHRONOS_USE_INTPTR_T
1737-
typedef intptr_t khronos_intptr_t;
1738-
typedef uintptr_t khronos_uintptr_t;
1739-
#elif defined(_WIN64)
1722+
#ifdef _WIN64
17401723
typedef signed long long int khronos_intptr_t;
17411724
typedef unsigned long long int khronos_uintptr_t;
1742-
#else
1743-
typedef signed long int khronos_intptr_t;
1744-
typedef unsigned long int khronos_uintptr_t;
1745-
#endif
1746-
1747-
#if defined(_WIN64)
17481725
typedef signed long long int khronos_ssize_t;
17491726
typedef unsigned long long int khronos_usize_t;
17501727
#else
1728+
typedef signed long int khronos_intptr_t;
1729+
typedef unsigned long int khronos_uintptr_t;
17511730
typedef signed long int khronos_ssize_t;
17521731
typedef unsigned long int khronos_usize_t;
17531732
#endif
@@ -1793,70 +1772,113 @@ typedef enum {
17931772
} khronos_boolean_enum_t;
17941773

17951774
#endif /* __khrplatform_h_ */
1775+
17961776
typedef unsigned int GLenum;
1777+
17971778
typedef unsigned char GLboolean;
1779+
17981780
typedef unsigned int GLbitfield;
1781+
17991782
typedef void GLvoid;
1783+
18001784
typedef khronos_int8_t GLbyte;
1785+
18011786
typedef khronos_uint8_t GLubyte;
1787+
18021788
typedef khronos_int16_t GLshort;
1789+
18031790
typedef khronos_uint16_t GLushort;
1791+
18041792
typedef int GLint;
1793+
18051794
typedef unsigned int GLuint;
1795+
18061796
typedef khronos_int32_t GLclampx;
1797+
18071798
typedef int GLsizei;
1799+
18081800
typedef khronos_float_t GLfloat;
1801+
18091802
typedef khronos_float_t GLclampf;
1803+
18101804
typedef double GLdouble;
1805+
18111806
typedef double GLclampd;
1807+
18121808
typedef void *GLeglClientBufferEXT;
1809+
18131810
typedef void *GLeglImageOES;
1811+
18141812
typedef char GLchar;
1813+
18151814
typedef char GLcharARB;
1815+
18161816
#ifdef __APPLE__
18171817
typedef void *GLhandleARB;
18181818
#else
18191819
typedef unsigned int GLhandleARB;
18201820
#endif
1821+
18211822
typedef khronos_uint16_t GLhalf;
1823+
18221824
typedef khronos_uint16_t GLhalfARB;
1825+
18231826
typedef khronos_int32_t GLfixed;
1827+
18241828
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
18251829
typedef khronos_intptr_t GLintptr;
18261830
#else
18271831
typedef khronos_intptr_t GLintptr;
18281832
#endif
1833+
18291834
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
18301835
typedef khronos_intptr_t GLintptrARB;
18311836
#else
18321837
typedef khronos_intptr_t GLintptrARB;
18331838
#endif
1839+
18341840
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
18351841
typedef khronos_ssize_t GLsizeiptr;
18361842
#else
18371843
typedef khronos_ssize_t GLsizeiptr;
18381844
#endif
1845+
18391846
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
18401847
typedef khronos_ssize_t GLsizeiptrARB;
18411848
#else
18421849
typedef khronos_ssize_t GLsizeiptrARB;
18431850
#endif
1851+
18441852
typedef khronos_int64_t GLint64;
1853+
18451854
typedef khronos_int64_t GLint64EXT;
1855+
18461856
typedef khronos_uint64_t GLuint64;
1857+
18471858
typedef khronos_uint64_t GLuint64EXT;
1859+
18481860
typedef struct __GLsync *GLsync;
1861+
18491862
struct _cl_context;
1863+
18501864
struct _cl_event;
1865+
18511866
typedef void (GLAD_API_PTR *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1867+
18521868
typedef void (GLAD_API_PTR *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1869+
18531870
typedef void (GLAD_API_PTR *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1871+
18541872
typedef void (GLAD_API_PTR *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
1873+
18551874
typedef unsigned short GLhalfNV;
1875+
18561876
typedef GLintptr GLvdpauSurfaceNV;
1877+
18571878
typedef void (GLAD_API_PTR *GLVULKANPROCNV)(void);
18581879

18591880

1881+
18601882
#define GL_VERSION_1_0 1
18611883
GLAD_API_CALL int GLAD_GL_VERSION_1_0;
18621884
#define GL_VERSION_1_1 1
@@ -4172,9 +4194,6 @@ GLAD_API_CALL int gladLoadGL( GLADloadfunc load);
41724194

41734195
/* Source */
41744196
#ifdef GLAD_GL_IMPLEMENTATION
4175-
/**
4176-
* SPDX-License-Identifier: (WTFPL OR CC0-1.0) AND Apache-2.0
4177-
*/
41784197
#include <stdio.h>
41794198
#include <stdlib.h>
41804199
#include <string.h>
@@ -5788,9 +5807,9 @@ static int glad_gl_get_extensions( int version, const char **out_exts, unsigned
57885807
#if GLAD_GL_IS_SOME_NEW_VERSION
57895808
if(GLAD_VERSION_MAJOR(version) < 3) {
57905809
#else
5791-
GLAD_UNUSED(version);
5792-
GLAD_UNUSED(out_num_exts_i);
5793-
GLAD_UNUSED(out_exts_i);
5810+
(void) version;
5811+
(void) out_num_exts_i;
5812+
(void) out_exts_i;
57945813
#endif
57955814
if (glad_glGetString == NULL) {
57965815
return 0;
@@ -5978,3 +5997,6 @@ int gladLoadGL( GLADloadfunc load) {
59785997

59795998
#endif /* GLAD_GL_IMPLEMENTATION */
59805999

6000+
6001+
6002+
#endif // GLAD_GL

0 commit comments

Comments
 (0)