[rlgl] Check for extensions before enabling them
This commit is contained in:
parent
ff25402f68
commit
6061d1b94b
337
src/external/glad.h
vendored
337
src/external/glad.h
vendored
|
|
@ -1,9 +1,9 @@
|
|||
/**
|
||||
* Loader generated by glad 2.0.0-beta on Sun Oct 17 18:39:09 2021
|
||||
* Loader generated by glad 2.0.0-beta on Sun Sep 18 14:40:24 2022
|
||||
*
|
||||
* Generator: C/C++
|
||||
* Specification: gl
|
||||
* Extensions: 110
|
||||
* Extensions: 116
|
||||
*
|
||||
* APIs:
|
||||
* - gl:core=4.3
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
* - ON_DEMAND = False
|
||||
*
|
||||
* Commandline:
|
||||
* --api='gl:core=4.3' --extensions='GL_ARB_ES2_compatibility,GL_ARB_ES3_1_compatibility,GL_ARB_ES3_2_compatibility,GL_ARB_ES3_compatibility,GL_ARB_blend_func_extended,GL_ARB_buffer_storage,GL_ARB_clear_buffer_object,GL_ARB_clear_texture,GL_ARB_color_buffer_float,GL_ARB_compatibility,GL_ARB_compressed_texture_pixel_storage,GL_ARB_compute_shader,GL_ARB_compute_variable_group_size,GL_ARB_copy_buffer,GL_ARB_copy_image,GL_ARB_debug_output,GL_ARB_depth_buffer_float,GL_ARB_depth_clamp,GL_ARB_depth_texture,GL_ARB_direct_state_access,GL_ARB_draw_buffers,GL_ARB_draw_buffers_blend,GL_ARB_draw_elements_base_vertex,GL_ARB_draw_indirect,GL_ARB_draw_instanced,GL_ARB_enhanced_layouts,GL_ARB_explicit_attrib_location,GL_ARB_explicit_uniform_location,GL_ARB_fragment_coord_conventions,GL_ARB_fragment_layer_viewport,GL_ARB_fragment_program,GL_ARB_fragment_program_shadow,GL_ARB_fragment_shader,GL_ARB_fragment_shader_interlock,GL_ARB_framebuffer_no_attachments,GL_ARB_framebuffer_object,GL_ARB_framebuffer_sRGB,GL_ARB_geometry_shader4,GL_ARB_get_program_binary,GL_ARB_get_texture_sub_image,GL_ARB_gl_spirv,GL_ARB_gpu_shader5,GL_ARB_gpu_shader_fp64,GL_ARB_gpu_shader_int64,GL_ARB_half_float_pixel,GL_ARB_half_float_vertex,GL_ARB_instanced_arrays,GL_ARB_internalformat_query,GL_ARB_internalformat_query2,GL_ARB_map_buffer_range,GL_ARB_multi_bind,GL_ARB_multi_draw_indirect,GL_ARB_multisample,GL_ARB_multitexture,GL_ARB_occlusion_query,GL_ARB_occlusion_query2,GL_ARB_pipeline_statistics_query,GL_ARB_query_buffer_object,GL_ARB_sample_locations,GL_ARB_sample_shading,GL_ARB_seamless_cube_map,GL_ARB_seamless_cubemap_per_texture,GL_ARB_shader_atomic_counter_ops,GL_ARB_shader_atomic_counters,GL_ARB_shader_bit_encoding,GL_ARB_shader_clock,GL_ARB_shader_image_load_store,GL_ARB_shader_image_size,GL_ARB_shader_objects,GL_ARB_shader_storage_buffer_object,GL_ARB_shader_texture_lod,GL_ARB_shading_language_100,GL_ARB_shading_language_420pack,GL_ARB_shading_language_include,GL_ARB_shading_language_packing,GL_ARB_spirv_extensions,GL_ARB_tessellation_shader,GL_ARB_texture_border_clamp,GL_ARB_texture_buffer_object_rgb32,GL_ARB_texture_compression,GL_ARB_texture_cube_map,GL_ARB_texture_cube_map_array,GL_ARB_texture_env_add,GL_ARB_texture_filter_anisotropic,GL_ARB_texture_filter_minmax,GL_ARB_texture_float,GL_ARB_texture_mirror_clamp_to_edge,GL_ARB_texture_mirrored_repeat,GL_ARB_texture_multisample,GL_ARB_texture_non_power_of_two,GL_ARB_texture_rg,GL_ARB_texture_storage,GL_ARB_texture_swizzle,GL_ARB_texture_view,GL_ARB_timer_query,GL_ARB_transpose_matrix,GL_ARB_uniform_buffer_object,GL_ARB_vertex_array_bgra,GL_ARB_vertex_array_object,GL_ARB_vertex_attrib_binding,GL_ARB_vertex_buffer_object,GL_ARB_vertex_program,GL_ARB_vertex_shader,GL_EXT_fog_coord,GL_EXT_framebuffer_blit,GL_EXT_framebuffer_multisample,GL_EXT_framebuffer_object,GL_EXT_framebuffer_sRGB,GL_OES_compressed_paletted_texture,GL_OES_fixed_point' c --header-only --loader
|
||||
* --api='gl:core=4.3' --extensions='GL_ARB_ES2_compatibility,GL_ARB_ES3_1_compatibility,GL_ARB_ES3_2_compatibility,GL_ARB_ES3_compatibility,GL_ARB_blend_func_extended,GL_ARB_buffer_storage,GL_ARB_clear_buffer_object,GL_ARB_clear_texture,GL_ARB_color_buffer_float,GL_ARB_compatibility,GL_ARB_compressed_texture_pixel_storage,GL_ARB_compute_shader,GL_ARB_compute_variable_group_size,GL_ARB_copy_buffer,GL_ARB_copy_image,GL_ARB_debug_output,GL_ARB_depth_buffer_float,GL_ARB_depth_clamp,GL_ARB_depth_texture,GL_ARB_direct_state_access,GL_ARB_draw_buffers,GL_ARB_draw_buffers_blend,GL_ARB_draw_elements_base_vertex,GL_ARB_draw_indirect,GL_ARB_draw_instanced,GL_ARB_enhanced_layouts,GL_ARB_explicit_attrib_location,GL_ARB_explicit_uniform_location,GL_ARB_fragment_coord_conventions,GL_ARB_fragment_layer_viewport,GL_ARB_fragment_program,GL_ARB_fragment_program_shadow,GL_ARB_fragment_shader,GL_ARB_fragment_shader_interlock,GL_ARB_framebuffer_no_attachments,GL_ARB_framebuffer_object,GL_ARB_framebuffer_sRGB,GL_ARB_geometry_shader4,GL_ARB_get_program_binary,GL_ARB_get_texture_sub_image,GL_ARB_gl_spirv,GL_ARB_gpu_shader5,GL_ARB_gpu_shader_fp64,GL_ARB_gpu_shader_int64,GL_ARB_half_float_pixel,GL_ARB_half_float_vertex,GL_ARB_instanced_arrays,GL_ARB_internalformat_query,GL_ARB_internalformat_query2,GL_ARB_map_buffer_range,GL_ARB_multi_bind,GL_ARB_multi_draw_indirect,GL_ARB_multisample,GL_ARB_multitexture,GL_ARB_occlusion_query,GL_ARB_occlusion_query2,GL_ARB_pipeline_statistics_query,GL_ARB_query_buffer_object,GL_ARB_sample_locations,GL_ARB_sample_shading,GL_ARB_seamless_cube_map,GL_ARB_seamless_cubemap_per_texture,GL_ARB_shader_atomic_counter_ops,GL_ARB_shader_atomic_counters,GL_ARB_shader_bit_encoding,GL_ARB_shader_clock,GL_ARB_shader_image_load_store,GL_ARB_shader_image_size,GL_ARB_shader_objects,GL_ARB_shader_storage_buffer_object,GL_ARB_shader_texture_lod,GL_ARB_shading_language_100,GL_ARB_shading_language_420pack,GL_ARB_shading_language_include,GL_ARB_shading_language_packing,GL_ARB_spirv_extensions,GL_ARB_tessellation_shader,GL_ARB_texture_border_clamp,GL_ARB_texture_buffer_object_rgb32,GL_ARB_texture_compression,GL_ARB_texture_cube_map,GL_ARB_texture_cube_map_array,GL_ARB_texture_env_add,GL_ARB_texture_filter_anisotropic,GL_ARB_texture_filter_minmax,GL_ARB_texture_float,GL_ARB_texture_mirror_clamp_to_edge,GL_ARB_texture_mirrored_repeat,GL_ARB_texture_multisample,GL_ARB_texture_non_power_of_two,GL_ARB_texture_rg,GL_ARB_texture_storage,GL_ARB_texture_swizzle,GL_ARB_texture_view,GL_ARB_timer_query,GL_ARB_transpose_matrix,GL_ARB_uniform_buffer_object,GL_ARB_vertex_array_bgra,GL_ARB_vertex_array_object,GL_ARB_vertex_attrib_binding,GL_ARB_vertex_buffer_object,GL_ARB_vertex_program,GL_ARB_vertex_shader,GL_EXT_draw_instanced,GL_EXT_fog_coord,GL_EXT_framebuffer_blit,GL_EXT_framebuffer_multisample,GL_EXT_framebuffer_object,GL_EXT_framebuffer_sRGB,GL_EXT_texture_compression_s3tc,GL_EXT_texture_filter_anisotropic,GL_EXT_texture_mirror_clamp,GL_KHR_texture_compression_astc_hdr,GL_KHR_texture_compression_astc_ldr,GL_OES_compressed_paletted_texture,GL_OES_fixed_point' c --header-only --loader
|
||||
*
|
||||
* Online:
|
||||
* http://glad.sh/#api=gl%3Acore%3D4.3&generator=c&options=HEADER_ONLY%2CLOADER
|
||||
|
|
@ -381,11 +381,25 @@ typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apipro
|
|||
#define GL_COMPRESSED_RGBA 0x84EE
|
||||
#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
|
||||
#define GL_COMPRESSED_RGBA_ARB 0x84EE
|
||||
#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB
|
||||
#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8
|
||||
#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9
|
||||
#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA
|
||||
#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC
|
||||
#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD
|
||||
#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
|
||||
#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1
|
||||
#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2
|
||||
#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3
|
||||
#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4
|
||||
#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5
|
||||
#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6
|
||||
#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7
|
||||
#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C
|
||||
#define GL_COMPRESSED_RGB_ARB 0x84ED
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
|
||||
#define GL_COMPRESSED_RGB_ARB 0x84ED
|
||||
#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E
|
||||
#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F
|
||||
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
|
||||
|
|
@ -395,6 +409,20 @@ typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apipro
|
|||
#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
|
||||
#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
|
||||
#define GL_COMPRESSED_SRGB 0x8C48
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7
|
||||
#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
|
||||
#define GL_COMPRESSED_SRGB8_ETC2 0x9275
|
||||
#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
|
||||
|
|
@ -1067,6 +1095,7 @@ typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apipro
|
|||
#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
|
||||
#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
|
||||
#define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF
|
||||
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
|
||||
#define GL_MAX_TEXTURE_SIZE 0x0D33
|
||||
#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
|
||||
#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70
|
||||
|
|
@ -1113,7 +1142,10 @@ typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apipro
|
|||
#define GL_MIPMAP 0x8293
|
||||
#define GL_MIRRORED_REPEAT 0x8370
|
||||
#define GL_MIRRORED_REPEAT_ARB 0x8370
|
||||
#define GL_MIRROR_CLAMP_EXT 0x8742
|
||||
#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
|
||||
#define GL_MIRROR_CLAMP_TO_EDGE 0x8743
|
||||
#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
|
||||
#define GL_MULTISAMPLE 0x809D
|
||||
#define GL_MULTISAMPLE_ARB 0x809D
|
||||
#define GL_MULTISAMPLE_BIT_ARB 0x20000000
|
||||
|
|
@ -1749,6 +1781,7 @@ typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apipro
|
|||
#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
|
||||
#define GL_TEXTURE_MAG_FILTER 0x2800
|
||||
#define GL_TEXTURE_MAX_ANISOTROPY 0x84FE
|
||||
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
|
||||
#define GL_TEXTURE_MAX_LEVEL 0x813D
|
||||
#define GL_TEXTURE_MAX_LOD 0x813B
|
||||
#define GL_TEXTURE_MIN_FILTER 0x2801
|
||||
|
|
@ -2159,6 +2192,20 @@ typedef int64_t khronos_int64_t;
|
|||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
/*
|
||||
* To support platform where unsigned long cannot be used interchangeably with
|
||||
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
|
||||
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
|
||||
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
|
||||
* unsigned long long or similar (this results in different C++ name mangling).
|
||||
* To avoid changes for existing platforms, we restrict usage of intptr_t to
|
||||
* platforms where the size of a pointer is larger than the size of long.
|
||||
*/
|
||||
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
|
||||
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
|
||||
#define KHRONOS_USE_INTPTR_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#elif defined(__VMS ) || defined(__sgi)
|
||||
|
||||
|
|
@ -2241,14 +2288,21 @@ typedef unsigned short int khronos_uint16_t;
|
|||
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
||||
* to be the only LLP64 architecture in current use.
|
||||
*/
|
||||
#ifdef _WIN64
|
||||
#ifdef KHRONOS_USE_INTPTR_T
|
||||
typedef intptr_t khronos_intptr_t;
|
||||
typedef uintptr_t khronos_uintptr_t;
|
||||
#elif defined(_WIN64)
|
||||
typedef signed long long int khronos_intptr_t;
|
||||
typedef unsigned long long int khronos_uintptr_t;
|
||||
typedef signed long long int khronos_ssize_t;
|
||||
typedef unsigned long long int khronos_usize_t;
|
||||
#else
|
||||
typedef signed long int khronos_intptr_t;
|
||||
typedef unsigned long int khronos_uintptr_t;
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64)
|
||||
typedef signed long long int khronos_ssize_t;
|
||||
typedef unsigned long long int khronos_usize_t;
|
||||
#else
|
||||
typedef signed long int khronos_ssize_t;
|
||||
typedef unsigned long int khronos_usize_t;
|
||||
#endif
|
||||
|
|
@ -2294,113 +2348,70 @@ typedef enum {
|
|||
} khronos_boolean_enum_t;
|
||||
|
||||
#endif /* __khrplatform_h_ */
|
||||
|
||||
typedef unsigned int GLenum;
|
||||
|
||||
typedef unsigned char GLboolean;
|
||||
|
||||
typedef unsigned int GLbitfield;
|
||||
|
||||
typedef void GLvoid;
|
||||
|
||||
typedef khronos_int8_t GLbyte;
|
||||
|
||||
typedef khronos_uint8_t GLubyte;
|
||||
|
||||
typedef khronos_int16_t GLshort;
|
||||
|
||||
typedef khronos_uint16_t GLushort;
|
||||
|
||||
typedef int GLint;
|
||||
|
||||
typedef unsigned int GLuint;
|
||||
|
||||
typedef khronos_int32_t GLclampx;
|
||||
|
||||
typedef int GLsizei;
|
||||
|
||||
typedef khronos_float_t GLfloat;
|
||||
|
||||
typedef khronos_float_t GLclampf;
|
||||
|
||||
typedef double GLdouble;
|
||||
|
||||
typedef double GLclampd;
|
||||
|
||||
typedef void* GLeglClientBufferEXT;
|
||||
|
||||
typedef void* GLeglImageOES;
|
||||
|
||||
typedef char GLchar;
|
||||
|
||||
typedef char GLcharARB;
|
||||
|
||||
#ifdef __APPLE__
|
||||
typedef void* GLhandleARB;
|
||||
#else
|
||||
typedef unsigned int GLhandleARB;
|
||||
#endif
|
||||
|
||||
typedef khronos_uint16_t GLhalf;
|
||||
|
||||
typedef khronos_uint16_t GLhalfARB;
|
||||
|
||||
typedef khronos_int32_t GLfixed;
|
||||
|
||||
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
|
||||
typedef khronos_intptr_t GLintptr;
|
||||
#else
|
||||
typedef khronos_intptr_t GLintptr;
|
||||
#endif
|
||||
|
||||
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
|
||||
typedef khronos_intptr_t GLintptrARB;
|
||||
#else
|
||||
typedef khronos_intptr_t GLintptrARB;
|
||||
#endif
|
||||
|
||||
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
|
||||
typedef khronos_ssize_t GLsizeiptr;
|
||||
#else
|
||||
typedef khronos_ssize_t GLsizeiptr;
|
||||
#endif
|
||||
|
||||
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
|
||||
typedef khronos_ssize_t GLsizeiptrARB;
|
||||
#else
|
||||
typedef khronos_ssize_t GLsizeiptrARB;
|
||||
#endif
|
||||
|
||||
typedef khronos_int64_t GLint64;
|
||||
|
||||
typedef khronos_int64_t GLint64EXT;
|
||||
|
||||
typedef khronos_uint64_t GLuint64;
|
||||
|
||||
typedef khronos_uint64_t GLuint64EXT;
|
||||
|
||||
typedef struct __GLsync* GLsync;
|
||||
|
||||
struct _cl_context;
|
||||
|
||||
struct _cl_event;
|
||||
|
||||
typedef void (GLAD_API_PTR* GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam);
|
||||
|
||||
typedef void (GLAD_API_PTR* GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam);
|
||||
|
||||
typedef void (GLAD_API_PTR* GLDEBUGPROCKHR)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam);
|
||||
|
||||
typedef void (GLAD_API_PTR* GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, void* userParam);
|
||||
|
||||
typedef unsigned short GLhalfNV;
|
||||
|
||||
typedef GLintptr GLvdpauSurfaceNV;
|
||||
|
||||
typedef void (GLAD_API_PTR* GLVULKANPROCNV)(void);
|
||||
|
||||
|
||||
|
||||
#define GL_VERSION_1_0 1
|
||||
GLAD_API_CALL int GLAD_GL_VERSION_1_0;
|
||||
#define GL_VERSION_1_1 1
|
||||
|
|
@ -2593,8 +2604,6 @@ GLAD_API_CALL int GLAD_GL_ARB_texture_border_clamp;
|
|||
GLAD_API_CALL int GLAD_GL_ARB_texture_buffer_object_rgb32;
|
||||
#define GL_ARB_texture_compression 1
|
||||
GLAD_API_CALL int GLAD_GL_ARB_texture_compression;
|
||||
#define GL_EXT_texture_compression_s3tc 1
|
||||
GLAD_API_CALL int GLAD_GL_EXT_texture_compression_s3tc;
|
||||
#define GL_ARB_texture_cube_map 1
|
||||
GLAD_API_CALL int GLAD_GL_ARB_texture_cube_map;
|
||||
#define GL_ARB_texture_cube_map_array 1
|
||||
|
|
@ -2641,6 +2650,8 @@ GLAD_API_CALL int GLAD_GL_ARB_vertex_buffer_object;
|
|||
GLAD_API_CALL int GLAD_GL_ARB_vertex_program;
|
||||
#define GL_ARB_vertex_shader 1
|
||||
GLAD_API_CALL int GLAD_GL_ARB_vertex_shader;
|
||||
#define GL_EXT_draw_instanced 1
|
||||
GLAD_API_CALL int GLAD_GL_EXT_draw_instanced;
|
||||
#define GL_EXT_fog_coord 1
|
||||
GLAD_API_CALL int GLAD_GL_EXT_fog_coord;
|
||||
#define GL_EXT_framebuffer_blit 1
|
||||
|
|
@ -2651,6 +2662,16 @@ GLAD_API_CALL int GLAD_GL_EXT_framebuffer_multisample;
|
|||
GLAD_API_CALL int GLAD_GL_EXT_framebuffer_object;
|
||||
#define GL_EXT_framebuffer_sRGB 1
|
||||
GLAD_API_CALL int GLAD_GL_EXT_framebuffer_sRGB;
|
||||
#define GL_EXT_texture_compression_s3tc 1
|
||||
GLAD_API_CALL int GLAD_GL_EXT_texture_compression_s3tc;
|
||||
#define GL_EXT_texture_filter_anisotropic 1
|
||||
GLAD_API_CALL int GLAD_GL_EXT_texture_filter_anisotropic;
|
||||
#define GL_EXT_texture_mirror_clamp 1
|
||||
GLAD_API_CALL int GLAD_GL_EXT_texture_mirror_clamp;
|
||||
#define GL_KHR_texture_compression_astc_hdr 1
|
||||
GLAD_API_CALL int GLAD_GL_KHR_texture_compression_astc_hdr;
|
||||
#define GL_KHR_texture_compression_astc_ldr 1
|
||||
GLAD_API_CALL int GLAD_GL_KHR_texture_compression_astc_ldr;
|
||||
#define GL_OES_compressed_paletted_texture 1
|
||||
GLAD_API_CALL int GLAD_GL_OES_compressed_paletted_texture;
|
||||
#define GL_OES_fixed_point 1
|
||||
|
|
@ -2848,6 +2869,7 @@ typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSINDIRECTPROC)(GLenum mode, const void
|
|||
typedef void (GLAD_API_PTR* PFNGLDRAWARRAYSINSTANCEDPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
|
||||
typedef void (GLAD_API_PTR* PFNGLDRAWARRAYSINSTANCEDARBPROC)(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
|
||||
typedef void (GLAD_API_PTR* PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
|
||||
typedef void (GLAD_API_PTR* PFNGLDRAWARRAYSINSTANCEDEXTPROC)(GLenum mode, GLint start, GLsizei count, GLsizei primcount);
|
||||
typedef void (GLAD_API_PTR* PFNGLDRAWBUFFERPROC)(GLenum buf);
|
||||
typedef void (GLAD_API_PTR* PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum* bufs);
|
||||
typedef void (GLAD_API_PTR* PFNGLDRAWBUFFERSARBPROC)(GLsizei n, const GLenum* bufs);
|
||||
|
|
@ -2859,6 +2881,7 @@ typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSINSTANCEDARBPROC)(GLenum mode, GLsi
|
|||
typedef void (GLAD_API_PTR* PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount, GLuint baseinstance);
|
||||
typedef void (GLAD_API_PTR* PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount, GLint basevertex);
|
||||
typedef void (GLAD_API_PTR* PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
|
||||
typedef void (GLAD_API_PTR* PFNGLDRAWELEMENTSINSTANCEDEXTPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount);
|
||||
typedef void (GLAD_API_PTR* PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices);
|
||||
typedef void (GLAD_API_PTR* PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices, GLint basevertex);
|
||||
typedef void (GLAD_API_PTR* PFNGLDRAWTRANSFORMFEEDBACKPROC)(GLenum mode, GLuint id);
|
||||
|
|
@ -4045,6 +4068,8 @@ GLAD_API_CALL PFNGLDRAWARRAYSINSTANCEDARBPROC glad_glDrawArraysInstancedARB;
|
|||
#define glDrawArraysInstancedARB glad_glDrawArraysInstancedARB
|
||||
GLAD_API_CALL PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC glad_glDrawArraysInstancedBaseInstance;
|
||||
#define glDrawArraysInstancedBaseInstance glad_glDrawArraysInstancedBaseInstance
|
||||
GLAD_API_CALL PFNGLDRAWARRAYSINSTANCEDEXTPROC glad_glDrawArraysInstancedEXT;
|
||||
#define glDrawArraysInstancedEXT glad_glDrawArraysInstancedEXT
|
||||
GLAD_API_CALL PFNGLDRAWBUFFERPROC glad_glDrawBuffer;
|
||||
#define glDrawBuffer glad_glDrawBuffer
|
||||
GLAD_API_CALL PFNGLDRAWBUFFERSPROC glad_glDrawBuffers;
|
||||
|
|
@ -4067,6 +4092,8 @@ GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstan
|
|||
#define glDrawElementsInstancedBaseVertex glad_glDrawElementsInstancedBaseVertex
|
||||
GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC glad_glDrawElementsInstancedBaseVertexBaseInstance;
|
||||
#define glDrawElementsInstancedBaseVertexBaseInstance glad_glDrawElementsInstancedBaseVertexBaseInstance
|
||||
GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDEXTPROC glad_glDrawElementsInstancedEXT;
|
||||
#define glDrawElementsInstancedEXT glad_glDrawElementsInstancedEXT
|
||||
GLAD_API_CALL PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements;
|
||||
#define glDrawRangeElements glad_glDrawRangeElements
|
||||
GLAD_API_CALL PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex;
|
||||
|
|
@ -5813,7 +5840,6 @@ int GLAD_GL_ARB_tessellation_shader = 0;
|
|||
int GLAD_GL_ARB_texture_border_clamp = 0;
|
||||
int GLAD_GL_ARB_texture_buffer_object_rgb32 = 0;
|
||||
int GLAD_GL_ARB_texture_compression = 0;
|
||||
int GLAD_GL_EXT_texture_compression_s3tc = 0;
|
||||
int GLAD_GL_ARB_texture_cube_map = 0;
|
||||
int GLAD_GL_ARB_texture_cube_map_array = 0;
|
||||
int GLAD_GL_ARB_texture_env_add = 0;
|
||||
|
|
@ -5837,11 +5863,17 @@ int GLAD_GL_ARB_vertex_attrib_binding = 0;
|
|||
int GLAD_GL_ARB_vertex_buffer_object = 0;
|
||||
int GLAD_GL_ARB_vertex_program = 0;
|
||||
int GLAD_GL_ARB_vertex_shader = 0;
|
||||
int GLAD_GL_EXT_draw_instanced = 0;
|
||||
int GLAD_GL_EXT_fog_coord = 0;
|
||||
int GLAD_GL_EXT_framebuffer_blit = 0;
|
||||
int GLAD_GL_EXT_framebuffer_multisample = 0;
|
||||
int GLAD_GL_EXT_framebuffer_object = 0;
|
||||
int GLAD_GL_EXT_framebuffer_sRGB = 0;
|
||||
int GLAD_GL_EXT_texture_compression_s3tc = 0;
|
||||
int GLAD_GL_EXT_texture_filter_anisotropic = 0;
|
||||
int GLAD_GL_EXT_texture_mirror_clamp = 0;
|
||||
int GLAD_GL_KHR_texture_compression_astc_hdr = 0;
|
||||
int GLAD_GL_KHR_texture_compression_astc_ldr = 0;
|
||||
int GLAD_GL_OES_compressed_paletted_texture = 0;
|
||||
int GLAD_GL_OES_fixed_point = 0;
|
||||
|
||||
|
|
@ -6038,6 +6070,7 @@ PFNGLDRAWARRAYSINDIRECTPROC glad_glDrawArraysIndirect = NULL;
|
|||
PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced = NULL;
|
||||
PFNGLDRAWARRAYSINSTANCEDARBPROC glad_glDrawArraysInstancedARB = NULL;
|
||||
PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC glad_glDrawArraysInstancedBaseInstance = NULL;
|
||||
PFNGLDRAWARRAYSINSTANCEDEXTPROC glad_glDrawArraysInstancedEXT = NULL;
|
||||
PFNGLDRAWBUFFERPROC glad_glDrawBuffer = NULL;
|
||||
PFNGLDRAWBUFFERSPROC glad_glDrawBuffers = NULL;
|
||||
PFNGLDRAWBUFFERSARBPROC glad_glDrawBuffersARB = NULL;
|
||||
|
|
@ -6049,6 +6082,7 @@ PFNGLDRAWELEMENTSINSTANCEDARBPROC glad_glDrawElementsInstancedARB = NULL;
|
|||
PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC glad_glDrawElementsInstancedBaseInstance = NULL;
|
||||
PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex = NULL;
|
||||
PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC glad_glDrawElementsInstancedBaseVertexBaseInstance = NULL;
|
||||
PFNGLDRAWELEMENTSINSTANCEDEXTPROC glad_glDrawElementsInstancedEXT = NULL;
|
||||
PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements = NULL;
|
||||
PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex = NULL;
|
||||
PFNGLDRAWTRANSFORMFEEDBACKPROC glad_glDrawTransformFeedback = NULL;
|
||||
|
|
@ -8122,6 +8156,11 @@ static void glad_gl_load_GL_ARB_vertex_shader( GLADuserptrloadfunc load, void* u
|
|||
glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load(userptr, "glVertexAttrib4usvARB");
|
||||
glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load(userptr, "glVertexAttribPointerARB");
|
||||
}
|
||||
static void glad_gl_load_GL_EXT_draw_instanced(GLADuserptrloadfunc load, void* userptr) {
|
||||
if (!GLAD_GL_EXT_draw_instanced) return;
|
||||
glad_glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)load(userptr, "glDrawArraysInstancedEXT");
|
||||
glad_glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)load(userptr, "glDrawElementsInstancedEXT");
|
||||
}
|
||||
static void glad_gl_load_GL_EXT_fog_coord(GLADuserptrloadfunc load, void* userptr) {
|
||||
if (!GLAD_GL_EXT_fog_coord) return;
|
||||
glad_glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)load(userptr, "glFogCoordPointerEXT");
|
||||
|
|
@ -8286,7 +8325,8 @@ static int glad_gl_get_extensions( int version, const char **out_exts, unsigned
|
|||
}
|
||||
*out_exts = (const char*)glad_glGetString(GL_EXTENSIONS);
|
||||
#if GLAD_GL_IS_SOME_NEW_VERSION
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
unsigned int index = 0;
|
||||
unsigned int num_exts_i = 0;
|
||||
char** exts_i = NULL;
|
||||
|
|
@ -8295,7 +8335,7 @@ static int glad_gl_get_extensions( int version, const char **out_exts, unsigned
|
|||
}
|
||||
glad_glGetIntegerv(GL_NUM_EXTENSIONS, (int*)&num_exts_i);
|
||||
if (num_exts_i > 0) {
|
||||
exts_i = (char **) GLAD_MALLOC(num_exts_i * (sizeof *exts_i));
|
||||
exts_i = (char**)malloc(num_exts_i * (sizeof * exts_i));
|
||||
}
|
||||
if (exts_i == NULL) {
|
||||
return 0;
|
||||
|
|
@ -8304,7 +8344,7 @@ static int glad_gl_get_extensions( int version, const char **out_exts, unsigned
|
|||
const char* gl_str_tmp = (const char*)glad_glGetStringi(GL_EXTENSIONS, index);
|
||||
size_t len = strlen(gl_str_tmp) + 1;
|
||||
|
||||
char *local_str = (char*) GLAD_MALLOC(len * sizeof(char));
|
||||
char* local_str = (char*)malloc(len * sizeof(char));
|
||||
if (local_str != NULL) {
|
||||
memcpy(local_str, gl_str_tmp, len * sizeof(char));
|
||||
}
|
||||
|
|
@ -8322,9 +8362,9 @@ static void glad_gl_free_extensions(char **exts_i, unsigned int num_exts_i) {
|
|||
if (exts_i != NULL) {
|
||||
unsigned int index;
|
||||
for (index = 0; index < num_exts_i; index++) {
|
||||
GLAD_FREE((void *) (exts_i[index]));
|
||||
free((void*)(exts_i[index]));
|
||||
}
|
||||
GLAD_FREE((void *)exts_i);
|
||||
free((void*)exts_i);
|
||||
exts_i = NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -8349,7 +8389,8 @@ static int glad_gl_has_extension(int version, const char *exts, unsigned int num
|
|||
}
|
||||
extensions = terminator;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
unsigned int index;
|
||||
for (index = 0; index < num_exts_i; index++) {
|
||||
const char* e = exts_i[index];
|
||||
|
|
@ -8451,7 +8492,6 @@ static int glad_gl_find_extensions_gl( int version) {
|
|||
GLAD_GL_ARB_texture_border_clamp = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_ARB_texture_border_clamp");
|
||||
GLAD_GL_ARB_texture_buffer_object_rgb32 = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_ARB_texture_buffer_object_rgb32");
|
||||
GLAD_GL_ARB_texture_compression = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_ARB_texture_compression");
|
||||
GLAD_GL_EXT_texture_compression_s3tc = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_EXT_texture_compression_s3tc");
|
||||
GLAD_GL_ARB_texture_cube_map = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_ARB_texture_cube_map");
|
||||
GLAD_GL_ARB_texture_cube_map_array = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_ARB_texture_cube_map_array");
|
||||
GLAD_GL_ARB_texture_env_add = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_ARB_texture_env_add");
|
||||
|
|
@ -8475,11 +8515,17 @@ static int glad_gl_find_extensions_gl( int version) {
|
|||
GLAD_GL_ARB_vertex_buffer_object = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_ARB_vertex_buffer_object");
|
||||
GLAD_GL_ARB_vertex_program = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_ARB_vertex_program");
|
||||
GLAD_GL_ARB_vertex_shader = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_ARB_vertex_shader");
|
||||
GLAD_GL_EXT_draw_instanced = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_EXT_draw_instanced");
|
||||
GLAD_GL_EXT_fog_coord = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_EXT_fog_coord");
|
||||
GLAD_GL_EXT_framebuffer_blit = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_EXT_framebuffer_blit");
|
||||
GLAD_GL_EXT_framebuffer_multisample = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_EXT_framebuffer_multisample");
|
||||
GLAD_GL_EXT_framebuffer_object = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_EXT_framebuffer_object");
|
||||
GLAD_GL_EXT_framebuffer_sRGB = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_EXT_framebuffer_sRGB");
|
||||
GLAD_GL_EXT_texture_compression_s3tc = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_EXT_texture_compression_s3tc");
|
||||
GLAD_GL_EXT_texture_filter_anisotropic = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_EXT_texture_filter_anisotropic");
|
||||
GLAD_GL_EXT_texture_mirror_clamp = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_EXT_texture_mirror_clamp");
|
||||
GLAD_GL_KHR_texture_compression_astc_hdr = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_KHR_texture_compression_astc_hdr");
|
||||
GLAD_GL_KHR_texture_compression_astc_ldr = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_KHR_texture_compression_astc_ldr");
|
||||
GLAD_GL_OES_compressed_paletted_texture = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_OES_compressed_paletted_texture");
|
||||
GLAD_GL_OES_fixed_point = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_OES_fixed_point");
|
||||
|
||||
|
|
@ -8615,6 +8661,7 @@ int gladLoadGLUserPtr( GLADuserptrloadfunc load, void *userptr) {
|
|||
glad_gl_load_GL_ARB_vertex_buffer_object(load, userptr);
|
||||
glad_gl_load_GL_ARB_vertex_program(load, userptr);
|
||||
glad_gl_load_GL_ARB_vertex_shader(load, userptr);
|
||||
glad_gl_load_GL_EXT_draw_instanced(load, userptr);
|
||||
glad_gl_load_GL_EXT_fog_coord(load, userptr);
|
||||
glad_gl_load_GL_EXT_framebuffer_blit(load, userptr);
|
||||
glad_gl_load_GL_EXT_framebuffer_multisample(load, userptr);
|
||||
|
|
@ -8632,6 +8679,176 @@ int gladLoadGL( GLADloadfunc load) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef GLAD_GL
|
||||
|
||||
#ifndef GLAD_LOADER_LIBRARY_C_
|
||||
#define GLAD_LOADER_LIBRARY_C_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if GLAD_PLATFORM_WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
|
||||
static void* glad_get_dlopen_handle(const char* lib_names[], int length) {
|
||||
void* handle = NULL;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < length; ++i) {
|
||||
#if GLAD_PLATFORM_WIN32
|
||||
#if GLAD_PLATFORM_UWP
|
||||
size_t buffer_size = (strlen(lib_names[i]) + 1) * sizeof(WCHAR);
|
||||
LPWSTR buffer = (LPWSTR)malloc(buffer_size);
|
||||
if (buffer != NULL) {
|
||||
int ret = MultiByteToWideChar(CP_ACP, 0, lib_names[i], -1, buffer, buffer_size);
|
||||
if (ret != 0) {
|
||||
handle = (void*)LoadPackagedLibrary(buffer, 0);
|
||||
}
|
||||
free((void*)buffer);
|
||||
}
|
||||
#else
|
||||
handle = (void*)LoadLibraryA(lib_names[i]);
|
||||
#endif
|
||||
#else
|
||||
handle = dlopen(lib_names[i], RTLD_LAZY | RTLD_LOCAL);
|
||||
#endif
|
||||
if (handle != NULL) {
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void glad_close_dlopen_handle(void* handle) {
|
||||
if (handle != NULL) {
|
||||
#if GLAD_PLATFORM_WIN32
|
||||
FreeLibrary((HMODULE)handle);
|
||||
#else
|
||||
dlclose(handle);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static GLADapiproc glad_dlsym_handle(void* handle, const char* name) {
|
||||
if (handle == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if GLAD_PLATFORM_WIN32
|
||||
return (GLADapiproc)GetProcAddress((HMODULE)handle, name);
|
||||
#else
|
||||
return GLAD_GNUC_EXTENSION(GLADapiproc) dlsym(handle, name);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* GLAD_LOADER_LIBRARY_C_ */
|
||||
|
||||
typedef void* (GLAD_API_PTR* GLADglprocaddrfunc)(const char*);
|
||||
struct _glad_gl_userptr {
|
||||
void* handle;
|
||||
GLADglprocaddrfunc gl_get_proc_address_ptr;
|
||||
};
|
||||
|
||||
static GLADapiproc glad_gl_get_proc(void* vuserptr, const char* name) {
|
||||
struct _glad_gl_userptr userptr = *(struct _glad_gl_userptr*)vuserptr;
|
||||
GLADapiproc result = NULL;
|
||||
|
||||
if (userptr.gl_get_proc_address_ptr != NULL) {
|
||||
result = GLAD_GNUC_EXTENSION(GLADapiproc) userptr.gl_get_proc_address_ptr(name);
|
||||
}
|
||||
if (result == NULL) {
|
||||
result = glad_dlsym_handle(userptr.handle, name);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void* _gl_handle = NULL;
|
||||
|
||||
static void* glad_gl_dlopen_handle(void) {
|
||||
#if GLAD_PLATFORM_APPLE
|
||||
static const char* NAMES[] = {
|
||||
"../Frameworks/OpenGL.framework/OpenGL",
|
||||
"/Library/Frameworks/OpenGL.framework/OpenGL",
|
||||
"/System/Library/Frameworks/OpenGL.framework/OpenGL",
|
||||
"/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"
|
||||
};
|
||||
#elif GLAD_PLATFORM_WIN32
|
||||
static const char* NAMES[] = { "opengl32.dll" };
|
||||
#else
|
||||
static const char* NAMES[] = {
|
||||
#if defined(__CYGWIN__)
|
||||
"libGL-1.so",
|
||||
#endif
|
||||
"libGL.so.1",
|
||||
"libGL.so"
|
||||
};
|
||||
#endif
|
||||
|
||||
if (_gl_handle == NULL) {
|
||||
_gl_handle = glad_get_dlopen_handle(NAMES, sizeof(NAMES) / sizeof(NAMES[0]));
|
||||
}
|
||||
|
||||
return _gl_handle;
|
||||
}
|
||||
|
||||
static struct _glad_gl_userptr glad_gl_build_userptr(void* handle) {
|
||||
struct _glad_gl_userptr userptr;
|
||||
|
||||
userptr.handle = handle;
|
||||
#if GLAD_PLATFORM_APPLE || defined(__HAIKU__)
|
||||
userptr.gl_get_proc_address_ptr = NULL;
|
||||
#elif GLAD_PLATFORM_WIN32
|
||||
userptr.gl_get_proc_address_ptr =
|
||||
(GLADglprocaddrfunc)glad_dlsym_handle(handle, "wglGetProcAddress");
|
||||
#else
|
||||
userptr.gl_get_proc_address_ptr =
|
||||
(GLADglprocaddrfunc)glad_dlsym_handle(handle, "glXGetProcAddressARB");
|
||||
#endif
|
||||
|
||||
return userptr;
|
||||
}
|
||||
|
||||
int gladLoaderLoadGL(void) {
|
||||
int version = 0;
|
||||
void* handle;
|
||||
int did_load = 0;
|
||||
struct _glad_gl_userptr userptr;
|
||||
|
||||
did_load = _gl_handle == NULL;
|
||||
handle = glad_gl_dlopen_handle();
|
||||
if (handle) {
|
||||
userptr = glad_gl_build_userptr(handle);
|
||||
|
||||
version = gladLoadGLUserPtr(glad_gl_get_proc, &userptr);
|
||||
|
||||
if (did_load) {
|
||||
gladLoaderUnloadGL();
|
||||
}
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void gladLoaderUnloadGL(void) {
|
||||
if (_gl_handle != NULL) {
|
||||
glad_close_dlopen_handle(_gl_handle);
|
||||
_gl_handle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* GLAD_GL */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
17
src/rlgl.h
17
src/rlgl.h
|
|
@ -2020,14 +2020,15 @@ void rlLoadExtensions(void *loader)
|
|||
|
||||
// Register supported extensions flags
|
||||
// OpenGL 3.3 extensions supported by default (core)
|
||||
RLGL.ExtSupported.vao = true;
|
||||
RLGL.ExtSupported.instancing = true;
|
||||
RLGL.ExtSupported.texNPOT = true;
|
||||
RLGL.ExtSupported.texFloat32 = true;
|
||||
RLGL.ExtSupported.texDepth = true;
|
||||
RLGL.ExtSupported.vao = GLAD_GL_ARB_vertex_array_object;
|
||||
RLGL.ExtSupported.instancing = GLAD_GL_EXT_draw_instanced && GLAD_GL_ARB_instanced_arrays;
|
||||
RLGL.ExtSupported.texNPOT = GLAD_GL_ARB_texture_non_power_of_two;
|
||||
RLGL.ExtSupported.texFloat32 = GLAD_GL_ARB_texture_float;
|
||||
RLGL.ExtSupported.texDepth = GLAD_GL_ARB_depth_texture;
|
||||
RLGL.ExtSupported.maxDepthBits = 32;
|
||||
RLGL.ExtSupported.texAnisoFilter = true;
|
||||
RLGL.ExtSupported.texMirrorClamp = true;
|
||||
RLGL.ExtSupported.texAnisoFilter = GLAD_GL_EXT_texture_filter_anisotropic;
|
||||
RLGL.ExtSupported.texMirrorClamp = GLAD_GL_EXT_texture_mirror_clamp;
|
||||
RLGL.ExtSupported.texCompASTC = GLAD_GL_KHR_texture_compression_astc_hdr && GLAD_GL_KHR_texture_compression_astc_ldr;
|
||||
#if defined(GRAPHICS_API_OPENGL_43)
|
||||
RLGL.ExtSupported.computeShader = GLAD_GL_ARB_compute_shader;
|
||||
RLGL.ExtSupported.ssbo = GLAD_GL_ARB_shader_storage_buffer_object;
|
||||
|
|
@ -2205,12 +2206,10 @@ void rlLoadExtensions(void *loader)
|
|||
#else // RLGL_SHOW_GL_DETAILS_INFO
|
||||
|
||||
// Show some basic info about GL supported features
|
||||
#if defined(GRAPHICS_API_OPENGL_ES2)
|
||||
if (RLGL.ExtSupported.vao) TRACELOG(RL_LOG_INFO, "GL: VAO extension detected, VAO functions loaded successfully");
|
||||
else TRACELOG(RL_LOG_WARNING, "GL: VAO extension not found, VAO not supported");
|
||||
if (RLGL.ExtSupported.texNPOT) TRACELOG(RL_LOG_INFO, "GL: NPOT textures extension detected, full NPOT textures supported");
|
||||
else TRACELOG(RL_LOG_WARNING, "GL: NPOT textures extension not found, limited NPOT support (no-mipmaps, no-repeat)");
|
||||
#endif
|
||||
if (RLGL.ExtSupported.texCompDXT) TRACELOG(RL_LOG_INFO, "GL: DXT compressed textures supported");
|
||||
if (RLGL.ExtSupported.texCompETC1) TRACELOG(RL_LOG_INFO, "GL: ETC1 compressed textures supported");
|
||||
if (RLGL.ExtSupported.texCompETC2) TRACELOG(RL_LOG_INFO, "GL: ETC2/EAC compressed textures supported");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user