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
@@ -0,0 +1,104 @@
|
|
1
|
+
module Roglew
|
2
|
+
module GLX
|
3
|
+
include GL::Native
|
4
|
+
|
5
|
+
USE_GL = 1
|
6
|
+
BUFFER_SIZE = 2
|
7
|
+
LEVEL = 3
|
8
|
+
RGBA = 4
|
9
|
+
DOUBLEBUFFER = 5
|
10
|
+
STEREO = 6
|
11
|
+
AUX_BUFFERS = 7
|
12
|
+
RED_SIZE = 8
|
13
|
+
GREEN_SIZE = 9
|
14
|
+
BLUE_SIZE = 10
|
15
|
+
ALPHA_SIZE = 11
|
16
|
+
DEPTH_SIZE = 12
|
17
|
+
STENCIL_SIZE = 13
|
18
|
+
ACCUM_RED_SIZE = 14
|
19
|
+
ACCUM_GREEN_SIZE = 15
|
20
|
+
ACCUM_BLUE_SIZE = 16
|
21
|
+
ACCUM_ALPHA_SIZE = 17
|
22
|
+
BAD_SCREEN = 1
|
23
|
+
BAD_ATTRIBUTE = 2
|
24
|
+
NO_EXTENSION = 3
|
25
|
+
BAD_VISUAL = 4
|
26
|
+
BAD_CONTEXT = 5
|
27
|
+
BAD_VALUE = 6
|
28
|
+
BAD_ENUM = 7
|
29
|
+
|
30
|
+
class XVisualInfo < FFI::Struct
|
31
|
+
layout :visual, :pointer,
|
32
|
+
:visualid, :uint,
|
33
|
+
:screen, :int ,
|
34
|
+
:depth, :int,
|
35
|
+
:class, :int,
|
36
|
+
:red_mask, :uint,
|
37
|
+
:green_mask, :uint,
|
38
|
+
:blue_mask, :uint,
|
39
|
+
:colormap_size, :int,
|
40
|
+
:bits_per_rgb, :int
|
41
|
+
end
|
42
|
+
|
43
|
+
[
|
44
|
+
#XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList)
|
45
|
+
[ :ChooseVisual, [:pointer, :int, :pointer], XVisualInfo.ptr ],
|
46
|
+
|
47
|
+
#void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask)
|
48
|
+
[ :CopyContext, [:pointer, :pointer, :pointer, :uint], :void ],
|
49
|
+
|
50
|
+
#GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct)
|
51
|
+
[ :CreateContext, [:pointer, XVisualInfo.ptr, :pointer, :bool], :pointer ],
|
52
|
+
|
53
|
+
#GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap)
|
54
|
+
[ :CreateGLXPixmap, [:pointer, XVisualInfo.ptr, :int], :int ],
|
55
|
+
|
56
|
+
#void glXDestroyContext (Display *dpy, GLXContext ctx)
|
57
|
+
[ :DestroyContext, [:pointer, :pointer], :void ],
|
58
|
+
|
59
|
+
#void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix)
|
60
|
+
[ :DestroyGLXPixmap, [:pointer, :int], :void ],
|
61
|
+
|
62
|
+
#int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value)
|
63
|
+
[ :GetConfig, [:pointer, XVisualInfo.ptr, :int, :pointer], :int ],
|
64
|
+
|
65
|
+
#GLXContext glXGetCurrentContext (void)
|
66
|
+
[ :GetCurrentContext, [], :pointer ],
|
67
|
+
|
68
|
+
#GLXDrawable glXGetCurrentDrawable (void)
|
69
|
+
[ :GetCurrentDrawable, [], :int ],
|
70
|
+
|
71
|
+
#Bool glXIsDirect (Display *dpy, GLXContext ctx)
|
72
|
+
[ :IsDirect, [:pointer, :pointer], :bool ],
|
73
|
+
|
74
|
+
#Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx)
|
75
|
+
[ :MakeCurrent, [:pointer, :int, :pointer], :bool ],
|
76
|
+
|
77
|
+
#Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase)
|
78
|
+
[ :QueryExtension, [:pointer, :pointer, :pointer], :bool ],
|
79
|
+
|
80
|
+
#Bool glXQueryVersion (Display *dpy, int *major, int *minor)
|
81
|
+
[ :QueryVersion, [:pointer, :pointer, :pointer], :bool ],
|
82
|
+
|
83
|
+
#void glXSwapBuffers (Display *dpy, GLXDrawable drawable)
|
84
|
+
[ :SwapBuffers, [:pointer, :int], :void ],
|
85
|
+
|
86
|
+
#void glXUseXFont (Font font, int first, int count, int listBase)
|
87
|
+
[ :UseXFont, [:int, :int, :int, :int], :void ],
|
88
|
+
|
89
|
+
#void glXWaitGL (void)
|
90
|
+
[ :WaitGL, [], :void ],
|
91
|
+
|
92
|
+
#void glXWaitX (void)
|
93
|
+
[ :WaitX, [], :void ]
|
94
|
+
].each do |args|
|
95
|
+
args[1, 0] = "glX#{args[0]}"
|
96
|
+
func = attach_function *args
|
97
|
+
RenderContext.send(:define_method, args[1]) { |*parms| func.call(*parms) }
|
98
|
+
end
|
99
|
+
|
100
|
+
def delete_context(dpy, ctx)
|
101
|
+
DestroyContext(dpy, ctx)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
module Roglew
|
2
|
+
class RenderContext
|
3
|
+
#if version not passed, builds context with latest version
|
4
|
+
def initialize(display, screen, window, version = nil)
|
5
|
+
@display, @screen, @window = display, screen, window
|
6
|
+
@loaded_extensions = Set.new
|
7
|
+
|
8
|
+
extension_list(:glx).each { |ext| load_extension(ext) }
|
9
|
+
|
10
|
+
attrList = FFI::MemoryPointer.new(:int, 11)
|
11
|
+
attrList.write_array_of_int([
|
12
|
+
Roglew::GLX::RGBA, Roglew::GLX::DOUBLEBUFFER,
|
13
|
+
Roglew::GLX::RED_SIZE, 4,
|
14
|
+
Roglew::GLX::GREEN_SIZE, 4,
|
15
|
+
Roglew::GLX::BLUE_SIZE, 4,
|
16
|
+
Roglew::GLX::DEPTH_SIZE, 16
|
17
|
+
])
|
18
|
+
@visual = glXChooseVisual(@display, screen, attrList)
|
19
|
+
@context = glXCreateContext(@display, @visual, nil, true)
|
20
|
+
|
21
|
+
|
22
|
+
bind do
|
23
|
+
#check version
|
24
|
+
max_version = glGetString(GL::VERSION).split('.', 2).map!(&:to_i)
|
25
|
+
|
26
|
+
#if max OpelGL version is less than requested, give error
|
27
|
+
raise ArgumentError, "unsupported version #{version.join('.')}" if version && (max_version <=> version < 0)
|
28
|
+
|
29
|
+
@version = version || max_version
|
30
|
+
extension_list(:core).each { |ext| load_extension(ext) }
|
31
|
+
old_context, @context = @context, upgrade_context if @version[0] > 2
|
32
|
+
extension_list(:gl, :platform).each { |ext| load_extension(ext) }
|
33
|
+
end
|
34
|
+
|
35
|
+
self.class.finalize(self, @display, @context)
|
36
|
+
end
|
37
|
+
|
38
|
+
def get_proc_address(name)
|
39
|
+
func = begin
|
40
|
+
GLX.attach_function :glXGetProcAddress, [:string], :pointer
|
41
|
+
rescue FFI::NotFoundError
|
42
|
+
GLX.attach_function :glXGetProcAddressARB, [:string], :pointer
|
43
|
+
end
|
44
|
+
define_singleton_method(:get_proc_address, ->(n) { func.(n) })
|
45
|
+
send(:get_proc_address, name)
|
46
|
+
end
|
47
|
+
|
48
|
+
def swap_buffers
|
49
|
+
#TODO
|
50
|
+
raise NotImplementedError
|
51
|
+
end
|
52
|
+
|
53
|
+
def unbind
|
54
|
+
glXMakeCurrent(@display, 0, nil)
|
55
|
+
end
|
56
|
+
|
57
|
+
#------
|
58
|
+
private
|
59
|
+
|
60
|
+
def upgrade_context
|
61
|
+
load_extension :GLX_ARB_create_context
|
62
|
+
|
63
|
+
raise 'undefined function wglCreateContextAttribsARB' unless respond_to?(:glXCreateContextAttribsARB)
|
64
|
+
|
65
|
+
attribs = [GLX::CONTEXT_MAJOR_VERSION_ARB, @version[0],
|
66
|
+
GLX::CONTEXT_MINOR_VERSION_ARB, @version[1],
|
67
|
+
GLX::CONTEXT_FLAGS_ARB, GLX::CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
|
68
|
+
0]
|
69
|
+
ptr_attribs = FFI::MemoryPointer.new(:int, attribs.length)
|
70
|
+
ptr_attribs.write_array_of_int(attribs)
|
71
|
+
glXCreateContextAttribsARB(@context, nil, ptr_attribs)
|
72
|
+
end
|
73
|
+
|
74
|
+
def extension_list_glx
|
75
|
+
major, minor = FFI::MemoryPointer.new(:int), FFI::MemoryPointer.new(:int)
|
76
|
+
glXQueryVersion(@display, major, minor)
|
77
|
+
version = major.read_int, minor.read_int
|
78
|
+
puts "GLX Version #{version.join('.')}"
|
79
|
+
|
80
|
+
list = Dir["#{File.expand_path('../../../extensions', __FILE__)}/GLX_VERSION_*.rb"].
|
81
|
+
map! { |f| File.basename(f, '.rb') }
|
82
|
+
list.select! { |f| (f.gsub('GLX_VERSION_', '').split('_', 2).map!(&:to_i) <=> version) <= 0 }
|
83
|
+
list
|
84
|
+
end
|
85
|
+
|
86
|
+
def extension_list_platform
|
87
|
+
(respond_to?(:glXQueryExtensionsString) ? glXQueryExtensionsString(@display, @screen) : '').split.map!(&:to_sym)
|
88
|
+
end
|
89
|
+
|
90
|
+
def make_current
|
91
|
+
glXMakeCurrent(@display, @window, @context)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -1,242 +1,242 @@
|
|
1
|
-
module Roglew
|
2
|
-
module Gdi32
|
3
|
-
extend FFI::Library
|
4
|
-
ffi_lib 'gdi32'
|
5
|
-
ffi_convention :stdcall
|
6
|
-
|
7
|
-
LOGPIXELSX = 88
|
8
|
-
LOGPIXELSY = 90
|
9
|
-
ENCODING = 'W' #A or W
|
10
|
-
|
11
|
-
FONT_CHARSETS = {
|
12
|
-
:ANSI => 0,
|
13
|
-
:DEFAULT => 1,
|
14
|
-
:SYMBOL => 2,
|
15
|
-
:MAC => 77,
|
16
|
-
:SHIFTJIS => 128,
|
17
|
-
:HANGUL => 129,
|
18
|
-
:JOHAB => 130,
|
19
|
-
:GB2312 => 134,
|
20
|
-
:CHINESEBIG5 => 136,
|
21
|
-
:GREEK => 161,
|
22
|
-
:TURKISH => 162,
|
23
|
-
:VIETNAMESE => 163,
|
24
|
-
:HEBREW => 177,
|
25
|
-
:ARABIC => 178,
|
26
|
-
:BALTIC => 186,
|
27
|
-
:RUSSIAN => 204,
|
28
|
-
:THAI => 222,
|
29
|
-
:EASTEUROPE => 238,
|
30
|
-
:OEM => 255,
|
31
|
-
}
|
32
|
-
|
33
|
-
FONT_CLIP_PRECISION = {
|
34
|
-
:DEFAULT_PRECIS => 0x00,
|
35
|
-
:CHARACTER_PRECIS => 0x01,
|
36
|
-
:STROKE_PRECIS => 0x02,
|
37
|
-
:LH_ANGLES => 0x10,
|
38
|
-
:TT_ALWAYS => 0x20,
|
39
|
-
:DFA_DISABLE => 0x40,
|
40
|
-
:EMBEDDED => 0x80,
|
41
|
-
:MASK => 0x0f,
|
42
|
-
}
|
43
|
-
|
44
|
-
FONT_FAMILY_PITCH = {
|
45
|
-
:DEFAULT_PITCH => 0x00,
|
46
|
-
:FIXED_PITCH => 0x01,
|
47
|
-
:VARIABLE_PITCH => 0x02,
|
48
|
-
:FAMILY_DONTCARE => 0x00,
|
49
|
-
:FAMILY_ROMAN => 0x10,
|
50
|
-
:FAMILY_SWISS => 0x20,
|
51
|
-
:FAMILY_MODERN => 0x30,
|
52
|
-
:FAMILY_SCRIPT => 0x40,
|
53
|
-
:FAMILY_DECORATIVE => 0x50,
|
54
|
-
}
|
55
|
-
|
56
|
-
FONT_OUTPUT_PRECISION = {
|
57
|
-
:DEFAULT => 0,
|
58
|
-
:STRING => 1,
|
59
|
-
:CHARACTER => 2,
|
60
|
-
:STROKE => 3,
|
61
|
-
:TT => 4,
|
62
|
-
:DEVICE => 5,
|
63
|
-
:RASTER => 6,
|
64
|
-
:TT_ONLY => 7,
|
65
|
-
:OUTLINE => 8,
|
66
|
-
:SCREEN_OUTLINE => 9,
|
67
|
-
:PS_ONLY => 10,
|
68
|
-
}
|
69
|
-
|
70
|
-
FONT_QUALITY = {
|
71
|
-
:DEFAULT => 0,
|
72
|
-
:DRAFT => 1,
|
73
|
-
:PROOF => 2,
|
74
|
-
:NONANTIALIASED => 3,
|
75
|
-
:ANTIALIASED => 4,
|
76
|
-
:CLEARTYPE => 5,
|
77
|
-
}
|
78
|
-
|
79
|
-
FONT_WEIGHTS = {
|
80
|
-
:DONTCARE => 0,
|
81
|
-
:THIN => 100,
|
82
|
-
:EXTRALIGHT => 200,
|
83
|
-
:LIGHT => 300,
|
84
|
-
:NORMAL => 400,
|
85
|
-
:MEDIUM => 500,
|
86
|
-
:SEMIBOLD => 600,
|
87
|
-
:BOLD => 700,
|
88
|
-
:EXTRABOLD => 800,
|
89
|
-
:HEAVY => 900,
|
90
|
-
}
|
91
|
-
|
92
|
-
PFDFlags = enum :pfd_flags, [
|
93
|
-
:DOUBLEBUFFER, 0x0001,
|
94
|
-
:STEREO, 0x0002,
|
95
|
-
:DRAW_TO_WINDOW, 0x0004,
|
96
|
-
:DRAW_TO_BITMAP, 0x0008,
|
97
|
-
:SUPPORT_GDI, 0x0010,
|
98
|
-
:SUPPORT_OPENGL, 0x0020,
|
99
|
-
:GENERIC_FORMAT, 0x0040,
|
100
|
-
:NEED_PALETTE, 0x0080,
|
101
|
-
:NEED_SYSTEM_PALETTE, 0x0100,
|
102
|
-
:SWAP_EXCHANGE, 0x0200,
|
103
|
-
:SWAP_COPY, 0x0400,
|
104
|
-
:SWAP_LAYER_BUFFERS, 0x0800,
|
105
|
-
:GENERIC_ACCELERATED, 0x1000,
|
106
|
-
:SUPPORT_DIRECTDRAW, 0x2000,
|
107
|
-
:DIRECT3D_ACCELERATED, 0x4000,
|
108
|
-
:SUPPORT_COMPOSITION, 0x8000,
|
109
|
-
:DEPTH_DONTCARE, 0x20000000,
|
110
|
-
:DOUBLEBUFFER_DONTCARE, 0x40000000,
|
111
|
-
:STEREO_DONTCARE, 0x80000000
|
112
|
-
]
|
113
|
-
|
114
|
-
PFD_TYPE = enum :pfd_type, [:RGBA, :COLORINDEX]
|
115
|
-
|
116
|
-
PFD_LAYER_TYPE = enum :pfd_layer_type, [:MAIN_PLANE, :OVERLAY_PLANE, :UNDERLAY_PLANE, -1]
|
117
|
-
|
118
|
-
class PIXELFORMATDESCRIPTOR < FFI::Struct
|
119
|
-
FLAGS_INV = PFDFlags.to_hash.reduce(Hash.new{ |h,k| h[k] = [] }){ |h,(k,v)| h[v] << k; h }.freeze
|
120
|
-
|
121
|
-
layout :nSize, :uint16,
|
122
|
-
:nVersion, :uint16,
|
123
|
-
:dwFlags, :uint,
|
124
|
-
:iPixelType, :uint8,
|
125
|
-
:cColorBits, :uint8,
|
126
|
-
:cRedBits, :uint8,
|
127
|
-
:cRedShift, :uint8,
|
128
|
-
:cGreenBits, :uint8,
|
129
|
-
:cGreenShift, :uint8,
|
130
|
-
:cBlueBits, :uint8,
|
131
|
-
:cBlueShift, :uint8,
|
132
|
-
:cAlphaBits, :uint8,
|
133
|
-
:cAlphaShift, :uint8,
|
134
|
-
:cAccumBits, :uint8,
|
135
|
-
:cAccumRedBits, :uint8,
|
136
|
-
:cAccumGreenBits, :uint8,
|
137
|
-
:cAccumBlueBits, :uint8,
|
138
|
-
:cAccumAlphaBits, :uint8,
|
139
|
-
:cDepthBits, :uint8,
|
140
|
-
:cStencilBits, :uint8,
|
141
|
-
:cAuxBuffers, :uint8,
|
142
|
-
:iLayerType, :uint8,
|
143
|
-
:bReserved, :uint8,
|
144
|
-
:dwLayerMask, :uint,
|
145
|
-
:dwVisibleMask, :uint,
|
146
|
-
:dwDamageMask, :uint
|
147
|
-
|
148
|
-
undef_method :nSize=
|
149
|
-
|
150
|
-
def initialize
|
151
|
-
super
|
152
|
-
self[:nSize] = self.size
|
153
|
-
end
|
154
|
-
|
155
|
-
def dwFlags
|
156
|
-
val = self[:dwFlags]
|
157
|
-
Set.new(FLAGS_INV.select { |k,_| val & k != 0 }.reduce([]) {|a,(_,v)| a << v}.flatten)
|
158
|
-
end
|
159
|
-
|
160
|
-
def dwFlags=(flags)
|
161
|
-
self[:dwFlags] = [*flags].reduce(0) {|a,f| a | PFDFlags[f].to_i}
|
162
|
-
end
|
163
|
-
|
164
|
-
def to_s
|
165
|
-
[:iPixelType, :cColorBits, :cAccumBits, :cDepthBits, :iLayerType, :dwFlags].map{|n| "#{n} = #{send(n).inspect}"}.join(', ')
|
166
|
-
end
|
167
|
-
end
|
168
|
-
|
169
|
-
#int ChoosePixelFormat(
|
170
|
-
# HDC hdc,
|
171
|
-
# const PIXELFORMATDESCRIPTOR *ppfd)
|
172
|
-
attach_function :ChoosePixelFormat, [:pointer, :pointer], :int
|
173
|
-
|
174
|
-
#HFONT CreateFont(
|
175
|
-
# __in int nHeight,
|
176
|
-
# __in int nWidth,
|
177
|
-
# __in int nEscapement,
|
178
|
-
# __in int nOrientation,
|
179
|
-
# __in int fnWeight,
|
180
|
-
# __in DWORD fdwItalic,
|
181
|
-
# __in DWORD fdwUnderline,
|
182
|
-
# __in DWORD fdwStrikeOut,
|
183
|
-
# __in DWORD fdwCharSet,
|
184
|
-
# __in DWORD fdwOutputPrecision,
|
185
|
-
# __in DWORD fdwClipPrecision,
|
186
|
-
# __in DWORD fdwQuality,
|
187
|
-
# __in DWORD fdwPitchAndFamily,
|
188
|
-
# __in LPCTSTR lpszFace)
|
189
|
-
attach_function :CreateFont, "CreateFont#{ENCODING}", [
|
190
|
-
:int, #nHeight
|
191
|
-
:int, #nWidth
|
192
|
-
:int, #nEscapement
|
193
|
-
:int, #nOrientation
|
194
|
-
:int, #fnWeight (Gdi32::FONT_WEIGHTS or number between 0 and 1000)
|
195
|
-
:uint, #fdwItalic
|
196
|
-
:uint, #fdwUnderline
|
197
|
-
:uint, #fdwStrikeOut
|
198
|
-
:uint, #fdwCharSet (use Gdi32::FONT_CHARSETS)
|
199
|
-
:uint, #fdwOutputPrecision (use Gdi32::FONT_OUTPUT_PRECISION)
|
200
|
-
:uint, #fdwClipPrecision (use Gdi32::FONT_CLIP_PRECISION)
|
201
|
-
:uint, #fdwQuality (use Gdi32::FONT_QUALITY)
|
202
|
-
:uint, #fdwPitchAndFamily (use Gdi32::FONT_FAMILY_PITCH)
|
203
|
-
:string #lpszFace
|
204
|
-
], :pointer
|
205
|
-
|
206
|
-
#BOOL DeleteObject(
|
207
|
-
# __in HGDIOBJ hObject)
|
208
|
-
attach_function :DeleteObject, [:pointer], :bool
|
209
|
-
|
210
|
-
#int DescribePixelFormat(
|
211
|
-
# HDC hdc,
|
212
|
-
# int iPixelFormat,
|
213
|
-
# UINT nBytes,
|
214
|
-
# LPPIXELFORMATDESCRIPTOR ppfd)
|
215
|
-
attach_function :DescribePixelFormat, [:pointer, :int, :uint, :pointer], :int
|
216
|
-
|
217
|
-
#int GetDeviceCaps(
|
218
|
-
# __in HDC hdc,
|
219
|
-
# __in int nIndex)
|
220
|
-
attach_function :GetDeviceCaps, [:pointer, :int], :int
|
221
|
-
|
222
|
-
#int GetPixelFormat(
|
223
|
-
# HDC hdc
|
224
|
-
#);
|
225
|
-
attach_function :GetPixelFormat, [:pointer], :int
|
226
|
-
|
227
|
-
#HGDIOBJ SelectObject(
|
228
|
-
# __in HDC hdc,
|
229
|
-
# __in HGDIOBJ hgdiobj)
|
230
|
-
attach_function :SelectObject, [:pointer, :pointer], :pointer
|
231
|
-
|
232
|
-
#BOOL SetPixelFormat(
|
233
|
-
# HDC hdc,
|
234
|
-
# int iPixelFormat,
|
235
|
-
# const PIXELFORMATDESCRIPTOR *ppfd)
|
236
|
-
attach_function :SetPixelFormat, [:pointer, :int, :pointer], :bool
|
237
|
-
|
238
|
-
#BOOL SwapBuffers(
|
239
|
-
# HDC hdc)
|
240
|
-
attach_function :SwapBuffers, [:pointer], :bool
|
241
|
-
end
|
1
|
+
module Roglew
|
2
|
+
module Gdi32
|
3
|
+
extend FFI::Library
|
4
|
+
ffi_lib 'gdi32'
|
5
|
+
ffi_convention :stdcall
|
6
|
+
|
7
|
+
LOGPIXELSX = 88
|
8
|
+
LOGPIXELSY = 90
|
9
|
+
ENCODING = 'W' #A or W
|
10
|
+
|
11
|
+
FONT_CHARSETS = {
|
12
|
+
:ANSI => 0,
|
13
|
+
:DEFAULT => 1,
|
14
|
+
:SYMBOL => 2,
|
15
|
+
:MAC => 77,
|
16
|
+
:SHIFTJIS => 128,
|
17
|
+
:HANGUL => 129,
|
18
|
+
:JOHAB => 130,
|
19
|
+
:GB2312 => 134,
|
20
|
+
:CHINESEBIG5 => 136,
|
21
|
+
:GREEK => 161,
|
22
|
+
:TURKISH => 162,
|
23
|
+
:VIETNAMESE => 163,
|
24
|
+
:HEBREW => 177,
|
25
|
+
:ARABIC => 178,
|
26
|
+
:BALTIC => 186,
|
27
|
+
:RUSSIAN => 204,
|
28
|
+
:THAI => 222,
|
29
|
+
:EASTEUROPE => 238,
|
30
|
+
:OEM => 255,
|
31
|
+
}
|
32
|
+
|
33
|
+
FONT_CLIP_PRECISION = {
|
34
|
+
:DEFAULT_PRECIS => 0x00,
|
35
|
+
:CHARACTER_PRECIS => 0x01,
|
36
|
+
:STROKE_PRECIS => 0x02,
|
37
|
+
:LH_ANGLES => 0x10,
|
38
|
+
:TT_ALWAYS => 0x20,
|
39
|
+
:DFA_DISABLE => 0x40,
|
40
|
+
:EMBEDDED => 0x80,
|
41
|
+
:MASK => 0x0f,
|
42
|
+
}
|
43
|
+
|
44
|
+
FONT_FAMILY_PITCH = {
|
45
|
+
:DEFAULT_PITCH => 0x00,
|
46
|
+
:FIXED_PITCH => 0x01,
|
47
|
+
:VARIABLE_PITCH => 0x02,
|
48
|
+
:FAMILY_DONTCARE => 0x00,
|
49
|
+
:FAMILY_ROMAN => 0x10,
|
50
|
+
:FAMILY_SWISS => 0x20,
|
51
|
+
:FAMILY_MODERN => 0x30,
|
52
|
+
:FAMILY_SCRIPT => 0x40,
|
53
|
+
:FAMILY_DECORATIVE => 0x50,
|
54
|
+
}
|
55
|
+
|
56
|
+
FONT_OUTPUT_PRECISION = {
|
57
|
+
:DEFAULT => 0,
|
58
|
+
:STRING => 1,
|
59
|
+
:CHARACTER => 2,
|
60
|
+
:STROKE => 3,
|
61
|
+
:TT => 4,
|
62
|
+
:DEVICE => 5,
|
63
|
+
:RASTER => 6,
|
64
|
+
:TT_ONLY => 7,
|
65
|
+
:OUTLINE => 8,
|
66
|
+
:SCREEN_OUTLINE => 9,
|
67
|
+
:PS_ONLY => 10,
|
68
|
+
}
|
69
|
+
|
70
|
+
FONT_QUALITY = {
|
71
|
+
:DEFAULT => 0,
|
72
|
+
:DRAFT => 1,
|
73
|
+
:PROOF => 2,
|
74
|
+
:NONANTIALIASED => 3,
|
75
|
+
:ANTIALIASED => 4,
|
76
|
+
:CLEARTYPE => 5,
|
77
|
+
}
|
78
|
+
|
79
|
+
FONT_WEIGHTS = {
|
80
|
+
:DONTCARE => 0,
|
81
|
+
:THIN => 100,
|
82
|
+
:EXTRALIGHT => 200,
|
83
|
+
:LIGHT => 300,
|
84
|
+
:NORMAL => 400,
|
85
|
+
:MEDIUM => 500,
|
86
|
+
:SEMIBOLD => 600,
|
87
|
+
:BOLD => 700,
|
88
|
+
:EXTRABOLD => 800,
|
89
|
+
:HEAVY => 900,
|
90
|
+
}
|
91
|
+
|
92
|
+
PFDFlags = enum :pfd_flags, [
|
93
|
+
:DOUBLEBUFFER, 0x0001,
|
94
|
+
:STEREO, 0x0002,
|
95
|
+
:DRAW_TO_WINDOW, 0x0004,
|
96
|
+
:DRAW_TO_BITMAP, 0x0008,
|
97
|
+
:SUPPORT_GDI, 0x0010,
|
98
|
+
:SUPPORT_OPENGL, 0x0020,
|
99
|
+
:GENERIC_FORMAT, 0x0040,
|
100
|
+
:NEED_PALETTE, 0x0080,
|
101
|
+
:NEED_SYSTEM_PALETTE, 0x0100,
|
102
|
+
:SWAP_EXCHANGE, 0x0200,
|
103
|
+
:SWAP_COPY, 0x0400,
|
104
|
+
:SWAP_LAYER_BUFFERS, 0x0800,
|
105
|
+
:GENERIC_ACCELERATED, 0x1000,
|
106
|
+
:SUPPORT_DIRECTDRAW, 0x2000,
|
107
|
+
:DIRECT3D_ACCELERATED, 0x4000,
|
108
|
+
:SUPPORT_COMPOSITION, 0x8000,
|
109
|
+
:DEPTH_DONTCARE, 0x20000000,
|
110
|
+
:DOUBLEBUFFER_DONTCARE, 0x40000000,
|
111
|
+
:STEREO_DONTCARE, 0x80000000
|
112
|
+
]
|
113
|
+
|
114
|
+
PFD_TYPE = enum :pfd_type, [:RGBA, :COLORINDEX]
|
115
|
+
|
116
|
+
PFD_LAYER_TYPE = enum :pfd_layer_type, [:MAIN_PLANE, :OVERLAY_PLANE, :UNDERLAY_PLANE, -1]
|
117
|
+
|
118
|
+
class PIXELFORMATDESCRIPTOR < FFI::Struct
|
119
|
+
FLAGS_INV = PFDFlags.to_hash.reduce(Hash.new{ |h,k| h[k] = [] }){ |h,(k,v)| h[v] << k; h }.freeze
|
120
|
+
|
121
|
+
layout :nSize, :uint16,
|
122
|
+
:nVersion, :uint16,
|
123
|
+
:dwFlags, :uint,
|
124
|
+
:iPixelType, :uint8,
|
125
|
+
:cColorBits, :uint8,
|
126
|
+
:cRedBits, :uint8,
|
127
|
+
:cRedShift, :uint8,
|
128
|
+
:cGreenBits, :uint8,
|
129
|
+
:cGreenShift, :uint8,
|
130
|
+
:cBlueBits, :uint8,
|
131
|
+
:cBlueShift, :uint8,
|
132
|
+
:cAlphaBits, :uint8,
|
133
|
+
:cAlphaShift, :uint8,
|
134
|
+
:cAccumBits, :uint8,
|
135
|
+
:cAccumRedBits, :uint8,
|
136
|
+
:cAccumGreenBits, :uint8,
|
137
|
+
:cAccumBlueBits, :uint8,
|
138
|
+
:cAccumAlphaBits, :uint8,
|
139
|
+
:cDepthBits, :uint8,
|
140
|
+
:cStencilBits, :uint8,
|
141
|
+
:cAuxBuffers, :uint8,
|
142
|
+
:iLayerType, :uint8,
|
143
|
+
:bReserved, :uint8,
|
144
|
+
:dwLayerMask, :uint,
|
145
|
+
:dwVisibleMask, :uint,
|
146
|
+
:dwDamageMask, :uint
|
147
|
+
|
148
|
+
#undef_method :nSize=
|
149
|
+
|
150
|
+
def initialize
|
151
|
+
super
|
152
|
+
self[:nSize] = self.size
|
153
|
+
end
|
154
|
+
|
155
|
+
def dwFlags
|
156
|
+
val = self[:dwFlags]
|
157
|
+
Set.new(FLAGS_INV.select { |k,_| val & k != 0 }.reduce([]) {|a,(_,v)| a << v}.flatten)
|
158
|
+
end
|
159
|
+
|
160
|
+
def dwFlags=(flags)
|
161
|
+
self[:dwFlags] = [*flags].reduce(0) {|a,f| a | PFDFlags[f].to_i}
|
162
|
+
end
|
163
|
+
|
164
|
+
def to_s
|
165
|
+
[:iPixelType, :cColorBits, :cAccumBits, :cDepthBits, :iLayerType, :dwFlags].map{|n| "#{n} = #{send(n).inspect}"}.join(', ')
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
#int ChoosePixelFormat(
|
170
|
+
# HDC hdc,
|
171
|
+
# const PIXELFORMATDESCRIPTOR *ppfd)
|
172
|
+
attach_function :ChoosePixelFormat, [:pointer, :pointer], :int
|
173
|
+
|
174
|
+
#HFONT CreateFont(
|
175
|
+
# __in int nHeight,
|
176
|
+
# __in int nWidth,
|
177
|
+
# __in int nEscapement,
|
178
|
+
# __in int nOrientation,
|
179
|
+
# __in int fnWeight,
|
180
|
+
# __in DWORD fdwItalic,
|
181
|
+
# __in DWORD fdwUnderline,
|
182
|
+
# __in DWORD fdwStrikeOut,
|
183
|
+
# __in DWORD fdwCharSet,
|
184
|
+
# __in DWORD fdwOutputPrecision,
|
185
|
+
# __in DWORD fdwClipPrecision,
|
186
|
+
# __in DWORD fdwQuality,
|
187
|
+
# __in DWORD fdwPitchAndFamily,
|
188
|
+
# __in LPCTSTR lpszFace)
|
189
|
+
attach_function :CreateFont, "CreateFont#{ENCODING}", [
|
190
|
+
:int, #nHeight
|
191
|
+
:int, #nWidth
|
192
|
+
:int, #nEscapement
|
193
|
+
:int, #nOrientation
|
194
|
+
:int, #fnWeight (Gdi32::FONT_WEIGHTS or number between 0 and 1000)
|
195
|
+
:uint, #fdwItalic
|
196
|
+
:uint, #fdwUnderline
|
197
|
+
:uint, #fdwStrikeOut
|
198
|
+
:uint, #fdwCharSet (use Gdi32::FONT_CHARSETS)
|
199
|
+
:uint, #fdwOutputPrecision (use Gdi32::FONT_OUTPUT_PRECISION)
|
200
|
+
:uint, #fdwClipPrecision (use Gdi32::FONT_CLIP_PRECISION)
|
201
|
+
:uint, #fdwQuality (use Gdi32::FONT_QUALITY)
|
202
|
+
:uint, #fdwPitchAndFamily (use Gdi32::FONT_FAMILY_PITCH)
|
203
|
+
:string #lpszFace
|
204
|
+
], :pointer
|
205
|
+
|
206
|
+
#BOOL DeleteObject(
|
207
|
+
# __in HGDIOBJ hObject)
|
208
|
+
attach_function :DeleteObject, [:pointer], :bool
|
209
|
+
|
210
|
+
#int DescribePixelFormat(
|
211
|
+
# HDC hdc,
|
212
|
+
# int iPixelFormat,
|
213
|
+
# UINT nBytes,
|
214
|
+
# LPPIXELFORMATDESCRIPTOR ppfd)
|
215
|
+
attach_function :DescribePixelFormat, [:pointer, :int, :uint, :pointer], :int
|
216
|
+
|
217
|
+
#int GetDeviceCaps(
|
218
|
+
# __in HDC hdc,
|
219
|
+
# __in int nIndex)
|
220
|
+
attach_function :GetDeviceCaps, [:pointer, :int], :int
|
221
|
+
|
222
|
+
#int GetPixelFormat(
|
223
|
+
# HDC hdc
|
224
|
+
#);
|
225
|
+
attach_function :GetPixelFormat, [:pointer], :int
|
226
|
+
|
227
|
+
#HGDIOBJ SelectObject(
|
228
|
+
# __in HDC hdc,
|
229
|
+
# __in HGDIOBJ hgdiobj)
|
230
|
+
attach_function :SelectObject, [:pointer, :pointer], :pointer
|
231
|
+
|
232
|
+
#BOOL SetPixelFormat(
|
233
|
+
# HDC hdc,
|
234
|
+
# int iPixelFormat,
|
235
|
+
# const PIXELFORMATDESCRIPTOR *ppfd)
|
236
|
+
attach_function :SetPixelFormat, [:pointer, :int, :pointer], :bool
|
237
|
+
|
238
|
+
#BOOL SwapBuffers(
|
239
|
+
# HDC hdc)
|
240
|
+
attach_function :SwapBuffers, [:pointer], :bool
|
241
|
+
end
|
242
242
|
end
|