roglew 0.1.4 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -3
- data/lib/roglew/ext/ffi_struct_ext.rb +19 -19
- data/lib/roglew/extensions/GLX_3DFX_multisample.rb +6 -0
- data/lib/roglew/extensions/GLX_AMD_gpu_association.rb +14 -0
- data/lib/roglew/extensions/GLX_ARB_create_context.rb +23 -0
- data/lib/roglew/extensions/GLX_ARB_create_context_profile.rb +7 -0
- data/lib/roglew/extensions/GLX_ARB_create_context_robustness.rb +8 -0
- data/lib/roglew/extensions/GLX_ARB_fbconfig_float.rb +6 -0
- data/lib/roglew/extensions/GLX_ARB_framebuffer_sRGB.rb +5 -0
- data/lib/roglew/extensions/GLX_ARB_get_proc_address.rb +7 -0
- data/lib/roglew/extensions/GLX_ARB_multisample.rb +7 -0
- data/lib/roglew/extensions/GLX_ARB_robustness_application_isolation.rb +5 -0
- data/lib/roglew/extensions/GLX_ARB_robustness_share_group_isolation.rb +5 -0
- data/lib/roglew/extensions/GLX_ARB_vertex_buffer_object.rb +5 -0
- data/lib/roglew/extensions/GLX_ATI_pixel_format_float.rb +5 -0
- data/lib/roglew/extensions/GLX_ATI_render_texture.rb +54 -0
- data/lib/roglew/extensions/GLX_EXT_create_context_es2_profile.rb +5 -0
- data/lib/roglew/extensions/GLX_EXT_create_context_es_profile.rb +5 -0
- data/lib/roglew/extensions/GLX_EXT_fbconfig_packed_float.rb +6 -0
- data/lib/roglew/extensions/GLX_EXT_framebuffer_sRGB.rb +5 -0
- data/lib/roglew/extensions/GLX_EXT_import_context.rb +25 -0
- data/lib/roglew/extensions/GLX_EXT_swap_control.rb +16 -0
- data/lib/roglew/extensions/GLX_EXT_swap_control_tear.rb +5 -0
- data/lib/roglew/extensions/GLX_EXT_texture_from_pixmap.rb +47 -0
- data/lib/roglew/extensions/GLX_EXT_visual_info.rb +20 -0
- data/lib/roglew/extensions/GLX_EXT_visual_rating.rb +7 -0
- data/lib/roglew/extensions/GLX_INTEL_swap_event.rb +8 -0
- data/lib/roglew/extensions/GLX_MESA_agp_offset.rb +8 -0
- data/lib/roglew/extensions/GLX_MESA_copy_sub_buffer.rb +8 -0
- data/lib/roglew/extensions/GLX_MESA_pixmap_colormap.rb +8 -0
- data/lib/roglew/extensions/GLX_MESA_release_buffers.rb +8 -0
- data/lib/roglew/extensions/GLX_MESA_set_3dfx_mode.rb +15 -0
- data/lib/roglew/extensions/GLX_MESA_swap_control.rb +11 -0
- data/lib/roglew/extensions/GLX_NV_copy_image.rb +26 -0
- data/lib/roglew/extensions/GLX_NV_float_buffer.rb +5 -0
- data/lib/roglew/extensions/GLX_NV_multisample_coverage.rb +6 -0
- data/lib/roglew/extensions/GLX_NV_present_video.rb +17 -0
- data/lib/roglew/extensions/GLX_NV_swap_group.rb +23 -0
- data/lib/roglew/extensions/GLX_NV_vertex_array_range.rb +11 -0
- data/lib/roglew/extensions/GLX_NV_video_capture.rb +28 -0
- data/lib/roglew/extensions/GLX_NV_video_out.rb +48 -0
- data/lib/roglew/extensions/GLX_OML_swap_method.rb +8 -0
- data/lib/roglew/extensions/GLX_OML_sync_control.rb +39 -0
- data/lib/roglew/extensions/GLX_SGIS_blended_overlay.rb +5 -0
- data/lib/roglew/extensions/GLX_SGIS_color_range.rb +13 -0
- data/lib/roglew/extensions/GLX_SGIS_multisample.rb +6 -0
- data/lib/roglew/extensions/GLX_SGIS_shared_multisample.rb +6 -0
- data/lib/roglew/extensions/GLX_SGIX_fbconfig.rb +44 -0
- data/lib/roglew/extensions/GLX_SGIX_hyperpipe.rb +63 -0
- data/lib/roglew/extensions/GLX_SGIX_pbuffer.rb +55 -0
- data/lib/roglew/extensions/GLX_SGIX_swap_barrier.rb +11 -0
- data/lib/roglew/extensions/GLX_SGIX_swap_group.rb +8 -0
- data/lib/roglew/extensions/GLX_SGIX_video_resize.rb +27 -0
- data/lib/roglew/extensions/GLX_SGIX_visual_select_group.rb +5 -0
- data/lib/roglew/extensions/GLX_SGI_cushion.rb +8 -0
- data/lib/roglew/extensions/GLX_SGI_make_current_read.rb +11 -0
- data/lib/roglew/extensions/GLX_SGI_swap_control.rb +8 -0
- data/lib/roglew/extensions/GLX_SGI_video_sync.rb +11 -0
- data/lib/roglew/extensions/GLX_SUN_get_transparent_index.rb +8 -0
- data/lib/roglew/extensions/GLX_SUN_video_resize.rb +21 -0
- data/lib/roglew/extensions/GLX_VERSION_1_1.rb +22 -0
- data/lib/roglew/extensions/GLX_VERSION_1_2.rb +8 -0
- data/lib/roglew/extensions/GLX_VERSION_1_3.rb +117 -0
- data/lib/roglew/extensions/GLX_VERSION_1_4.rb +10 -0
- data/lib/roglew/extensions/GL_3DFX_multisample.rb +7 -7
- data/lib/roglew/extensions/GL_3DFX_tbuffer.rb +7 -7
- data/lib/roglew/extensions/GL_3DFX_texture_compression_FXT1.rb +5 -5
- data/lib/roglew/extensions/GL_AMD_blend_minmax_factor.rb +5 -5
- data/lib/roglew/extensions/GL_AMD_debug_output.rb +36 -36
- data/lib/roglew/extensions/GL_AMD_depth_clamp_separate.rb +5 -5
- data/lib/roglew/extensions/GL_AMD_draw_buffers_blend.rb +9 -9
- data/lib/roglew/extensions/GL_AMD_multi_draw_indirect.rb +7 -7
- data/lib/roglew/extensions/GL_AMD_name_gen_delete.rb +18 -18
- data/lib/roglew/extensions/GL_AMD_performance_monitor.rb +28 -28
- data/lib/roglew/extensions/GL_AMD_pinned_memory.rb +4 -4
- data/lib/roglew/extensions/GL_AMD_query_buffer_object.rb +6 -6
- data/lib/roglew/extensions/GL_AMD_sample_positions.rb +12 -12
- data/lib/roglew/extensions/GL_AMD_seamless_cubemap_per_texture.rb +4 -4
- data/lib/roglew/extensions/GL_AMD_stencil_operation_extended.rb +15 -15
- data/lib/roglew/extensions/GL_AMD_vertex_shader_tessellator.rb +19 -19
- data/lib/roglew/extensions/GL_APPLE_aux_depth_stencil.rb +4 -4
- data/lib/roglew/extensions/GL_APPLE_client_storage.rb +4 -4
- data/lib/roglew/extensions/GL_APPLE_element_array.rb +18 -18
- data/lib/roglew/extensions/GL_APPLE_fence.rb +20 -20
- data/lib/roglew/extensions/GL_APPLE_float_pixels.rb +17 -17
- data/lib/roglew/extensions/GL_APPLE_flush_buffer_range.rb +14 -14
- data/lib/roglew/extensions/GL_APPLE_object_purgeable.rb +19 -19
- data/lib/roglew/extensions/GL_APPLE_pixel_buffer.rb +4 -4
- data/lib/roglew/extensions/GL_APPLE_rgb_422.rb +6 -6
- data/lib/roglew/extensions/GL_APPLE_row_bytes.rb +5 -5
- data/lib/roglew/extensions/GL_APPLE_specular_vector.rb +4 -4
- data/lib/roglew/extensions/GL_APPLE_texture_range.rb +18 -18
- data/lib/roglew/extensions/GL_APPLE_transform_hint.rb +4 -4
- data/lib/roglew/extensions/GL_APPLE_vertex_array_object.rb +15 -15
- data/lib/roglew/extensions/GL_APPLE_vertex_array_range.rb +21 -21
- data/lib/roglew/extensions/GL_APPLE_vertex_program_evaluators.rb +27 -27
- data/lib/roglew/extensions/GL_APPLE_ycbcr_422.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_ES2_compatibility.rb +31 -31
- data/lib/roglew/extensions/GL_ARB_ES3_compatibility.rb +16 -16
- data/lib/roglew/extensions/GL_ARB_base_instance.rb +8 -8
- data/lib/roglew/extensions/GL_ARB_blend_func_extended.rb +16 -16
- data/lib/roglew/extensions/GL_ARB_cl_event.rb +13 -13
- data/lib/roglew/extensions/GL_ARB_clear_buffer_object.rb +9 -9
- data/lib/roglew/extensions/GL_ARB_color_buffer_float.rb +16 -16
- data/lib/roglew/extensions/GL_ARB_compressed_texture_pixel_storage.rb +11 -11
- data/lib/roglew/extensions/GL_ARB_compute_shader.rb +30 -30
- data/lib/roglew/extensions/GL_ARB_copy_buffer.rb +13 -13
- data/lib/roglew/extensions/GL_ARB_copy_image.rb +6 -6
- data/lib/roglew/extensions/GL_ARB_debug_output.rb +38 -38
- data/lib/roglew/extensions/GL_ARB_depth_buffer_float.rb +6 -6
- data/lib/roglew/extensions/GL_ARB_depth_clamp.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_depth_texture.rb +8 -8
- data/lib/roglew/extensions/GL_ARB_draw_buffers.rb +28 -28
- data/lib/roglew/extensions/GL_ARB_draw_buffers_blend.rb +9 -9
- data/lib/roglew/extensions/GL_ARB_draw_elements_base_vertex.rb +9 -9
- data/lib/roglew/extensions/GL_ARB_draw_indirect.rb +14 -14
- data/lib/roglew/extensions/GL_ARB_explicit_uniform_location.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_fragment_program.rb +18 -18
- data/lib/roglew/extensions/GL_ARB_fragment_shader.rb +6 -6
- data/lib/roglew/extensions/GL_ARB_framebuffer_no_attachments.rb +23 -23
- data/lib/roglew/extensions/GL_ARB_framebuffer_sRGB.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_geometry_shader4.rb +33 -33
- data/lib/roglew/extensions/GL_ARB_get_program_binary.rb +17 -17
- data/lib/roglew/extensions/GL_ARB_gpu_shader5.rb +9 -9
- data/lib/roglew/extensions/GL_ARB_gpu_shader_fp64.rb +40 -40
- data/lib/roglew/extensions/GL_ARB_half_float_pixel.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_half_float_vertex.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_imaging.rb +119 -119
- data/lib/roglew/extensions/GL_ARB_instanced_arrays.rb +14 -14
- data/lib/roglew/extensions/GL_ARB_internalformat_query.rb +12 -12
- data/lib/roglew/extensions/GL_ARB_internalformat_query2.rb +123 -123
- data/lib/roglew/extensions/GL_ARB_invalidate_subdata.rb +11 -11
- data/lib/roglew/extensions/GL_ARB_map_buffer_alignment.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_map_buffer_range.rb +18 -18
- data/lib/roglew/extensions/GL_ARB_matrix_palette.rb +25 -25
- data/lib/roglew/extensions/GL_ARB_multi_draw_indirect.rb +7 -7
- data/lib/roglew/extensions/GL_ARB_multisample.rb +20 -20
- data/lib/roglew/extensions/GL_ARB_multitexture.rb +79 -79
- data/lib/roglew/extensions/GL_ARB_occlusion_query.rb +23 -23
- data/lib/roglew/extensions/GL_ARB_occlusion_query2.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_pixel_buffer_object.rb +8 -8
- data/lib/roglew/extensions/GL_ARB_point_parameters.rb +16 -16
- data/lib/roglew/extensions/GL_ARB_point_sprite.rb +5 -5
- data/lib/roglew/extensions/GL_ARB_program_interface_query.rb +63 -63
- data/lib/roglew/extensions/GL_ARB_provoking_vertex.rb +15 -15
- data/lib/roglew/extensions/GL_ARB_robustness.rb +37 -37
- data/lib/roglew/extensions/GL_ARB_sample_shading.rb +15 -15
- data/lib/roglew/extensions/GL_ARB_sampler_objects.rb +27 -27
- data/lib/roglew/extensions/GL_ARB_seamless_cube_map.rb +5 -5
- data/lib/roglew/extensions/GL_ARB_separate_shader_objects.rb +81 -81
- data/lib/roglew/extensions/GL_ARB_shader_atomic_counters.rb +42 -42
- data/lib/roglew/extensions/GL_ARB_shader_image_load_store.rb +78 -78
- data/lib/roglew/extensions/GL_ARB_shader_objects.rb +85 -85
- data/lib/roglew/extensions/GL_ARB_shader_storage_buffer_object.rb +29 -29
- data/lib/roglew/extensions/GL_ARB_shader_subroutine.rb +29 -29
- data/lib/roglew/extensions/GL_ARB_shading_language_100.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_shading_language_include.rb +19 -19
- data/lib/roglew/extensions/GL_ARB_shadow.rb +6 -6
- data/lib/roglew/extensions/GL_ARB_shadow_ambient.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_stencil_texturing.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_sync.rb +34 -34
- data/lib/roglew/extensions/GL_ARB_tessellation_shader.rb +46 -46
- data/lib/roglew/extensions/GL_ARB_texture_border_clamp.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_texture_buffer_object.rb +18 -18
- data/lib/roglew/extensions/GL_ARB_texture_buffer_range.rb +17 -17
- data/lib/roglew/extensions/GL_ARB_texture_compression.rb +30 -30
- data/lib/roglew/extensions/GL_ARB_texture_compression_bptc.rb +7 -7
- data/lib/roglew/extensions/GL_ARB_texture_compression_rgtc.rb +7 -7
- data/lib/roglew/extensions/GL_ARB_texture_cube_map.rb +15 -15
- data/lib/roglew/extensions/GL_ARB_texture_cube_map_array.rb +10 -10
- data/lib/roglew/extensions/GL_ARB_texture_env_combine.rb +25 -25
- data/lib/roglew/extensions/GL_ARB_texture_env_dot3.rb +5 -5
- data/lib/roglew/extensions/GL_ARB_texture_float.rb +23 -23
- data/lib/roglew/extensions/GL_ARB_texture_gather.rb +6 -6
- data/lib/roglew/extensions/GL_ARB_texture_mirrored_repeat.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_texture_multisample.rb +37 -37
- data/lib/roglew/extensions/GL_ARB_texture_rectangle.rb +9 -9
- data/lib/roglew/extensions/GL_ARB_texture_rg.rb +27 -27
- data/lib/roglew/extensions/GL_ARB_texture_rgb10_a2ui.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_texture_storage.rb +19 -19
- data/lib/roglew/extensions/GL_ARB_texture_storage_multisample.rb +11 -11
- data/lib/roglew/extensions/GL_ARB_texture_swizzle.rb +8 -8
- data/lib/roglew/extensions/GL_ARB_texture_view.rb +18 -18
- data/lib/roglew/extensions/GL_ARB_timer_query.rb +17 -17
- data/lib/roglew/extensions/GL_ARB_transform_feedback2.rb +23 -23
- data/lib/roglew/extensions/GL_ARB_transform_feedback3pt.rb +18 -18
- data/lib/roglew/extensions/GL_ARB_transform_feedback_instanced.rb +9 -9
- data/lib/roglew/extensions/GL_ARB_transpose_matrix.rb +20 -20
- data/lib/roglew/extensions/GL_ARB_uniform_buffer_object.rb +55 -55
- data/lib/roglew/extensions/GL_ARB_vertex_array_bgra.rb +4 -4
- data/lib/roglew/extensions/GL_ARB_vertex_array_object/vertex_array.rb +27 -27
- data/lib/roglew/extensions/GL_ARB_vertex_array_object.rb +26 -26
- data/lib/roglew/extensions/GL_ARB_vertex_attrib_64bit.rb +28 -28
- data/lib/roglew/extensions/GL_ARB_vertex_attrib_binding.rb +25 -25
- data/lib/roglew/extensions/GL_ARB_vertex_blend.rb +64 -64
- data/lib/roglew/extensions/GL_ARB_vertex_buffer_object.rb +51 -51
- data/lib/roglew/extensions/GL_ARB_vertex_program.rb +153 -153
- data/lib/roglew/extensions/GL_ARB_vertex_shader.rb +22 -22
- data/lib/roglew/extensions/GL_ARB_vertex_type_2_10_10_10_rev.rb +52 -52
- data/lib/roglew/extensions/GL_ARB_viewport_array.rb +35 -35
- data/lib/roglew/extensions/GL_ARB_window_pos.rb +21 -21
- data/lib/roglew/extensions/GL_ATIX_point_sprites.rb +9 -9
- data/lib/roglew/extensions/GL_ATIX_texture_env_combine3.rb +6 -6
- data/lib/roglew/extensions/GL_ATIX_texture_env_route.rb +6 -6
- data/lib/roglew/extensions/GL_ATIX_vertex_shader_output_point_size.rb +4 -4
- data/lib/roglew/extensions/GL_ATI_draw_buffers.rb +30 -30
- data/lib/roglew/extensions/GL_ATI_element_array.rb +18 -18
- data/lib/roglew/extensions/GL_ATI_envmap_bumpmap.rb +24 -24
- data/lib/roglew/extensions/GL_ATI_fragment_shader.rb +80 -80
- data/lib/roglew/extensions/GL_ATI_map_object_buffer.rb +9 -9
- data/lib/roglew/extensions/GL_ATI_meminfo.rb +6 -6
- data/lib/roglew/extensions/GL_ATI_pn_triangles.rb +23 -23
- data/lib/roglew/extensions/GL_ATI_separate_stencil.rb +18 -18
- data/lib/roglew/extensions/GL_ATI_text_fragment_shader.rb +4 -4
- data/lib/roglew/extensions/GL_ATI_texture_compression_3dc.rb +4 -4
- data/lib/roglew/extensions/GL_ATI_texture_env_combine3.rb +6 -6
- data/lib/roglew/extensions/GL_ATI_texture_float.rb +15 -15
- data/lib/roglew/extensions/GL_ATI_texture_mirror_once.rb +5 -5
- data/lib/roglew/extensions/GL_ATI_vertex_array_object.rb +32 -32
- data/lib/roglew/extensions/GL_ATI_vertex_attrib_array_object.rb +8 -8
- data/lib/roglew/extensions/GL_ATI_vertex_streams.rb +67 -67
- data/lib/roglew/extensions/GL_EXT_422_pixels.rb +7 -7
- data/lib/roglew/extensions/GL_EXT_Cg_shader.rb +5 -5
- data/lib/roglew/extensions/GL_EXT_abgr.rb +4 -4
- data/lib/roglew/extensions/GL_EXT_bgra.rb +5 -5
- data/lib/roglew/extensions/GL_EXT_bindable_uniform.rb +21 -21
- data/lib/roglew/extensions/GL_EXT_blend_color.rb +18 -18
- data/lib/roglew/extensions/GL_EXT_blend_equation_separate.rb +15 -15
- data/lib/roglew/extensions/GL_EXT_blend_func_separate.rb +17 -17
- data/lib/roglew/extensions/GL_EXT_blend_minmax.rb +17 -17
- data/lib/roglew/extensions/GL_EXT_blend_subtract.rb +7 -7
- data/lib/roglew/extensions/GL_EXT_clip_volume_hint.rb +4 -4
- data/lib/roglew/extensions/GL_EXT_cmyka.rb +7 -7
- data/lib/roglew/extensions/GL_EXT_color_subtable.rb +7 -7
- data/lib/roglew/extensions/GL_EXT_compiled_vertex_array.rb +16 -16
- data/lib/roglew/extensions/GL_EXT_convolution.rb +45 -45
- data/lib/roglew/extensions/GL_EXT_coordinate_frame.rb +28 -28
- data/lib/roglew/extensions/GL_EXT_copy_texture.rb +10 -10
- data/lib/roglew/extensions/GL_EXT_cull_vertex.rb +17 -17
- data/lib/roglew/extensions/GL_EXT_debug_marker.rb +8 -8
- data/lib/roglew/extensions/GL_EXT_depth_bounds_test.rb +15 -15
- data/lib/roglew/extensions/GL_EXT_direct_state_access.rb +245 -245
- data/lib/roglew/extensions/GL_EXT_draw_buffers2.rb +11 -11
- data/lib/roglew/extensions/GL_EXT_draw_instanced.rb +7 -7
- data/lib/roglew/extensions/GL_EXT_draw_range_elements.rb +15 -15
- data/lib/roglew/extensions/GL_EXT_fog_coord.rb +24 -24
- data/lib/roglew/extensions/GL_EXT_fragment_lighting.rb +44 -44
- data/lib/roglew/extensions/GL_EXT_framebuffer_blit.rb +17 -17
- data/lib/roglew/extensions/GL_EXT_framebuffer_multisample.rb +16 -16
- data/lib/roglew/extensions/GL_EXT_framebuffer_multisample_blit_scaled.rb +5 -5
- data/lib/roglew/extensions/GL_EXT_framebuffer_sRGB.rb +5 -5
- data/lib/roglew/extensions/GL_EXT_geometry_shader4.rb +35 -35
- data/lib/roglew/extensions/GL_EXT_gpu_program_parameters.rb +7 -7
- data/lib/roglew/extensions/GL_EXT_gpu_shader4.rb +72 -72
- data/lib/roglew/extensions/GL_EXT_histogram.rb +35 -35
- data/lib/roglew/extensions/GL_EXT_index_func.rb +6 -6
- data/lib/roglew/extensions/GL_EXT_index_material.rb +6 -6
- data/lib/roglew/extensions/GL_EXT_light_texture.rb +24 -24
- data/lib/roglew/extensions/GL_EXT_multi_draw_arrays.rb +7 -7
- data/lib/roglew/extensions/GL_EXT_multisample.rb +31 -31
- data/lib/roglew/extensions/GL_EXT_packed_depth_stencil.rb +7 -7
- data/lib/roglew/extensions/GL_EXT_packed_float.rb +6 -6
- data/lib/roglew/extensions/GL_EXT_packed_pixels.rb +8 -8
- data/lib/roglew/extensions/GL_EXT_paletted_texture.rb +37 -37
- data/lib/roglew/extensions/GL_EXT_pixel_buffer_object.rb +7 -7
- data/lib/roglew/extensions/GL_EXT_pixel_transform.rb +27 -27
- data/lib/roglew/extensions/GL_EXT_point_parameters.rb +18 -18
- data/lib/roglew/extensions/GL_EXT_polygon_offset.rb +16 -16
- data/lib/roglew/extensions/GL_EXT_provoking_vertex.rb +17 -17
- data/lib/roglew/extensions/GL_EXT_rescale_normal.rb +4 -4
- data/lib/roglew/extensions/GL_EXT_scene_marker.rb +7 -7
- data/lib/roglew/extensions/GL_EXT_secondary_color.rb +36 -36
- data/lib/roglew/extensions/GL_EXT_separate_shader_objects.rb +16 -16
- data/lib/roglew/extensions/GL_EXT_separate_specular_color.rb +6 -6
- data/lib/roglew/extensions/GL_EXT_shader_image_load_store.rb +69 -69
- data/lib/roglew/extensions/GL_EXT_shared_texture_palette.rb +4 -4
- data/lib/roglew/extensions/GL_EXT_stencil_clear_tag.rb +5 -5
- data/lib/roglew/extensions/GL_EXT_stencil_two_side.rb +15 -15
- data/lib/roglew/extensions/GL_EXT_stencil_wrap.rb +5 -5
- data/lib/roglew/extensions/GL_EXT_subtexture.rb +8 -8
- data/lib/roglew/extensions/GL_EXT_texture.rb +45 -45
- data/lib/roglew/extensions/GL_EXT_texture3D.rb +22 -22
- data/lib/roglew/extensions/GL_EXT_texture_array.rb +21 -21
- data/lib/roglew/extensions/GL_EXT_texture_buffer_object.rb +18 -18
- data/lib/roglew/extensions/GL_EXT_texture_compression_latc.rb +7 -7
- data/lib/roglew/extensions/GL_EXT_texture_compression_rgtc.rb +7 -7
- data/lib/roglew/extensions/GL_EXT_texture_compression_s3tc.rb +7 -7
- data/lib/roglew/extensions/GL_EXT_texture_cube_map.rb +15 -15
- data/lib/roglew/extensions/GL_EXT_texture_edge_clamp.rb +4 -4
- data/lib/roglew/extensions/GL_EXT_texture_env.rb +14 -14
- data/lib/roglew/extensions/GL_EXT_texture_env_combine.rb +24 -24
- data/lib/roglew/extensions/GL_EXT_texture_env_dot3.rb +5 -5
- data/lib/roglew/extensions/GL_EXT_texture_filter_anisotropic.rb +5 -5
- data/lib/roglew/extensions/GL_EXT_texture_integer.rb +65 -65
- data/lib/roglew/extensions/GL_EXT_texture_lod_bias.rb +6 -6
- data/lib/roglew/extensions/GL_EXT_texture_mirror_clamp.rb +6 -6
- data/lib/roglew/extensions/GL_EXT_texture_object.rb +23 -23
- data/lib/roglew/extensions/GL_EXT_texture_perturb_normal.rb +15 -15
- data/lib/roglew/extensions/GL_EXT_texture_rectangle.rb +7 -7
- data/lib/roglew/extensions/GL_EXT_texture_sRGB.rb +19 -19
- data/lib/roglew/extensions/GL_EXT_texture_sRGB_decode.rb +6 -6
- data/lib/roglew/extensions/GL_EXT_texture_shared_exponent.rb +6 -6
- data/lib/roglew/extensions/GL_EXT_texture_snorm.rb +28 -28
- data/lib/roglew/extensions/GL_EXT_texture_swizzle.rb +8 -8
- data/lib/roglew/extensions/GL_EXT_timer_query.rb +15 -15
- data/lib/roglew/extensions/GL_EXT_transform_feedback.rb +34 -34
- data/lib/roglew/extensions/GL_EXT_vertex_array.rb +53 -53
- data/lib/roglew/extensions/GL_EXT_vertex_array_bgra.rb +4 -4
- data/lib/roglew/extensions/GL_EXT_vertex_attrib_64bit.rb +35 -35
- data/lib/roglew/extensions/GL_EXT_vertex_shader.rb +164 -164
- data/lib/roglew/extensions/GL_EXT_vertex_weighting.rb +28 -28
- data/lib/roglew/extensions/GL_EXT_x11_sync_object.rb +14 -14
- data/lib/roglew/extensions/GL_GREMEDY_frame_terminator.rb +6 -6
- data/lib/roglew/extensions/GL_GREMEDY_string_marker.rb +6 -6
- data/lib/roglew/extensions/GL_HP_image_transform.rb +11 -11
- data/lib/roglew/extensions/GL_HP_occlusion_test.rb +5 -5
- data/lib/roglew/extensions/GL_IBM_cull_vertex.rb +4 -4
- data/lib/roglew/extensions/GL_IBM_multimode_draw_arrays.rb +7 -7
- data/lib/roglew/extensions/GL_IBM_rasterpos_clip.rb +4 -4
- data/lib/roglew/extensions/GL_IBM_static_data.rb +5 -5
- data/lib/roglew/extensions/GL_IBM_texture_mirrored_repeat.rb +4 -4
- data/lib/roglew/extensions/GL_IBM_vertex_array_lists.rb +36 -36
- data/lib/roglew/extensions/GL_INGR_color_clamp.rb +11 -11
- data/lib/roglew/extensions/GL_INGR_interlace_read.rb +4 -4
- data/lib/roglew/extensions/GL_INTEL_parallel_arrays.rb +21 -21
- data/lib/roglew/extensions/GL_INTEL_texture_scissor.rb +7 -7
- data/lib/roglew/extensions/GL_KHR_debug.rb +64 -64
- data/lib/roglew/extensions/GL_KHR_texture_compression_astc_ldr.rb +32 -32
- data/lib/roglew/extensions/GL_KTX_buffer_region.rb +21 -21
- data/lib/roglew/extensions/GL_MESAX_texture_stack.rb +9 -9
- data/lib/roglew/extensions/GL_MESA_pack_invert.rb +4 -4
- data/lib/roglew/extensions/GL_MESA_resize_buffers.rb +6 -6
- data/lib/roglew/extensions/GL_MESA_window_pos.rb +29 -29
- data/lib/roglew/extensions/GL_MESA_ycbcr_texture.rb +6 -6
- data/lib/roglew/extensions/GL_NVX_gpu_memory_info.rb +8 -8
- data/lib/roglew/extensions/GL_NV_bindless_texture.rb +18 -18
- data/lib/roglew/extensions/GL_NV_conditional_render.rb +18 -18
- data/lib/roglew/extensions/GL_NV_copy_depth_to_color.rb +5 -5
- data/lib/roglew/extensions/GL_NV_copy_image.rb +6 -6
- data/lib/roglew/extensions/GL_NV_depth_buffer_float.rb +19 -19
- data/lib/roglew/extensions/GL_NV_depth_clamp.rb +4 -4
- data/lib/roglew/extensions/GL_NV_depth_range_unclamped.rb +8 -8
- data/lib/roglew/extensions/GL_NV_evaluators.rb +45 -45
- data/lib/roglew/extensions/GL_NV_explicit_multisample.rb +25 -25
- data/lib/roglew/extensions/GL_NV_fence.rb +22 -22
- data/lib/roglew/extensions/GL_NV_float_buffer.rb +18 -18
- data/lib/roglew/extensions/GL_NV_fog_distance.rb +6 -6
- data/lib/roglew/extensions/GL_NV_fragment_program.rb +24 -24
- data/lib/roglew/extensions/GL_NV_fragment_program2.rb +8 -8
- data/lib/roglew/extensions/GL_NV_framebuffer_multisample_coverage.rb +17 -17
- data/lib/roglew/extensions/GL_NV_geometry_program4.rb +16 -16
- data/lib/roglew/extensions/GL_NV_gpu_program4.rb +32 -32
- data/lib/roglew/extensions/GL_NV_gpu_program5.rb +9 -9
- data/lib/roglew/extensions/GL_NV_gpu_shader5.rb +74 -74
- data/lib/roglew/extensions/GL_NV_half_float.rb +59 -59
- data/lib/roglew/extensions/GL_NV_light_max_exponent.rb +5 -5
- data/lib/roglew/extensions/GL_NV_multisample_coverage.rb +5 -5
- data/lib/roglew/extensions/GL_NV_multisample_filter_hint.rb +4 -4
- data/lib/roglew/extensions/GL_NV_occlusion_query.rb +23 -23
- data/lib/roglew/extensions/GL_NV_packed_depth_stencil.rb +5 -5
- data/lib/roglew/extensions/GL_NV_parameter_buffer_object.rb +20 -20
- data/lib/roglew/extensions/GL_NV_path_rendering.rb +191 -191
- data/lib/roglew/extensions/GL_NV_pixel_data_range.rb +20 -20
- data/lib/roglew/extensions/GL_NV_point_sprite.rb +17 -17
- data/lib/roglew/extensions/GL_NV_present_video.rb +24 -24
- data/lib/roglew/extensions/GL_NV_primitive_restart.rb +16 -16
- data/lib/roglew/extensions/GL_NV_register_combiners.rb +76 -76
- data/lib/roglew/extensions/GL_NV_register_combiners2.rb +15 -15
- data/lib/roglew/extensions/GL_NV_shader_buffer_load.rb +28 -28
- data/lib/roglew/extensions/GL_NV_tessellation_program5.rb +8 -8
- data/lib/roglew/extensions/GL_NV_texgen_emboss.rb +6 -6
- data/lib/roglew/extensions/GL_NV_texgen_reflection.rb +6 -6
- data/lib/roglew/extensions/GL_NV_texture_barrier.rb +6 -6
- data/lib/roglew/extensions/GL_NV_texture_env_combine4.rb +8 -8
- data/lib/roglew/extensions/GL_NV_texture_expand_normal.rb +4 -4
- data/lib/roglew/extensions/GL_NV_texture_multisample.rb +20 -20
- data/lib/roglew/extensions/GL_NV_texture_rectangle.rb +7 -7
- data/lib/roglew/extensions/GL_NV_texture_shader.rb +76 -76
- data/lib/roglew/extensions/GL_NV_texture_shader2.rb +31 -31
- data/lib/roglew/extensions/GL_NV_texture_shader3.rb +20 -20
- data/lib/roglew/extensions/GL_NV_transform_feedback.rb +48 -48
- data/lib/roglew/extensions/GL_NV_transform_feedback2.rb +23 -23
- data/lib/roglew/extensions/GL_NV_vdpau_interop.rb +26 -26
- data/lib/roglew/extensions/GL_NV_vertex_array_range.rb +19 -19
- data/lib/roglew/extensions/GL_NV_vertex_array_range2.rb +4 -4
- data/lib/roglew/extensions/GL_NV_vertex_attrib_integer_64bit.rb +33 -33
- data/lib/roglew/extensions/GL_NV_vertex_buffer_unified_memory.rb +49 -49
- data/lib/roglew/extensions/GL_NV_vertex_program.rb +159 -159
- data/lib/roglew/extensions/GL_NV_vertex_program2_option.rb +5 -5
- data/lib/roglew/extensions/GL_NV_vertex_program3.rb +4 -4
- data/lib/roglew/extensions/GL_NV_vertex_program4.rb +4 -4
- data/lib/roglew/extensions/GL_NV_video_capture.rb +53 -53
- data/lib/roglew/extensions/GL_OES_byte_coordinates.rb +4 -4
- data/lib/roglew/extensions/GL_OES_compressed_paletted_texture.rb +13 -13
- data/lib/roglew/extensions/GL_OES_read_format.rb +5 -5
- data/lib/roglew/extensions/GL_OES_single_precision.rb +11 -11
- data/lib/roglew/extensions/GL_OML_interlace.rb +5 -5
- data/lib/roglew/extensions/GL_OML_resample.rb +9 -9
- data/lib/roglew/extensions/GL_OML_subsample.rb +5 -5
- data/lib/roglew/extensions/GL_PGI_misc_hints.rb +23 -23
- data/lib/roglew/extensions/GL_PGI_vertex_hints.rb +25 -25
- data/lib/roglew/extensions/GL_REGAL_error_string.rb +6 -6
- data/lib/roglew/extensions/GL_REGAL_extension_query.rb +7 -7
- data/lib/roglew/extensions/GL_REGAL_log.rb +12 -12
- data/lib/roglew/extensions/GL_REND_screen_coordinates.rb +5 -5
- data/lib/roglew/extensions/GL_S3_s3tc.rb +9 -9
- data/lib/roglew/extensions/GL_SGIS_color_range.rb +12 -12
- data/lib/roglew/extensions/GL_SGIS_detail_texture.rb +7 -7
- data/lib/roglew/extensions/GL_SGIS_fog_function.rb +7 -7
- data/lib/roglew/extensions/GL_SGIS_generate_mipmap.rb +5 -5
- data/lib/roglew/extensions/GL_SGIS_multisample.rb +30 -30
- data/lib/roglew/extensions/GL_SGIS_point_line_texgen.rb +11 -11
- data/lib/roglew/extensions/GL_SGIS_sharpen_texture.rb +7 -7
- data/lib/roglew/extensions/GL_SGIS_texture4D.rb +7 -7
- data/lib/roglew/extensions/GL_SGIS_texture_border_clamp.rb +4 -4
- data/lib/roglew/extensions/GL_SGIS_texture_edge_clamp.rb +4 -4
- data/lib/roglew/extensions/GL_SGIS_texture_filter4.rb +7 -7
- data/lib/roglew/extensions/GL_SGIS_texture_lod.rb +7 -7
- data/lib/roglew/extensions/GL_SGIX_async.rb +19 -19
- data/lib/roglew/extensions/GL_SGIX_async_histogram.rb +5 -5
- data/lib/roglew/extensions/GL_SGIX_async_pixel.rb +9 -9
- data/lib/roglew/extensions/GL_SGIX_blend_alpha_minmax.rb +5 -5
- data/lib/roglew/extensions/GL_SGIX_convolution_accuracy.rb +4 -4
- data/lib/roglew/extensions/GL_SGIX_depth_texture.rb +6 -6
- data/lib/roglew/extensions/GL_SGIX_flush_raster.rb +6 -6
- data/lib/roglew/extensions/GL_SGIX_fog_offset.rb +5 -5
- data/lib/roglew/extensions/GL_SGIX_fog_texture.rb +16 -16
- data/lib/roglew/extensions/GL_SGIX_fragment_specular_lighting.rb +22 -22
- data/lib/roglew/extensions/GL_SGIX_framezoom.rb +8 -8
- data/lib/roglew/extensions/GL_SGIX_interlace.rb +4 -4
- data/lib/roglew/extensions/GL_SGIX_pixel_texture.rb +8 -8
- data/lib/roglew/extensions/GL_SGIX_reference_plane.rb +6 -6
- data/lib/roglew/extensions/GL_SGIX_resample.rb +7 -7
- data/lib/roglew/extensions/GL_SGIX_shadow_ambient.rb +4 -4
- data/lib/roglew/extensions/GL_SGIX_sprite.rb +9 -9
- data/lib/roglew/extensions/GL_SGIX_tag_sample_buffer.rb +6 -6
- data/lib/roglew/extensions/GL_SGIX_texture_coordinate_clamp.rb +6 -6
- data/lib/roglew/extensions/GL_SGIX_texture_multi_buffer.rb +4 -4
- data/lib/roglew/extensions/GL_SGIX_texture_range.rb +31 -31
- data/lib/roglew/extensions/GL_SGIX_texture_scale_bias.rb +7 -7
- data/lib/roglew/extensions/GL_SGIX_vertex_preclip.rb +5 -5
- data/lib/roglew/extensions/GL_SGIX_vertex_preclip_hint.rb +5 -5
- data/lib/roglew/extensions/GL_SGI_color_matrix.rb +14 -14
- data/lib/roglew/extensions/GL_SGI_color_table.rb +35 -35
- data/lib/roglew/extensions/GL_SGI_texture_color_table.rb +6 -6
- data/lib/roglew/extensions/GL_SUNX_constant_data.rb +15 -15
- data/lib/roglew/extensions/GL_SUN_convolution_border_modes.rb +4 -4
- data/lib/roglew/extensions/GL_SUN_global_alpha.rb +22 -22
- data/lib/roglew/extensions/GL_SUN_mesh_array.rb +5 -5
- data/lib/roglew/extensions/GL_SUN_read_video_pixels.rb +6 -6
- data/lib/roglew/extensions/GL_SUN_slice_accum.rb +4 -4
- data/lib/roglew/extensions/GL_SUN_triangle_list.rb +36 -36
- data/lib/roglew/extensions/GL_SUN_vertex.rb +45 -45
- data/lib/roglew/extensions/GL_VERSION_1_3.rb +153 -153
- data/lib/roglew/extensions/GL_VERSION_1_4.rb +98 -98
- data/lib/roglew/extensions/GL_VERSION_1_5/buffer.rb +24 -23
- data/lib/roglew/extensions/GL_VERSION_1_5/buffer_context.rb +22 -22
- data/lib/roglew/extensions/GL_VERSION_1_5/query.rb +18 -18
- data/lib/roglew/extensions/GL_VERSION_1_5.rb +105 -105
- data/lib/roglew/extensions/GL_VERSION_2_0/shader_program.rb +8 -0
- data/lib/roglew/extensions/GL_VERSION_2_1.rb +39 -39
- data/lib/roglew/extensions/GL_VERSION_3_0.rb +178 -178
- data/lib/roglew/extensions/GL_VERSION_3_1.rb +52 -52
- data/lib/roglew/extensions/GL_VERSION_3_2.rb +43 -43
- data/lib/roglew/extensions/GL_VERSION_3_3.rb +18 -18
- data/lib/roglew/extensions/GL_VERSION_4_0.rb +46 -46
- data/lib/roglew/extensions/GL_VERSION_4_2.rb +21 -21
- data/lib/roglew/extensions/GL_VERSION_4_3.rb +29 -29
- data/lib/roglew/extensions/GL_WIN_specular_fog.rb +4 -4
- data/lib/roglew/extensions/GL_WIN_swap_hint.rb +6 -6
- data/lib/roglew/extensions/WGL_3DFX_multisample.rb +5 -5
- data/lib/roglew/extensions/WGL_3DL_stereo_control.rb +15 -15
- data/lib/roglew/extensions/WGL_AMD_gpu_association.rb +29 -29
- data/lib/roglew/extensions/WGL_ARB_buffer_region.rb +18 -18
- data/lib/roglew/extensions/WGL_ARB_create_context.rb +19 -19
- data/lib/roglew/extensions/WGL_ARB_create_context_profile.rb +7 -7
- data/lib/roglew/extensions/WGL_ARB_extensions_string.rb +6 -6
- data/lib/roglew/extensions/WGL_ARB_framebuffer_sRGB.rb +4 -4
- data/lib/roglew/extensions/WGL_ARB_make_current_read.rb +14 -14
- data/lib/roglew/extensions/WGL_ARB_multisample.rb +5 -5
- data/lib/roglew/extensions/WGL_ARB_pbuffer.rb +23 -23
- data/lib/roglew/extensions/WGL_ARB_pixel_format.rb +62 -62
- data/lib/roglew/extensions/WGL_ARB_pixel_format_float.rb +4 -4
- data/lib/roglew/extensions/WGL_ARB_render_texture.rb +46 -46
- data/lib/roglew/extensions/WGL_ATI_pixel_format_float.rb +9 -9
- data/lib/roglew/extensions/WGL_ATI_render_texture_rectangle.rb +4 -4
- data/lib/roglew/extensions/WGL_EXT_create_context_es2_profile.rb +4 -4
- data/lib/roglew/extensions/WGL_EXT_create_context_es_profile.rb +4 -4
- data/lib/roglew/extensions/WGL_EXT_depth_float.rb +4 -4
- data/lib/roglew/extensions/WGL_EXT_display_color_table.rb +9 -9
- data/lib/roglew/extensions/WGL_EXT_extensions_string.rb +6 -6
- data/lib/roglew/extensions/WGL_EXT_framebuffer_sRGB.rb +4 -4
- data/lib/roglew/extensions/WGL_EXT_make_current_read.rb +13 -13
- data/lib/roglew/extensions/WGL_EXT_multisample.rb +5 -5
- data/lib/roglew/extensions/WGL_EXT_pbuffer.rb +24 -24
- data/lib/roglew/extensions/WGL_EXT_pixel_format.rb +58 -58
- data/lib/roglew/extensions/WGL_EXT_pixel_format_packed_float.rb +4 -4
- data/lib/roglew/extensions/WGL_EXT_swap_control.rb +7 -7
- data/lib/roglew/extensions/WGL_I3D_digital_video_control.rb +16 -16
- data/lib/roglew/extensions/WGL_I3D_gamma.rb +16 -16
- data/lib/roglew/extensions/WGL_I3D_genlock.rb +31 -31
- data/lib/roglew/extensions/WGL_I3D_image_buffer.rb +17 -17
- data/lib/roglew/extensions/WGL_I3D_swap_frame_lock.rb +9 -9
- data/lib/roglew/extensions/WGL_I3D_swap_frame_usage.rb +9 -9
- data/lib/roglew/extensions/WGL_NV_DX_interop.rb +21 -21
- data/lib/roglew/extensions/WGL_NV_copy_image.rb +6 -6
- data/lib/roglew/extensions/WGL_NV_float_buffer.rb +12 -12
- data/lib/roglew/extensions/WGL_NV_gpu_affinity.rb +25 -25
- data/lib/roglew/extensions/WGL_NV_multisample_coverage.rb +5 -5
- data/lib/roglew/extensions/WGL_NV_present_video.rb +14 -14
- data/lib/roglew/extensions/WGL_NV_render_depth_texture.rb +9 -9
- data/lib/roglew/extensions/WGL_NV_render_texture_rectangle.rb +6 -6
- data/lib/roglew/extensions/WGL_NV_swap_group.rb +11 -11
- data/lib/roglew/extensions/WGL_NV_vertex_array_range.rb +7 -7
- data/lib/roglew/extensions/WGL_NV_video_capture.rb +17 -17
- data/lib/roglew/extensions/WGL_NV_video_output.rb +29 -29
- data/lib/roglew/extensions/WGL_OML_sync_control.rb +11 -11
- data/lib/roglew/{native/gl.rb → gl.rb} +2 -5
- data/lib/roglew/gl_extension.rb +0 -7
- data/lib/roglew/platform/linux/gl.rb +11 -0
- data/lib/roglew/platform/linux/glx.rb +104 -0
- data/lib/roglew/platform/linux/render_context.rb +94 -0
- data/lib/roglew/platform/linux.rb +3 -0
- data/lib/roglew/{native → platform/windows}/gdi32.rb +241 -241
- data/lib/roglew/platform/windows/gl.rb +9 -0
- data/lib/roglew/{native → platform/windows}/kernel32.rb +8 -8
- data/lib/roglew/platform/windows/render_context.rb +100 -0
- data/lib/roglew/{native → platform/windows}/wgl.rb +6 -3
- data/lib/roglew/platform/windows.rb +5 -0
- data/lib/roglew/render_context.rb +74 -146
- data/lib/roglew.rb +28 -24
- metadata +88 -35
- data/lib/roglew/extensions/GLX_VERSION_1_0.rb +0 -28
- data/lib/roglew/native/glx.rb +0 -8
- data/lib/roglew/native/native_object.rb +0 -11
- data/lib/roglew/native/win32ffi.rb +0 -27
@@ -1,9 +1,9 @@
|
|
1
|
-
module Roglew
|
2
|
-
module Kernel32
|
3
|
-
extend ::FFI::Library
|
4
|
-
ffi_lib 'kernel32'
|
5
|
-
ffi_convention :stdcall
|
6
|
-
|
7
|
-
attach_function :GetLastError, [], :uint
|
8
|
-
end
|
1
|
+
module Roglew
|
2
|
+
module Kernel32
|
3
|
+
extend ::FFI::Library
|
4
|
+
ffi_lib 'kernel32'
|
5
|
+
ffi_convention :stdcall
|
6
|
+
|
7
|
+
attach_function :GetLastError, [], :uint
|
8
|
+
end
|
9
9
|
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
module Roglew
|
2
|
+
class RenderContext
|
3
|
+
#if version not passed, builds context with latest version
|
4
|
+
def initialize(hdc, version = nil)
|
5
|
+
@hdc = hdc
|
6
|
+
|
7
|
+
initialize_pixel_format
|
8
|
+
|
9
|
+
@hrc, old_hrc = wglCreateContext(@hdc), nil
|
10
|
+
|
11
|
+
bind do
|
12
|
+
#check version
|
13
|
+
max_version = glGetString(GL::VERSION).split('.', 2).map!(&:to_i)
|
14
|
+
|
15
|
+
#if max OpelGL version is less than requested, give error
|
16
|
+
raise ArgumentError, "unsupported version #{version.join('.')}" if version && (max_version <=> version < 0)
|
17
|
+
|
18
|
+
@version = version || max_version
|
19
|
+
@loaded_extensions = Set.new
|
20
|
+
extension_list(:core).each { |ext| load_extension(ext) }
|
21
|
+
old_hrc, @hrc = @hrc, upgrade_context if @version[0] > 2
|
22
|
+
extension_list(:gl, :platform).each { |ext| load_extension(ext) }
|
23
|
+
end
|
24
|
+
|
25
|
+
@attribs = Set[GL::DITHER, GL::MULTISAMPLE]
|
26
|
+
|
27
|
+
wglDeleteContext(old_hrc) if old_hrc
|
28
|
+
|
29
|
+
self.class.finalize(self, @hrc)
|
30
|
+
end
|
31
|
+
|
32
|
+
alias_method :get_proc_address, :wglGetProcAddress
|
33
|
+
|
34
|
+
def swap_buffers
|
35
|
+
Gdi32.SwapBuffers(@hdc)
|
36
|
+
end
|
37
|
+
|
38
|
+
def unbind
|
39
|
+
wglMakeCurrent(nil, nil)
|
40
|
+
end
|
41
|
+
|
42
|
+
#------
|
43
|
+
private
|
44
|
+
|
45
|
+
def initialize_pixel_format
|
46
|
+
pfd = Gdi32::PIXELFORMATDESCRIPTOR.new
|
47
|
+
pfd.dwFlags = [:DOUBLEBUFFER, :SUPPORT_OPENGL, :DRAW_TO_WINDOW]
|
48
|
+
pfd.cColorBits = 24
|
49
|
+
pfd.cAlphaBits = 8
|
50
|
+
pfd.cDepthBits = 32
|
51
|
+
|
52
|
+
pxfmt = Gdi32.ChoosePixelFormat(@hdc, pfd)
|
53
|
+
raise InvalidPixelFormatError,
|
54
|
+
"(ChoosePixelFormat) GetLastError returned #{Kernel32.GetLastError}" if pxfmt == 0
|
55
|
+
|
56
|
+
#Can't use DescribePixelFormat. Blows up remote desktop
|
57
|
+
#
|
58
|
+
#max_pfd = Gdi32.DescribePixelFormat(@hdc, pxfmt, Gdi32::PIXELFORMATDESCRIPTOR.size, pfd)
|
59
|
+
#puts "#\t" + Gdi32::PIXELFORMATDESCRIPTOR.members.select { |x| x != :nSize }.join("\t")
|
60
|
+
#max_pfd.times do |i|
|
61
|
+
# pfd2 = Gdi32::PIXELFORMATDESCRIPTOR.new
|
62
|
+
# Gdi32.DescribePixelFormat(@hdc, i+1, Gdi32::PIXELFORMATDESCRIPTOR.size, pfd2)
|
63
|
+
# puts "#{i + 1}\t" + Gdi32::PIXELFORMATDESCRIPTOR.
|
64
|
+
# members.select { |x| x != :nSize }.map { |x| pfd2.send(x).inspect }.join("\t")
|
65
|
+
#end
|
66
|
+
|
67
|
+
raise InvalidPixelFormatError,
|
68
|
+
"(SetPixelFormat) GetLastError returned #{Kernel32.GetLastError}" unless Gdi32.SetPixelFormat(@hdc, pxfmt, pfd)
|
69
|
+
end
|
70
|
+
|
71
|
+
def upgrade_context
|
72
|
+
load_extension :WGL_ARB_create_context
|
73
|
+
|
74
|
+
raise 'undefined function wglCreateContextAttribsARB' unless respond_to?(:wglCreateContextAttribsARB)
|
75
|
+
|
76
|
+
attribs = [WGL::CONTEXT_MAJOR_VERSION_ARB, @version[0],
|
77
|
+
WGL::CONTEXT_MINOR_VERSION_ARB, @version[1],
|
78
|
+
WGL::CONTEXT_FLAGS_ARB, WGL::CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
|
79
|
+
0]
|
80
|
+
ptr_attribs = FFI::MemoryPointer.new(:int, attribs.length)
|
81
|
+
ptr_attribs.write_array_of_int(attribs)
|
82
|
+
|
83
|
+
wglCreateContextAttribsARB(@hdc, nil, ptr_attribs)
|
84
|
+
end
|
85
|
+
|
86
|
+
def extension_list_platform
|
87
|
+
if (func = get_function(:wglGetExtensionsStringARB, [:pointer], :string))
|
88
|
+
func.(@hdc)
|
89
|
+
elsif (func = get_function(:wglGetExtensionsStringEXT, [], :string))
|
90
|
+
func.()
|
91
|
+
else
|
92
|
+
''
|
93
|
+
end.split.map!(&:to_sym)
|
94
|
+
end
|
95
|
+
|
96
|
+
def make_current
|
97
|
+
wglMakeCurrent(@hdc, @hrc)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module Roglew
|
2
2
|
module WGL
|
3
3
|
include GL::Native
|
4
|
-
extend NativeObject
|
5
4
|
|
6
5
|
ENCODING = 'W'
|
7
6
|
|
@@ -131,8 +130,12 @@ module Roglew
|
|
131
130
|
[ :UseFontOutlines, "wglUseFontOutlines#{ENCODING}", [:pointer, :uint, :uint, :uint, :float, :float, :int, GLYPHMETRICSFLOAT.ptr], :bool ]
|
132
131
|
].each do |args|
|
133
132
|
args[1, 0] = "wgl#{args[0]}" if args.length == 3
|
134
|
-
attach_function *args
|
135
|
-
RenderContext.
|
133
|
+
func = attach_function *args
|
134
|
+
RenderContext.send(:define_method, args[1]) { |*parms| func.call(*parms) }
|
135
|
+
end
|
136
|
+
|
137
|
+
class << self
|
138
|
+
alias_method :delete_context, :DeleteContext
|
136
139
|
end
|
137
140
|
end
|
138
141
|
end
|
@@ -5,63 +5,37 @@ module Roglew
|
|
5
5
|
|
6
6
|
@registered_extensions = {}
|
7
7
|
|
8
|
-
|
9
|
-
def initialize(hdc, version = nil)
|
10
|
-
@hdc = hdc
|
11
|
-
|
12
|
-
initialize_pixel_format
|
13
|
-
|
14
|
-
@hrc, old_hrc = wglCreateContext(@hdc), nil
|
15
|
-
|
16
|
-
bind do
|
17
|
-
#check version
|
18
|
-
max_version = glGetString(GL::VERSION).split('.', 2).map!(&:to_i)
|
19
|
-
|
20
|
-
#if max OpelGL version is less than requested, give error
|
21
|
-
raise ArgumentError, "unsupported version #{version.join('.')}" if version && (max_version <=> version < 0)
|
22
|
-
|
23
|
-
@version = version || max_version
|
24
|
-
@loaded_extensions = Set.new
|
25
|
-
core_extension_list.each { |ext| load_extension(ext) }
|
26
|
-
|
27
|
-
old_hrc, @hrc = @hrc, upgrade_context if @version[0] > 2
|
28
|
-
|
29
|
-
(gl_extension_list + platform_extension_list).each { |ext| load_extension(ext) }
|
30
|
-
end
|
31
|
-
|
32
|
-
@attribs = Set[GL::DITHER, GL::MULTISAMPLE]
|
33
|
-
|
34
|
-
wglDeleteContext(old_hrc) if old_hrc
|
35
|
-
|
36
|
-
self.class.finalize(self, @hrc)
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.finalize(obj, hrc)
|
8
|
+
def self.finalize(obj, *args)
|
40
9
|
ObjectSpace.define_finalizer(obj, proc do
|
41
|
-
|
10
|
+
puts 'releasing a render context'
|
11
|
+
GL.platform_module.delete_context(*args)
|
42
12
|
end)
|
43
13
|
end
|
44
14
|
|
45
|
-
def
|
46
|
-
|
47
|
-
@
|
15
|
+
def self.register_extensions(extensions)
|
16
|
+
extensions = Hash[extensions.map { |k, v| [k.to_sym, v] }]
|
17
|
+
@registered_extensions.merge!(extensions)
|
18
|
+
nil
|
19
|
+
end
|
48
20
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
end
|
21
|
+
def self.unregister_extensions(*extensions)
|
22
|
+
extensions.map! { |e| e.to_sym }.each { |e| @registered_extensions.delete(e) }
|
23
|
+
nil
|
24
|
+
end
|
54
25
|
|
55
|
-
|
56
|
-
|
57
|
-
return unless
|
58
|
-
|
26
|
+
def begin(mode)
|
27
|
+
glBegin(mode)
|
28
|
+
return unless block_given?
|
29
|
+
yield
|
30
|
+
glEnd
|
31
|
+
end
|
59
32
|
|
60
|
-
|
33
|
+
%w'points lines line_strip line_loop triangles triangle_strip triangle_fan quads quad_strip polygon'.each do |v|
|
34
|
+
class_eval("def #{v}(&block) self.begin(GL::#{v.upcase}, &block) end")
|
61
35
|
end
|
62
36
|
|
63
37
|
def bind
|
64
|
-
|
38
|
+
make_current
|
65
39
|
if block_given?
|
66
40
|
yield
|
67
41
|
unbind
|
@@ -69,37 +43,16 @@ module Roglew
|
|
69
43
|
self
|
70
44
|
end
|
71
45
|
|
72
|
-
def
|
73
|
-
|
46
|
+
def clear(*flags)
|
47
|
+
glClear(flags.reduce(&:|))
|
74
48
|
end
|
75
49
|
|
76
|
-
def version; @version.dup end
|
77
|
-
|
78
|
-
def loaded_extensions; @loaded_extensions.dup end
|
79
|
-
|
80
|
-
def supports?(extension); !!@loaded_extensions[extension] end
|
81
|
-
|
82
50
|
def create_texture2d(*args)
|
83
51
|
Texture2d.new(self, *args)
|
84
52
|
end
|
85
53
|
|
86
54
|
def_object :Textures
|
87
55
|
|
88
|
-
def begin(mode)
|
89
|
-
glBegin(mode)
|
90
|
-
return unless block_given?
|
91
|
-
yield
|
92
|
-
glEnd
|
93
|
-
end
|
94
|
-
|
95
|
-
%w'points lines line_strip line_loop triangles triangle_strip triangle_fan quads quad_strip polygon'.each do |v|
|
96
|
-
class_eval("def #{v}(&block) self.begin(GL::#{v.upcase}, &block) end")
|
97
|
-
end
|
98
|
-
|
99
|
-
def clear(*flags)
|
100
|
-
glClear(flags.reduce(&:|))
|
101
|
-
end
|
102
|
-
|
103
56
|
def disable(*caps)
|
104
57
|
caps = Set[*caps] & @attribs
|
105
58
|
caps.each do |cap|
|
@@ -120,12 +73,10 @@ module Roglew
|
|
120
73
|
disable(*caps)
|
121
74
|
end
|
122
75
|
|
123
|
-
def
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
end
|
128
|
-
errors
|
76
|
+
def extension_list(*types)
|
77
|
+
list = types.flat_map { |type| send("extension_list_#{type}") }
|
78
|
+
list.uniq!
|
79
|
+
list
|
129
80
|
end
|
130
81
|
|
131
82
|
def get_integers(pname, count = 1)
|
@@ -135,95 +86,72 @@ module Roglew
|
|
135
86
|
count == 1 ? result[0] : result
|
136
87
|
end
|
137
88
|
|
138
|
-
def
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
type = params.all? { |param| param.is_a? Integer } ? 'int' : 'float'
|
145
|
-
ptr = FFI::MemoryPointer.new(type.to_sym, params.length)
|
146
|
-
ptr.send("write_array_of_#{type}", params)
|
147
|
-
send("glTexParameter#{type[0]}v", target, pname, ptr)
|
89
|
+
def get_errors
|
90
|
+
errors = []
|
91
|
+
while (error = glGetError) != 0
|
92
|
+
errors << GL::ERROR[error] || error
|
93
|
+
end
|
94
|
+
errors
|
148
95
|
end
|
149
96
|
|
150
|
-
def
|
151
|
-
|
152
|
-
|
153
|
-
|
97
|
+
def get_function(function_name, parameters, return_type)
|
98
|
+
ptr = get_proc_address(function_name.to_s)
|
99
|
+
return nil if ptr.null?
|
100
|
+
return_type = GL.find_type(return_type) || return_type
|
101
|
+
parameters = parameters.map { |p| GL.find_type(p) || p }
|
102
|
+
FFI::Function.new(return_type, parameters, ptr, convention: :stdcall)
|
154
103
|
end
|
155
104
|
|
156
|
-
def
|
157
|
-
|
158
|
-
|
159
|
-
end
|
160
|
-
|
161
|
-
#------
|
162
|
-
private
|
105
|
+
def load_extension(ext)
|
106
|
+
ext = ext.to_sym
|
107
|
+
@loaded_extensions << ext
|
163
108
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
pfd.cDepthBits = 32
|
109
|
+
unless Object.const_defined?(ext)
|
110
|
+
reg = self.class.instance_variable_get(:@registered_extensions)
|
111
|
+
filename = reg[ext] || File.expand_path("../extensions/#{ext}.rb", __FILE__)
|
112
|
+
require filename if File.exists?(filename)
|
113
|
+
end
|
170
114
|
|
171
|
-
|
172
|
-
|
173
|
-
|
115
|
+
return unless Object.const_defined?(ext)
|
116
|
+
mod = Object.const_get(ext)
|
117
|
+
return unless mod.const_defined?(:RenderContext)
|
118
|
+
mod = mod::RenderContext
|
119
|
+
return unless mod
|
174
120
|
|
175
|
-
|
176
|
-
#
|
177
|
-
#max_pfd = Gdi32.DescribePixelFormat(@hdc, pxfmt, Gdi32::PIXELFORMATDESCRIPTOR.size, pfd)
|
178
|
-
#puts "#\t" + Gdi32::PIXELFORMATDESCRIPTOR.members.select { |x| x != :nSize }.join("\t")
|
179
|
-
#max_pfd.times do |i|
|
180
|
-
# pfd2 = Gdi32::PIXELFORMATDESCRIPTOR.new
|
181
|
-
# Gdi32.DescribePixelFormat(@hdc, i+1, Gdi32::PIXELFORMATDESCRIPTOR.size, pfd2)
|
182
|
-
# puts "#{i + 1}\t" + Gdi32::PIXELFORMATDESCRIPTOR.
|
183
|
-
# members.select { |x| x != :nSize }.map { |x| pfd2.send(x).inspect }.join("\t")
|
184
|
-
#end
|
121
|
+
singleton_class.send(:include, mod)
|
185
122
|
|
186
|
-
|
187
|
-
|
123
|
+
return unless mod.respond_to? :functions
|
124
|
+
mod.functions.each do |name, parameters, ret_type|
|
125
|
+
function = get_function(name, parameters, ret_type)
|
126
|
+
define_singleton_method(name) { |*a| function.call(*a) } if function
|
127
|
+
end
|
188
128
|
end
|
189
129
|
|
190
|
-
def
|
191
|
-
load_extension(:WGL_ARB_create_context)
|
192
|
-
|
193
|
-
raise 'undefined function wglCreateContextAttribsARB' unless respond_to?(:wglCreateContextAttribsARB)
|
130
|
+
def loaded_extensions; @loaded_extensions.dup end
|
194
131
|
|
195
|
-
|
196
|
-
WGL::CONTEXT_MINOR_VERSION_ARB, @version[1],
|
197
|
-
WGL::CONTEXT_FLAGS_ARB, WGL::CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
|
198
|
-
0]
|
199
|
-
ptr_attribs = FFI::MemoryPointer.new(:int, attribs.length)
|
200
|
-
ptr_attribs.write_array_of_int(attribs)
|
132
|
+
def supports?(extension); !!@loaded_extensions[extension] end
|
201
133
|
|
202
|
-
|
134
|
+
def tex_parameter(target, pname, *params)
|
135
|
+
params.flatten!
|
136
|
+
type = params.all? { |param| param.is_a? Integer } ? 'int' : 'float'
|
137
|
+
ptr = FFI::MemoryPointer.new(type.to_sym, params.length)
|
138
|
+
ptr.send("write_array_of_#{type}", params)
|
139
|
+
send("glTexParameter#{type[0]}v", target, pname, ptr)
|
203
140
|
end
|
204
141
|
|
205
|
-
def
|
142
|
+
def version; @version.dup end
|
143
|
+
|
144
|
+
private
|
145
|
+
def extension_list_core
|
206
146
|
Dir["#{File.expand_path('../extensions', __FILE__)}/GL_VERSION_*.rb"].
|
207
147
|
map! { |f| File.basename(f, '.rb') }.
|
208
148
|
select! { |f| (f.gsub('GL_VERSION_', '').split('_', 2).map!(&:to_i) <=> @version) <= 0 }
|
209
149
|
end
|
210
150
|
|
211
|
-
def
|
212
|
-
|
213
|
-
glGetString(GL::EXTENSIONS).split
|
214
|
-
|
215
|
-
get_integers(GL::NUM_EXTENSIONS).times.map { |i| glGetStringi(GL::EXTENSIONS, i) }
|
216
|
-
end.map!(&:to_sym)
|
217
|
-
end
|
218
|
-
|
219
|
-
def platform_extension_list
|
220
|
-
if (func = WGL.get_function(:wglGetExtensionsStringARB, [:pointer], :string))
|
221
|
-
func.(@hdc)
|
222
|
-
elsif (func = WGL.get_function(:wglGetExtensionsStringEXT, [], :string))
|
223
|
-
func.()
|
224
|
-
else
|
225
|
-
''
|
226
|
-
end.split.map!(&:to_sym)
|
151
|
+
def extension_list_gl
|
152
|
+
(@version[0] < 3 ?
|
153
|
+
glGetString(GL::EXTENSIONS).split :
|
154
|
+
get_integers(GL::NUM_EXTENSIONS).times.map { |i| glGetStringi(GL::EXTENSIONS, i) }).map!(&:to_sym)
|
227
155
|
end
|
228
156
|
end
|
229
157
|
end
|
data/lib/roglew.rb
CHANGED
@@ -1,31 +1,35 @@
|
|
1
1
|
#Raw Glue - the Ruby OpenGL and Extensions Wrapper
|
2
2
|
|
3
|
-
module Roglew
|
4
|
-
VERSION = '0.1.4'
|
5
|
-
end
|
6
|
-
|
7
3
|
#external dependencies
|
8
|
-
%w'
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
%w'set
|
5
|
+
ffi
|
6
|
+
facets/module/module_load
|
7
|
+
facets/string/camelcase
|
8
|
+
facets/string/snakecase
|
9
|
+
facets/platform
|
14
10
|
'.each { |f| require f }
|
15
11
|
|
12
|
+
module Roglew
|
13
|
+
VERSION = '0.2.1'
|
14
|
+
|
15
|
+
PLATFORM = case
|
16
|
+
when Platform.local.windows? then 'windows'
|
17
|
+
when Platform.local.linux? then 'linux'
|
18
|
+
else raise 'Unknown platform'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
16
22
|
#internal files
|
17
|
-
%
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
native/gl
|
30
|
-
render_context
|
23
|
+
%W'ext/ffi_struct_ext
|
24
|
+
contexts/base
|
25
|
+
contexts/deferred
|
26
|
+
contexts/immediate
|
27
|
+
errors
|
28
|
+
contextual
|
29
|
+
gl_extension
|
30
|
+
gl_object
|
31
|
+
platform/#{Roglew::PLATFORM}/gl
|
32
|
+
gl
|
33
|
+
platform/#{Roglew::PLATFORM}
|
34
|
+
render_context
|
31
35
|
'.each { |f| require "roglew/#{f}" }
|