// OpenGL, GLU set of insructions

// стандартный OpenGL разбитый по версиям (всё отключено). Вы можете включить интересуюущую вас версию здесь, если вам не требуются
// дополнительные расширения.
{.$DEFINE USE_GL_21}
{.$DEFINE USE_GL_33}
{.$DEFINE USE_GL_46}

// это основной рабочий набор для ZenGL. На самом деле его отключить нельзя, но он и не занимает много места в вашей программе.
{$DEFINE USE_MIN_OPENGL}
{$IFNDEF USE_MIN_OPENGL}
  {$define USE_DEPRECATED}   // all GL 1.0 + GL 1.1
  // это наиполнейшая версия OpenGL, в неё включены все расширения. Но если ваша видеокарта не поддерживает эти расширения,
  // то они просто не загрузятся. Проверка всех расширений производится.
  {$DEFINE USE_GLEXT}
  // по замыслу GL_CORE и GL_EXT должны быть основными, но в ZenGL мы сможем выбирать версию которая интересует именно нас.
  // мы можем включить GL_EXT (полный OpenGL) и ниже выключить дефайны которые нас не интересуют.
  {$define USE_GLCORE}
  {$IF defined(USE_GLCORE) or defined(USE_GLEXT)}
    // Включение полной версии OpenGL или определённой версии. Всё в порядке очереди, версия GL_4+ включится самой последней,
    // потому если вы хотите использовать версию GL_4+ и выше, то всё остальное можно будет отключить.
    // При выборе версий GL_2+, GL_3+ или GL_4+ будут работать только эти версии и ни какие больше.
    {$DEFINE USE_GL_21}
    {$DEFINE USE_GL_33}
    {$DEFINE USE_GL_46}
    {$IFDEF USE_GLCORE}
      {$undef USE_GLEXT}
      {$undef USE_DEPRECATED}
    {$ENDIF}
  {$IFEND}
{$ENDIF}

{$IF DEFINED(USE_GL_21) or DEFINED(USE_MIN_OPENGL)}
  {$DEFINE USE_GLU}
  // при полном использовании OpenGL или при использовании версии до 2.1 можно включить полное GLU
  {.$DEFINE USE_FULL_GLU}
{$IFEND}

{$IFDEF USE_GLU}
  {$DEFINE USE_TRIANGULATION}
{$ENDIF}

// GLCORE содержит в себе основные версии GL_VERSION_1_0 - GL_VERSION_4_6.
// вы можете это исправить.

{$IFDEF USE_DEPRECATED}
  {$DEFINE GL_VERSION_1_0}
  {$DEFINE GL_VERSION_1_1}
  {$define GL_VERSION_1_2}
  {$define GL_VERSION_1_3}
  {$define GL_VERSION_1_4}
  {$define GL_VERSION_1_5}
{$ENDIF}

// можно выбрать нужную версию и только её использовать.
{$IFDEF USE_GL_21}
  {$IFNDEF USE_GLCORE}
    {$define GL_VERSION_1_0}
    {$define GL_VERSION_1_1}
  {$ENDIF}
  {$define GL_VERSION_1_2}
  {$define GL_VERSION_1_3}
  {$define GL_VERSION_1_4}
  {$define GL_VERSION_1_5}
  {$define GL_VERSION_2_0}
  {$define GL_VERSION_2_1}
{$ENDIF}

{$IFDEF USE_GL_33}
  {$define GL_VERSION_3_0}
  {$define GL_VERSION_3_1}
  {$define GL_VERSION_3_2}
  {$define GL_VERSION_3_3}
{$ENDIF}

{$IFDEF USE_GL_46}
  {$define GL_VERSION_3_0}   // определить, какие ещё расширения нужны для использования GL 4.6
  {$define GL_VERSION_4_0}
  {$define GL_VERSION_4_1}
  {$define GL_VERSION_4_2}
  {$define GL_VERSION_4_3}
  {$define GL_VERSION_4_4}
  {$define GL_VERSION_4_5}
  {$define GL_VERSION_4_6}
{$ENDIF}

{$If defined(USE_GLCORE) or defined(USE_GLEXT)}
  // перечисление всех дефайнов. Большая часть не используется по умолчанию, даже в Кроносе.
  {.$define GL_ARB_ES2_compatibility}
  {.$define GL_ARB_ES3_1_compatibility}
  {$define GL_ARB_ES3_2_compatibility}
  {.$define GL_ARB_ES3_compatibility}
  {.$define GL_ARB_arrays_of_arrays}
  {.$define GL_ARB_base_instance}
  {$define GL_ARB_bindless_texture}
  {.$define GL_ARB_blend_func_extended}
  {.$define GL_ARB_buffer_storage}
  {$define GL_ARB_cl_event}
  {.$define GL_ARB_clear_buffer_object}
  {.$define GL_ARB_clear_texture}
  {.$define GL_ARB_clip_control}
  {$IFDEF GL_VERSION_3_0}
    {$Define GL_ARB_compatibility}
  {$ENDIF}
     {$IFDEF USE_GLEXT}
      {$Define GL_ARB_color_buffer_float}
     {$ENDIF}
  {.$define GL_ARB_compressed_texture_pixel_storage}
  {.$define GL_ARB_compute_shader}
  {$define GL_ARB_compute_variable_group_size}
  {.$define GL_ARB_conditional_render_inverted}
  {.$define GL_ARB_conservative_depth}
  {.$define GL_ARB_copy_buffer}
  {.$define GL_ARB_copy_image}
  {.$define GL_ARB_cull_distance}
  {$define GL_ARB_debug_output}
  {.$define GL_ARB_depth_buffer_float}
  {.$define GL_ARB_depth_clamp}
     {$IFDEF USE_GLEXT}
      {$define GL_ARB_depth_texture}
     {$ENDIF}
  {.$define GL_ARB_derivative_control}
  {.$define GL_ARB_direct_state_access}
     {$IFDEF USE_GLEXT}
      {$define GL_ARB_draw_buffers}
     {$ENDIF}
  {$define GL_ARB_draw_buffers_blend}
  {.$define GL_ARB_draw_elements_base_vertex}
  {.$define GL_ARB_draw_indirect}
  {$define GL_ARB_draw_instanced}
  {.$define GL_ARB_enhanced_layouts}
  {.$define GL_ARB_explicit_attrib_location}
  {.$define GL_ARB_explicit_uniform_location}
  {.$define GL_ARB_fragment_coord_conventions}
  {.$define GL_ARB_fragment_layer_viewport}
     {$IFDEF USE_GLEXT}
      {$define GL_ARB_fragment_program}
      {.$define GL_ARB_fragment_program_shadow}
      {$define GL_ARB_fragment_shader}
     {$ENDIF}
  {.$define GL_ARB_fragment_shader_interlock}
  {.$define GL_ARB_framebuffer_no_attachments}
  {.$define GL_ARB_framebuffer_object}
  {.$define GL_ARB_framebuffer_sRGB}
  {$define GL_ARB_geometry_shader4}
  {.$define GL_ARB_get_program_binary}
  {.$define GL_ARB_get_texture_sub_image}
  {$define GL_ARB_gl_spirv}
  {.$define GL_ARB_gpu_shader5}
  {.$define GL_ARB_gpu_shader_fp64}
  {$define GL_ARB_gpu_shader_int64}
     {$IFDEF USE_GLEXT}
      {$Define GL_ARB_half_float_pixel}
      {$define GL_ARB_imaging}
     {$ENDIF}
  {.$define GL_ARB_half_float_vertex}
  {$define GL_ARB_indirect_parameters}
  {$define GL_ARB_instanced_arrays}
  {.$define GL_ARB_internalformat_query}
  {$define GL_ARB_internalformat_query2}
  {.$define GL_ARB_invalidate_subdata}
  {.$define GL_ARB_map_buffer_alignment}
  {.$define GL_ARB_map_buffer_range}
     {$IFDEF USE_GLEXT}
      {$Define GL_ARB_matrix_palette}
     {$ENDIF}
  {.$define GL_ARB_multi_bind}
  {.$define GL_ARB_multi_draw_indirect}
     {$IFDEF USE_GLEXT}
      {$Define GL_ARB_multisample}
      {$Define GL_ARB_multitexture}
      {$Define GL_ARB_occlusion_query}
     {$ENDIF}
  {.$define GL_ARB_occlusion_query2}
  {$define GL_ARB_parallel_shader_compile}
  {$define GL_ARB_pipeline_statistics_query}
  {$define GL_ARB_pixel_buffer_object}
     {$IFDEF USE_GLEXT}
      {$Define GL_ARB_point_parameters}
      {$Define GL_ARB_point_sprite}
     {$ENDIF}
  {.$define GL_ARB_polygon_offset_clamp}
  {.$define GL_ARB_post_depth_coverage}
  {.$define GL_ARB_program_interface_query}
  {.$define GL_ARB_provoking_vertex}
  {.$define GL_ARB_query_buffer_object}
  {.$define GL_ARB_robust_buffer_access_behavior}
  {$define GL_ARB_robustness}
  {.$define GL_ARB_robustness_isolation}
  {$define GL_ARB_sample_locations}
  {$define GL_ARB_sample_shading}
  {.$define GL_ARB_sampler_objects}
  {.$define GL_ARB_seamless_cube_map}
  {.$define GL_ARB_seamless_cubemap_per_texture}
  {.$define GL_ARB_separate_shader_objects}
  {.$define GL_ARB_shader_atomic_counter_ops}
  {.$define GL_ARB_shader_atomic_counters}
  {.$define GL_ARB_shader_ballot}
  {.$define GL_ARB_shader_bit_encoding}
  {.$define GL_ARB_shader_clock}
  {.$define GL_ARB_shader_draw_parameters}
  {.$define GL_ARB_shader_group_vote}
  {.$define GL_ARB_shader_image_load_store}
  {.$define GL_ARB_shader_image_size}
     {$IFDEF USE_GLEXT}
      {$Define GL_ARB_shader_objects}
     {$ENDIF}
  {.$define GL_ARB_shader_precision}
  {.$define GL_ARB_shader_stencil_export}
  {.$define GL_ARB_shader_storage_buffer_object}
  {.$define GL_ARB_shader_subroutine}
  {.$define GL_ARB_shader_texture_image_samples}
     {$IFDEF USE_GLEXT}
      {.$Define GL_ARB_shader_texture_lod}
      {$Define GL_ARB_shading_language_100}
     {$ENDIF}
  {.$define GL_ARB_shader_viewport_layer_array}
  {.$define GL_ARB_shading_language_420pack}
  {$define GL_ARB_shading_language_include}
  {.$define GL_ARB_shading_language_packing}
     {$IFDEF USE_GLEXT}
      {$Define GL_ARB_shadow}
      {$Define GL_ARB_shadow_ambient}
     {$ENDIF}
  {$define GL_ARB_sparse_buffer}
  {$define GL_ARB_sparse_texture}
  {.$define GL_ARB_sparse_texture2}
  {.$define GL_ARB_sparse_texture_clamp}
  {.$define GL_ARB_spirv_extensions}
  {.$define GL_ARB_stencil_texturing}
  {.$define GL_ARB_sync}
  {.$define GL_ARB_tessellation_shader}
  {.$define GL_ARB_texture_barrier}
  {$define GL_ARB_texture_border_clamp}
  {$define GL_ARB_texture_buffer_object}
  {.$define GL_ARB_texture_buffer_object_rgb32}
  {.$define GL_ARB_texture_buffer_range}
     {$IFDEF USE_GLEXT}
      {$Define GL_ARB_texture_compression}
     {$ENDIF}
  {$define GL_ARB_texture_compression_bptc}
  {.$define GL_ARB_texture_compression_rgtc}
     {$IFDEF USE_GLEXT}
      {$Define GL_ARB_texture_cube_map}
     {$ENDIF}
  {$define GL_ARB_texture_cube_map_array}
     {$IFDEF USE_GLEXT}
      {.$Define GL_ARB_texture_env_add}
      {$Define GL_ARB_texture_env_combine}
      {.$Define GL_ARB_texture_env_crossbar}
      {$Define GL_ARB_texture_env_dot3}
     {$ENDIF}
  {.$define GL_ARB_texture_filter_anisotropic}
  {$define GL_ARB_texture_filter_minmax}
     {$IFDEF USE_GLEXT}
      {$Define GL_ARB_texture_float}
     {$ENDIF}
  {$define GL_ARB_texture_gather}
  {.$define GL_ARB_texture_mirror_clamp_to_edge}
  {$define GL_ARB_texture_mirrored_repeat}
  {.$define GL_ARB_texture_multisample}
  {.$define GL_ARB_texture_non_power_of_two}
  {.$define GL_ARB_texture_query_levels}
  {.$define GL_ARB_texture_query_lod}
     {$IFDEF USE_GLEXT}
      {.$Define GL_ARB_texture_rectangle}
     {$ENDIF}
  {.$define GL_ARB_texture_rg}
  {.$define GL_ARB_texture_rgb10_a2ui}
  {.$define GL_ARB_texture_stencil8}
  {.$define GL_ARB_texture_storage}
  {.$define GL_ARB_texture_storage_multisample}
  {.$define GL_ARB_texture_swizzle}
  {.$define GL_ARB_texture_view}
  {.$define GL_ARB_timer_query}
  {.$define GL_ARB_transform_feedback2}
  {.$define GL_ARB_transform_feedback3}
  {.$define GL_ARB_transform_feedback_instanced}
  {$define GL_ARB_transform_feedback_overflow_query}
     {$IFDEF USE_GLEXT}
      {$Define GL_ARB_transpose_matrix}
     {$ENDIF}
  {.$define GL_ARB_uniform_buffer_object}
  {.$define GL_ARB_vertex_array_bgra}
  {.$define GL_ARB_vertex_array_object}
  {.$define GL_ARB_vertex_attrib_64bit}
  {.$define GL_ARB_vertex_attrib_binding}
     {$IFDEF USE_GLEXT}
      {$Define GL_ARB_vertex_blend}
      {$Define GL_ARB_vertex_buffer_object}
      {$Define GL_ARB_vertex_program}
      {$Define GL_ARB_vertex_shader}
     {$ENDIF}
  {.$define GL_ARB_vertex_type_10f_11f_11f_rev}
  {.$define GL_ARB_vertex_type_2_10_10_10_rev}
  {$define GL_ARB_viewport_array}
     {$IFDEF USE_GLEXT}
      {$Define GL_ARB_window_pos}
     {$ENDIF}
  {$define GL_KHR_blend_equation_advanced}
  {$define GL_KHR_blend_equation_advanced_coherent}
  {.$define GL_KHR_context_flush_control}
  {.$define GL_KHR_debug}
  {$define GL_KHR_no_error}
  {$define GL_KHR_parallel_shader_compile}
  {.$define GL_KHR_robust_buffer_access_behavior}
  {$define GL_KHR_robustness}
  {$define GL_KHR_shader_subgroup}
  {$define GL_KHR_texture_compression_astc_hdr}
  {.$define GL_KHR_texture_compression_astc_ldr}
  {.$define GL_KHR_texture_compression_astc_sliced_3d}
     {$IFDEF USE_GLEXT}
      {$Define GL_OES_byte_coordinates}
      {$Define GL_OES_compressed_paletted_texture}
      {$Define GL_OES_fixed_point}
      {$Define GL_OES_query_matrix}
      {$Define GL_OES_read_format}
      {$Define GL_OES_single_precision}
      {$Define GL_3DFX_multisample}
      {$Define GL_3DFX_tbuffer}
      {$Define GL_3DFX_texture_compression_FXT1}
      {$Define GL_AMD_blend_minmax_factor}
      {.$Define GL_AMD_conservative_depth}
      {$Define GL_AMD_debug_output}
      {$Define GL_AMD_depth_clamp_separate}
      {$Define GL_AMD_draw_buffers_blend}
     {$ENDIF}
  {$define GL_AMD_framebuffer_multisample_advanced}
     {$IFDEF USE_GLEXT}
      {$Define GL_AMD_framebuffer_sample_positions}
      {.$Define GL_AMD_gcn_shader}
      {$Define GL_AMD_gpu_shader_half_float}
      {.$Define GL_AMD_gpu_shader_int16}
      {$Define GL_AMD_gpu_shader_int64}
      {$Define GL_AMD_interleaved_elements}
      {$Define GL_AMD_multi_draw_indirect}
      {$Define GL_AMD_name_gen_delete}
      {$Define GL_AMD_occlusion_query_event}
     {$ENDIF}
  {$define GL_AMD_performance_monitor}
     {$IFDEF USE_GLEXT}
      {$Define GL_AMD_pinned_memory}
      {$Define GL_AMD_query_buffer_object}
      {$Define GL_AMD_sample_positions}
      {.$Define GL_AMD_seamless_cubemap_per_texture}
      {.$Define GL_AMD_shader_atomic_counter_ops}
      {.$Define GL_AMD_shader_ballot}
      {.$Define GL_AMD_shader_explicit_vertex_parameter}
      {.$Define GL_AMD_shader_gpu_shader_half_float_fetch}
      {.$Define GL_AMD_shader_image_load_store_lod}
      {.$Define GL_AMD_shader_stencil_export}
      {.$Define GL_AMD_shader_trinary_minmax}
      {$Define GL_AMD_sparse_texture}
      {$Define GL_AMD_stencil_operation_extended}
      {.$Define GL_AMD_texture_gather_bias_lod}
      {.$Define GL_AMD_texture_texture4}
      {.$Define GL_AMD_transform_feedback3_lines_triangles}
      {$Define GL_AMD_transform_feedback4}
      {.$Define GL_AMD_vertex_shader_layer}
      {$Define GL_AMD_vertex_shader_tessellator}
      {.$Define GL_AMD_vertex_shader_viewport_index}
      {$Define GL_APPLE_aux_depth_stencil}
      {$Define GL_APPLE_client_storage}
      {$Define GL_APPLE_element_array}
      {$Define GL_APPLE_fence}
      {$Define GL_APPLE_float_pixels}
      {$Define GL_APPLE_flush_buffer_range}
      {$Define GL_APPLE_object_purgeable}
     {$ENDIF}
  {$define GL_APPLE_rgb_422}
     {$IFDEF USE_GLEXT}
      {$Define GL_APPLE_row_bytes}
      {$Define GL_APPLE_specular_vector}
      {$Define GL_APPLE_texture_range}
      {$Define GL_APPLE_transform_hint}
      {$Define GL_APPLE_vertex_array_object}
      {$Define GL_APPLE_vertex_array_range}
      {$Define GL_APPLE_vertex_program_evaluators}
      {$Define GL_APPLE_ycbcr_422}
      {$Define GL_ATI_draw_buffers}
      {$Define GL_ATI_element_array}
      {$Define GL_ATI_envmap_bumpmap}
      {$Define GL_ATI_fragment_shader}
      {$Define GL_ATI_map_object_buffer}
      {$Define GL_ATI_meminfo}
      {$Define GL_ATI_pixel_format_float}
      {$Define GL_ATI_pn_triangles}
      {$Define GL_ATI_separate_stencil}
      {$Define GL_ATI_text_fragment_shader}
      {$Define GL_ATI_texture_env_combine3}
      {$Define GL_ATI_texture_float}
      {$Define GL_ATI_texture_mirror_once}
      {$Define GL_ATI_vertex_array_object}
      {$Define GL_ATI_vertex_attrib_array_object}
      {$Define GL_ATI_vertex_streams}
      {$Define GL_EXT_422_pixels}
     {$ENDIF}
  {$define GL_EXT_EGL_image_storage}
  {.$define GL_EXT_EGL_sync}
     {$IFDEF USE_GLEXT}
      {$Define GL_EXT_abgr}
      {$Define GL_EXT_bgra}
      {$Define GL_EXT_bindable_uniform}
      {$Define GL_EXT_blend_color}
      {$Define GL_EXT_blend_equation_separate}
      {$Define GL_EXT_blend_func_separate}
      {.$Define GL_EXT_blend_logic_op}
      {$Define GL_EXT_blend_minmax}
      {$Define GL_EXT_blend_subtract}
      {$Define GL_EXT_clip_volume_hint}
      {$Define GL_EXT_cmyka}
      {$Define GL_EXT_color_subtable}
      {$Define GL_EXT_compiled_vertex_array}
      {$Define GL_EXT_convolution}
      {$Define GL_EXT_coordinate_frame}
      {$Define GL_EXT_copy_texture}
      {$Define GL_EXT_cull_vertex}
     {$ENDIF}
  {$define GL_EXT_debug_label}
  {$define GL_EXT_debug_marker}
     {$IFDEF USE_GLEXT}
      {$Define GL_EXT_depth_bounds_test}
     {$ENDIF}
  {$define GL_EXT_direct_state_access}
     {$IFDEF USE_GLEXT}
      {$Define GL_EXT_draw_buffers2}
     {$ENDIF}
  {$define GL_EXT_draw_instanced}
     {$IFDEF USE_GLEXT}
      {$Define GL_EXT_draw_range_elements}
      {$Define GL_EXT_external_buffer}
      {$Define GL_EXT_fog_coord}
      {$Define GL_EXT_framebuffer_blit}
      {$Define GL_EXT_framebuffer_multisample}
      {$Define GL_EXT_framebuffer_multisample_blit_scaled}
      {$Define GL_EXT_framebuffer_object}
      {$Define GL_EXT_framebuffer_sRGB}
      {$Define GL_EXT_geometry_shader4}
      {$Define GL_EXT_gpu_program_parameters}
      {$Define GL_EXT_gpu_shader4}
      {$Define GL_EXT_histogram}
      {$Define GL_EXT_index_array_formats}
      {$Define GL_EXT_index_func}
      {$Define GL_EXT_index_material}
      {.$Define GL_EXT_index_texture}
      {$Define GL_EXT_light_texture}
      {$Define GL_EXT_memory_object}
      {$Define GL_EXT_memory_object_fd}
      {$Define GL_EXT_memory_object_win32}
      {.$Define GL_EXT_misc_attribute}
      {$Define GL_EXT_multi_draw_arrays}
      {$Define GL_EXT_multisample}
     {$ENDIF}
  {.$Define GL_EXT_multiview_tessellation_geometry_shader}
  {.$Define GL_EXT_multiview_texture_multisample}
  {.$Define GL_EXT_multiview_timer_query}
     {$IFDEF USE_GLEXT}
      {$Define GL_EXT_packed_depth_stencil}
      {$Define GL_EXT_packed_float}
      {$Define GL_EXT_packed_pixels}
      {$Define GL_EXT_paletted_texture}
      {$Define GL_EXT_pixel_buffer_object}
      {$Define GL_EXT_pixel_transform}
      {.$Define GL_EXT_pixel_transform_color_table}
      {$Define GL_EXT_point_parameters}
      {$Define GL_EXT_polygon_offset}
     {$ENDIF}
  {$define GL_EXT_polygon_offset_clamp}
  {.$Define GL_EXT_post_depth_coverage}
     {$IFDEF USE_GLEXT}
      {$Define GL_EXT_provoking_vertex}
     {$ENDIF}
  {$define GL_EXT_raster_multisample}
     {$IFDEF USE_GLEXT}
      {$Define GL_EXT_rescale_normal}
      {$Define GL_EXT_secondary_color}
      {$Define GL_EXT_semaphore}
      {$Define GL_EXT_semaphore_fd}
      {$Define GL_EXT_semaphore_win32}
     {$ENDIF}
  {$define GL_EXT_separate_shader_objects}
     {$IFDEF USE_GLEXT}
      {$define GL_EXT_separate_specular_color}
     {$ENDIF}
  {$define GL_EXT_shader_framebuffer_fetch}
  {$define GL_EXT_shader_framebuffer_fetch_non_coherent}
     {$IFDEF USE_GLEXT}
      {.$Define GL_EXT_shader_image_load_formatted}
      {$Define GL_EXT_shader_image_load_store}
     {$ENDIF}
  {.$Define GL_EXT_shader_integer_mix}
     {$IFDEF USE_GLEXT}
      {.$Define GL_EXT_shadow_funcs}
      {$Define GL_EXT_shared_texture_palette}
      {.$Define GL_EXT_sparse_texture2}
      {$Define GL_EXT_stencil_clear_tag}
      {$Define GL_EXT_stencil_two_side}
      {$Define GL_EXT_stencil_wrap}
      {$Define GL_EXT_subtexture}
      {$Define GL_EXT_texture}
      {$Define GL_EXT_texture3D}
      {$Define GL_EXT_texture_array}
      {$Define GL_EXT_texture_buffer_object}
      {$Define GL_EXT_texture_compression_latc}
      {$Define GL_EXT_texture_compression_rgtc}
     {$ENDIF}
  {$define GL_EXT_texture_compression_s3tc}
     {$IFDEF USE_GLEXT}
      {$Define GL_EXT_texture_cube_map}
      {.$Define GL_EXT_texture_env_add}
      {$Define GL_EXT_texture_env_combine}
      {$Define GL_EXT_texture_env_dot3}
      {$Define GL_EXT_texture_filter_anisotropic}
     {$ENDIF}
  {$define GL_EXT_texture_filter_minmax}
     {$IFDEF USE_GLEXT}
      {$Define GL_EXT_texture_integer}
      {$Define GL_EXT_texture_lod_bias}
      {$Define GL_EXT_texture_mirror_clamp}
      {$Define GL_EXT_texture_object}
      {$Define GL_EXT_texture_perturb_normal}
      {$Define GL_EXT_texture_sRGB}
     {$ENDIF}
  {$define GL_EXT_texture_sRGB_R8}
  {$define GL_EXT_texture_sRGB_RG8}
  {$define GL_EXT_texture_sRGB_decode}
  {.$Define GL_EXT_texture_shadow_lod}
     {$IFDEF USE_GLEXT}
      {$Define GL_EXT_texture_shared_exponent}
      {$Define GL_EXT_texture_snorm}
     {$ENDIF}
  {$define GL_EXT_texture_storage}
     {$IFDEF USE_GLEXT}
      {$Define GL_EXT_texture_swizzle}
      {$Define GL_EXT_timer_query}
      {$Define GL_EXT_transform_feedback}
      {$Define GL_EXT_vertex_array}
      {.$Define GL_EXT_vertex_array_bgra}
      {$Define GL_EXT_vertex_attrib_64bit}
      {$Define GL_EXT_vertex_shader}
      {$Define GL_EXT_vertex_weighting}
      {$Define GL_EXT_win32_keyed_mutex}
     {$ENDIF}
  {$define GL_EXT_window_rectangles}
     {$IFDEF USE_GLEXT}
      {$Define GL_EXT_x11_sync_object}
      {$Define GL_GREMEDY_frame_terminator}
      {$Define GL_GREMEDY_string_marker}
      {$Define GL_HP_convolution_border_modes}
      {$Define GL_HP_image_transform}
      {$Define GL_HP_occlusion_test}
      {$Define GL_HP_texture_lighting}
      {$Define GL_IBM_cull_vertex}
      {$Define GL_IBM_multimode_draw_arrays}
      {$Define GL_IBM_rasterpos_clip}
      {$Define GL_IBM_static_data}
      {$Define GL_IBM_texture_mirrored_repeat}
      {$Define GL_IBM_vertex_array_lists}
      {$Define GL_INGR_blend_func_separate}
      {$Define GL_INGR_color_clamp}
      {$Define GL_INGR_interlace_read}
     {$ENDIF}
  {$define GL_INTEL_blackhole_render}
  {$define GL_INTEL_conservative_rasterization}
     {$IFDEF USE_GLEXT}
      {.$Define GL_INTEL_fragment_shader_ordering}
     {$ENDIF}
  {$define GL_INTEL_framebuffer_CMAA}
     {$IFDEF USE_GLEXT}
      {$Define GL_INTEL_map_texture}
      {$Define GL_INTEL_parallel_arrays}
     {$ENDIF}
  {$define GL_INTEL_performance_query}
     {$IFDEF USE_GLEXT}
      {$Define GL_MESAX_texture_stack}
     {$ENDIF}
  {$define GL_MESA_framebuffer_flip_x}
  {$define GL_MESA_framebuffer_flip_y}
  {$define GL_MESA_framebuffer_swap_xy}
     {$IFDEF USE_GLEXT}
      {$Define GL_MESA_pack_invert}
      {$Define GL_MESA_program_binary_formats}
      {$Define GL_MESA_resize_buffers}
      {.$Define GL_MESA_shader_integer_functions}
      {$Define GL_MESA_tile_raster_order}
      {$Define GL_MESA_window_pos}
      {$Define GL_MESA_ycbcr_texture}
      {.$Define GL_NVX_blend_equation_advanced_multi_draw_buffers}
      {$Define GL_NVX_conditional_render}
      {$Define GL_NVX_gpu_memory_info}
      {$Define GL_NVX_gpu_multicast2}
      {$Define GL_NVX_linked_gpu_multicast}
      {$Define GL_NVX_progress_fence}
      {$Define GL_NV_alpha_to_coverage_dither_control}
     {$ENDIF}
  {$define GL_NV_bindless_multi_draw_indirect}
  {$define GL_NV_bindless_multi_draw_indirect_count}
  {$define GL_NV_bindless_texture}
  {$define GL_NV_blend_equation_advanced}
  {$define GL_NV_blend_equation_advanced_coherent}
  {$define GL_NV_blend_minmax_factor}
     {$IFDEF USE_GLEXT}
      {.$Define GL_NV_blend_square}
     {$ENDIF}
  {$define GL_NV_clip_space_w_scaling}
  {$define GL_NV_command_list}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_compute_program5}
     {$ENDIF}
  {.$Define GL_NV_compute_shader_derivatives}
  {$define GL_NV_conditional_render}
  {$define GL_NV_conservative_raster}
  {$define GL_NV_conservative_raster_dilate}
  {$define GL_NV_conservative_raster_pre_snap}
  {$define GL_NV_conservative_raster_pre_snap_triangles}
  {.$Define GL_NV_conservative_raster_underestimation}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_copy_depth_to_color}
      {$Define GL_NV_copy_image}
      {$Define GL_NV_deep_texture3D}
     {$ENDIF}
  {$define GL_NV_depth_buffer_float}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_depth_clamp}
      {$Define GL_NV_draw_texture}
     {$ENDIF}
  {$define GL_NV_draw_vulkan_image}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_evaluators}
      {$Define GL_NV_explicit_multisample}
      {$Define GL_NV_fence}
     {$ENDIF}
  {$define GL_NV_fill_rectangle}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_float_buffer}
      {$Define GL_NV_fog_distance}
     {$ENDIF}
  {$define GL_NV_fragment_coverage_to_color}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_fragment_program}
      {$Define GL_NV_fragment_program2}
      {.$Define GL_NV_fragment_program4}
      {.$Define GL_NV_fragment_program_option}
     {$ENDIF}
  {.$Define GL_NV_fragment_shader_barycentric}
  {.$Define GL_NV_fragment_shader_interlock}
  {$define GL_NV_framebuffer_mixed_samples}
  {$define GL_NV_framebuffer_multisample_coverage}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_geometry_program4}
      {.$Define GL_NV_geometry_shader4}
     {$ENDIF}
  {.$Define GL_NV_geometry_shader_passthrough}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_gpu_multicast}
      {$Define GL_NV_gpu_program4}
      {$Define GL_NV_gpu_program5}
      {.$Define GL_NV_gpu_program5_mem_extended}
     {$ENDIF}

     // узнать, работает ли эта часть при GLext!!!!
     // хотя функции подменены в другом разделе. У меня его вообще нет!!!
  {$IFDEF USE_GLCORE}
  {$define GL_NV_gpu_shader5}
  {$ENDIF}

     {$IFDEF USE_GLEXT}
      {$Define GL_NV_half_float}
     {$ENDIF}
  {$define GL_NV_internalformat_sample_query}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_light_max_exponent}
     {$ENDIF}
  {$define GL_NV_memory_attachment}
  {$define GL_NV_memory_object_sparse}
  {$define GL_NV_mesh_shader}
     {$IFDEF USE_GLEXT}
      {.$Define GL_NV_multisample_coverage}
      {$Define GL_NV_multisample_filter_hint}
      {$Define GL_NV_occlusion_query}
      {$Define GL_NV_packed_depth_stencil}
      {$Define GL_NV_parameter_buffer_object}
      {.$Define GL_NV_parameter_buffer_object2}
     {$ENDIF}
  {$define GL_NV_path_rendering}
  {$define GL_NV_path_rendering_shared_edge}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_pixel_data_range}
      {$Define GL_NV_point_sprite}
      {$Define GL_NV_present_video}
      {$Define GL_NV_primitive_restart}
     {$ENDIF}
  {$define GL_NV_primitive_shading_rate}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_query_resource}
      {$Define GL_NV_query_resource_tag}
      {$Define GL_NV_register_combiners}
      {$Define GL_NV_register_combiners2}
     {$ENDIF}
  {$define GL_NV_representative_fragment_test}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_robustness_video_memory_purge}
     {$ENDIF}
  {$define GL_NV_sample_locations}
  {.$Define GL_NV_sample_mask_override_coverage}
  {$define GL_NV_scissor_exclusive}
  {.$Define GL_NV_shader_atomic_counters}
  {.$Define GL_NV_shader_atomic_float}
  {.$Define GL_NV_shader_atomic_float64}
  {.$Define GL_NV_shader_atomic_fp16_vector}
  {.$Define GL_NV_shader_atomic_int64}
  {$define GL_NV_shader_buffer_load}
  {$define GL_NV_shader_buffer_store}
     {$IFDEF USE_GLEXT}
      {.$Define GL_NV_shader_storage_buffer_object}
     {$ENDIF}
  {$define GL_NV_shader_subgroup_partitioned}
  {.$Define GL_NV_shader_texture_footprint}
  {$define GL_NV_shader_thread_group}
  {.$Define GL_NV_shader_thread_shuffle}
  {$define GL_NV_shading_rate_image}
     {$IFDEF USE_GLEXT}
      {.$Define GL_NV_stereo_view_rendering}
      {$Define GL_NV_tessellation_program5}
      {$Define GL_NV_texgen_emboss}
      {$Define GL_NV_texgen_reflection}
     {$ENDIF}
  {$define GL_NV_texture_barrier}
     {$IFDEF USE_GLEXT}
      {.$Define GL_NV_texture_compression_vtc}
      {$Define GL_NV_texture_env_combine4}
      {$Define GL_NV_texture_expand_normal}
      {$Define GL_NV_texture_multisample}
      {$Define GL_NV_texture_rectangle}
     {$ENDIF}
  {.$Define GL_NV_texture_rectangle_compressed}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_texture_shader}
      {$Define GL_NV_texture_shader2}
      {$Define GL_NV_texture_shader3}
      {$Define GL_NV_timeline_semaphore}
      {$Define GL_NV_transform_feedback}
      {$Define GL_NV_transform_feedback2}
     {$ENDIF}
  {$define GL_NV_uniform_buffer_unified_memory}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_vdpau_interop}
      {$Define GL_NV_vdpau_interop2}
      {$Define GL_NV_vertex_array_range}
      {$Define GL_NV_vertex_array_range2}
     {$ENDIF}
  {$define GL_NV_vertex_attrib_integer_64bit}
  {$define GL_NV_vertex_buffer_unified_memory}
     {$IFDEF USE_GLEXT}
      {$Define GL_NV_vertex_program}
      {.$Define GL_NV_vertex_program1_1}
      {.$Define GL_NV_vertex_program2}
      {.$Define GL_NV_vertex_program2_option}
      {.$Define GL_NV_vertex_program3}
      {$Define GL_NV_vertex_program4}
      {$Define GL_NV_video_capture}
     {$ENDIF}
  {.$Define GL_NV_viewport_array2}
  {$define GL_NV_viewport_swizzle}
     {$IFDEF USE_GLEXT}
      {$Define GL_OML_interlace}
      {$Define GL_OML_resample}
      {$Define GL_OML_subsample}
     {$ENDIF}
  {$define GL_OVR_multiview}
  {.$Define GL_OVR_multiview2}
     {$IFDEF USE_GLEXT}
      {$Define GL_PGI_misc_hints}
      {.$Define GL_PGI_vertex_hints}
      {$Define GL_REND_screen_coordinates}
      {$Define GL_S3_s3tc}
      {$Define GL_SGIS_detail_texture}
      {$Define GL_SGIS_fog_function}
      {.$Define GL_SGIS_generate_mipmap}
      {$Define GL_SGIS_multisample}
      {$Define GL_SGIS_pixel_texture}
      {$Define GL_SGIS_point_line_texgen}
      {$Define GL_SGIS_point_parameters}
      {$Define GL_SGIS_sharpen_texture}
      {$Define GL_SGIS_texture4D}
      {$Define GL_SGIS_texture_border_clamp}
      {$Define GL_SGIS_texture_color_mask}
      {$Define GL_SGIS_texture_edge_clamp}
      {$Define GL_SGIS_texture_filter4}
      {$Define GL_SGIS_texture_lod}
      {$Define GL_SGIS_texture_select}
      {$Define GL_SGIX_async}
      {$Define GL_SGIX_async_histogram}
      {$Define GL_SGIX_async_pixel}
      {$Define GL_SGIX_blend_alpha_minmax}
      {$Define GL_SGIX_calligraphic_fragment}
      {$Define GL_SGIX_clipmap}
      {$Define GL_SGIX_convolution_accuracy}
      {.$Define GL_SGIX_depth_pass_instrument}
      {$Define GL_SGIX_depth_texture}
      {$Define GL_SGIX_flush_raster}
      {$Define GL_SGIX_fog_offset}
      {$Define GL_SGIX_fragment_lighting}
      {$Define GL_SGIX_framezoom}
      {$Define GL_SGIX_igloo_interface}
      {$Define GL_SGIX_instruments}
      {$Define GL_SGIX_interlace}
      {$Define GL_SGIX_ir_instrument1}
      {$Define GL_SGIX_list_priority}
      {$Define GL_SGIX_pixel_texture}
      {$Define GL_SGIX_pixel_tiles}
      {$Define GL_SGIX_polynomial_ffd}
      {$Define GL_SGIX_reference_plane}
      {$Define GL_SGIX_resample}
      {$Define GL_SGIX_scalebias_hint}
      {$Define GL_SGIX_shadow}
      {$Define GL_SGIX_shadow_ambient}
      {$Define GL_SGIX_sprite}
      {$Define GL_SGIX_subsample}
      {$Define GL_SGIX_tag_sample_buffer}
      {$Define GL_SGIX_texture_add_env}
      {$Define GL_SGIX_texture_coordinate_clamp}
      {$Define GL_SGIX_texture_lod_bias}
      {$Define GL_SGIX_texture_multi_buffer}
      {$Define GL_SGIX_texture_scale_bias}
      {$Define GL_SGIX_vertex_preclip}
      {$Define GL_SGIX_ycrcb}
      {.$Define GL_SGIX_ycrcb_subsample}
      {$Define GL_SGIX_ycrcba}
      {$Define GL_SGI_color_matrix}
      {$Define GL_SGI_color_table}
      {$Define GL_SGI_texture_color_table}
      {$Define GL_SUNX_constant_data}
      {$Define GL_SUN_convolution_border_modes}
      {$Define GL_SUN_global_alpha}
      {$Define GL_SUN_mesh_array}
      {$Define GL_SUN_slice_accum}
      {$Define GL_SUN_triangle_list}
      {$Define GL_SUN_vertex}
      {$Define GL_WIN_phong_shading}
      {$Define GL_WIN_specular_fog}
     {$ENDIF}
{$IfEnd}

{$IFDEF WINDOWS}
(*******************************************************************************
*                                   begin WGL                                  *
*******************************************************************************)
{$IFDEF GL_VERSION_3_0}
  {$define WGL_ARB_create_context}
{$ENDIF}
{$IFDEF USE_FULL_WGL}
  {$define WGL_ARB_buffer_region}
  {.$define WGL_ARB_context_flush_control}
  {.$define WGL_ARB_create_context_no_error}
  {.$define WGL_ARB_create_context_profile}
  {.$define WGL_ARB_create_context_robustness}
  {$define WGL_ARB_make_current_read}
{$ENDIF}

{$define WGL_ARB_extensions_string}
{.$define WGL_ARB_framebuffer_sRGB}
{.$define WGL_ARB_multisample}
{$define WGL_ARB_pbuffer}
{$define WGL_ARB_pixel_format}

{$IFDEF USE_FULL_WGL}
  {.$define WGL_ARB_pixel_format_float}
  {$define WGL_ARB_render_texture}
  {.$define WGL_ARB_robustness_application_isolation}
  {.$define WGL_ARB_robustness_share_group_isolation}    // пусто
  {.$define WGL_3DFX_multisample}
  {$define WGL_3DL_stereo_control}
  {$define WGL_AMD_gpu_association}
  {.$define WGL_ATI_pixel_format_float}
  {.$define WGL_ATI_render_texture_rectangle}
  {.$define WGL_EXT_colorspace}
  {.$define WGL_EXT_create_context_es2_profile}
  {.$define WGL_EXT_create_context_es_profile}
  {.$define WGL_EXT_depth_float}
  {$define WGL_EXT_display_color_table}
  {.$define WGL_EXT_framebuffer_sRGB}
  {$define WGL_EXT_make_current_read}
  {.$define WGL_EXT_multisample}
{$ENDIF}

{$define WGL_EXT_pbuffer}
{$define WGL_EXT_extensions_string}
{$define WGL_EXT_pixel_format}
{.$define WGL_EXT_pixel_format_packed_float}
{$define WGL_EXT_swap_control}

{$IFDEF USE_FULL_WGL}
  {.$define WGL_EXT_swap_control_tear}               // пусто
  {$define WGL_I3D_digital_video_control}
  {$define WGL_I3D_gamma}
  {$define WGL_I3D_genlock}
  {$define WGL_I3D_image_buffer}
  {$define WGL_I3D_swap_frame_lock}
  {$define WGL_I3D_swap_frame_usage}
  {$define WGL_NV_DX_interop}
  {.$define WGL_NV_DX_interop2}                      // пусто
  {$define WGL_NV_copy_image}
  {$define WGL_NV_delay_before_swap}
  {.$define WGL_NV_float_buffer}
  {$define WGL_NV_gpu_affinity}
  {.$define WGL_NV_multigpu_context}
  {.$define WGL_NV_multisample_coverage}
  {$define WGL_NV_present_video}
  {.$define WGL_NV_render_depth_texture}
  {.$define WGL_NV_render_texture_rectangle}
  {$define WGL_NV_swap_group}
  {$define WGL_NV_vertex_array_range}
  {$define WGL_NV_video_capture}
  {$define WGL_NV_video_output}
  {$define WGL_OML_sync_control}
{$ENDIF}
(*******************************************************************************
*                                     end WGL                                  *
*******************************************************************************)
{$ENDIF}

{$IFDEF LINUX}
(*******************************************************************************
*                                   begin GLX                                  *
*******************************************************************************)
// версии ниже удалили?????
{$define GLX_VERSION_1_3}
{$define GLX_VERSION_1_4}
{$IFDEF GL_VERSION_3_0}
  {$define GLX_ARB_create_context}
{$ENDIF}
{$IFDEF USE_FULL_GLX}
  {.$define GLX_ARB_context_flush_control}
  {.$define GLX_ARB_create_context_no_error}
  {.$define GLX_ARB_create_context_profile}
  {.$define GLX_ARB_create_context_robustness}
  {.$define GLX_ARB_fbconfig_float}
  {.$define GLX_ARB_framebuffer_sRGB}
  {$define GLX_ARB_get_proc_address}
  {.$define GLX_ARB_multisample}
  {.$define GLX_ARB_robustness_application_isolation}
  {.$define GLX_ARB_robustness_share_group_isolation}     // пусто
  {.$define GLX_ARB_vertex_buffer_object}
  {.$define GLX_3DFX_multisample}
  {$define GLX_AMD_gpu_association}
  {.$define GLX_EXT_buffer_age}
  {.$define GLX_EXT_context_priority}
  {.$define GLX_EXT_create_context_es2_profile}
  {.$define GLX_EXT_create_context_es_profile}
  {.$define GLX_EXT_fbconfig_packed_float}
  {.$define GLX_EXT_framebuffer_sRGB}
  {.$define GLX_EXT_get_drawable_type}                    // пусто
  {$define GLX_EXT_import_context}
  {$define GLX_EXT_libglvnd}
  {.$define GLX_EXT_no_config_context}                    // пусто
  {.$define GLX_EXT_stereo_tree}
  {$define GLX_EXT_swap_control}
  {.$define GLX_EXT_swap_control_tear}
  {$define GLX_EXT_texture_from_pixmap}
  {.$define GLX_EXT_visual_info}
  {.$define GLX_EXT_visual_rating}
  {.$define GLX_INTEL_swap_event}
  {$define GLX_MESA_agp_offset}
  {$define GLX_MESA_copy_sub_buffer}
  {$define GLX_MESA_pixmap_colormap}
  {$define GLX_MESA_query_renderer}
  {$define GLX_MESA_release_buffers}
  {$define GLX_MESA_set_3dfx_mode}
  {$define GLX_MESA_swap_control}
  {$define GLX_NV_copy_buffer}
  {$define GLX_NV_copy_image}
  {$define GLX_NV_delay_before_swap}
  {.$define GLX_NV_float_buffer}
  {.$define GLX_NV_multigpu_context}
  {.$define GLX_NV_multisample_coverage}
  {$define GLX_NV_present_video}
  {$define GLX_NV_robustness_video_memory_purge}
  {$define GLX_NV_swap_group}
  {$define GLX_NV_video_capture}
  {$define GLX_NV_video_out}
  {.$define GLX_OML_swap_method}
  {-$define GLX_OML_sync_control}     // disable. надо знать как это использовать
  {.$define GLX_SGIS_blended_overlay}
  {.$define GLX_SGIS_multisample}
  {.$define GLX_SGIS_shared_multisample}
  {-$define GLX_SGIX_dmbuffer}        // disable. сюда надо подключить dm_buffer.h (Digital media)
  {$define GLX_SGIX_hyperpipe}
  {$define GLX_SGIX_swap_barrier}
  {$define GLX_SGIX_swap_group}
  {$define GLX_SGIX_video_resize}
  {-$define GLX_SGIX_video_source}    // disable. Для использования нужно использовать afs_vl.h   https://wiki.gentoo.org/wiki/OpenAFS#What_is_AFS.3F
  {.$define GLX_SGIX_visual_select_group}
  {$define GLX_SGI_cushion}
  {$define GLX_SGI_make_current_read}
  {$define GLX_SGI_video_sync}
  {$define GLX_SUN_get_transparent_index}
{$ENDIF}
{$define GLX_SGIX_fbconfig}
{$define GLX_SGIX_pbuffer}
{$define GLX_SGI_swap_control}
(*******************************************************************************
*                                     end GLX                                  *
*******************************************************************************)
{$ENDIF}
