{"id":13805305,"url":"https://github.com/BindBC/bindbc-opengl","last_synced_at":"2025-05-13T19:30:38.040Z","repository":{"id":39616655,"uuid":"152732765","full_name":"BindBC/bindbc-opengl","owner":"BindBC","description":"Dynamic D bindings to OpenGL, compatible with BetterC, @nogc, and nothrow.","archived":false,"fork":false,"pushed_at":"2024-04-18T15:10:46.000Z","size":252,"stargazers_count":35,"open_issues_count":0,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-04T01:04:45.216Z","etag":null,"topics":["bindbc","dlang","opengl","opengl-bindings"],"latest_commit_sha":null,"homepage":"","language":"D","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BindBC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE_1_0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"BindBC"}},"created_at":"2018-10-12T10:13:57.000Z","updated_at":"2024-04-06T06:29:35.000Z","dependencies_parsed_at":"2024-04-18T14:56:56.925Z","dependency_job_id":"f6438013-88c1-4768-8e53-162f95c6b9eb","html_url":"https://github.com/BindBC/bindbc-opengl","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BindBC%2Fbindbc-opengl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BindBC%2Fbindbc-opengl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BindBC%2Fbindbc-opengl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BindBC%2Fbindbc-opengl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BindBC","download_url":"https://codeload.github.com/BindBC/bindbc-opengl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225254290,"owners_count":17445160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bindbc","dlang","opengl","opengl-bindings"],"created_at":"2024-08-04T01:00:59.812Z","updated_at":"2024-11-18T21:31:00.095Z","avatar_url":"https://github.com/BindBC.png","language":"D","funding_links":["https://github.com/sponsors/BindBC"],"categories":["Game Bindings"],"sub_categories":["XML"],"readme":"# BindBC-OpenGL\nThis project provides dynamic bindings to [the OpenGL library](https://www.opengl.org/). It supports OpenGL versions up to and including 4.6, along with numerous extensions (if an extension you need is not yet supported, please submit a PR or open an issue). BindBC-OpenGL is compatible with `@nogc` and `nothrow` and can be compiled with BetterC compatibility. This package is intended as a replacement of [DerelictGL3](https://github.com/DerelictOrg/DerelictGL3), which does not provide the same level of compatibility.\n\n__NOTE__: BindBC-OpenGL does not support static binding due to the nature of the OpenGL API.\n\n__NOTE__: This documentation describes how to use BindBC-OpenGL. As the maintainer of this library, I do not provide instructions on using the OpenGL library. However, since this is a direct binding to the OpenGL API, existing OpenGL documentation and tutorials can be adapted to D with few modifications (those being minor differences in the language, such as array declaration syntax). [The tutorial at learnopengl.com](https://learnopengl.com/) is a particularly good introduction to OpenGL for those who have little or no experience with the API. For documentation, I prefer [the layout of docs.gl](https://docs.gl/) over [that of the Khronos site](https://www.khronos.org/registry/OpenGL-Refpages/gl4/).\n\n## Add BindBC-OpenGL to your project\nBy default, BindBC-OpenGL is configured to compile with BetterC compatibility disabled and with support only for up to OpenGL 2.1 core. To use BindBC-OpenGL in this default mode, simply add the package as a dependency in your `dub.json` or `dub.sdl` recipe.\n\nExample: __dub.json__\n```\n\"dependencies\": {\n\t\"bindbc-opengl\": \"~\u003e1.1.0\"\n}\n```\n\nExample: __dub.sdl__\n```\ndependency \"bindbc-opengl\" version=\"~\u003e1.1.0\"\n```\n\n## Enable BetterC support\nIf you are using BetterC, add the `dynamicBC` sub-configuration to your package recipe.\n\nExample: __dub.json__\n```\n\"subConfigurations\": {\n\t\"bindbc-opengl\": \"dynamicBC\"\n},\n```\n\nExample: __dub.sdl__\n```\nsubConfiguration \"bindbc-opengl\" \"dynamicBC\"\n```\n\n## Enable support for OpenGL 3.0 and higher\nSupport for OpenGL versions can be configured at compile time by adding the appropriate version to a `versions` directive in your package configuration file (or on the command line if you are building with a tool other than dub).\n\nBindBC-OpenGL supports a D version identifier for each OpenGL version. The following table lists each identifier and the OpenGL versions they enable.\n\n\n| OpenGL versions |Version identifier|\n|-----------------|------------------|\n| 1.0\u0026ndash;2.1   | Default          |\n| 1.0\u0026ndash;3.0   | `GL_30`          |\n| 1.0\u0026ndash;3.1   | `GL_31`          |\n| 1.0\u0026ndash;3.2   | `GL_32`          |\n| 1.0\u0026ndash;3.3   | `GL_33`          |\n| 1.0\u0026ndash;4.0   | `GL_40`          |\n| 1.0\u0026ndash;4.1   | `GL_41`          |\n| 1.0\u0026ndash;4.2   | `GL_42`          |\n| 1.0\u0026ndash;4.3   | `GL_43`          |\n| 1.0\u0026ndash;4.4   | `GL_44`          |\n| 1.0\u0026ndash;4.5   | `GL_45`          |\n| 1.0\u0026ndash;4.6   | `GL_46`          |\n\n\u003e [!NOTE]\\\n\u003e If you use versions higher than OpenGL 4.1, then your application will not work on macOS; due to OpenGL being deprecated on macOS.\n\nAdding one of these version identifiers to your package recipe will do two things:\n\n* symbols for the core types and functions in the supported OpenGL versions will be declared and available in user code\n* the `loadOpenGL` function will attempt to load all OpenGL versions for which support is enabled and which is supported by the OpenGL context at run time.\n\nTo load all functions and enable all constants from \"classic\" OpenGL versions, including those that have been deprecated, set the version identifier `GL_AllowDeprecated` in your build system. Note that doing so means you may need to take special steps to configure your OpenGL context to ensure the deprecated functions are made available by the driver. Check the documentation of the API you are using for OpenGL context creation.\n\nThe following examples are configured to load the core functions from all OpenGL versions up to OpenGL 4.1:\n\n__dub.json__\n```\n\"dependencies\": {\n\t\"bindbc-opengl\": \"~\u003e1.1.0\"\n}\n\"versions\": [\n\t\"GL_41\"\n],\n```\n\n__dub.sdl__\n```\ndependency \"bindbc-opengl\" version=\"~\u003e1.1.0\"\nversions \"GL_41\"\n```\n\nWith this configuration, client code can make use of all core OpenGL types and functions up to OpenGL 4.1. At run time, if the context supports OpenGL 4.1 or higher, the loader will attempt to load up to OpenGL 4.1. If the highest OpenGL version the context supports is lower than 4.1, the loader will attempt to load up to that version.\n\nTo enable the loading of deprecated functions in the same configuration:\n\n__dub.json__\n```\n\"dependencies\": {\n\t\"bindbc-opengl\": \"~\u003e1.1.0\"\n}\n\"versions\": [\n\t\"GL_41\", \"GL_AllowDeprecated\"\n],\n```\n\n__dub.sdl__\n```\ndependency \"bindbc-opengl\" version=\"~\u003e1.1.0\"\nversions \"GL_41\" \"GL_AllowDeprecated\"\n```\n\nWith this, all OpenGL functions, both core and deprecated, will be loaded if the context has been configured appropriately _and_ they are supported by the driver. Some deprecated features were removed from the specification in later versions of OpenGL.\n\n`GL_AllowDeprecated` by itself enables support for deprecated functions and constants from OpenGL versions 1.0 - 2.1. When `GL_AllowDeprecated` is specified in conjunction with `GL_30` or higher, support for deprecated constants from OpenGL version 3.0 will be enabled.\n\n## Enable support for extensions\nExtension support is enabled on an as-needed basis. All supported ARB/KHR extensions can be enabled by adding the `GL_ARB` version identifier to your `dub.json` or `dub.sdl`. Supported NV (Nvidia) extensions are enabled via `GL_NV`.\n\nFor example, the following enables support for all core OpenGL functions up to and including GL 4.1, as well as all ARB/KHR extensions:\n\n__dub.json__\n```\n\"dependencies\": {\n\t\"bindbc-opengl\": \"~\u003e1.1.0\"\n}\n\"versions\": [\n\t\"GL_41\",\n\t\"GL_ARB\"\n],\n```\n\n__dub.sdl__\n```\ndependency \"bindbc-opengl\" version=\"~\u003e1.1.0\"\nversions \"GL_41\" \"GL_ARB\"\n```\n\nExtensions which were promoted to the core OpenGL API are loaded automatically along with the OpenGL version APIs to which they belong.\n\nSpecific extensions can be enabled using the extension's OpenGL name string as a version identifier. The name string for each extension is listed below. They the form of `GL_` prefixed to the extension name.\n\n| Version added to core | OpenGL extension |Version identifier|\n|-----------------------|------------------|------------------|\n| N/A | ARB_bindless_texture | `GL_ARB_bindless_texture` |\n| N/A | ARB_cl_event | `GL_ARB_cl_event` |\n| N/A | ARB_compute_variable_group_size | `GL_ARB_compute_variable_group_size` |\n| N/A | ARB_debug_output | `GL_ARB_debug_output` |\n| N/A | ARB_framebuffer_sRGB | `GL_ARB_framebuffer_sRGB` |\n| N/A | ARB_geometry_shader4 | `GL_ARB_geometry_shader4` |\n| N/A | ARB_gl_spirv | `GL_ARB_gl_spirv` |\n| N/A | ARB_gpu_shader_int64 | `GL_ARB_gpu_shader_int64` |\n| N/A | ARB_indirect_parameters | `GL_ARB_indirect_parameters` |\n| N/A | ARB_instanced_arrays | `GL_ARB_instanced_arrays` |\n| N/A | ARB_pipeline_statistics_query | `GL_ARB_pipeline_statistics_query` |\n| N/A | ARB_robustness_isolation | `GL_ARB_robustness_isolation` |\n| N/A | ARB_sample_shading | `GL_ARB_sample_shading` |\n| N/A | ARB_texture_buffer_object | `GL_ARB_texture_buffer_object` |\n| N/A | ARB_texture_compression_bptc | `GL_ARB_texture_compression_bptc` |\n| N/A | ARB_texture_cube_map_array | `GL_ARB_texture_cube_map_array` |\n| N/A | ARB_texture_gather | `GL_ARB_texture_gather` |\n| N/A | ARB_transform_feedback_overflow_query | `GL_ARB_transform_feedback_overflow_query` |\n| N/A | ARB_sparse_texture | `GL_ARB_sparse_texture` |\n| N/A | ARB_sparse_texture2 | `GL_ARB_sparse_texture2` |\n| N/A | ARB_sparse_texture_clamp | `GL_ARB_sparse_texture_clamp` |\n| 3.0 | ARB_depth_buffer_float | `GL_ARB_depth_buffer_float` |\n| 3.0 | ARB_half_float_vertex | `GL_ARB_half_float_vertex` |\n| 3.0 | ARB_texture_compression_rgtc | `GL_ARB_texture_compression_rgtc` |\n| 3.0 | ARB_texture_rg | `GL_ARB_texture_rg` |\n| 3.0 | ARB_framebuffer_object | `GL_ARB_framebuffer_object` |\n| 3.0 | ARB_map_buffer_range | `GL_ARB_map_buffer_range` |\n| 3.0 | ARB_vertex_array_object | `GL_ARB_vertex_array_object` |\n| 3.1 | ARB_copy_buffer | `GL_ARB_copy_buffer` |\n| 3.1 | ARB_uniform_buffer_object | `GL_ARB_uniform_buffer_object` |\n| 3.2 | ARB_depth_clamp | `GL_ARB_depth_clamp` |\n| 3.2 | ARB_provoking_vertex | `GL_ARB_provoking_vertex` |\n| 3.2 | ARB_seamless_cube_map | `GL_ARB_seamless_cube_map` |\n| 3.2 | ARB_draw_elements_base_vertex | `GL_ARB_draw_elements_base_vertex` |\n| 3.2 | ARB_sync | `GL_ARB_sync` |\n| 3.2 | ARB_texture_multisample | `GL_ARB_texture_multisample` |\n| 3.3 | ARB_occlusion_query2 | `GL_ARB_occlusion_query2` |\n| 3.3 | ARB_texture_rgb10_a2ui | `GL_ARB_texture_rgb10_a2ui` |\n| 3.3 | ARB_texture_swizzle | `GL_ARB_texture_swizzle` |\n| 3.3 | ARB_blend_func_extended | `GL_ARB_blend_func_extended` |\n| 3.3 | ARB_sampler_objects | `GL_ARB_sampler_objects` |\n| 3.3 | ARB_timer_query | `GL_ARB_timer_query` |\n| 3.3 | ARB_vertex_type_2_10_10_10_rev | `GL_ARB_vertex_type_2_10_10_10_rev` |\n| 4.0 | ARB_gpu_shader5 | `GL_ARB_gpu_shader5` |\n| 4.0 | ARB_draw_indirect | `GL_ARB_draw_indirect` |\n| 4.0 | ARB_gpu_shader_fp64 | `GL_ARB_gpu_shader_fp64` |\n| 4.0 | ARB_shader_subroutine | `GL_ARB_shader_subroutine` |\n| 4.0 | ARB_tessellation_shader | `GL_ARB_tessellation_shader` |\n| 4.0 | ARB_transform_feedback2 | `GL_ARB_transform_feedback2` |\n| 4.0 | ARB_transform_feedback3 | `GL_ARB_transform_feedback3` |\n| 4.1 | ARB_ES2_compatibility | `GL_ARB_ES2_compatibility` |\n| 4.1 | ARB_get_program_binary | `GL_ARB_get_program_binary` |\n| 4.1 | ARB_separate_shader_objects | `GL_ARB_separate_shader_objects` |\n| 4.1 | ARB_vertex_attrib_64bit | `GL_ARB_vertex_attrib_64bit` |\n| 4.1 | ARB_viewport_array | `GL_ARB_viewport_array` |\n| 4.2 | ARB_base_instance | `GL_ARB_base_instance` |\n| 4.2 | ARB_compressed_texture_pixel_storage | `GL_ARB_compressed_texture_pixel_storage` |\n| 4.2 | ARB_internalformat_query | `GL_ARB_internalformat_query` |\n| 4.2 | ARB_map_buffer_alignment | `GL_ARB_map_buffer_alignment` |\n| 4.2 | ARB_shader_image_load_store | `GL_ARB_shader_image_load_store` |\n| 4.2 | ARB_texture_storage | `GL_ARB_texture_storage` |\n| 4.2 | ARB_transform_feedback_instanced | `GL_ARB_transform_feedback_instanced` |\n| 4.3 | ARB_clear_buffer_object | `GL_ARB_clear_buffer_object` |\n| 4.3 | ARB_compute_shader | `GL_ARB_compute_shader` |\n| 4.3 | ARB_copy_image | `GL_ARB_copy_image` |\n| 4.3 | ARB_ES3_compatibility | `GL_ARB_ES3_compatibility` |\n| 4.3 | ARB_explicit_uniform_location | `GL_ARB_explicit_uniform_location` |\n| 4.3 | ARB_framebuffer_no_attachments | `GL_ARB_framebuffer_no_attachments` |\n| 4.3 | ARB_internalformat_query2 | `GL_ARB_internalformat_query2` |\n| 4.3 | ARB_invalidate_subdata | `GL_ARB_invalidate_subdata` |\n| 4.3 | ARB_multi_draw_indirect | `GL_ARB_multi_draw_indirect` |\n| 4.3 | ARB_program_interface_query | `GL_ARB_program_interface_query` |\n| 4.3 | ARB_shader_storage_buffer_object | `GL_ARB_shader_storage_buffer_object` |\n| 4.3 | ARB_stencil_texturing | `GL_ARB_stencil_texturing` |\n| 4.3 | ARB_texture_buffer_range | `GL_ARB_texture_buffer_range` |\n| 4.3 | ARB_texture_storage_multisample | `GL_ARB_texture_storage_multisample` |\n| 4.3 | ARB_texture_view | `GL_ARB_texture_view` |\n| 4.3 | ARB_vertex_attrib_binding | `GL_ARB_vertex_attrib_binding` |\n| 4.3 | KHR_debug | `GL_KHR_debug` |\n| 4.4 | ARB_buffer_storage | `GL_ARB_buffer_storage` |\n| 4.4 | ARB_clear_texture | `GL_ARB_clear_texture` |\n| 4.4 | ARB_enhanced_layouts | `GL_ARB_enhanced_layouts` |\n| 4.4 | ARB_multi_bind | `GL_ARB_multi_bind` |\n| 4.4 | ARB_query_buffer_object | `GL_ARB_query_buffer_object` |\n| 4.4 | ARB_texture_mirror_clamp_to_edge | `GL_ARB_texture_mirror_clamp_to_edge` |\n| 4.5 | ARB_clip_control | `GL_ARB_clip_control` |\n| 4.5 | ARB_conditional_render_inverted | `GL_ARB_conditional_render_inverted` |\n| 4.5 | ARB_cull_distance | `GL_ARB_cull_distance` |\n| 4.5 | ARB_direct_state_access | `GL_ARB_direct_state_access` |\n| 4.5 | ARB_ES3_1_compatibility | `GL_ARB_ES3_1_compatibility` |\n| 4.5 | ARB_get_texture_sub_image | `GL_ARB_get_texture_sub_image` |\n| 4.5 | ARB_texture_barrier | `GL_ARB_texture_barrier` |\n| 4.5 | KHR_context_flush_control | `GL_KHR_context_flush_control` |\n| 4.5 | KHR_robustness | `GL_KHR_robustness` |\n| 4.6 | ARB_polygon_offset_clamp | `GL_ARB_polygon_offset_clamp` |\n| 4.6 | ARB_texture_filter_anisotropic | `GL_ARB_texture_filter_anisotropic` |\n| N/A | KHR_blend_equation_advanced | `GL_KHR_blend_equation_advanced` |\n| N/A | NV_shader_buffer_load | `GL_NV_shader_buffer_load` |\n| N/A | NV_vertex_buffer_unified_memory | `GL_NV_vertex_buffer_unified_memory` |\n| N/A | NV_command_list | `GL_NV_command_list` |\n\nFor example, the following configurations enable support for OpenGL 4.1 and the extensions `ARB_base_instance` and `ARB_compressed_texture_pixel_storage`, both of which were promoted to core in OpenGL 4.2:\n\n__dub.json__\n```\n\"dependencies\": {\n\t\"bindbc-opengl\": \"~\u003e1.1.0\"\n}\n\"versions\": [\n\t\"GL_41\",\n\t\"GL_ARB_base_instance\",\n\t\"GL_ARB_compressed_texture_pixel_storage\"\n],\n```\n\n__dub.sdl__\n```\ndependency \"bindbc-opengl\" version=\"~\u003e1.1.0\"\nversions \"GL_41\" \"GL_ARB_base_instance\" \"GL_ARB_compressed_texture_pixel_storage\"\n```\n\nThe `loadOpenGL` function (described in the next section) will attempt to load all extensions configured in this manner. No errors will be reported on failure. To determine if an extension was loaded, use the `has*` property for each extension, like so:\n\n```d\nimport bindbc.opengl;\n\n// Create the OpenGL context and load OpenGl\n...\n// Check for required extensions\nif(hasARBBaseInstance){\n\t// configure renderer for GL_ARB_base_instance support\n}\nif(hasARBCompressedTexturePixelStorage){\n\t// configure renderer for GL_ARB_compressed_texture_pixel_storage support\n}\n```\n\nIf you have a need for an extension that is not currently supported then please submit a pull request.\n\n## Loading OpenGL\nThe `loadOpenGL` function is used to load all supported OpenGL functions and extensions. __In order for this function to succeed, an OpenGL context must be created before it is called__. The return value of `loadOpenGL` can be used to determine which version of OpenGL actually loaded.\n\nFor example, assume you've configured BindBC-OpenGL to support up to OpenGL 4.1, but you've designed your renderer to work with both 4.1 and 3.3. You can create a 4.1 or 3.3 context in one part of your code, then load OpenGL in another part, and configure your renderer based upon the return value.\n\n```d\nimport bindbc.opengl;\n\n// Create OpenGL context\n...\n// Load supported OpenGL version + supported extensions\nGLSupport retVal = loadOpenGL();\nif(retVal == GLSupport.gl41){\n\t// configure renderer for OpenGL 4.1\n}else if(retVal == GLSupport.gl33){\n\t// configure renderer for OpenGL 3.3\n}else{\n\t// Error\n}\n```\n\n\u003e [!NOTE]\\\n\u003e `loadOpenGL` returns the *highest* version that was loaded. On some systems, deprecated OpenGL functions (e.g. from OpenGL 1.2) may be missing, so if you rely on these you should check that they were loaded using `versionLoadedStatus`:\n\u003e```d\n\u003eif((versionLoadedStatus(GLSupport.gl12) \u0026 GLLoadStatus.loaded) == 0){\n\u003e\t//OpenGL 1.2 functions were not loaded!\n\u003e}\n\u003e```\n\nOn error, `loadOpenGL` will return one of the following:\n* `GLSupport.noLibrary` - the OpenGL shared library failed to load\n* `GLSupport.badLibrary` - one of the context-independent symbols (OpenGL 1.0 \u0026 1.1) in the OpenGL shared library failed to load.\n* `GLSupport.noContext` - an OpenGL context was not created before calling the function. When asserts are enabled, calling `loadOpenGL` before a context is created will trigger an assertion failure instead.\n\nThe following functions are provided for convenience:\n* `isOpenGLLoaded` - returns `true` if any version of OpenGL has been successfully loaded and `false` otherwise.\n* `openGLContextVersion` - returns a `GLSupport` member corresponding to the version supported by the OpenGL context against which the library was loaded.\n* `loadedOpenGLVersion` - returns a `GLSupport` member corresponding to the version of OpenGL currently loaded (identical to the return value of `loadOpenGL`).\n\nNote that when working with multiple contexts, it may be necessary to call `loadOpenGL` on every context switch. On Windows in particular, a context switch may cause context-dependent functions, i.e., core functions above 1.1 and all extensions, to become invalid in some circumstances.\n\nThe [error reporting API in bindbc.loader](https://github.com/BindBC/bindbc-loader/blob/master/README.md) can be used to facilitate logging error messages.\n\n```d\n// Import the dependent package\nimport bindbc.opengl;\n\n/*\n Import the sharedlib module for error handling. Assigning an alias ensures the function names do not conflict with\n other public APIs. This isn't strictly necessary, but the API names are common enough that they could appear in other\n packages.\n*/\nimport loader = bindbc.loader.sharedlib;\n\n// Create the OpenGL context before calling this function.\nbool loadLib(){\n\t/*\n\tCompare the return value of loadGL with the global `glSupport` constant to determine if the version of GLFW\n\tconfigured at compile time is the version that was loaded.\n\t*/\n\tauto ret = loadOpenGL();\n\tif(ret != glSupport){\n\t\t// Log the error info\n\t\tforeach(info; loader.errors){\n\t\t\t/*\n\t\t\tA hypothetical logging function. Note that `info.error` and `info.message` are `const(char)*`, not\n\t\t\t`string`.\n\t\t\t*/\n\t\t\tlogError(info.error, info.message);\n\t\t}\n\t\t\n\t\t// Optionally construct a user-friendly error message for the user\n\t\tstring msg;\n\t\tif(ret == GLSupport.noLibrary){\n\t\t\tmsg = \"This application requires OpenGL.\";\n\t\t}else if(ret == GLSupport.badLibrary){\n\t\t\tmsg = \"The version of OpenGL on your system is too low. Please upgrade.\"\n\t\t}else{\n\t\t\t// GLSupport.noContext\n\t\t\tmsg = \"This program has encountered a graphics configuration error. Please report it to the developers.\"\n\t\t}\n\t\t// A hypothetical message box function\n\t\tshowMessageBox(msg);\n\t\treturn false;\n\t}\n\treturn true;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBindBC%2Fbindbc-opengl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBindBC%2Fbindbc-opengl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBindBC%2Fbindbc-opengl/lists"}