From 0771c102667d857facb78446ff170b5202b7c155 Mon Sep 17 00:00:00 2001 From: Koray Date: Sun, 16 Sep 2018 12:46:17 +0300 Subject: [PATCH] add precompiled libs --- .gitmodules | 9 - .../ClanLib/Include/ClanLib/App/clanapp.h | 100 + .../ClanLib/Core/Crypto/aes128_decrypt.h | 102 + .../ClanLib/Core/Crypto/aes128_encrypt.h | 100 + .../ClanLib/Core/Crypto/aes192_decrypt.h | 102 + .../ClanLib/Core/Crypto/aes192_encrypt.h | 100 + .../ClanLib/Core/Crypto/aes256_decrypt.h | 102 + .../ClanLib/Core/Crypto/aes256_encrypt.h | 100 + .../ClanLib/Core/Crypto/hash_functions.h | 365 +++ .../ClanLib/Include/ClanLib/Core/Crypto/md5.h | 87 + .../Include/ClanLib/Core/Crypto/random.h | 77 + .../ClanLib/Include/ClanLib/Core/Crypto/rsa.h | 123 + .../Include/ClanLib/Core/Crypto/secret.h | 72 + .../Include/ClanLib/Core/Crypto/sha1.h | 85 + .../Include/ClanLib/Core/Crypto/sha224.h | 85 + .../Include/ClanLib/Core/Crypto/sha256.h | 86 + .../Include/ClanLib/Core/Crypto/sha384.h | 85 + .../Include/ClanLib/Core/Crypto/sha512.h | 85 + .../Include/ClanLib/Core/Crypto/sha512_224.h | 85 + .../Include/ClanLib/Core/Crypto/sha512_256.h | 86 + .../Include/ClanLib/Core/Crypto/tls_client.h | 78 + .../Core/ErrorReporting/crash_reporter.h | 69 + .../Core/ErrorReporting/exception_dialog.h | 50 + .../Include/ClanLib/Core/IOData/cl_endian.h | 60 + .../Include/ClanLib/Core/IOData/directory.h | 128 + .../ClanLib/Core/IOData/directory_listing.h | 80 + .../Core/IOData/directory_listing_entry.h | 68 + .../ClanLib/Core/IOData/directory_scanner.h | 120 + .../Include/ClanLib/Core/IOData/file.h | 157 ++ .../Include/ClanLib/Core/IOData/file_help.h | 60 + .../Include/ClanLib/Core/IOData/file_system.h | 135 + .../Core/IOData/file_system_provider.h | 79 + .../Include/ClanLib/Core/IOData/html_url.h | 57 + .../Include/ClanLib/Core/IOData/iodevice.h | 298 +++ .../ClanLib/Core/IOData/iodevice_provider.h | 69 + .../ClanLib/Core/IOData/memory_device.h | 62 + .../Include/ClanLib/Core/IOData/path_help.h | 284 ++ .../Include/ClanLib/Core/JSON/json_value.h | 152 ++ .../ClanLib/Include/ClanLib/Core/Math/aabb.h | 55 + .../ClanLib/Include/ClanLib/Core/Math/angle.h | 157 ++ .../ClanLib/Core/Math/base64_decoder.h | 79 + .../ClanLib/Core/Math/base64_encoder.h | 83 + .../Include/ClanLib/Core/Math/bezier_curve.h | 72 + .../Include/ClanLib/Core/Math/big_int.h | 258 ++ .../Include/ClanLib/Core/Math/circle.h | 95 + .../Include/ClanLib/Core/Math/cl_math.h | 201 ++ .../ClanLib/Core/Math/delauney_triangulator.h | 99 + .../ClanLib/Core/Math/ear_clip_result.h | 63 + .../ClanLib/Core/Math/ear_clip_triangulator.h | 103 + .../Include/ClanLib/Core/Math/easing.h | 45 + .../ClanLib/Core/Math/frustum_planes.h | 52 + .../Include/ClanLib/Core/Math/half_float.h | 120 + .../ClanLib/Core/Math/half_float_vector.h | 151 ++ .../ClanLib/Core/Math/intersection_test.h | 70 + .../ClanLib/Include/ClanLib/Core/Math/line.h | 181 ++ .../Include/ClanLib/Core/Math/line_math.h | 100 + .../Include/ClanLib/Core/Math/line_ray.h | 173 ++ .../Include/ClanLib/Core/Math/line_segment.h | 240 ++ .../ClanLib/Include/ClanLib/Core/Math/mat2.h | 238 ++ .../ClanLib/Include/ClanLib/Core/Math/mat3.h | 376 +++ .../ClanLib/Include/ClanLib/Core/Math/mat4.h | 529 ++++ .../ClanLib/Include/ClanLib/Core/Math/obb.h | 49 + .../Include/ClanLib/Core/Math/origin.h | 52 + .../ClanLib/Core/Math/outline_triangulator.h | 68 + .../ClanLib/Include/ClanLib/Core/Math/point.h | 91 + .../Include/ClanLib/Core/Math/pointset_math.h | 88 + .../ClanLib/Include/ClanLib/Core/Math/quad.h | 236 ++ .../Include/ClanLib/Core/Math/quaternion.h | 202 ++ .../ClanLib/Include/ClanLib/Core/Math/rect.h | 548 ++++ .../Include/ClanLib/Core/Math/rect_packer.h | 102 + .../ClanLib/Include/ClanLib/Core/Math/size.h | 209 ++ .../Include/ClanLib/Core/Math/triangle_math.h | 98 + .../ClanLib/Include/ClanLib/Core/Math/vec2.h | 429 +++ .../ClanLib/Include/ClanLib/Core/Math/vec3.h | 419 +++ .../ClanLib/Include/ClanLib/Core/Math/vec4.h | 395 +++ .../Core/Resources/file_resource_document.h | 67 + .../Core/Resources/file_resource_manager.h | 62 + .../Include/ClanLib/Core/Resources/resource.h | 126 + .../Core/Resources/resource_container.h | 70 + .../ClanLib/Core/Resources/resource_manager.h | 70 + .../ClanLib/Core/Resources/resource_object.h | 82 + .../ClanLib/Core/Signals/bind_member.h | 43 + .../Include/ClanLib/Core/Signals/signal.h | 160 ++ .../ClanLib/Core/System/block_allocator.h | 91 + .../Include/ClanLib/Core/System/cl_platform.h | 52 + .../Include/ClanLib/Core/System/comptr.h | 83 + .../ClanLib/Core/System/console_window.h | 73 + .../Include/ClanLib/Core/System/databuffer.h | 90 + .../Include/ClanLib/Core/System/datetime.h | 174 ++ .../ClanLib/Core/System/disposable_object.h | 49 + .../Include/ClanLib/Core/System/exception.h | 72 + .../Include/ClanLib/Core/System/game_time.h | 97 + .../ClanLib/Core/System/registry_key.h | 101 + .../Include/ClanLib/Core/System/service.h | 75 + .../Include/ClanLib/Core/System/system.h | 98 + .../Core/System/thread_local_storage.h | 77 + .../Include/ClanLib/Core/System/userdata.h | 106 + .../Include/ClanLib/Core/System/work_queue.h | 87 + .../Include/ClanLib/Core/Text/console.h | 328 +++ .../ClanLib/Core/Text/console_logger.h | 51 + .../Include/ClanLib/Core/Text/file_logger.h | 56 + .../Include/ClanLib/Core/Text/logger.h | 115 + .../Include/ClanLib/Core/Text/string_format.h | 212 ++ .../Include/ClanLib/Core/Text/string_help.h | 595 +++++ .../Include/ClanLib/Core/Text/utf8_reader.h | 78 + .../Include/ClanLib/Core/Zip/zip_archive.h | 121 + .../Include/ClanLib/Core/Zip/zip_file_entry.h | 93 + .../Include/ClanLib/Core/Zip/zip_reader.h | 82 + .../Include/ClanLib/Core/Zip/zip_writer.h | 70 + .../ClanLib/Core/Zip/zlib_compression.h | 65 + .../Include/ClanLib/Core/core_iostream.h | 84 + .../ClanLib/Include/ClanLib/D3D/d3d_target.h | 120 + .../Include/ClanLib/Display/2D/brush.h | 131 + .../Include/ClanLib/Display/2D/canvas.h | 458 ++++ .../Include/ClanLib/Display/2D/color.h | 1900 +++++++++++++ .../Include/ClanLib/Display/2D/color_hsl.h | 74 + .../Include/ClanLib/Display/2D/color_hsv.h | 73 + .../Include/ClanLib/Display/2D/gradient.h | 98 + .../Include/ClanLib/Display/2D/image.h | 262 ++ .../ClanLib/Include/ClanLib/Display/2D/path.h | 116 + .../ClanLib/Include/ClanLib/Display/2D/pen.h | 45 + .../Include/ClanLib/Display/2D/span_layout.h | 224 ++ .../Include/ClanLib/Display/2D/sprite.h | 429 +++ .../Include/ClanLib/Display/2D/subtexture.h | 75 + .../ClanLib/Display/2D/texture_group.h | 114 + .../Include/ClanLib/Display/Font/font.h | 205 ++ .../ClanLib/Display/Font/font_description.h | 195 ++ .../ClanLib/Display/Font/font_family.h | 99 + .../ClanLib/Display/Font/font_metrics.h | 88 + .../ClanLib/Display/Font/glyph_metrics.h | 58 + .../ClanLib/Display/Image/buffer_usage.h | 61 + .../Include/ClanLib/Display/Image/icon_set.h | 63 + .../Display/Image/image_import_description.h | 104 + .../ClanLib/Display/Image/perlin_noise.h | 159 ++ .../ClanLib/Display/Image/pixel_buffer.h | 307 +++ .../ClanLib/Display/Image/pixel_buffer_help.h | 47 + .../ClanLib/Display/Image/pixel_buffer_lock.h | 185 ++ .../ClanLib/Display/Image/pixel_buffer_set.h | 96 + .../ClanLib/Display/Image/pixel_converter.h | 104 + .../ClanLib/Display/Image/texture_format.h | 141 + .../Display/ImageProviders/dds_provider.h | 55 + .../Display/ImageProviders/jpeg_provider.h | 86 + .../ImageProviders/png_output_description.h | 151 ++ .../Display/ImageProviders/png_provider.h | 80 + .../Display/ImageProviders/provider_factory.h | 102 + .../Display/ImageProviders/provider_type.h | 73 + .../ImageProviders/provider_type_register.h | 83 + .../Display/ImageProviders/targa_provider.h | 77 + .../ClanLib/Display/Render/blend_state.h | 66 + .../Display/Render/blend_state_description.h | 83 + .../Display/Render/depth_stencil_state.h | 66 + .../Render/depth_stencil_state_description.h | 101 + .../Display/Render/element_array_buffer.h | 99 + .../Display/Render/element_array_vector.h | 109 + .../ClanLib/Display/Render/frame_buffer.h | 203 ++ .../ClanLib/Display/Render/graphic_context.h | 694 +++++ .../ClanLib/Display/Render/occlusion_query.h | 84 + .../ClanLib/Display/Render/primitives_array.h | 460 ++++ .../ClanLib/Display/Render/program_object.h | 381 +++ .../ClanLib/Display/Render/rasterizer_state.h | 66 + .../Render/rasterizer_state_description.h | 118 + .../ClanLib/Display/Render/render_batcher.h | 65 + .../ClanLib/Display/Render/render_buffer.h | 83 + .../ClanLib/Display/Render/shader_object.h | 207 ++ .../ClanLib/Display/Render/shared_gc_data.h | 95 + .../ClanLib/Display/Render/storage_buffer.h | 98 + .../ClanLib/Display/Render/storage_vector.h | 109 + .../Include/ClanLib/Display/Render/texture.h | 256 ++ .../ClanLib/Display/Render/texture_1d.h | 93 + .../ClanLib/Display/Render/texture_1d_array.h | 96 + .../ClanLib/Display/Render/texture_2d.h | 204 ++ .../ClanLib/Display/Render/texture_2d_array.h | 167 ++ .../ClanLib/Display/Render/texture_3d.h | 123 + .../ClanLib/Display/Render/texture_cube.h | 123 + .../Display/Render/texture_cube_array.h | 120 + .../ClanLib/Display/Render/transfer_buffer.h | 99 + .../ClanLib/Display/Render/transfer_texture.h | 87 + .../ClanLib/Display/Render/transfer_vector.h | 102 + .../ClanLib/Display/Render/uniform_buffer.h | 105 + .../ClanLib/Display/Render/uniform_vector.h | 109 + .../Display/Render/vertex_array_buffer.h | 97 + .../Display/Render/vertex_array_vector.h | 112 + .../ClanLib/Display/Resources/display_cache.h | 62 + .../Display/ShaderEffect/shader_effect.h | 67 + .../ShaderEffect/shader_effect_description.h | 298 +++ .../ClanLib/Display/System/detect_hang.h | 53 + .../Include/ClanLib/Display/System/run_loop.h | 97 + .../Include/ClanLib/Display/System/timer.h | 63 + .../Display/TargetProviders/cursor_provider.h | 44 + .../TargetProviders/display_target_provider.h | 52 + .../TargetProviders/display_window_provider.h | 291 ++ .../element_array_buffer_provider.h | 67 + .../TargetProviders/frame_buffer_provider.h | 133 + .../graphic_context_provider.h | 340 +++ .../TargetProviders/input_device_provider.h | 107 + .../occlusion_query_provider.h | 61 + .../TargetProviders/pixel_buffer_provider.h | 81 + .../primitives_array_provider.h | 64 + .../TargetProviders/program_object_provider.h | 124 + .../TargetProviders/render_buffer_provider.h | 52 + .../TargetProviders/shader_object_provider.h | 78 + .../TargetProviders/storage_buffer_provider.h | 67 + .../TargetProviders/texture_provider.h | 132 + .../transfer_buffer_provider.h | 70 + .../TargetProviders/uniform_buffer_provider.h | 67 + .../vertex_array_buffer_provider.h | 67 + .../Include/ClanLib/Display/Window/cursor.h | 74 + .../Display/Window/cursor_description.h | 182 ++ .../ClanLib/Display/Window/display_window.h | 389 +++ .../Window/display_window_description.h | 298 +++ .../ClanLib/Display/Window/input_code.h | 481 ++++ .../ClanLib/Display/Window/input_device.h | 162 ++ .../ClanLib/Display/Window/input_event.h | 102 + .../Include/ClanLib/Display/Window/keys.h | 174 ++ .../Include/ClanLib/Display/display_target.h | 54 + .../Include/ClanLib/Display/screen_info.h | 57 + .../ClanLib/Include/ClanLib/GL/opengl.h | 148 ++ .../ClanLib/GL/opengl_context_description.h | 130 + .../Include/ClanLib/GL/opengl_defines.h | 1955 ++++++++++++++ .../Include/ClanLib/GL/opengl_target.h | 96 + .../ClanLib/Include/ClanLib/GL/opengl_wrap.h | 2345 +++++++++++++++++ .../Include/ClanLib/Network/NetGame/client.h | 91 + .../ClanLib/Network/NetGame/connection.h | 93 + .../ClanLib/Network/NetGame/connection_site.h | 49 + .../Include/ClanLib/Network/NetGame/event.h | 70 + .../Network/NetGame/event_dispatcher.h | 67 + .../ClanLib/Network/NetGame/event_value.h | 254 ++ .../Include/ClanLib/Network/NetGame/server.h | 92 + .../Socket/network_condition_variable.h | 54 + .../ClanLib/Network/Socket/socket_name.h | 119 + .../ClanLib/Network/Socket/tcp_connection.h | 61 + .../ClanLib/Network/Socket/tcp_listen.h | 43 + .../ClanLib/Network/Socket/udp_socket.h | 41 + .../Sound/AudioWorld/audio_definition.h | 65 + .../ClanLib/Sound/AudioWorld/audio_object.h | 80 + .../ClanLib/Sound/AudioWorld/audio_world.h | 62 + .../ClanLib/Sound/Resources/sound_cache.h | 55 + .../ClanLib/Sound/SoundFilters/echofilter.h | 56 + .../ClanLib/Sound/SoundFilters/fadefilter.h | 65 + .../Sound/SoundFilters/inverse_echofilter.h | 56 + .../SoundProviders/soundfilter_provider.h | 52 + .../Sound/SoundProviders/soundprovider.h | 65 + .../SoundProviders/soundprovider_factory.h | 75 + .../Sound/SoundProviders/soundprovider_raw.h | 77 + .../SoundProviders/soundprovider_session.h | 103 + .../Sound/SoundProviders/soundprovider_type.h | 63 + .../soundprovider_type_register.h | 68 + .../SoundProviders/soundprovider_vorbis.h | 82 + .../Sound/SoundProviders/soundprovider_wave.h | 82 + .../ClanLib/Include/ClanLib/Sound/sound.h | 63 + .../ClanLib/Include/ClanLib/Sound/sound_sse.h | 90 + .../Include/ClanLib/Sound/soundbuffer.h | 162 ++ .../ClanLib/Sound/soundbuffer_session.h | 177 ++ .../Include/ClanLib/Sound/soundfilter.h | 88 + .../Include/ClanLib/Sound/soundformat.h | 44 + .../Include/ClanLib/Sound/soundoutput.h | 115 + .../ClanLib/Sound/soundoutput_description.h | 65 + .../ClanLib/UI/Controller/window_controller.h | 80 + .../ClanLib/UI/Controller/window_manager.h | 90 + .../UI/Events/activation_change_event.h | 54 + .../Include/ClanLib/UI/Events/close_event.h | 40 + .../ClanLib/Include/ClanLib/UI/Events/event.h | 95 + .../ClanLib/UI/Events/focus_change_event.h | 53 + .../Include/ClanLib/UI/Events/key_event.h | 93 + .../Include/ClanLib/UI/Events/pointer_event.h | 109 + .../Include/ClanLib/UI/Events/resize_event.h | 40 + .../Include/ClanLib/UI/Image/image_source.h | 50 + .../ClanLib/UI/StandardViews/button_view.h | 66 + .../ClanLib/UI/StandardViews/checkbox_view.h | 78 + .../ClanLib/UI/StandardViews/image_view.h | 79 + .../ClanLib/UI/StandardViews/label_view.h | 97 + .../ClanLib/UI/StandardViews/layout_views.h | 62 + .../ClanLib/UI/StandardViews/listbox_view.h | 72 + .../ClanLib/UI/StandardViews/progress_view.h | 52 + .../UI/StandardViews/radiobutton_view.h | 87 + .../ClanLib/UI/StandardViews/scroll_view.h | 85 + .../ClanLib/UI/StandardViews/scrollbar_view.h | 85 + .../ClanLib/UI/StandardViews/slider_view.h | 78 + .../UI/StandardViews/span_layout_view.h | 67 + .../ClanLib/UI/StandardViews/spin_view.h | 98 + .../UI/StandardViews/text_field_view.h | 114 + .../ClanLib/UI/StandardViews/text_view.h | 88 + .../ClanLib/Include/ClanLib/UI/Style/style.h | 85 + .../Include/ClanLib/UI/Style/style_cascade.h | 119 + .../ClanLib/UI/Style/style_dimension.h | 62 + .../ClanLib/UI/Style/style_get_value.h | 187 ++ .../ClanLib/UI/Style/style_property_parser.h | 128 + .../ClanLib/UI/Style/style_set_image.h | 72 + .../ClanLib/UI/Style/style_set_value.h | 128 + .../Include/ClanLib/UI/Style/style_token.h | 80 + .../ClanLib/UI/Style/style_tokenizer.h | 59 + .../ClanLib/UI/Style/style_value_type.h | 49 + .../UI/SystemDialogs/folder_browse_dialog.h | 62 + .../UI/SystemDialogs/open_file_dialog.h | 84 + .../UI/SystemDialogs/save_file_dialog.h | 75 + .../ClanLib/UI/TopLevel/texture_window.h | 95 + .../ClanLib/UI/TopLevel/top_level_window.h | 77 + .../Include/ClanLib/UI/TopLevel/view_tree.h | 113 + .../Include/ClanLib/UI/UIThread/ui_thread.h | 56 + .../Include/ClanLib/UI/View/focus_policy.h | 39 + .../ClanLib/Include/ClanLib/UI/View/view.h | 366 +++ .../Include/ClanLib/UI/View/view_action.h | 120 + .../Include/ClanLib/UI/View/view_geometry.h | 115 + .../ClanLib/XML/Resources/resource_factory.h | 48 + .../XML/Resources/xml_resource_document.h | 176 ++ .../XML/Resources/xml_resource_manager.h | 60 + .../ClanLib/XML/Resources/xml_resource_node.h | 99 + .../ClanLib/Include/ClanLib/XML/dom_attr.h | 114 + .../Include/ClanLib/XML/dom_cdata_section.h | 75 + .../Include/ClanLib/XML/dom_character_data.h | 97 + .../ClanLib/Include/ClanLib/XML/dom_comment.h | 65 + .../Include/ClanLib/XML/dom_document.h | 207 ++ .../ClanLib/XML/dom_document_fragment.h | 90 + .../Include/ClanLib/XML/dom_document_type.h | 97 + .../ClanLib/Include/ClanLib/XML/dom_element.h | 262 ++ .../ClanLib/Include/ClanLib/XML/dom_entity.h | 72 + .../ClanLib/XML/dom_entity_reference.h | 72 + .../Include/ClanLib/XML/dom_exception.h | 75 + .../Include/ClanLib/XML/dom_implementation.h | 89 + .../Include/ClanLib/XML/dom_named_node_map.h | 113 + .../ClanLib/Include/ClanLib/XML/dom_node.h | 403 +++ .../Include/ClanLib/XML/dom_node_list.h | 86 + .../Include/ClanLib/XML/dom_notation.h | 71 + .../ClanLib/XML/dom_processing_instruction.h | 80 + .../ClanLib/Include/ClanLib/XML/dom_string.h | 40 + .../ClanLib/Include/ClanLib/XML/dom_text.h | 90 + .../ClanLib/Include/ClanLib/XML/xml_token.h | 89 + .../Include/ClanLib/XML/xml_tokenizer.h | 80 + .../ClanLib/Include/ClanLib/XML/xml_writer.h | 75 + .../Include/ClanLib/XML/xpath_evaluator.h | 62 + .../Include/ClanLib/XML/xpath_exception.h | 52 + .../Include/ClanLib/XML/xpath_object.h | 119 + .../ClanLib/Include/ClanLib/application.h | 68 + .../ClanLib/Include/ClanLib/core.h | 189 ++ .../ClanLib/Include/ClanLib/d3d.h | 73 + .../ClanLib/Include/ClanLib/display.h | 170 ++ .../CompiledLibs/ClanLib/Include/ClanLib/gl.h | 73 + .../ClanLib/Include/ClanLib/network.h | 83 + .../ClanLib/Include/ClanLib/sound.h | 95 + .../CompiledLibs/ClanLib/Include/ClanLib/ui.h | 114 + .../ClanLib/Include/ClanLib/xml.h | 96 + Extern/ReflectiveDLLRefresher | 1 - Extern/libmysql.lib | Bin 28714 -> 0 bytes Extern/lz4 | 1 - Extern/mysqlclient.lib | Bin 5944226 -> 0 bytes Extern/rewolf-wow64ext | 1 - 346 files changed, 46562 insertions(+), 12 deletions(-) create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/App/clanapp.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes128_decrypt.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes128_encrypt.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes192_decrypt.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes192_encrypt.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes256_decrypt.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes256_encrypt.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/hash_functions.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/md5.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/random.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/rsa.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/secret.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha1.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha224.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha256.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha384.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha512.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha512_224.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha512_256.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/tls_client.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/ErrorReporting/crash_reporter.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/ErrorReporting/exception_dialog.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/cl_endian.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory_listing.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory_listing_entry.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory_scanner.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file_help.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file_system.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file_system_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/html_url.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/iodevice.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/iodevice_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/memory_device.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/path_help.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/JSON/json_value.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/aabb.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/angle.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/base64_decoder.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/base64_encoder.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/bezier_curve.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/big_int.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/circle.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/cl_math.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/delauney_triangulator.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/ear_clip_result.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/ear_clip_triangulator.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/easing.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/frustum_planes.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/half_float.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/half_float_vector.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/intersection_test.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line_math.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line_ray.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line_segment.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/mat2.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/mat3.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/mat4.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/obb.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/origin.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/outline_triangulator.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/point.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/pointset_math.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/quad.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/quaternion.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/rect.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/rect_packer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/size.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/triangle_math.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/vec2.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/vec3.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/vec4.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/file_resource_document.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/file_resource_manager.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource_container.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource_manager.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource_object.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Signals/bind_member.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Signals/signal.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/block_allocator.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/cl_platform.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/comptr.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/console_window.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/databuffer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/datetime.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/disposable_object.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/exception.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/game_time.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/registry_key.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/service.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/system.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/thread_local_storage.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/userdata.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/work_queue.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/console.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/console_logger.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/file_logger.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/logger.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/string_format.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/string_help.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/utf8_reader.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_archive.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_file_entry.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_reader.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_writer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zlib_compression.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/core_iostream.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/D3D/d3d_target.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/brush.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/canvas.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/color.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/color_hsl.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/color_hsv.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/gradient.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/image.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/path.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/pen.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/span_layout.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/sprite.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/subtexture.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/texture_group.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font_description.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font_family.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font_metrics.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/glyph_metrics.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/buffer_usage.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/icon_set.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/image_import_description.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/perlin_noise.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer_help.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer_lock.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer_set.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_converter.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/texture_format.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/dds_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/jpeg_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/png_output_description.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/png_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/provider_factory.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/provider_type.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/provider_type_register.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/targa_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/blend_state.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/blend_state_description.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/depth_stencil_state.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/depth_stencil_state_description.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/element_array_buffer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/element_array_vector.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/frame_buffer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/graphic_context.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/occlusion_query.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/primitives_array.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/program_object.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/rasterizer_state.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/rasterizer_state_description.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/render_batcher.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/render_buffer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/shader_object.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/shared_gc_data.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/storage_buffer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/storage_vector.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_1d.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_1d_array.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_2d.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_2d_array.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_3d.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_cube.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_cube_array.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/transfer_buffer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/transfer_texture.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/transfer_vector.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/uniform_buffer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/uniform_vector.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/vertex_array_buffer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/vertex_array_vector.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Resources/display_cache.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ShaderEffect/shader_effect.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ShaderEffect/shader_effect_description.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/System/detect_hang.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/System/run_loop.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/System/timer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/cursor_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/display_target_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/display_window_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/element_array_buffer_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/frame_buffer_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/graphic_context_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/input_device_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/occlusion_query_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/pixel_buffer_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/primitives_array_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/program_object_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/render_buffer_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/shader_object_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/storage_buffer_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/texture_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/transfer_buffer_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/uniform_buffer_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/vertex_array_buffer_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/cursor.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/cursor_description.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/display_window.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/display_window_description.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/input_code.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/input_device.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/input_event.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/keys.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/display_target.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/screen_info.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_context_description.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_defines.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_target.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_wrap.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/client.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/connection.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/connection_site.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/event.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/event_dispatcher.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/event_value.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/server.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/network_condition_variable.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/socket_name.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/tcp_connection.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/tcp_listen.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/udp_socket.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/AudioWorld/audio_definition.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/AudioWorld/audio_object.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/AudioWorld/audio_world.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/Resources/sound_cache.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundFilters/echofilter.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundFilters/fadefilter.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundFilters/inverse_echofilter.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundfilter_provider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_factory.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_raw.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_session.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_type.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_type_register.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_vorbis.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_wave.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/sound.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/sound_sse.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundbuffer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundbuffer_session.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundfilter.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundformat.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundoutput.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundoutput_description.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Controller/window_controller.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Controller/window_manager.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/activation_change_event.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/close_event.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/event.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/focus_change_event.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/key_event.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/pointer_event.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/resize_event.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Image/image_source.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/button_view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/checkbox_view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/image_view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/label_view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/layout_views.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/listbox_view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/progress_view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/radiobutton_view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/scroll_view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/scrollbar_view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/slider_view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/span_layout_view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/spin_view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/text_field_view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/text_view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Style/style.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Style/style_cascade.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Style/style_dimension.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Style/style_get_value.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Style/style_property_parser.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Style/style_set_image.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Style/style_set_value.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Style/style_token.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Style/style_tokenizer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Style/style_value_type.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/SystemDialogs/folder_browse_dialog.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/SystemDialogs/open_file_dialog.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/SystemDialogs/save_file_dialog.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/TopLevel/texture_window.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/TopLevel/top_level_window.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/TopLevel/view_tree.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/UIThread/ui_thread.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/View/focus_policy.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/View/view.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/View/view_action.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/View/view_geometry.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/Resources/resource_factory.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/Resources/xml_resource_document.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/Resources/xml_resource_manager.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/Resources/xml_resource_node.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_attr.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_cdata_section.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_character_data.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_comment.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_document.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_document_fragment.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_document_type.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_element.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_entity.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_entity_reference.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_exception.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_implementation.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_named_node_map.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_node.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_node_list.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_notation.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_processing_instruction.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_string.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/dom_text.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/xml_token.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/xml_tokenizer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/xml_writer.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/xpath_evaluator.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/xpath_exception.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/XML/xpath_object.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/application.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/core.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/d3d.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/display.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/gl.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/network.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/sound.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/ui.h create mode 100644 Extern/CompiledLibs/ClanLib/Include/ClanLib/xml.h delete mode 160000 Extern/ReflectiveDLLRefresher delete mode 100644 Extern/libmysql.lib delete mode 160000 Extern/lz4 delete mode 100644 Extern/mysqlclient.lib delete mode 160000 Extern/rewolf-wow64ext diff --git a/.gitmodules b/.gitmodules index 7fc834a..285b81a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,18 +16,9 @@ [submodule "Extern/tinyxml2"] path = Extern/tinyxml2 url = https://github.com/leethomason/tinyxml2 -[submodule "Extern/lz4"] - path = Extern/lz4 - url = https://github.com/lz4/lz4 [submodule "Extern/xxHash"] path = Extern/xxHash url = https://github.com/Cyan4973/xxHash -[submodule "Extern/rewolf-wow64ext"] - path = Extern/rewolf-wow64ext - url = https://github.com/mq1n/rewolf-wow64ext -[submodule "Extern/ReflectiveDLLRefresher"] - path = Extern/ReflectiveDLLRefresher - url = https://github.com/CylanceVulnResearch/ReflectiveDLLRefresher [submodule "Extern/spdlog"] path = Extern/spdlog url = https://github.com/gabime/spdlog diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/App/clanapp.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/App/clanapp.h new file mode 100644 index 0000000..2c7f5e3 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/App/clanapp.h @@ -0,0 +1,100 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include +#include + +namespace clan +{ + /// \addtogroup clanApp_System clanApp System + /// \{ + + /// \brief Base class for the application object + /// + /// All applications using the clanApp module need to inherit from this class. See ApplicationInstance for more information. + class Application + { + public: + virtual ~Application() { } + + /// \brief Main loop update handler + /// + /// Once the target environment has been initialized this function is called continously to update and render the application. + /// If the function returns false the main loop will end and the application will exit. + virtual bool update() { return true; } + + /// \brief Set update handler to wait a certain amount of milliseconds between each update + static void use_timeout_timing(int timeout_ms); + + /// \brief Returns the command line arguments passed to the application + static const std::vector &main_args(); + }; + + class ApplicationInstancePrivate + { + public: + ApplicationInstancePrivate(bool catch_exceptions = true); + virtual std::unique_ptr create() = 0; + }; + + /// \brief Helper class to create cross platform applications + /// + /// To use this class, inherit from Application and make a single global instance of ApplicationInstance. + /// + /// \code + /// class MyApplication : public clan::Application + /// { + /// public: + /// bool update() override; + /// }; + /// + /// ApplicationInstance clanapp; + /// \endcode + /// If you do not want exceptions to be automatically caught, pass "false" to the optional catch_exceptions parameter in Application\n + /// Your program does not have to use this class. For more advanced usage use a normal main function for the target platform and interface with the RunLoop class in clanDisplay\n + template + class ApplicationInstance : ApplicationInstancePrivate + { + public: + /// \brief Constructor + ApplicationInstance(bool catch_exceptions = true) : ApplicationInstancePrivate(catch_exceptions) + { + } + + private: + std::unique_ptr create() override + { + return std::unique_ptr(new ApplicationClass()); + } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes128_decrypt.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes128_decrypt.h new file mode 100644 index 0000000..0db0d29 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes128_decrypt.h @@ -0,0 +1,102 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class AES128_Decrypt_Impl; + + /// \brief AES-128 decryption class (running in Cipher Block Chaining mode) + class AES128_Decrypt + { + public: + /// \brief Constructs a AES-128 generator (running in Cipher Block Chaining mode) + AES128_Decrypt(); + + /// \brief Get decrypted data + /// + /// This is the databuffer used internally to store the decrypted data. + /// You may call "set_size()" to clear the buffer, inbetween calls to "add()" + /// You may call "set_capacity()" to optimise storage requirements before the add() call + DataBuffer get_data() const; + + static const int iv_size = 16; + static const int key_size = 16; + + /// \brief Resets the decryption + void reset(); + + /// \brief Sets the initialisation vector + /// + /// This should be a random number\n + /// This must be called before the initial add() + void set_iv(const unsigned char iv[iv_size]); + + /// \brief Sets the cipher key + /// + /// This must be called before the initial add() + void set_key(const unsigned char key[key_size]); + + /// \brief Enable AES Padding + /// + /// Example (use_pkcs7==true) : ... 0x03 0x03 0x03 (3 octets of padding) + /// Example (use_pkcs7==false) : ... 0x02 0x02 0x02 (3 octets of padding, the last octet is the length) + /// + /// \param value = true = Enable padding (default) + /// \param use_pkcs7 = true = This uses the PKCS#7/RFC3369 method (Enabled by default). false = use the TLS method (rfc2246) + void set_padding(bool value = true, bool use_pkcs7 = true); + + /// \brief Adds data to be decrypted + void add(const void *data, int size); + + /// \brief Add data to be decrypted + /// + /// \param data = Data Buffer + void add(const DataBuffer &data); + + /// \brief Finalize decryption + /// + /// IMPORTANT, to avoid timing attacks, if this function fails, you should still validate the data (via a hash or otherwise), then throw an error + /// + /// \return false = AES Padding value is invalid. + bool calculate(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes128_encrypt.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes128_encrypt.h new file mode 100644 index 0000000..9710a4e --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes128_encrypt.h @@ -0,0 +1,100 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class AES128_Encrypt_Impl; + + /// \brief AES-128 encryption class (running in Cipher Block Chaining mode) + class AES128_Encrypt + { + public: + /// \brief Constructs a AES-128 generator (running in Cipher Block Chaining mode) + AES128_Encrypt(); + + /// \brief Get encrypted data + /// + /// This is the databuffer used internally to store the encrypted data. + /// You may call "set_size()" to clear the buffer, inbetween calls to "add()" + /// You may call "set_capacity()" to optimise storage requirements before the add() call + DataBuffer get_data() const; + + static const int iv_size = 16; + static const int key_size = 16; + static const int block_size = 16; + + /// \brief Resets the encryption + void reset(); + + /// \brief Sets the initialisation vector + /// + /// This should be a random number\n + /// This must be called before the initial add() + void set_iv(const unsigned char iv[iv_size]); + + /// \brief Sets the cipher key + /// + /// This must be called before the initial add() + void set_key(const unsigned char key[key_size]); + + /// \brief Enable AES Padding + /// + /// Example (use_pkcs7==true) : ... 0x03 0x03 0x03 (3 octets of padding) + /// Example (use_pkcs7==false) : ... 0x02 0x02 0x02 (3 octets of padding, the last octet is the length) + /// + /// \param value = true = Enable padding (default) + /// \param use_pkcs7 = true = This uses the PKCS#7/RFC3369 method (Enabled by default). false = use the TLS method (rfc2246) + /// \param num_additional_padded_blocks = (Only valid when use_pkcs7==false). Set to "frustrate attacks on a protocol based on analysis of the lengths of exchanged messages". (Range 0 to 15) + void set_padding(bool value = true, bool use_pkcs7 = true, unsigned int num_additional_padded_blocks = 0); + + /// \brief Adds data to be encrypted + void add(const void *data, int size); + + /// \brief Add data to be encrypted + /// + /// \param data = Data Buffer + void add(const DataBuffer &data); + + /// \brief Finalize encryption + void calculate(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes192_decrypt.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes192_decrypt.h new file mode 100644 index 0000000..447d32c --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes192_decrypt.h @@ -0,0 +1,102 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class AES192_Decrypt_Impl; + + /// \brief AES-192 decryption class (running in Cipher Block Chaining mode) + class AES192_Decrypt + { + public: + /// \brief Constructs a AES-192 generator (running in Cipher Block Chaining mode) + AES192_Decrypt(); + + /// \brief Get decrypted data + /// + /// This is the databuffer used internally to store the decrypted data. + /// You may call "set_size()" to clear the buffer, inbetween calls to "add()" + /// You may call "set_capacity()" to optimise storage requirements before the add() call + DataBuffer get_data() const; + + static const int iv_size = 16; + static const int key_size = 24; + + /// \brief Resets the decryption + void reset(); + + /// \brief Sets the initialisation vector + /// + /// This should be a random number\n + /// This must be called before the initial add() + void set_iv(const unsigned char iv[iv_size]); + + /// \brief Sets the cipher key + /// + /// This must be called before the initial add() + void set_key(const unsigned char key[key_size]); + + /// \brief Enable AES Padding + /// + /// Example (use_pkcs7==true) : ... 0x03 0x03 0x03 (3 octets of padding) + /// Example (use_pkcs7==false) : ... 0x02 0x02 0x02 (3 octets of padding, the last octet is the length) + /// + /// \param value = true = Enable padding (default) + /// \param use_pkcs7 = true = This uses the PKCS#7/RFC3369 method (Enabled by default). false = use the TLS method (rfc2246) + void set_padding(bool value = true, bool use_pkcs7 = true); + + /// \brief Adds data to be decrypted + void add(const void *data, int size); + + /// \brief Add data to be decrypted + /// + /// \param data = Data Buffer + void add(const DataBuffer &data); + + /// \brief Finalize decryption + /// + /// IMPORTANT, to avoid timing attacks, if this function fails, you should still validate the data (via a hash or otherwise), then throw an error + /// + /// \return false = AES Padding value is invalid. + bool calculate(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes192_encrypt.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes192_encrypt.h new file mode 100644 index 0000000..1953770 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes192_encrypt.h @@ -0,0 +1,100 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class AES192_Encrypt_Impl; + + /// \brief AES-192 encryption class (running in Cipher Block Chaining mode) + class AES192_Encrypt + { + public: + /// \brief Constructs a AES-192 generator (running in Cipher Block Chaining mode) + AES192_Encrypt(); + + /// \brief Get encrypted data + /// + /// This is the databuffer used internally to store the encrypted data. + /// You may call "set_size()" to clear the buffer, inbetween calls to "add()" + /// You may call "set_capacity()" to optimise storage requirements before the add() call + DataBuffer get_data() const; + + static const int iv_size = 16; + static const int key_size = 24; + static const int block_size = 16; + + /// \brief Resets the encryption + void reset(); + + /// \brief Sets the initialisation vector + /// + /// This should be a random number\n + /// This must be called before the initial add() + void set_iv(const unsigned char iv[iv_size]); + + /// \brief Sets the cipher key + /// + /// This must be called before the initial add() + void set_key(const unsigned char key[key_size]); + + /// \brief Enable AES Padding + /// + /// Example (use_pkcs7==true) : ... 0x03 0x03 0x03 (3 octets of padding) + /// Example (use_pkcs7==false) : ... 0x02 0x02 0x02 (3 octets of padding, the last octet is the length) + /// + /// \param value = true = Enable padding (default) + /// \param use_pkcs7 = true = This uses the PKCS#7/RFC3369 method (Enabled by default). false = use the TLS method (rfc2246) + /// \param num_additional_padded_blocks = (Only valid when use_pkcs7==false). Set to "frustrate attacks on a protocol based on analysis of the lengths of exchanged messages". (Range 0 to 15) + void set_padding(bool value = true, bool use_pkcs7 = true, unsigned int num_additional_padded_blocks = 0); + + /// \brief Adds data to be encrypted + void add(const void *data, int size); + + /// \brief Add data to be encrypted + /// + /// \param data = Data Buffer + void add(const DataBuffer &data); + + /// \brief Finalize encryption + void calculate(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes256_decrypt.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes256_decrypt.h new file mode 100644 index 0000000..624c4be --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes256_decrypt.h @@ -0,0 +1,102 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class AES256_Decrypt_Impl; + + /// \brief AES-256 decryption class (running in Cipher Block Chaining mode) + class AES256_Decrypt + { + public: + /// \brief Constructs a AES-256 generator (running in Cipher Block Chaining mode) + AES256_Decrypt(); + + /// \brief Get decrypted data + /// + /// This is the databuffer used internally to store the decrypted data. + /// You may call "set_size()" to clear the buffer, inbetween calls to "add()" + /// You may call "set_capacity()" to optimise storage requirements before the add() call + DataBuffer get_data() const; + + static const int iv_size = 16; + static const int key_size = 32; + + /// \brief Resets the decryption + void reset(); + + /// \brief Sets the initialisation vector + /// + /// This should be a random number\n + /// This must be called before the initial add() + void set_iv(const unsigned char iv[iv_size]); + + /// \brief Sets the cipher key + /// + /// This must be called before the initial add() + void set_key(const unsigned char key[key_size]); + + /// \brief Enable AES Padding + /// + /// Example (use_pkcs7==true) : ... 0x03 0x03 0x03 (3 octets of padding) + /// Example (use_pkcs7==false) : ... 0x02 0x02 0x02 (3 octets of padding, the last octet is the length) + /// + /// \param value = true = Enable padding (default) + /// \param use_pkcs7 = true = This uses the PKCS#7/RFC3369 method (Enabled by default). false = use the TLS method (rfc2246) + void set_padding(bool value = true, bool use_pkcs7 = true); + + /// \brief Adds data to be decrypted + void add(const void *data, int size); + + /// \brief Add data to be decrypted + /// + /// \param data = Data Buffer + void add(const DataBuffer &data); + + /// \brief Finalize decryption + /// + /// IMPORTANT, to avoid timing attacks, if this function fails, you should still validate the data (via a hash or otherwise), then throw an error + /// + /// \return false = AES Padding value is invalid. + bool calculate(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes256_encrypt.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes256_encrypt.h new file mode 100644 index 0000000..ebb1d85 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/aes256_encrypt.h @@ -0,0 +1,100 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class AES256_Encrypt_Impl; + + /// \brief AES-256 encryption class (running in Cipher Block Chaining mode) + class AES256_Encrypt + { + public: + /// \brief Constructs a AES-256 generator (running in Cipher Block Chaining mode) + AES256_Encrypt(); + + /// \brief Get encrypted data + /// + /// This is the databuffer used internally to store the encrypted data. + /// You may call "set_size()" to clear the buffer, inbetween calls to "add()" + /// You may call "set_capacity()" to optimise storage requirements before the add() call + DataBuffer get_data() const; + + static const int iv_size = 16; + static const int key_size = 32; + static const int block_size = 16; + + /// \brief Resets the encryption + void reset(); + + /// \brief Sets the initialisation vector + /// + /// This should be a random number\n + /// This must be called before the initial add() + void set_iv(const unsigned char iv[iv_size]); + + /// \brief Sets the cipher key + /// + /// This must be called before the initial add() + void set_key(const unsigned char key[key_size]); + + /// \brief Enable AES Padding + /// + /// Example (use_pkcs7==true) : ... 0x03 0x03 0x03 (3 octets of padding) + /// Example (use_pkcs7==false) : ... 0x02 0x02 0x02 (3 octets of padding, the last octet is the length) + /// + /// \param value = true = Enable padding (default) + /// \param use_pkcs7 = true = This uses the PKCS#7/RFC3369 method (Enabled by default). false = use the TLS method (rfc2246) + /// \param num_additional_padded_blocks = (Only valid when use_pkcs7==false). Set to "frustrate attacks on a protocol based on analysis of the lengths of exchanged messages". (Range 0 to 15) + void set_padding(bool value = true, bool use_pkcs7 = true, unsigned int num_additional_padded_blocks = 0); + + /// \brief Adds data to be encrypted + void add(const void *data, int size); + + /// \brief Add data to be encrypted + /// + /// \param data = Data Buffer + void add(const DataBuffer &data); + + /// \brief Finalize encryption + void calculate(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/hash_functions.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/hash_functions.h new file mode 100644 index 0000000..dc2c1dd --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/hash_functions.h @@ -0,0 +1,365 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + + +#pragma once + +#include "../System/cl_platform.h" +#include "../Crypto/sha1.h" +#include "../Crypto/md5.h" +#include "../Crypto/sha224.h" +#include "../Crypto/sha256.h" +#include "../Crypto/sha384.h" +#include "../Crypto/sha512.h" +#include "../Crypto/sha512_224.h" +#include "../Crypto/sha512_256.h" + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + /// \brief A Collection of checksum functions. + class HashFunctions + { + public: + /// \brief Calculate a CRC32 checksum on the data. + static uint32_t crc32(const void *data, int size, uint32_t running_crc = 0); + + /// \brief Calculate a CRC32 checksum on the data. + static uint32_t adler32(const void *data, int size, uint32_t running_adler32 = 0); + + /// \brief Generate SHA-1 hash from data. + static std::string sha1(const void *data, int size, bool uppercase = false); + + /// \brief SHA1 + /// + /// \param data = String Ref8 + /// \param uppercase = bool + /// + /// \return String8 + static std::string sha1(const std::string &data, bool uppercase = false); + + /// \brief SHA1 + /// + /// \param data = Data Buffer + /// \param uppercase = bool + /// + /// \return String8 + static std::string sha1(const DataBuffer &data, bool uppercase = false); + + /// \brief SHA1 + /// + /// \param data = void + /// \param size = value + /// \param out_hash = char + static void sha1(const void *data, int size, unsigned char out_hash[20]); + + /// \brief SHA1 + /// + /// \param data = String Ref8 + /// \param out_hash = char + static void sha1(const std::string &data, unsigned char out_hash[20]); + + /// \brief SHA1 + /// + /// \param data = Data Buffer + /// \param out_hash = char + static void sha1(const DataBuffer &data, unsigned char out_hash[20]); + + /// \brief Generate SHA-1 hash from data. + static std::string md5(const void *data, int size, bool uppercase = false); + + /// \brief MD5 + /// + /// \param data = String Ref8 + /// \param uppercase = bool + /// + /// \return String8 + static std::string md5(const std::string &data, bool uppercase = false); + + /// \brief MD5 + /// + /// \param data = Data Buffer + /// \param uppercase = bool + /// + /// \return String8 + static std::string md5(const DataBuffer &data, bool uppercase = false); + + /// \brief MD5 + /// + /// \param data = void + /// \param size = value + /// \param out_hash = char + static void md5(const void *data, int size, unsigned char out_hash[16]); + + /// \brief MD5 + /// + /// \param data = String Ref8 + /// \param out_hash = char + static void md5(const std::string &data, unsigned char out_hash[16]); + + /// \brief MD5 + /// + /// \param data = Data Buffer + /// \param out_hash = char + static void md5(const DataBuffer &data, unsigned char out_hash[16]); + + /// \brief Generate SHA-224 hash from data. + static std::string sha224(const void *data, int size, bool uppercase = false); + + /// \brief SHA224 + /// + /// \param data = String Ref8 + /// \param uppercase = bool + /// + /// \return String8 + static std::string sha224(const std::string &data, bool uppercase = false); + + /// \brief SHA224 + /// + /// \param data = Data Buffer + /// \param uppercase = bool + /// + /// \return String8 + static std::string sha224(const DataBuffer &data, bool uppercase = false); + + /// \brief SHA224 + /// + /// \param data = void + /// \param size = value + /// \param out_hash = char + static void sha224(const void *data, int size, unsigned char out_hash[28]); + + /// \brief SHA224 + /// + /// \param data = String Ref8 + /// \param out_hash = char + static void sha224(const std::string &data, unsigned char out_hash[28]); + + /// \brief SHA224 + /// + /// \param data = Data Buffer + /// \param out_hash = char + static void sha224(const DataBuffer &data, unsigned char out_hash[28]); + + + /// \brief Generate SHA-256 hash from data. + static std::string sha256(const void *data, int size, bool uppercase = false); + + /// \brief SHA256 + /// + /// \param data = String Ref8 + /// \param uppercase = bool + /// + /// \return String8 + static std::string sha256(const std::string &data, bool uppercase = false); + + /// \brief SHA256 + /// + /// \param data = Data Buffer + /// \param uppercase = bool + /// + /// \return String8 + static std::string sha256(const DataBuffer &data, bool uppercase = false); + + /// \brief SHA256 + /// + /// \param data = void + /// \param size = value + /// \param out_hash = char + static void sha256(const void *data, int size, unsigned char out_hash[32]); + + /// \brief SHA256 + /// + /// \param data = String Ref8 + /// \param out_hash = char + static void sha256(const std::string &data, unsigned char out_hash[32]); + + /// \brief SHA256 + /// + /// \param data = Data Buffer + /// \param out_hash = char + static void sha256(const DataBuffer &data, unsigned char out_hash[32]); + + /// \brief Generate SHA-384 hash from data. + static std::string sha384(const void *data, int size, bool uppercase = false); + + /// \brief SHA384 + /// + /// \param data = String Ref8 + /// \param uppercase = bool + /// + /// \return String8 + static std::string sha384(const std::string &data, bool uppercase = false); + + /// \brief SHA384 + /// + /// \param data = Data Buffer + /// \param uppercase = bool + /// + /// \return String8 + static std::string sha384(const DataBuffer &data, bool uppercase = false); + + /// \brief SHA384 + /// + /// \param data = void + /// \param size = value + /// \param out_hash = char + static void sha384(const void *data, int size, unsigned char out_hash[48]); + + /// \brief SHA384 + /// + /// \param data = String Ref8 + /// \param out_hash = char + static void sha384(const std::string &data, unsigned char out_hash[48]); + + /// \brief SHA384 + /// + /// \param data = Data Buffer + /// \param out_hash = char + static void sha384(const DataBuffer &data, unsigned char out_hash[48]); + + /// \brief Generate SHA-512 hash from data. + static std::string sha512(const void *data, int size, bool uppercase = false); + + /// \brief SHA512 + /// + /// \param data = String Ref8 + /// \param uppercase = bool + /// + /// \return String8 + static std::string sha512(const std::string &data, bool uppercase = false); + + /// \brief SHA512 + /// + /// \param data = Data Buffer + /// \param uppercase = bool + /// + /// \return String8 + static std::string sha512(const DataBuffer &data, bool uppercase = false); + + /// \brief SHA512 + /// + /// \param data = void + /// \param size = value + /// \param out_hash = char + static void sha512(const void *data, int size, unsigned char out_hash[64]); + + /// \brief SHA512 + /// + /// \param data = String Ref8 + /// \param out_hash = char + static void sha512(const std::string &data, unsigned char out_hash[64]); + + /// \brief SHA512 + /// + /// \param data = Data Buffer + /// \param out_hash = char + static void sha512(const DataBuffer &data, unsigned char out_hash[64]); + + /// \brief Generate SHA-512_224 hash from data. + static std::string sha512_224(const void *data, int size, bool uppercase = false); + + /// \brief SHA512_224 + /// + /// \param data = String Ref8 + /// \param uppercase = bool + /// + /// \return String8 + static std::string sha512_224(const std::string &data, bool uppercase = false); + + /// \brief SHA512_224 + /// + /// \param data = Data Buffer + /// \param uppercase = bool + /// + /// \return String8 + static std::string sha512_224(const DataBuffer &data, bool uppercase = false); + + /// \brief SHA512_224 + /// + /// \param data = void + /// \param size = value + /// \param out_hash = char + static void sha512_224(const void *data, int size, unsigned char out_hash[28]); + + /// \brief SHA512_224 + /// + /// \param data = String Ref8 + /// \param out_hash = char + static void sha512_224(const std::string &data, unsigned char out_hash[28]); + + /// \brief SHA512_224 + /// + /// \param data = Data Buffer + /// \param out_hash = char + static void sha512_224(const DataBuffer &data, unsigned char out_hash[28]); + + + /// \brief Generate SHA-512_256 hash from data. + static std::string sha512_256(const void *data, int size, bool uppercase = false); + + /// \brief SHA512_256 + /// + /// \param data = String Ref8 + /// \param uppercase = bool + /// + /// \return String8 + static std::string sha512_256(const std::string &data, bool uppercase = false); + + /// \brief SHA512_256 + /// + /// \param data = Data Buffer + /// \param uppercase = bool + /// + /// \return String8 + static std::string sha512_256(const DataBuffer &data, bool uppercase = false); + + /// \brief SHA512_256 + /// + /// \param data = void + /// \param size = value + /// \param out_hash = char + static void sha512_256(const void *data, int size, unsigned char out_hash[32]); + + /// \brief SHA512_256 + /// + /// \param data = String Ref8 + /// \param out_hash = char + static void sha512_256(const std::string &data, unsigned char out_hash[32]); + + /// \brief SHA512_256 + /// + /// \param data = Data Buffer + /// \param out_hash = char + static void sha512_256(const DataBuffer &data, unsigned char out_hash[32]); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/md5.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/md5.h new file mode 100644 index 0000000..5ef3116 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/md5.h @@ -0,0 +1,87 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class MD5_Impl; + + /// \brief MD5 hash function class. + class MD5 + { + public: + /// \brief Constructs a MD5 hash generator. + MD5(); + + static const int hash_size = 16; + + /// \brief Returns the calculated hash. + std::string get_hash(bool uppercase = false) const; + + /// \brief Get hash + /// + /// \param out_hash = where to write to + void get_hash(unsigned char out_hash[hash_size]) const; + + /// \brief Resets the hash generator. + void reset(); + + /// \brief Enable a HMAC based calculation + /// + /// Call this function before the initial add(). It is reset by reset() + /// + /// \param key_data = The HMAC key + /// \param key_size = The size of the key_data + void set_hmac(const void *key_data, int key_size); + + /// \brief Adds data to be hashed. + void add(const void *data, int size); + + /// \brief Add + /// + /// \param data = Data Buffer + void add(const DataBuffer &data); + + /// \brief Finalize hash calculation. + void calculate(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/random.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/random.h new file mode 100644 index 0000000..1a8d8c6 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/random.h @@ -0,0 +1,77 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class Random_Impl; + class Random; + + /// \brief Random class + /// + /// Uses the operating system cryptographically secure pseudorandom number generator + class Random + { + public: + /// \brief Constructs the object + /// + /// cache_size = Random number cache size + Random(int cache_size = 1024); + + /// \brief Get the random bytes + /// + /// out_dest_ptr = Where to write to + /// num_bytes = Number of bytes to copy + void get_random_bytes(unsigned char *out_dest_ptr, int num_bytes); + + /// \brief Get the random bytes excluding bytes containing 0 + /// + /// out_dest_ptr = Where to write to + /// num_bytes = Number of bytes to copy + void get_random_bytes_nzero(unsigned char *out_dest_ptr, int num_bytes); + + /// \brief Get the random boolean + /// + /// out_dest_ptr = Where to write to + /// num_bytes = Number of bytes to copy + bool get_random_bool(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/rsa.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/rsa.h new file mode 100644 index 0000000..19ea0ce --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/rsa.h @@ -0,0 +1,123 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +** Michael J. Fromberger +*/ + +// This class is based on the original MPI library (not NSS, because of license restrictions) with some modifications. +// Some ideas and algorithms are from NSS (Netscape Security Suite). Where they have been used, the function contains a reference note +// +// Note, since September 2011, I believe the MPI homepage is now: http://spinning-yarns.org/michael/mpi/ +// The license is as follows +// This software was written by Michael J. Fromberger, +// http://www.dartmouth.edu/~sting/ +// +// See the MPI home page at +// http://www.dartmouth.edu/~sting/mpi/ +// +// This software is in the public domain. It is entirely free, and you +// may use it and/or redistribute it for whatever purpose you choose; +// however, as free software, it is provided without warranty of any +// kind, not even the implied warranty of merchantability or fitness for +// a particular purpose. + +#pragma once + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class Random; + class Secret; + class DataBuffer; + + /// \brief RSA class + /// + /// Important: This class has NOT been tested thoroughly by a cryptography expert. + class RSA + { + public: + /// \brief Create a keypair + /// + /// \param random = Random number generator + /// \param out_private_exponent = Private exponent (to decrypt with) + /// \param out_public_exponent = Public exponent (to encrypt with) + /// \param out_modulus = Modulus + /// \param key_size_in_bits = key size in bits + /// \param public_exponent_value = public exponent value + static void create_keypair(Random &random, Secret &out_private_exponent, DataBuffer &out_public_exponent, DataBuffer &out_modulus, int key_size_in_bits = 1024, int public_exponent_value = 65537); + + /// \brief Encrypt + /// + /// \param block_type = 0 (private key), 1 (private key) or 2 (public key) + /// \param random = Random number generator + /// \param in_public_exponent = Public exponent + /// \param in_modulus = Modulus + /// \param in_data = Data to encrypt (maximum length is in_modulus.get_size() - 11) + /// \return Encrypted data + static DataBuffer encrypt(int block_type, Random &random, const DataBuffer &in_public_exponent, const DataBuffer &in_modulus, const Secret &in_data); + + /// \brief Encrypt + /// + /// \param block_type = 0 (private key), 1 (private key) or 2 (public key) + /// \param random = Random number generator + /// \param in_public_exponent = Public exponent + /// \param in_public_exponent_size = size in bytes of in_public_exponent + /// \param in_modulus = Modulus + /// \param in_modulus_size = size in bytes of in_modulus + /// \param in_data = Data to encrypt + /// \param in_data_size = size in bytes of in_data (maximum size is in_modulus_size - 11) + /// \return Encrypted data + static DataBuffer encrypt(int block_type, Random &random, const void *in_public_exponent, unsigned int in_public_exponent_size, const void *in_modulus, unsigned int in_modulus_size, const void *in_data, unsigned int in_data_size); + + /// \brief Decrypt + /// + /// Warning: An exception may be thrown when decrypting if in_data is not valid. + /// Be careful handling this, to prevent "timing attacks" + /// + /// \param in_private_exponent = Private exponent + /// \param in_modulus = Modulus + /// \param in_data = Data to decrypt (length equals in_modulus.get_size()) + /// \return Decrypted data + static Secret decrypt(const Secret &in_private_exponent, const DataBuffer &in_modulus, const DataBuffer &in_data); + + /// \brief Decrypt + /// + /// Warning: An exception may be thrown when decrypting if in_data is not valid. + /// Be careful handling this, to prevent "timing attacks" + /// + /// \param in_private_exponent = Private exponent + /// \param in_modulus = Modulus + /// \param in_modulus_size = size in bytes of in_modulus + /// \param in_data = Data to encrypt + /// \param in_data_size = size in bytes of in_data (length equals in_modulus_size) + /// \return Decrypted data + static Secret decrypt(const Secret &in_private_exponent, const void *in_modulus, unsigned int in_modulus_size, const void *in_data, unsigned int in_data_size); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/secret.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/secret.h new file mode 100644 index 0000000..fbc640d --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/secret.h @@ -0,0 +1,72 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class Secret_Impl; + + /// \brief Key class + /// + /// This class zero's the key from memory when the class is destroyed + class Secret + { + public: + /// \brief Constructs a key (unset) + Secret(); + + /// \brief Constructs a key to a specified length + /// + /// The data is not initialised + /// + /// \param new_key_length = Length of the key + Secret(unsigned int new_key_length); + + /// \brief Get the key size + /// + /// \return The key size + unsigned int get_size() const; + + /// \brief Get the key data + /// + /// \return The key + unsigned char *get_data() const; + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha1.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha1.h new file mode 100644 index 0000000..20f6c0b --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha1.h @@ -0,0 +1,85 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class SHA1_Impl; + + /// \brief SHA-1 hash function class. + class SHA1 + { + public: + /// \brief Constructs a SHA-1 hash generator. + SHA1(); + + static const int hash_size = 20; + + /// \brief Returns the calculated hash. + std::string get_hash(bool uppercase = false) const; + + /// \brief Get hash + /// + /// \param out_hash = where to write to + void get_hash(unsigned char out_hash[hash_size]) const; + + /// \brief Resets the hash generator. + void reset(); + + /// \brief Enable a HMAC based calculation + /// + /// Call this function before the initial add(). It is reset by reset() + /// + /// \param key_data = The HMAC key + /// \param key_size = The size of the key_data + void set_hmac(const void *key_data, int key_size); + + /// \brief Adds data to be hashed. + void add(const void *data, int size); + + /// \brief Add + /// + /// \param data = Data Buffer + void add(const DataBuffer &data); + + /// \brief Finalize hash calculation. + void calculate(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha224.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha224.h new file mode 100644 index 0000000..cb10ef7 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha224.h @@ -0,0 +1,85 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class SHA256_Impl; + + /// \brief SHA-224 hash function class. + class SHA224 + { + public: + /// \brief Constructs a SHA-224 hash generator. + SHA224(); + + static const int hash_size = 28; + + /// \brief Returns the calculated hash. + std::string get_hash(bool uppercase = false) const; + + /// \brief Get hash + /// + /// \param out_hash = where to write to + void get_hash(unsigned char out_hash[hash_size]) const; + + /// \brief Resets the hash generator. + void reset(); + + /// \brief Enable a HMAC based calculation + /// + /// Call this function before the initial add(). It is reset by reset() + /// + /// \param key_data = The HMAC key + /// \param key_size = The size of the key_data + void set_hmac(const void *key_data, int key_size); + + /// \brief Adds data to be hashed. + void add(const void *data, int size); + + /// \brief Add + /// + /// \param data = Data Buffer + void add(const DataBuffer &data); + + /// \brief Finalize hash calculation. + void calculate(); + + private: + std::shared_ptr impl; // Uses SHA256 implementation + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha256.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha256.h new file mode 100644 index 0000000..aded14c --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha256.h @@ -0,0 +1,86 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class SHA256_Impl; + + /// \brief SHA-256 hash function class. + class SHA256 + { + public: + /// \brief Constructs a SHA-256 hash generator. + SHA256(); + + static const int hash_size = 32; + + /// \brief Returns the calculated hash. + std::string get_hash(bool uppercase = false) const; + + /// \brief Get hash + /// + /// \param out_hash = where to write to + void get_hash(unsigned char out_hash[hash_size]) const; + + /// \brief Resets the hash generator. + void reset(); + + /// \brief Enable a HMAC based calculation + /// + /// Call this function before the initial add(). It is reset by reset() + /// + /// \param key_data = The HMAC key + /// \param key_size = The size of the key_data + void set_hmac(const void *key_data, int key_size); + + /// \brief Adds data to be hashed. + void add(const void *data, int size); + + /// \brief Add + /// + /// \param data = Data Buffer + void add(const DataBuffer &data); + + /// \brief Finalize hash calculation. + void calculate(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha384.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha384.h new file mode 100644 index 0000000..1d6b0a3 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha384.h @@ -0,0 +1,85 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class SHA512_Impl; + + /// \brief SHA-384 hash function class. + class SHA384 + { + public: + /// \brief Constructs a SHA-384 hash generator. + SHA384(); + + static const int hash_size = 48; + + /// \brief Returns the calculated hash. + std::string get_hash(bool uppercase = false) const; + + /// \brief Get hash + /// + /// \param out_hash = where to write to + void get_hash(unsigned char out_hash[hash_size]) const; + + /// \brief Resets the hash generator. + void reset(); + + /// \brief Enable a HMAC based calculation + /// + /// Call this function before the initial add(). It is reset by reset() + /// + /// \param key_data = The HMAC key + /// \param key_size = The size of the key_data + void set_hmac(const void *key_data, int key_size); + + /// \brief Adds data to be hashed. + void add(const void *data, int size); + + /// \brief Add + /// + /// \param data = Data Buffer + void add(const DataBuffer &data); + + /// \brief Finalize hash calculation. + void calculate(); + + private: + std::shared_ptr impl; // Uses SHA512 implementation + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha512.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha512.h new file mode 100644 index 0000000..0d689ff --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha512.h @@ -0,0 +1,85 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class SHA512_Impl; + + /// \brief SHA-512 hash function class. + class SHA512 + { + public: + /// \brief Constructs a SHA-512 hash generator. + SHA512(); + + static const int hash_size = 64; + + /// \brief Returns the calculated hash. + std::string get_hash(bool uppercase = false) const; + + /// \brief Get hash + /// + /// \param out_hash = where to write to + void get_hash(unsigned char out_hash[hash_size]) const; + + /// \brief Resets the hash generator. + void reset(); + + /// \brief Enable a HMAC based calculation + /// + /// Call this function before the initial add(). It is reset by reset() + /// + /// \param key_data = The HMAC key + /// \param key_size = The size of the key_data + void set_hmac(const void *key_data, int key_size); + + /// \brief Adds data to be hashed. + void add(const void *data, int size); + + /// \brief Add + /// + /// \param data = Data Buffer + void add(const DataBuffer &data); + + /// \brief Finalize hash calculation. + void calculate(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha512_224.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha512_224.h new file mode 100644 index 0000000..f6e9881 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha512_224.h @@ -0,0 +1,85 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class SHA512_Impl; + + /// \brief SHA-512_224 hash function class. + class SHA512_224 + { + public: + /// \brief Constructs a SHA-512_224 hash generator. + SHA512_224(); + + static const int hash_size = 28; + + /// \brief Returns the calculated hash. + std::string get_hash(bool uppercase = false) const; + + /// \brief Get hash + /// + /// \param out_hash = where to write to + void get_hash(unsigned char out_hash[hash_size]) const; + + /// \brief Resets the hash generator. + void reset(); + + /// \brief Enable a HMAC based calculation + /// + /// Call this function before the initial add(). It is reset by reset() + /// + /// \param key_data = The HMAC key + /// \param key_size = The size of the key_data + void set_hmac(const void *key_data, int key_size); + + /// \brief Adds data to be hashed. + void add(const void *data, int size); + + /// \brief Add + /// + /// \param data = Data Buffer + void add(const DataBuffer &data); + + /// \brief Finalize hash calculation. + void calculate(); + + private: + std::shared_ptr impl; // Uses SHA512 implementation + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha512_256.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha512_256.h new file mode 100644 index 0000000..8dc67f2 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/sha512_256.h @@ -0,0 +1,86 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class SHA512_Impl; + + /// \brief SHA-512_256 hash function class. + class SHA512_256 + { + public: + /// \brief Constructs a SHA-512_256 hash generator. + SHA512_256(); + + static const int hash_size = 32; + + /// \brief Returns the calculated hash. + std::string get_hash(bool uppercase = false) const; + + /// \brief Get hash + /// + /// \param out_hash = where to write to + void get_hash(unsigned char out_hash[hash_size]) const; + + /// \brief Resets the hash generator. + void reset(); + + /// \brief Enable a HMAC based calculation + /// + /// Call this function before the initial add(). It is reset by reset() + /// + /// \param key_data = The HMAC key + /// \param key_size = The size of the key_data + void set_hmac(const void *key_data, int key_size); + + /// \brief Adds data to be hashed. + void add(const void *data, int size); + + /// \brief Add + /// + /// \param data = Data Buffer + void add(const DataBuffer &data); + + /// \brief Finalize hash calculation. + void calculate(); + + private: + std::shared_ptr impl; // Uses SHA512 implementation + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/tls_client.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/tls_client.h new file mode 100644 index 0000000..123845f --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Crypto/tls_client.h @@ -0,0 +1,78 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Crypto clanCore Crypto + /// \{ + + class DataBuffer; + class TLSClient_Impl; + + /// \brief Transport Layer Security (TLS) client class + class TLSClient + { + public: + /// \brief Constructs a TLS client + TLSClient(); + + /// \brief Return a pointer to decrypted data available for consumption. + const void *get_decrypted_data() const; + + /// \brief Returns how much decrypted data is available. + int get_decrypted_data_available() const; + + /// \brief Return a pointer to encrypted data available for consumption. + const void *get_encrypted_data() const; + + /// \brief Returns how much encrypted data is available. + int get_encrypted_data_available() const; + + /// \brief Adds data to be encrypted. + int encrypt(const void *data, int size); + + /// \brief Adds data to be decrypted. + int decrypt(const void *data, int size); + + /// \brief Marks decrypted data as consumed. + void decrypted_data_consumed(int size); + + /// \brief Marks encrypted data as consumed. + void encrypted_data_consumed(int size); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/ErrorReporting/crash_reporter.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/ErrorReporting/crash_reporter.h new file mode 100644 index 0000000..8950e9a --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/ErrorReporting/crash_reporter.h @@ -0,0 +1,69 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_ErrorReporting clanCore ErrorReporting + /// \{ + + class CrashReporter_Impl; + + /// \brief Generates crash reports (aka. minidumps or core dumps) when the application crashes, or when requested. + class CrashReporter + { + public: + /// \brief Constructs a crash reporter that creates crash dumps in the specified directory. + /// + /// If uploader_executable is a non-empty string the executable will be launched if the application crashes. + CrashReporter(const std::string &reports_directory, const std::string &uploader_executable = std::string()); + ~CrashReporter(); + + /// \brief Hooks the current thread to the crash reporter. + /// + /// The crash reporter will only work for hooked threads. + static void hook_thread(); + + /// \brief Force a crash. + /// + /// This is useful for failing asserts. + static void invoke(); + + /// \brief Generate a crash report for the current thread without terminating. + static void generate_report(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/ErrorReporting/exception_dialog.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/ErrorReporting/exception_dialog.h new file mode 100644 index 0000000..a6d4b6f --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/ErrorReporting/exception_dialog.h @@ -0,0 +1,50 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_ErrorReporting clanCore ErrorReporting + /// \{ + + class Exception; + class ExceptionDialog_Impl; + + /// \brief Displays a modal dialog with exception details. + class ExceptionDialog + { + public: + /// \brief Displays a modal dialog with the details of the specified exception. + static void show(const std::exception_ptr &exception); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/cl_endian.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/cl_endian.h new file mode 100644 index 0000000..0f814f8 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/cl_endian.h @@ -0,0 +1,60 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + /// \brief Endianess management class. + class Endian + { + public: + /// \brief Swaps larger amounts of data between little and big endian. + /// + /// \param data Data to be swapped. + /// \param type_size Size of datatype to be swapped. (Must be an even number) + /// \param total_times Number of 'type_size' size data chunks to be swapped. + static void swap(void *data, int type_size, int total_times = 1); + + static void swap_if_big(void *data, int type_size, int total_times = 1) { if (is_system_big()) swap(data, type_size, total_times); } + static void swap_if_little(void *data, int type_size, int total_times = 1) { if (!is_system_big()) swap(data, type_size, total_times); } + + /// \brief Returns true if big endian system. + /** \return True if big endian system, false otherwise.*/ + static bool is_system_big(); + + /// \brief Returns true if 64 bit system. + /** \return True if 64 bit, false otherwise.*/ + static bool is_system_64bit(); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory.h new file mode 100644 index 0000000..758f7d7 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory.h @@ -0,0 +1,128 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + /// \brief Directory utility class + class Directory + { + public: + /// \brief Create directory. + /// + /// \param dir_name = Directory name for create. + /// \param recursive = If true, function will create all directories in the path, otherwise only the last directory + /// \return true on success or false on error. + static bool create(const std::string &dir_name, bool recursive = false); + + /// \brief Remove directory. + /// + /// \param dir_name = Directory name for delete. + /// \param delete_files = If true, function will delete files. + /// \param delete_sub_directories = If true, function will delete subdirectories too. + /// \return true on success or false on error. + static bool remove(const std::string &dir_name, bool delete_files = false, bool delete_sub_directories = false); + + /// \brief Rename directory. + /// + /// \param old_name = Old name of the directory to be renamed. + /// \param new_name = New directory name. + /// \return true on success or false on error. + static bool rename(const std::string &old_name, const std::string &new_name); + + /// \brief Change current directory. + /// + /// \param dir_name = Directory name to change to. + /// \return true on success or false on error. + static bool set_current(const std::string &dir_name); + + /// \brief Get current directory. + /// + /// \return the current directory path. + static std::string get_current(); + + /// \brief Returns the current user's roaming application data directory. + /// + /// In Windows, this functions returns special folder directory CSIDL_APPDATA + /// appended with the "company_name\application_name\version" string. A typical path would be + /// "C:\Documents and Settings\username\Application Data\company_name\application_name\version\".\n + /// In OS X, this function returns the directory "~/Library/company_name/application_name/version/".\n + /// In Linux, this function returns the directory "~/.company_name/application_name/version/". + /// + /// \param company_name = Company name. + /// \param application_name = Application name. + /// \param version = Application version. + /// \param create_dirs_if_missing = If true, function will create all missing directories in the path. + /// + /// \return the current user's roaming application data directory. + static std::string get_appdata(const std::string &company_name, const std::string &application_name, const std::string &version, bool create_dirs_if_missing = true); + + /// \brief Returns the current user's local (nonroaming) application data directory. + /// + /// In Windows, this functions returns special folder directory CSIDL_LOCAL_APPDATA + /// appended with the "company_name\application_name\version" string. A typical path would be + /// "C:\Documents and Settings\username\Local Settings\Application Data\company_name\application_name\version\".\n + /// In OS X, this function returns the directory "~/Library/company_name/application_name/version/".\n + /// In Linux, this function returns the directory "~/.company_name/application_name/version/". + /// + /// \param company_name = Company name. + /// \param application_name = Application name. + /// \param version = Application version. + /// \param create_dirs_if_missing = If true, function will create all missing directories in the path. + /// + /// \return the current user's local (nonroaming) application data directory. + static std::string get_local_appdata(const std::string &company_name, const std::string &application_name, const std::string &version, bool create_dirs_if_missing = true); + + /// \brief Returns the application resource data directory. + /// + /// In Windows, this function returns a data_dir_name subdirectory located at the + /// executable. If the executable path is "C:\Program Files\My Application\MyApp.exe", + /// then it will return the path "C:\Program Files\My Application\data_dir_name\".\n + /// In OS X, this function returns a "Resources" subdirectory inside the application bundle. + /// For example, if the application executable path is + /// "/Applications/MyApplication.app/Contents/MacOS/MyApplication", then it will return + /// "/Applications/MyApplication.app/Contents/Resources/". If the executable is not in + /// an application bundle, it will use the same behavior as in Windows; that is, it will + /// return a data_dir_name subdirectory next to the executable.\n + /// In Linux, this function will return the directory "../share/application_name/" + /// relative to the executable, so if it is located in "/usr/bin" it will return + /// "/usr/share/application_name/" + /// + /// \param application_name = Application name. + /// \param data_dir_name = Data directory name. + /// + /// \return the application resource data directory. + static std::string get_resourcedata(const std::string &application_name, const std::string &data_dir_name = "Resources"); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory_listing.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory_listing.h new file mode 100644 index 0000000..996d791 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory_listing.h @@ -0,0 +1,80 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ + +#pragma once + +#include + +namespace clan +{ + + class DirectoryListingEntry; + class FileSystemProvider; + class DirectoryListing_Impl; + + /// \brief Virtual File System (VFS) directory listing class. + class DirectoryListing + { + public: + /// \brief Constructs a null instance. + DirectoryListing(); + + /// \brief Constructs a virtual directory listening object. + DirectoryListing(FileSystemProvider *provider, const std::string &path); + + virtual ~DirectoryListing(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns the file name of the current item in the listing. + std::string get_filename(); + + /// \brief Returns true if item is a directory. + bool is_directory(); + + /// \brief Returns true if item is hidden. + bool is_hidden(); + + /// \brief Returns true if item is writable. + bool is_writable(); + + /// \brief Returns true if item is readable. + bool is_readable(); + + /// \brief Advance to next item in listing. + bool next(); + + private: + std::shared_ptr impl; + }; + +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory_listing_entry.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory_listing_entry.h new file mode 100644 index 0000000..9032059 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory_listing_entry.h @@ -0,0 +1,68 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ + +#pragma once + +#include + +namespace clan +{ + class DirectoryListingEntry_Impl; + + /// \brief Virtual File System (VFS) directory listing entry class. + class DirectoryListingEntry + { + public: + DirectoryListingEntry(); + virtual ~DirectoryListingEntry(); + + /// \brief Returns the file name of the item in the listing. + std::string get_filename(); + + /// \brief Returns true if item is a directory. + bool is_directory(); + + /// \brief Returns true if item is hidden. + bool is_hidden(); + + /// \brief Returns true if item is writable. + bool is_writable(); + + /// \brief Returns true if item is readable. + bool is_readable(); + + void set_filename(const std::string &); + void set_directory(bool); + void set_hidden(bool); + void set_writable(bool); + void set_readable(bool); + + private: + std::shared_ptr impl; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory_scanner.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory_scanner.h new file mode 100644 index 0000000..c2afccc --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/directory_scanner.h @@ -0,0 +1,120 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + class DirectoryScanner_Impl; + + /// \brief Directory scanning class. + /// + ///

DirectoryScanner is used to parse through directory trees and return information about files.

+ /// - + ///

Example that prints all files and directories found in the root directory:

+ ///
+	///    DirectoryScanner scanner;
+	///    if (scanner.scan("/", "*"))
+	///    {
+	///    		while (scanner.next())
+	///    		{
+	///    				cl_console_write_line(scanner.get_name());
+	///    		}
+	///    }
+	///    
+ class DirectoryScanner + { + public: + /// \brief Constructs directory scanner for iterating over a directory. + DirectoryScanner(); + + /// \brief Destructor. + ~DirectoryScanner(); + + /// \brief Gets the directory being scanned. + /** \return Directory being scanned. (including the trailing slash)*/ + std::string get_directory_path(); + + /// \brief Gets the name of the current file. + /** \return The name of the current found file.*/ + std::string get_name(); + + /// \brief Gets the size of the current file. + /** \return The size of the current found file.*/ + int get_size(); + + /// \brief Gets the pathname of the current file. + /** \return The name of the current found file, including the directory path.*/ + std::string get_pathname(); + + /// \brief Returns true if the current file is a directory. + /** \return True if filename is a directory.*/ + bool is_directory(); + + /// \brief Returns true if the file is hidden. + /** \return True if filename is hidden.*/ + bool is_hidden(); + + /// \brief Returns true if the file is readable by the current user. + /** \return True if the file is readable.*/ + bool is_readable(); + + /// \brief Returns true if the file is writable by the current user. + /** \return True if the file is writable.*/ + bool is_writable(); + + /// \brief Selects the directory to scan through. + /**

Selects the directory to scan through

+ \param pathname Path to the directory to scan (without trailing slash) + \return true if the directory can be accessed.*/ + bool scan(const std::string& pathname); + + /// \brief Selects the directory to scan through. + /**

Selects the directory to scan through and use a matching pattern on the files.

+ WIN32: The pattern is normal DOS pattern matching ("*.*", ?) + Unix: The pattern is normal pattern matching (*, ?) + \param pathname Path to the directory to scan (without trailing slash) + \param pattern Pattern to match files against. + \return true if the directory can be accessed.*/ + bool scan(const std::string& pathname, const std::string& pattern); + + /// \brief Find next file in directory scan. + /** \return false if no more files was found.*/ + bool next(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file.h new file mode 100644 index 0000000..89ba213 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file.h @@ -0,0 +1,157 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "iodevice.h" +#include "../System/databuffer.h" + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + /// \brief File I/O device. + class File : public IODevice + { + public: + /// \brief Loads an UTF-8 text file into a string. + static std::string read_text(const std::string &filename); + + /// \brief Loads an file into a byte buffer. + static DataBuffer read_bytes(const std::string &filename); + + /// \brief Saves an UTF-8 text string to file. + static void write_text(const std::string &filename, const std::string &text, bool write_bom = false); + + /// \brief Saves a byte buffer to file. + static void write_bytes(const std::string &filename, const DataBuffer &bytes); + + /// \brief Access flags. + /**

File access types available.

*/ + enum AccessFlags + { + /// \brief Generic read access. + access_read = 1, + + /// \brief Generic write access. + access_write = 2, + + /// \brief Generic read write access. + access_read_write = access_read | access_write + }; + + /// \brief File sharing flags. + enum ShareFlags + { + /// \brief Allow others to open the file for reading. + share_read = 1, + + /// \brief Allow others to open the file for writing. + share_write = 2, + + /// \brief Allow others to delete the file. + share_delete = 4, + + /// \brief All other sharing flags combined. + share_all = share_read + share_write + share_delete + }; + + /// \brief File opening modes. + enum OpenMode + { + /// \brief Open file or create it if it does not exist. + open_always, + + /// \brief Open existing file. Fails if it does not exist. + open_existing, + + /// \brief Open existing file and truncate it. + open_existing_truncate, + + /// \brief Create file, even if it already exists. + create_always, + + /// \brief Create a new file. Fails if it already exists. + create_new + }; + + /// \brief Optimization Flags. + enum Flags + { + flag_write_through = 1, + flag_no_buffering = 2, + flag_random_access = 4, + flag_sequential_scan = 8 + }; + + /// \brief Constructs a file object. + File(); + + /// \brief Constructs a file object read only + /// + /// PathHelp::normalize(filename, PathHelp::path_type_file) is called + File( + const std::string &filename); + + /// \brief Constructs a file object. + /// + /// PathHelp::normalize(filename, PathHelp::path_type_file) is called + File( + const std::string &filename, + OpenMode mode, + unsigned int access, + unsigned int share = share_all, + unsigned int flags = 0); + + ~File(); + + /// \brief Opens a file read only. + /// + /// PathHelp::normalize(filename, PathHelp::path_type_file) is called + bool open( + const std::string &filename); + + /// \brief Opens a file + /// + /// PathHelp::normalize(filename, PathHelp::path_type_file) is called + bool open( + const std::string &filename, + OpenMode mode, + unsigned int access, + unsigned int share = share_all, + unsigned int flags = 0); + + /// \brief Close file. + void close(); + + private: + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file_help.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file_help.h new file mode 100644 index 0000000..4d8505f --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file_help.h @@ -0,0 +1,60 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Kenneth Gangstoe +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + /// \brief File operation helpers. + class FileHelp + { + public: + /// \brief Copy a file. + /// + /// \param from Where to copy from + /// \param to Where to copy to + /// \param copy_always true = Copy, even if destination already exists. false = Do not copy if destination exists (throw a Exception) + static void copy_file(const std::string &from, const std::string &to, bool copy_always); + + /// \brief Delete a file. + /// + /// \param filename File to delete + static void delete_file(const std::string &filename); + + /// \brief Check if a file exists. + /// + /// \param filename File to check for existance + static bool file_exists(const std::string &filename); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file_system.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file_system.h new file mode 100644 index 0000000..9056aef --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file_system.h @@ -0,0 +1,135 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include +#include "file.h" + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + class IODevice; + class FileSystem_Impl; + class FileSystemProvider; + class DirectoryListing; + + /// \brief Virtual File System (VFS). + class FileSystem + { + public: + /// \brief Constructs a file system. + FileSystem(); + + /// \brief Constructs a FileSystem + /// + /// \param provider = Virtual File Source + FileSystem(FileSystemProvider *provider); + + /// \brief Constructs a FileSystem + /// + /// \param path = String + /// \param is_zip_file = bool + FileSystem(const std::string &path, bool is_zip_file = false); + + ~FileSystem(); + + /// \brief Returns true if the file system is null. + bool is_null() const { return !impl; } + + /// \brief Returns true if a path is a mount point. + bool is_mount(const std::string &mount_point); + + /// \brief Return directory listing for path. + DirectoryListing get_directory_listing(const std::string &path_rel); + + /// \brief Return true if the root of the filesystem contains the specified file. + bool has_file(const std::string &filename); + + /// \brief Return true if the root of the filesystem contains the specified directory. + bool has_directory(const std::string &directory); + + /// \brief Returns the file source for this file system. + FileSystemProvider *get_provider(); + + /// \brief Returns a path to the file source for this file system. + std::string get_path() const; + + /// \brief Get the identifier of this file source + /// + /// The exact format of this identifier depends on the implementation of the underlying filesystem and mounts + /// \return the identifier + std::string get_identifier() const; + + /// \brief Opens a file. + /** param: mode = File::OpenMode modes + param: access = File::AccessFlags flags + param: share = File::ShareFlags flags + param: flags = File::Flags flags + \return The IODevice*/ + IODevice open_file(const std::string &filename, + File::OpenMode mode = File::open_existing, + unsigned int access = File::access_read, + unsigned int share = File::share_all, + unsigned int flags = 0) const; + + /// \brief Mounts a file system at mount point. + /** This is only available if FileSystem was set + Filenames starting with "mount_point" at the start will be replaced by the filesystem specified by "fs" + (ie the the base_path is ignored) + For example: + FileSystem new_vfs(new MyFileSource("Hello")); + vfs.mount("ABC", new_vfs); + param: mount_point = Mount alias name to use + param: fs = Filesystem to use*/ + void mount(const std::string &mount_point, FileSystem fs); + + /// \brief Mounts a file system at mount point. + /** Filenames starting with "mount_point" at the start will be replaced by the path specified by "path" + (ie the the base_path is ignored) + param: mount_point = Mount alias name to use + param: path = Path which "mount_point" should point to + param: is_zip_file = false, create as a FileSystemProvider_File, else create as a FileSystemProvider_Zip*/ + void mount(const std::string &mount_point, const std::string &path, bool is_zip_file); + + /// \brief Unmount a file system. + /** param: mount_point = The mount point to unmount*/ + void unmount(const std::string &mount_point); + + private: + class NullVFS { }; + explicit FileSystem(class NullVFS null_fs); + + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file_system_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file_system_provider.h new file mode 100644 index 0000000..81b60c3 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/file_system_provider.h @@ -0,0 +1,79 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include +#include "file.h" + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + class IODevice; + class DirectoryListingEntry; + + /// \brief Virtual File System (VFS) file source. + class FileSystemProvider + { + public: + virtual ~FileSystemProvider() { return; } + + /// \brief Open file from this source. + /** param: filename = The filename to use + param: mode = File::OpenMode modes + param: access = File::AccessFlags flags + param: share = File::ShareFlags flags + param: flags = File::Flags flags + \return The IODevice*/ + virtual IODevice open_file(const std::string &filename, + File::OpenMode mode = File::open_existing, + unsigned int access = File::access_read | File::access_write, + unsigned int share = File::share_all, + unsigned int flags = 0) = 0; + + /// \brief Initiate directory listing. + virtual bool initialize_directory_listing(const std::string &path) = 0; + + /// \brief Update directory listing item. + virtual bool next_file(DirectoryListingEntry &entry) = 0; + + /// \brief Return the path of this file source. + virtual std::string get_path() const = 0; + + /// \brief Get the identifier of this file source + /// + /// The exact format of this identifier depends on the implementation of the underlying filesystem and mounts + /// \return the identifier + virtual std::string get_identifier() const = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/html_url.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/html_url.h new file mode 100644 index 0000000..3da999c --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/html_url.h @@ -0,0 +1,57 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +namespace clan +{ + /// \brief Class for handling HTML urls. + class HTMLUrl + { + public: + HTMLUrl(); + HTMLUrl(const std::string &url, const HTMLUrl &base = HTMLUrl()); + std::string to_string() const; + + std::string scheme; + + // http scheme: + std::string host; + std::string port; + std::string path; + std::string query; + + // data scheme: + std::string content_type; + std::string encoding; + std::string data; + + private: + std::string read_scheme(std::string &input, std::string::size_type &pos); + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/iodevice.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/iodevice.h new file mode 100644 index 0000000..c14f0a7 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/iodevice.h @@ -0,0 +1,298 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include "../System/cl_platform.h" +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + class IODeviceProvider; + class IODevice_Impl; + + /// \brief I/O Device interface. + /// + /// This class can store basic datatypes and retain portability (using the specified endian mode)\n + /// The supported datatypes are: int64_t, int32_t, int16_t and int8_t\n + /// The std::string datatype is supported - Using Size(int32_t), Charactor Data (std::string characters) + class IODevice + { + public: + /// \brief Seeking modes. + enum SeekMode + { + /// \brief Set to a specific value from the start + seek_set, + + /// \brief Set relative to the current position + seek_cur, + + /// \brief Set to a specific value from the end (use negative position) + seek_end + }; + + /// \brief Constructs a null instance + IODevice(); + + /// \brief Constructs a IODevice + /// + /// \param provider = IODevice Provider + IODevice(IODeviceProvider *provider); + + ~IODevice(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns the size of data stream. + /**

Returns -1 if the size is unknown.

+ \return The size (-1 if size is unknown)*/ + int get_size() const; + + /// \brief Returns the position in the data stream. + /**

Returns -1 if the position is unknown.

+ \return The size (-1 if position is unknown)*/ + int get_position() const; + + /// \brief Returns true if the input source is in little endian mode. + /** \return true if little endian*/ + bool is_little_endian() const; + + /// \brief Returns the provider for this object + const IODeviceProvider *get_provider() const; + + /// \brief Returns the provider for this object + IODeviceProvider *get_provider(); + + /// \brief Send data to device. + /** If the device databuffer is too small, it will be extended (ie grow memory block size or file size) + \param data Data to send + \param len Length to send + \param send_all true to send all the data. false = send part of the data, if it would block + \return size of data sent*/ + int send(const void *data, int len, bool send_all = true); + + /// \brief Receive data from device. + /// + /// \param data Data to receive + /// \param len Length to receive + /// \param receive_all true to receive all the data. false = receive part of the data, if it would block + /// + /// \return size of data received + int receive(void *data, int len, bool receive_all = true); + + /// \brief Peek data from device (data is left in the buffer). + /// + /// \param data Data to receive + /// \param len Maximum length of data to receive + /// \return size of data received. + int peek(void *data, int len); + + /// \brief Seek in data stream. + /// + /// \param position Position to use (usage depends on the seek mode) + /// \param mode Seek mode + /// \return false = Failed + bool seek(int position, SeekMode mode = seek_set); + + /// \brief Alias for receive(data, len, receive_all) + /// + /// \param data Data to receive + /// \param len Length to receive + /// \param receive_all true to receive all the data. false = receive part of the data, if it would block + /// + /// \return size of data received + int read(void *data, int len, bool receive_all = true); + + /// \brief Alias for send(data, len, send_all) + /// + /// \param data Data to send + /// \param len Length to send + /// \param send_all true to send all the data. false = send part of the data, if it would block + /// + /// \return size of data sent + int write(const void *data, int len, bool send_all = true); + + /// \brief Changes input data endianess to the local systems mode. + void set_system_mode(); + + /// \brief Changes input data endianess to big endian mode. (Default is little endian) + void set_big_endian_mode(); + + /// \brief Changes input data endianess to little endian mode. This is the default setting. + void set_little_endian_mode(); + + /// \brief Writes a signed 64 bit integer to output source. + /// + /// \param data Integer to write + void write_int64(int64_t data); + + /// \brief Writes an unsigned 64 bit integer to output source. + /// + /// \param data Integer to write + void write_uint64(uint64_t data); + + /// \brief Writes a signed 32 bit integer to output source. + /// + /// \param data Integer to write + void write_int32(int32_t data); + + /// \brief Writes an unsigned 32 bit integer to output source. + /// + /// \param data Integer to write + void write_uint32(uint32_t data); + + /// \brief Writes a signed 16 bit integer to output source. + /// + /// \param data Integer to write + void write_int16(int16_t data); + + /// \brief Writes an unsigned 16 bit integer to output source. + /// + /// \param data Integer to write + void write_uint16(uint16_t data); + + /// \brief Writes a signed 8 bit integer to output source. + /// + /// \param data Integer to write + void write_int8(int8_t data); + + /// \brief Writes an unsigned 8 bit integer to output source. + /// + /// \param data Integer to write + void write_uint8(uint8_t data); + + /// \brief Writes a float to output source. + /// + /// \param data = Float to write + /// + /// Warning, this is not portable. + void write_float(float data); + + /// \brief Writes a string to the output source. + /// + /// \param str String to write + /// + /// The binary format written to the output source is first an uint32 telling the length of the + /// string, and then the string itself. + void write_string_a(const std::string &str); + + /// \brief Writes a nul terminated string to the output source. + /// + /// \param str String to write + /// + /// The binary format written to the output source is the string content followed by the NUL character. + void write_string_nul(const std::string &str); + + /// \brief Writes a text string to the output source. + /// + /// \param str String to write + /// + /// The binary format written to the output source is the string content appended with a native newline. + /// On Windows the newline is CR+LF sequence and on other platforms it is only LF character. + /// This function is intended for use with text files. + void write_string_text(const std::string &str); + + /// \brief Reads a signed 64 bit integer from input source. + /** \return The integer read.*/ + int64_t read_int64(); + + /// \brief Reads an unsigned 64 bit integer from input source. + /** \return The integer read.*/ + uint64_t read_uint64(); + + /// \brief Reads a signed 32 bit integer from input source. + /** \return The integer read.*/ + int32_t read_int32(); + + /// \brief Reads an unsigned 32 bit integer from input source. + /** \return The integer read.*/ + uint32_t read_uint32(); + + /// \brief Reads a signed 16 bit integer from input source. + /** \return The integer read.*/ + int16_t read_int16(); + + /// \brief Reads an unsigned 16 bit integer from input source. + /** \return The integer read.*/ + uint16_t read_uint16(); + + /// \brief Reads a signed 8 bit integer from input source. + /** \return The integer read.*/ + int8_t read_int8(); + + /// \brief Reads an unsigned 8 bit integer from input source. + /** \return The integer read.*/ + uint8_t read_uint8(); + + /// \brief Reads a float from input source. + /** Warning, this is not portable + \return The float read.*/ + float read_float(); + + /// \brief Reads a string from the input source. + /**

The binary format expected in the input source is first an uint32 telling the length of the + string, and then the string itself.

+ \return The string read.*/ + std::string read_string_a(); + + /// \brief Reads a nul terminated string from the input source. + /** The binary format expected in the input source is a nul terminated string. + (The NUL termintor is read, so that the file position is set after the NUL) + \return The string read.*/ + std::string read_string_nul(); + + /// \brief Reads a string from the input source where the source is a text file. + /// + /// After reading the input source up to "read_until_chars", the file position is set to the first character that was not read. + /// If the file contains NUL characters, then the input is read up to the NUL character, and the file position is set AFTER the NUL) + /// + /// \param skip_initial_chars Ignore any of these characters at the start of the string. NULL = Do not ignore any characters + /// \param read_until_chars Read from the input until any of these characters are found. NULL = Read until the end of the file + /// \param allow_eof Allow EOF + /// \return The string read. + std::string read_string_text(const char *skip_initial_chars, const char *read_until_chars, bool allow_eof = true); + + /// \brief Create a new IODevice referencing the same resource. + IODevice duplicate(); + + protected: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/iodevice_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/iodevice_provider.h new file mode 100644 index 0000000..d1898b9 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/iodevice_provider.h @@ -0,0 +1,69 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "iodevice.h" + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + /// \brief I/O device provider interface. + class IODeviceProvider + { + public: + virtual ~IODeviceProvider() { return; } + + /// \brief Returns the size of data stream. + /**

Returns -1 if the size is unknown.

*/ + virtual int get_size() const { return -1; } + + /// \brief Returns the position in the data stream. + /**

Returns -1 if the position is unknown.

*/ + virtual int get_position() const { return -1; } + + /// \brief Send data to device. + virtual int send(const void *data, int len, bool send_all = true) = 0; + + /// \brief Receive data from device. + virtual int receive(void *data, int len, bool receive_all = true) = 0; + + /// \brief Peek data from device. + virtual int peek(void *data, int len) = 0; + + /// \brief Returns a new provider to the same resource. + virtual IODeviceProvider *duplicate() = 0; + + /// \brief Seek in data stream. + virtual bool seek(int /*position*/, IODevice::SeekMode /*mode*/) { return false; } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/memory_device.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/memory_device.h new file mode 100644 index 0000000..f1b36c0 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/memory_device.h @@ -0,0 +1,62 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "iodevice.h" + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + class DataBuffer; + + /// \brief Memory I/O device. + class MemoryDevice : public IODevice + { + public: + /// \brief Constructs a memory I/O device. + MemoryDevice(); + + /// \brief Constructs a IODevice Memory + /// + /// \param data = Data Buffer + MemoryDevice(DataBuffer &data); + + /// \brief Retrieves the data buffer for the memory device. + const DataBuffer &get_data() const; + + /// \brief Get Data + /// + /// \return data + DataBuffer &get_data(); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/path_help.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/path_help.h new file mode 100644 index 0000000..5cefb7b --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/IOData/path_help.h @@ -0,0 +1,284 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + /// \brief Path helper functions. + class PathHelp + { + public: + /// \brief Path types. + enum PathType + { + /// \brief Native file system path. (On windows, '/' are turned into '\'. On linux, '\' are turned into '/') + path_type_file, + + /// \brief Path using slashes ('/'). + path_type_virtual + }; + + /// \brief Convert a relative path to an absolute path. + /// + /// \param base_path The base path (Does not require a trailing slash) + /// \param relative_path The relative path + /// \param path_type The path type + /// + /// \return The converted path + /// + /// This function behaves differently depending on OS and path_type. + /// In Windows, if the relative_path begins with a drive letter, and + /// the driver letter differs from the base path, the path is + /// converted to an absolute path using the current directory for that + /// drive. Likewise, if the specified base path does not include a + /// drive or its path is not absolute, the current drive and directory + /// is added. The function converts all slashes to backslashes. + /// + /// If the OS is unix based, there is no location (drive or share name) + /// and the function also converts all backslashes to slashes. + /// + /// If the type is path_type_virtual, the base path is required to be + /// absolute. If it does not start in a slash, the function prefixes a + /// slash to the path. The current drive or directory is never taken into + /// account and all backslashes are converted to slashes. + /// + /// This function calls normalise() on base_path and relative_path. + /// + /// Example #1: + /// \code + /// std::string str = PathHelp::make_absolute("ABD/DEF/", "GFX/Filename.txt", PathHelp::path_type_file); + /// On Linux: str = "/home/user/ABD/DEF/GFX/Filename.txt" + /// On Windows: str = "c:\user\ABD\DEF\GFX\Filename.txt" + /// \endcode + /// + /// Example #2: + /// \code + /// std::string str = PathHelp::make_absolute("/ABD/DEF/", "../Filename.txt", PathHelp::path_type_file); + /// On Linux: str = "/ABD/Filename.txt" + /// On Windows: str = "c:\ABD\Filename.txt" + /// \endcode + /// + /// Example #3: + /// \code + /// std::string str = PathHelp::make_absolute("/ABD/DEF/", "../Filename.txt", PathHelp::path_type_virtual); + /// On Linux: str = "/ABD/Filename.txt" + /// On Windows: str = "/ABD/Filename.txt" + /// \endcode + static std::string make_absolute( + const std::string &base_path, + const std::string &relative_path, + PathType path_type = path_type_file); + + /// \brief Converts an absolute path into a path relative to a base path. + /// + /// \param base_path The base path (Does not require a trailing slash) + /// \param absolute_path The absolute path + /// \param path_type The path type + /// + /// \return The converted path + /// + /// This function is the inverse of FileHelp::make_absolute. Please + /// see the detailed information for make_absolute for more information + /// about behavior. + /// + /// This function calls normalise() on the base_path and absolute_path- + /// + /// Example #1 (Windows): + /// \code + /// std::string str = PathHelp::make_relative("ABD/DEF/", "c:\user\ABD\Filename.txt", PathHelp::path_type_file); + /// On Windows: str = "..\Filename.txt" + /// \endcode + static std::string make_relative( + const std::string &base_path, + const std::string &absolute_path, + PathType path_type = path_type_file); + + /// \brief Check if a path is absolute. + /// + /// \param path The path to check + /// \param path_type The path type (of path) + /// \return true if path is absolute + static bool is_absolute( + const std::string &path, + PathType path_type = path_type_file); + + /// \brief Check if a path is relative. + /// + /// \param path The path to check + /// \param path_type The path type (of path) + /// \return true if path is relative + static bool is_relative( + const std::string &path, + PathType path_type = path_type_file); + + /// \brief Normalize a path. + /// + /// \param path The path to use + /// \param path_type The path type (of the normalized path) + /// \return The converted path + /// + /// Converts all slashes and backslashes into their right type. + /// Simplifies or removes all . and .., converting the path into its + /// most readable form. + static std::string normalize( + const std::string &path, + PathType path_type = path_type_file); + + /// \brief Add trailing slash or backslash to path. + /// + /// This function checks if a path already has a trailing + /// slash/backslash and adds it if its missing. + /// \param path The path to use + /// \param path_type The path type (of path) + /// \return The converted path + static std::string add_trailing_slash( + const std::string &path, + PathType path_type = path_type_file); + + /// \brief Remove trailing slash or backslash from path. + /// + /// This function checks if a path has a trailing + /// slash/backslash and removes it if needed. + /// \param path The path to use + /// \return The converted path + static std::string remove_trailing_slash( + const std::string &path); + + /// \brief Returns the drive (C:) or share name ( \ \ computer \ share) + /// + /// If (path_type == path_type_virtual) or not using windows, then this function always returns an empty string. + /// \param fullname The full path name to use + /// \param path_type The path type + /// \return The drive or share name*/ + static std::string get_location( + const std::string &fullname, + PathType path_type = path_type_file); + + /// \brief Returns the path excluding the location and filename. + /// + /// \param fullname The full path name to use + /// \param path_type The path type + /// \return The base path + /// + /// If (path_type == path_type_virtual) or not using windows, then this function returns the path (excluding filename) + static std::string get_basepath( + const std::string &fullname, + PathType path_type = path_type_file); + + /// \brief Splits the path, excluding the location, into parts. + /** param: fullname = The full path name to use + param: path_type = The path type + \return The split path*/ + static std::vector split_basepath( + const std::string &fullname, + PathType path_type = path_type_file); + + /// \brief Returns the path including the location. + /** param: fullname = The full path to use (including filename) + param: path_type = The path type + \return The full path including the location (excluding filename)*/ + static std::string get_fullpath( + const std::string &fullname, + PathType path_type = path_type_file); + + /// \brief Returns the filename part of a fullname. + /** param: fullname = The full path to use + param: path_type = The path type + \return The filename*/ + static std::string get_filename( + const std::string &fullname, + PathType path_type = path_type_file); + + /// \brief Returns the basename part of a fullname. + /** param: fullname = The full path to use + param: path_type = The path type + \return The filename (excluding the extension)*/ + static std::string get_basename( + const std::string &fullname, + PathType path_type = path_type_file); + + /// \brief Returns the extension part of a fullname. + /**

If no extension was found, an empty string is returned.

+ param: fullname = The full path to use + param: path_type = The path type + \return The extension*/ + static std::string get_extension( + const std::string &fullname, + PathType path_type = path_type_file); + + /// \brief Create a fullname from parts. + /** param: fullpath = The full path to use + param: filename = The filename to use + param: path_type = The path type + \return The full name*/ + static std::string get_fullname( + const std::string &fullpath, + const std::string &filename, + PathType path_type = path_type_file); + + /// \brief Create a fullname from parts. + /** param: fullpath = The full path to use + param: filename = The filename to use + param: extension = The filename extension to use + param: path_type = The path type + \return The full name*/ + static std::string get_fullname( + const std::string &fullpath, + const std::string &filename, + const std::string &extension, + PathType path_type = path_type_file); + + /// \brief Create a fullname from parts. + /** param: location = The location to use + param: fullpath = The full path to use + param: filename = The filename to use + param: extension = The filename extension to use + param: path_type = The path type + \return The full name*/ + static std::string get_fullname( + const std::string &location, + const std::string &basepath, + const std::string &filename, + const std::string &extension, + PathType path_type = path_type_file); + + /// \brief Concatenates two strings into one adding a trailing slash to first string if missing. + /// \param part1 First part of path + /// \param part2 Second part of path + /// \param path_type The path type (of path) + static std::string combine(const std::string &part1, const std::string &part2, PathType path_type = path_type_file); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/JSON/json_value.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/JSON/json_value.h new file mode 100644 index 0000000..c32f9f7 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/JSON/json_value.h @@ -0,0 +1,152 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_JSON clanCore JSON + /// \{ + + /// \brief Exception class thrown for JSON exceptions. + class JsonException : public Exception + { + public: + JsonException(const std::string &message) : Exception(message) { } + }; + + enum class JsonType + { + undefined, + null, + object, + array, + number, + boolean, + string + }; + + class JsonValue + { + public: + static JsonValue undefined() { JsonValue v; v._type = JsonType::undefined; return v; } + static JsonValue null() { JsonValue v; v._type = JsonType::null; return v; } + static JsonValue object() { JsonValue v; v._type = JsonType::object; return v; } + static JsonValue array() { JsonValue v; v._type = JsonType::array; return v; } + static JsonValue number(double value) { JsonValue v; v._type = JsonType::number; v._number = value; return v; } + static JsonValue number(float value) { return JsonValue::number(static_cast(value)); } + static JsonValue number(int value) { return JsonValue::number(static_cast(value)); } + static JsonValue number(unsigned int value) { return JsonValue::number(static_cast(value)); } + static JsonValue number(short value) { return JsonValue::number(static_cast(value)); } + static JsonValue number(unsigned short value) { return JsonValue::number(static_cast(value)); } + static JsonValue number(char value) { return JsonValue::number(static_cast(value)); } + static JsonValue number(unsigned char value) { return JsonValue::number(static_cast(value)); } + static JsonValue boolean(bool value) { JsonValue v; v._type = JsonType::boolean; v._boolean = value; return v; } + static JsonValue string(const std::string &value) { JsonValue v; v._type = JsonType::string; v._string = value; return v; } + + static JsonValue parse(const std::string &json); + std::string to_json() const; + + const JsonValue &prop(const std::string &name) const { auto it = _properties.find(name); if (it != _properties.end()) return it->second; static JsonValue undef; return undef; } + const JsonValue &prop(const char *name) const { auto it = _properties.find(name); if (it != _properties.end()) return it->second; static JsonValue undef; return undef; } + JsonValue &prop(const std::string &name) { return _properties[name]; } + JsonValue &prop(const char *name) { return _properties[name]; } + + void remove(const std::string &name) { auto it = _properties.find(name); if (it != _properties.end()) _properties.erase(it); } + void remove(const char *name) { auto it = _properties.find(name); if (it != _properties.end()) _properties.erase(it); } + + size_t size() const { return _items.size(); } + JsonValue &at(size_t index) { return _items.at(index); } + const JsonValue &at(size_t index) const { return _items.at(index); } + void erase(size_t offset, size_t length) { _items.erase(_items.begin() + offset, _items.begin() + offset + length); } + + void clear() { _items.clear(); _properties.clear(); } + + JsonType type() const { return _type; } + bool is_undefined() const { return type() == JsonType::undefined; } + bool is_null() const { return type() == JsonType::null; } + bool is_object() const { return type() == JsonType::object; } + bool is_array() const { return type() == JsonType::array; } + bool is_number() const { return type() == JsonType::number; } + bool is_boolean() const { return type() == JsonType::boolean; } + + std::map &properties() { return _properties; } + const std::map &properties() const { return _properties; } + + std::vector &items() { return _items; } + const std::vector &items() const { return _items; } + + double to_number() const { return _number; } + bool to_boolean() const { return _boolean; } + const std::string &to_string() const { return _string; } + + double to_double() const { return to_number(); } + float to_float() const { return static_cast(to_number()); } + int to_int() const { return static_cast(to_number()); } + unsigned int to_uint() const { return static_cast(to_number()); } + short to_short() const { return static_cast(to_number()); } + unsigned short to_ushort() const { return static_cast(to_number()); } + char to_char() const { return static_cast(to_number()); } + unsigned char to_uchar() const { return static_cast(to_number()); } + + void set_undefined() { *this = JsonValue::undefined(); } + void set_null() { *this = JsonValue::null(); } + void set_object() { *this = JsonValue::object(); } + void set_array() { *this = JsonValue::array(); } + void set_string(const std::string &v) { *this = JsonValue::string(v); } + void set_string(const char *v) { *this = JsonValue::string(v); } + void set_number(double v) { *this = JsonValue::number(v); } + void set_number(float v) { *this = JsonValue::number(v); } + void set_number(int v) { *this = JsonValue::number(v); } + void set_number(unsigned int v) { *this = JsonValue::number(v); } + void set_number(short v) { *this = JsonValue::number(v); } + void set_number(unsigned short v) { *this = JsonValue::number(v); } + void set_number(char v) { *this = JsonValue::number(v); } + void set_number(unsigned char v) { *this = JsonValue::number(v); } + void set_boolean(bool v) { *this = JsonValue::boolean(v); } + + JsonValue &operator[](const std::string &name) { return prop(name); } + JsonValue &operator[](const char *name) { return prop(name); } + const JsonValue &operator[](const std::string &name) const { return prop(name); } + const JsonValue &operator[](const char *name) const { return prop(name); } + + JsonValue &operator[](size_t index) { return at(index); } + const JsonValue &operator[](size_t index) const { return at(index); } + + private: + JsonType _type = JsonType::undefined; + std::vector _items; + std::map _properties; + std::string _string; + double _number = 0.0; + bool _boolean = false; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/aabb.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/aabb.h new file mode 100644 index 0000000..3b9ee0d --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/aabb.h @@ -0,0 +1,55 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "vec3.h" +#include "cl_math.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + class AxisAlignedBoundingBox + { + public: + AxisAlignedBoundingBox() : aabb_min(), aabb_max() {} + AxisAlignedBoundingBox(const Vec3f &aabb_min, const Vec3f &aabb_max) : aabb_min(aabb_min), aabb_max(aabb_max) { } + AxisAlignedBoundingBox(const AxisAlignedBoundingBox &aabb, const Vec3f &barycentric_min, const Vec3f &barycentric_max) + : aabb_min(mix(aabb.aabb_min, aabb.aabb_max, barycentric_min)), aabb_max(mix(aabb.aabb_min, aabb.aabb_max, barycentric_max)) { } + + Vec3f center() const { return (aabb_max + aabb_min) * 0.5f; } + Vec3f extents() const { return (aabb_max - aabb_min) * 0.5f; } + + Vec3f aabb_min; + Vec3f aabb_max; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/angle.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/angle.h new file mode 100644 index 0000000..fb9e88a --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/angle.h @@ -0,0 +1,157 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + class Angle_Impl; + + /// \brief Angle unit + enum AngleUnit + { + angle_degrees, + angle_radians + }; + + /// \brief Euler angle rotation order + enum EulerOrder + { + order_XYZ, + order_XZY, + order_YZX, + order_YXZ, + order_ZXY, + order_ZYX + }; + + /// \brief Angle class. + class Angle + { + public: + /// \brief Constructs a null Angle object. + Angle(); + + /// \brief Constructs an Angle object. + Angle(float value, AngleUnit unit); + + /// \brief From radians + /// + /// \param value = value + /// + /// \return Angle + static Angle from_radians(float value); + + /// \brief From degrees + /// + /// \param value = value + /// + /// \return Angle + static Angle from_degrees(float value); + + /// \brief Returns the angle as degrees. + float to_degrees() const; + + /// \brief Returns the angle as radians. + float to_radians() const; + + /// \brief Set the angle value in degrees. + void set_degrees(float value_degrees); + + /// \brief Set the angle value in radians. + void set_radians(float value_radians); + + /// \brief Converts angle to range [0,360] degrees. + /// + /// \return reference to this object + Angle &normalize(); + + /// \brief Converts angle to range [-180,180] degrees. + /// + /// \return reference to this object + Angle &normalize_180(); + + /// \brief += operator. + void operator += (const Angle &angle); + + /// \brief -= operator. + void operator -= (const Angle &angle); + + /// \brief *= operator. + void operator *= (const Angle &angle); + + /// \brief /= operator. + void operator /= (const Angle &angle); + + /// \brief + operator. + Angle operator + (const Angle &angle) const; + + /// \brief - operator. + Angle operator - (const Angle &angle) const; + + /// \brief * operator. + Angle operator * (const Angle &angle) const; + + /// \brief * operator. + Angle operator * (float value) const; + + /// \brief / operator. + Angle operator / (const Angle &angle) const; + + /// \brief / operator. + Angle operator / (float value) const; + + /// \brief < operator. + bool operator < (const Angle &angle) const; + + /// \brief < operator. + bool operator <= (const Angle &angle) const; + + /// \brief > operator. + bool operator > (const Angle &angle) const; + + /// \brief > operator. + bool operator >= (const Angle &angle) const; + + /// \brief == operator. + bool operator== (const Angle &angle) const; + + /// \brief != operator. + bool operator!= (const Angle &angle) const; + + private: + float value_rad; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/base64_decoder.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/base64_decoder.h new file mode 100644 index 0000000..6fa2bcf --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/base64_decoder.h @@ -0,0 +1,79 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + class DataBuffer; + class Base64Decoder_Impl; + + /// \brief Base64 decoder class. + class Base64Decoder + { + public: + /// \brief Constructs a base64 decoder. + Base64Decoder(); + + /// \brief Returns the decoded data. + DataBuffer &get_result(); + + /// \brief Resets the decoder. + void reset(); + + /// \brief Feeds the decoder with base64 encoded data. + void feed(const void *data, int size, bool append_result = true); + + /// \brief Decode base64 data and return it in a buffer. + static DataBuffer decode(const void *data, int size); + + /// \brief Decode + /// + /// \param data = String Ref8 + /// + /// \return Data Buffer + static DataBuffer decode(const std::string &data); + + /// \brief Decode + /// + /// \param data = Data Buffer + /// + /// \return Data Buffer + static DataBuffer decode(const DataBuffer &data); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/base64_encoder.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/base64_encoder.h new file mode 100644 index 0000000..b92ed9c --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/base64_encoder.h @@ -0,0 +1,83 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + class DataBuffer; + class Base64Encoder_Impl; + + /// \brief Base64 encoder class. + class Base64Encoder + { + public: + /// \brief Constructs a base64 encoder. + Base64Encoder(); + + /// \brief Returns the data in encoded form. + DataBuffer &get_result(); + + /// \brief Resets the encoder. + void reset(); + + /// \brief Feeds the encoder with more data. + void feed(const void *data, int size, bool append_result = true); + + /// \brief Ends the base64 encoding. + void finalize(bool append_result = true); + + /// \brief Base64 encodes data and returns it as an 8 bit string. + static std::string encode(const void *data, int size); + + /// \brief Encode + /// + /// \param data = String Ref8 + /// + /// \return String8 + static std::string encode(const std::string &data); + + /// \brief Encode + /// + /// \param data = Data Buffer + /// + /// \return String8 + static std::string encode(const DataBuffer &data); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/bezier_curve.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/bezier_curve.h new file mode 100644 index 0000000..bca06a1 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/bezier_curve.h @@ -0,0 +1,72 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +** Magnus Norddahl +*/ + +#pragma once + +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + class BezierCurve_Impl; + class Pointf; + class Angle; + + /// \brief Bezier curve generator. + class BezierCurve + { + public: + /// \brief Constructs a bezier curve generator. + BezierCurve(); + + virtual ~BezierCurve(); + + /// \brief Returns the control points of the bezier. + std::vector get_control_points() const; + + /// \brief Adds a control point to bezier. + void add_control_point(float x, float y); + + void add_control_point(const Pointf &); + + /// \brief Generates points on the bezier curve. + std::vector generate_curve_points(const Angle &split_angle); + + /// \brief Get a point on the bezier curve. + Pointf get_point_relative(float pos_0_to_1) const; + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/big_int.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/big_int.h new file mode 100644 index 0000000..835bae6 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/big_int.h @@ -0,0 +1,258 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +** Michael J. Fromberger +*/ + +// This class is based on the original MPI library (not NSS, because of license restrictions) with some modifications. +// Some ideas and algorithms are from NSS (Netscape Security Suite). Where they have been used, the function contains a reference note +// +// Note, since September 2011, I believe the MPI homepage is now: http://spinning-yarns.org/michael/mpi/ +// Note, since 2013, the MPI page no longer exists, however the internet archive has the details here: http://web.archive.org/web/20100426001741/http://spinning-yarns.org/michael/mpi/README +// The license is as follows +// This software was written by Michael J. Fromberger, +// http://www.dartmouth.edu/~sting/ +// +// See the MPI home page at +// http://www.dartmouth.edu/~sting/mpi/ +// +// This software is in the public domain. It is entirely free, and you +// may use it and/or redistribute it for whatever purpose you choose; +// however, as free software, it is provided without warranty of any +// kind, not even the implied warranty of merchantability or fitness for +// a particular purpose. + + +#pragma once + +#include "../System/cl_platform.h" +#include + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + class BigInt_Impl; + + /// \brief Big Integer class + class BigInt + { + public: + /// \brief Constructs a big integer (initialised to zero) + BigInt(); + + /// \brief Constructs a big integer (initialised to value) + explicit BigInt(uint32_t value); + + /// \brief Constructs a big integer (initialised to value) + explicit BigInt(int32_t value); + + /// \brief Constructs a big integer (initialised to value) + explicit BigInt(uint64_t value); + + /// \brief Constructs a big integer (initialised to value) + explicit BigInt(int64_t value); + + /// \brief Copy constructor + BigInt(const BigInt &other); + + /// \brief Destructor + ~BigInt(); + + BigInt &operator=(const BigInt& other); + + void read_unsigned_octets(const unsigned char *input_str, unsigned int input_length); + + void zero(); + + bool make_prime(unsigned int num_bits); + + /// \brief Compare a <=> 0. Returns <0 if a<0, 0 if a=0, >0 if a>0. + int cmp_z() const; + + void set_bit(unsigned int bit_number, unsigned int value); + + int significant_bits() const; + + void sieve(const uint32_t *primes, unsigned int num_primes, std::vector &sieve); + + /// \brief Compute c = a (mod d). Result will always be 0 <= c < d + uint32_t mod_d(uint32_t d) const; + + /// \brief Compute the quotient q = a / d and remainder r = a mod d, for a single digit d. Respects the sign of its divisor (single digits are unsigned anyway). + void div_d(uint32_t d, BigInt *q, uint32_t *r) const; + + /// \brief Using w as a witness, try pseudo-primality testing based on Fermat's little theorem. + /// + /// If a is prime, and (w, a) = 1, then w^a == w (mod a). + /// So, we compute z = w^a (mod a) and compare z to w; if they are + /// equal, the test passes and we return true. Otherwise, we return false. + bool fermat(uint32_t w) const; + + /// \brief Performs nt iteration of the Miller-Rabin probabilistic primality test on a. + /// + /// Returns true if the tests pass, false if one fails. + /// If false is returned, the number is definitely composite. If true + bool pprime(int nt) const; + + /// \brief Sets a value + void set(int32_t d); + void set(uint32_t d); + void set(uint64_t d); + void set(int64_t d); + + /// \brief Gets a value. + /// + /// Throws exception if number exceeds datatype bounds + void get(uint32_t &d); + void get(uint64_t &d); + void get(int64_t &d); + void get(int32_t &d); + + /// \brief Compute c = (a ** b) mod m. + /// + /// Uses a standard square-and-multiply + /// method with modular reductions at each step. (This is basically the + /// same code as expt(), except for the addition of the reductions) + /// + /// The modular reductions are done using Barrett's algorithm (see reduce() for details) + void exptmod(const BigInt *b, const BigInt *m, BigInt *c) const; + + /// \brief Compute c = a (mod m). Result will always be 0 <= c < m. + void mod(const BigInt *m, BigInt *c) const; + + /// \brief Compute q = a / b and r = a mod b. + /// + /// Input parameters may be re-used + /// as output parameters. If q or r is NULL, that portion of the + /// computation will be discarded (although it will still be computed) + void div(const BigInt &b, BigInt *q, BigInt *r) const; + void div(uint32_t d, BigInt *q, BigInt *r) const; + + /// \brief Compute result = this + b. + BigInt operator + (const BigInt& b); + BigInt operator + (uint32_t d); + + /// \brief Compute this += b. + BigInt operator += (const BigInt& b); + BigInt operator += (uint32_t d); + + /// \brief Compute result = this - b. + BigInt operator - (const BigInt& b); + BigInt operator - (uint32_t d); + + /// \brief Compute this -= b. + BigInt operator -= (const BigInt& b); + BigInt operator -= (uint32_t d); + + /// \brief Compute result = this * b. + BigInt operator * (const BigInt& b); + BigInt operator * (uint32_t d); + + /// \brief Compute this *= b. + BigInt operator *= (const BigInt& b); + BigInt operator *= (uint32_t d); + + /// \brief Compute result = this / b. + BigInt operator / (const BigInt& b); + BigInt operator / (uint32_t d); + + /// \brief Compute this /= b. + BigInt operator /= (const BigInt& b); + BigInt operator /= (uint32_t d); + + /// \brief Compute result = this % b. + BigInt operator % (const BigInt& b); + BigInt operator % (uint32_t d); + + /// \brief Compute this %= b. + BigInt operator %= (const BigInt& b); + BigInt operator %= (uint32_t d); + + int cmp(const BigInt *b) const; + + /// \brief Compare a <=> d. Returns <0 if a0 if a>d + int cmp_d(uint32_t d) const; + + /// \brief Compute b = -a. 'a' and 'b' may be identical. + void neg(BigInt *b) const; + + unsigned int trailing_zeros() const; + + void sqrmod(const BigInt *m, BigInt *c) const; + void sqr(BigInt *b) const; + + /// \brief Assigns a random value to a. + /// + /// This value is generated using the + /// standard C library's rand() function, so it should not be used for + /// cryptographic purposes, but it should be fine for primality testing, + /// since all we really care about there is reasonable statistical + /// properties. + /// As many digits as a currently has are filled with random digits. + void random(); + + /// \brief Exchange mp1 and mp2 without allocating any intermediate memory + /// + /// (well, unless you count the stack space needed for this call and the + /// locals it creates...). This cannot fail. + void exch(BigInt *mp2); + + /// \brief Compute c = a^-1 (mod m), if there is an inverse for a (mod m). + /// + /// This is equivalent to the question of whether (a, m) = 1. If not, + /// false is returned, and there is no inverse. + bool invmod(const BigInt *m, BigInt *c) const; + + /// \brief Compute g = (a, b) and values x and y satisfying Bezout's identity + /// + /// (that is, ax + by = g). This uses the extended binary GCD algorithm + /// based on the Stein algorithm used for mp_gcd() + void xgcd(const BigInt *b, BigInt *g, BigInt *x, BigInt *y) const; + + /// \brief Compute b = |a|. 'a' and 'b' may be identical. + void abs(BigInt *b) const; + + /// \brief Returns a true if number is even + bool is_even() const; + + /// \brief Returns a true if number is odd + bool is_odd() const; + + /// \brief Compute c = a / 2, disregarding the remainder. + void div_2(BigInt *c) const; + + void to_unsigned_octets(unsigned char *output_str, unsigned int output_length) const; + + int unsigned_octet_size() const; + + private: + std::unique_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/circle.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/circle.h new file mode 100644 index 0000000..db05b47 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/circle.h @@ -0,0 +1,95 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +** Mark Page +*/ + +#pragma once + +#include "point.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + /// \brief Circle + /// + /// These circle templates are defined for: int (Circle), float (Circlef), double (Circled) + template + class Circlex + { + public: + /// \brief Circle center point + Vec2 position; + + /// \brief Circle radius + Type radius; + + Circlex(Type x, Type y, Type radius) : position(x, y), radius(radius) { } + Circlex(const Vec2 &p, Type radius) : position(p), radius(radius) { } + Circlex() : position(), radius(static_cast (0)) { } + Circlex(const Circlex ©) : position(copy.position), radius(copy.radius) {} + + bool is_inside(const Vec2 &point) { return radius >= position.distance(point); } + + Circlex &operator = (const Circlex& copy) { position = copy.position; radius = copy.radius; return *this; } + bool operator == (const Circlex& circle) const { return ((position == circle.position) && (radius == circle.radius)); } + bool operator != (const Circlex& circle) const { return ((position != circle.position) || (radius != circle.radius)); } + }; + + /// \brief Circle - Integer + class Circle : public Circlex + { + public: + Circle(int x, int y, int radius) : Circlex(x, y, radius) { } + Circle(const Vec2 &p, int radius) : Circlex(p, radius) { } + Circle() : Circlex(){ } + Circle(const Circlex ©) : Circlex(copy){ } + }; + + /// \brief Circle - Float + class Circlef : public Circlex + { + public: + Circlef(float x, float y, float radius) : Circlex(x, y, radius) { } + Circlef(const Vec2 &p, float radius) : Circlex(p, radius) { } + Circlef() : Circlex(){ } + Circlef(const Circlex ©) : Circlex(copy){ } + }; + + /// \brief Circle - Double + class Circled : public Circlex + { + public: + Circled(double x, double y, double radius) : Circlex(x, y, radius) { } + Circled(const Vec2 &p, double radius) : Circlex(p, radius) { } + Circled() : Circlex(){ } + Circled(const Circlex ©) : Circlex(copy){ } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/cl_math.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/cl_math.h new file mode 100644 index 0000000..8c19273 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/cl_math.h @@ -0,0 +1,201 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../System/cl_platform.h" +#include "vec4.h" +#include + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + template + std::unique_ptr make_unique(Args&& ...args) + { + return std::unique_ptr(new T(std::forward(args)...)); + } + + #undef pow2 + #undef min + #undef max + + template + inline T pow2(T value) + { + return value*value; + } + + template inline A min(A a, B b) { return a < b ? a : b; } + template inline A max(A a, B b) { return a > b ? a : b; } + + template + inline Vec2 min(Vec2 a, Vec2 b) + { + return Vec2(min(a.x, b.x), min(a.y, b.y)); + } + + template + inline Vec3 min(Vec3 a, Vec3 b) + { + return Vec3(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z)); + } + + template + inline Vec4 min(Vec4 a, Vec4 b) + { + return Vec4(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w)); + } + + template + inline Vec2 max(Vec2 a, Vec2 b) + { + return Vec2(max(a.x, b.x), max(a.y, b.y)); + } + + template + inline Vec3 max(Vec3 a, Vec3 b) + { + return Vec3(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z)); + } + + template + inline Vec4 max(Vec4 a, Vec4 b) + { + return Vec4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w)); + } + + template + inline C clamp(A val, B minval, C maxval) + { + return max((A)minval, min((A)maxval, val)); + } + + template + inline A mix(A a, B b, C mix) + { + return a * (C(1) - mix) + b * mix; + } + + inline int sign(int x) + { + if (x < 0) + return -1; + else if (x > 0) + return 1; + else + return 0; + } + + inline float sign(float x) + { + if (x < 0.0f) + return -1.0f; + else if (x > 0.0f) + return 1.0f; + else + return 0.0f; + } + + inline double sign(double x) + { + if (x < 0.0) + return -1.0; + else if (x > 0.0) + return 1.0; + else + return 0.0; + } + + template + inline Vec2 sign(const Vec2 &x) + { + return Vec2(sign(x.x), sign(x.y)); + } + + template + inline Vec3 sign(const Vec3 &x) + { + return Vec3(sign(x.x), sign(x.y), sign(x.z)); + } + + template + inline Vec4 sign(const Vec4 &x) + { + return Vec4(sign(x.x), sign(x.y), sign(x.z), sign(x.w)); + } + + template inline C smoothstep(A edge0, B edge1, C x) + { + C t = clamp((x - edge0) / (edge1 - edge0), C(0), C(1)); + return t * t * (C(3) - C(2) * t); + } + + inline int step(int edge, int x) + { + return x < edge ? 0 : 1; + } + + inline long long step(long long edge, long long x) + { + return x < edge ? 0 : 1; + } + + inline float step(float edge, float x) + { + return x < edge ? 0.0f : 1.0f; + } + + inline double step(double edge, double x) + { + return x < edge ? 0.0 : 1.0; + } + + template + inline Vec2 step(const Vec2 &edge, const Vec2 &x) + { + return Vec2(step(edge.x, x.x), step(edge.y, x.y)); + } + + template + inline Vec3 step(const Vec3 &edge, const Vec3 &x) + { + return Vec3(step(edge.x, x.x), step(edge.y, x.y), step(edge.z, x.z)); + } + + template + inline Vec4 step(const Vec4 &edge, const Vec4 &x) + { + return Vec4(step(edge.x, x.x), step(edge.y, x.y), step(edge.z, x.z), step(edge.w, x.w)); + } + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/delauney_triangulator.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/delauney_triangulator.h new file mode 100644 index 0000000..c45b7f2 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/delauney_triangulator.h @@ -0,0 +1,99 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + /// \brief Vertex in the delauney triangulation. + class DelauneyTriangulator_Vertex + { + public: + /// \brief Data pointer given when adding the vertex. + void *data; + + /// \brief X position of vertex. + float x; + + /// \brief Y position of vertex. + float y; + }; + + /// \brief Triangle generated from a delauney triangulation. + class DelauneyTriangulator_Triangle + { + public: + /// \brief First point in the triangle. + DelauneyTriangulator_Vertex *vertex_A; + + /// \brief Second point in the triangle. + DelauneyTriangulator_Vertex *vertex_B; + + /// \brief Third point in the triangle. + DelauneyTriangulator_Vertex *vertex_C; + }; + + class DelauneyTriangulator_Impl; + + /// \brief Delauney triangulator. + /// + ///

This class uses the + /// delauney triangulation algorithm to produce + /// triangles between a list of points.

+ class DelauneyTriangulator + { + public: + /// \brief Creates a triangulator object. + DelauneyTriangulator(); + + virtual ~DelauneyTriangulator(); + + /// \brief Returns the list of vertices in the triangulation. + const std::vector &get_vertices() const; + + /// \brief Returns the resulting triangles produced from triangulation. + const std::vector &get_triangles() const; + + /// \brief This function specifies a point to be used in the triangulation. + void add_vertex(float x, float y, void *data); + + /// \brief Converts passed points into triangles. + void generate(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/ear_clip_result.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/ear_clip_result.h new file mode 100644 index 0000000..938d2d6 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/ear_clip_result.h @@ -0,0 +1,63 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ + +#pragma once + +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + class EarClipResult_Impl; + class EarClipTriangulator_Triangle; + + /// \brief Ear clipping triangulation result structure. + class EarClipResult + { + public: + /// \brief Constructs an ear clipping result structure. + EarClipResult(int num_triangles); + + virtual ~EarClipResult(); + + /// \brief Returns the triangles for this result. + std::vector &get_triangles(); + + /// \brief return a reference to a triangle in the triangulation. + /** Memory is preallocated for all triangles at creation. Use the returned reference to modify the triangles.*/ + EarClipTriangulator_Triangle &get_triangle(int index); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/ear_clip_triangulator.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/ear_clip_triangulator.h new file mode 100644 index 0000000..bc5ecbf --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/ear_clip_triangulator.h @@ -0,0 +1,103 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ + +#pragma once + +#include +#include "../Math/point.h" +#include + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + /// \brief EarClipTriangulator_Triangle + class EarClipTriangulator_Triangle + { + public: + float x1, y1, x2, y2, x3, y3; + }; + + class EarClipTriangulator_Impl; + class EarClipResult; + + /// \brief Polygon orientations. + enum PolygonOrientation + { + cl_clockwise, + cl_counter_clockwise + }; + + /// \brief Ear-clipping triangulator. + class EarClipTriangulator + { + public: + /// \brief Constructs a triangulator. + EarClipTriangulator(); + + virtual ~EarClipTriangulator(); + + /// \brief Returns a list of the vertices added to the triangulator. + std::vector get_vertices(); + + /// \brief Returns the number of vertices in the triangulator. + int get_vertice_count(); + + /// \brief Determine the orientation of the vertices in the triangulator. + PolygonOrientation calculate_polygon_orientation(); + + /// \brief Add the next vertex of the polygon to the triangulator. + void add_vertex(float x, float y); + + /// \brief Add vertex + /// + /// \param p = Pointf + void add_vertex(const Pointf &p); + + /// \brief Remove all vertices from triangulator. + void clear(); + + /// \brief Set polygon orientation. + void set_orientation(PolygonOrientation orientation); + + /// \brief Perform triangulation. + EarClipResult triangulate(); + + /// \brief Mark beginning of a polygon hole. + void begin_hole(); + + /// \brief Mark ending of a polygon hole. + void end_hole(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/easing.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/easing.h new file mode 100644 index 0000000..dc732be --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/easing.h @@ -0,0 +1,45 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +namespace clan +{ + class Easing + { + public: + static float linear(float t); + static float easeout(float t); + static float easein(float t); + static float easeinout(float t); + static float backin(float t); + static float backout(float t); + static float elastic(float t); + static float bounce(float t); + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/frustum_planes.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/frustum_planes.h new file mode 100644 index 0000000..b73dadb --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/frustum_planes.h @@ -0,0 +1,52 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "mat4.h" +#include "vec4.h" + +namespace clan +{ + class FrustumPlanes + { + public: + FrustumPlanes(); + explicit FrustumPlanes(const Mat4f &world_to_projection); + + Vec4f planes[6]; + + private: + static Vec4f left_frustum_plane(const Mat4f &matrix); + static Vec4f right_frustum_plane(const Mat4f &matrix); + static Vec4f top_frustum_plane(const Mat4f &matrix); + static Vec4f bottom_frustum_plane(const Mat4f &matrix); + static Vec4f near_frustum_plane(const Mat4f &matrix); + static Vec4f far_frustum_plane(const Mat4f &matrix); + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/half_float.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/half_float.h new file mode 100644 index 0000000..18ddf27 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/half_float.h @@ -0,0 +1,120 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + class HalfFloat + { + public: + HalfFloat() : value(0) + { + } + + HalfFloat(const HalfFloat &other) : value(other.value) + { + } + + HalfFloat(float v) : value(float_to_half(v)) + { + } + + HalfFloat &operator =(const HalfFloat &other) + { + value = other.value; + return *this; + } + + HalfFloat &operator =(const float v) + { + return from_float(v); + } + + operator float() const + { + return to_float(); + } + + float to_float() const + { + return half_to_float(value); + } + + HalfFloat &from_float(float v) + { + value = float_to_half(v); + return *this; + } + + /// Only works for 'normal' half-float values + static float half_to_float_simple(unsigned short hf) + { + unsigned int float_value = ((hf & 0x8000) << 16) | (((hf & 0x7c00) + 0x1C000) << 13) | ((hf & 0x03FF) << 13); + void *ptr = static_cast(&float_value); + return *static_cast(ptr); + } + + /// Only works for 'normal' half-float values + static unsigned short float_to_half_simple(float float_value) + { + void *ptr = static_cast(&float_value); + unsigned int f = *static_cast(ptr); + return ((f >> 16) & 0x8000) | ((((f & 0x7f800000) - 0x38000000) >> 13) & 0x7c00) | ((f >> 13) & 0x03ff); + } + + static float half_to_float(unsigned short hf) + { + unsigned int float_value = mantissa_table[offset_table[hf >> 10] + (hf & 0x3ff)] + exponent_table[hf >> 10]; + void *ptr = static_cast(&float_value); + return *static_cast(ptr); + } + + static unsigned short float_to_half(float float_value) + { + void *ptr = static_cast(&float_value); + unsigned int f = *static_cast(ptr); + return base_table[(f >> 23) & 0x1ff] + ((f & 0x007fffff) >> shift_table[(f >> 23) & 0x1ff]); + } + + private: + unsigned short value; + + static unsigned int mantissa_table[2048]; + static unsigned int exponent_table[64]; + static unsigned short offset_table[64]; + + static unsigned short base_table[512]; + static unsigned char shift_table[512]; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/half_float_vector.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/half_float_vector.h new file mode 100644 index 0000000..5bc4614 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/half_float_vector.h @@ -0,0 +1,151 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include "half_float.h" +#include "vec2.h" +#include "vec3.h" +#include "vec4.h" +#include "point.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + class Vec2hf; + class Vec3hf; + class Vec4hf; + + /// \brief 2D half-float vector + class Vec2hf + { + public: + HalfFloat x; + HalfFloat y; + + Vec2hf() : x(), y() { } + + explicit Vec2hf(const HalfFloat &scalar) : x(scalar), y(scalar) { } + explicit Vec2hf(const Vec3hf ©); + explicit Vec2hf(const Vec4hf ©); + explicit Vec2hf(const HalfFloat &p1, const HalfFloat &p2) : x(p1), y(p2) { } + explicit Vec2hf(const HalfFloat *array_xy) : x(array_xy[0]), y(array_xy[1]) { } + + explicit Vec2hf(float scalar) : x(scalar), y(scalar) { } + explicit Vec2hf(const Vec3f ©) : x(copy.x), y(copy.y) { } + explicit Vec2hf(const Vec4f ©) : x(copy.x), y(copy.y) { } + explicit Vec2hf(float p1, float p2) : x(p1), y(p2) { } + explicit Vec2hf(float *array_xy) : x(array_xy[0]), y(array_xy[1]) { } + explicit Vec2hf(const Pointx &point) : x(static_cast (point.x)), y(static_cast (point.y)) { } + explicit Vec2hf(const Pointx &point) : x(point.x), y(point.y) { } + explicit Vec2hf(const Pointx &point) : x(static_cast (point.x)), y(static_cast (point.y)) { } + + Vec2hf(const Vec2hf ©) : x(copy.x), y(copy.y) { } + Vec2hf(const Vec2d ©) : x((float)copy.x), y((float)copy.y) { } + Vec2hf(const Vec2f ©) : x(copy.x), y(copy.y) { } + Vec2hf(const Vec2i ©) : x((float)copy.x), y((float)copy.y) { } + + public: + operator Vec2f() const { return to_float(); } + Vec2f to_float() const { return Vec2f((float)x, (float)y); } + }; + + /// \brief 3D half-float vector + class Vec3hf + { + public: + HalfFloat x; + HalfFloat y; + HalfFloat z; + + Vec3hf() : x(), y(), z() { } + explicit Vec3hf(const HalfFloat &scalar) : x(scalar), y(scalar), z(scalar) { } + explicit Vec3hf(const Vec2hf ©, const HalfFloat &p3) : x(copy.x), y(copy.y), z(p3) { } + explicit Vec3hf(const Vec4hf ©); + explicit Vec3hf(const HalfFloat &p1, const HalfFloat &p2, const HalfFloat &p3) : x(p1), y(p2), z(p3) { } + explicit Vec3hf(const HalfFloat *array_xyz) : x(array_xyz[0]), y(array_xyz[1]), z(array_xyz[2]) { } + + explicit Vec3hf(float scalar) : x(scalar), y(scalar), z(scalar) { } + explicit Vec3hf(const Vec2f ©, float p3) : x(copy.x), y(copy.y), z(p3) { } + explicit Vec3hf(const Vec4f ©) : x(copy.x), y(copy.y), z(copy.z) { } + explicit Vec3hf(float p1, float p2, float p3) : x(p1), y(p2), z(p3) { } + explicit Vec3hf(const float *array_xyz) : x(array_xyz[0]), y(array_xyz[1]), z(array_xyz[2]){ } + + Vec3hf(const Vec3hf ©) : x(copy.x), y(copy.y), z(copy.z) { } + Vec3hf(const Vec3d ©) : x((float)copy.x), y((float)copy.y), z((float)copy.z) { } + Vec3hf(const Vec3f ©) : x(copy.x), y(copy.y), z(copy.z) { } + Vec3hf(const Vec3i ©) : x((float)copy.x), y((float)copy.y), z((float)copy.z) { } + + public: + operator Vec3f() const { return to_float(); } + Vec3f to_float() const { return Vec3f((float)x, (float)y, (float)z); } + }; + + /// \brief 4D half-float vector + class Vec4hf + { + public: + HalfFloat x; + HalfFloat y; + HalfFloat z; + HalfFloat w; + + Vec4hf() : x(), y(), z(), w() { } + explicit Vec4hf(const Vec4f ©) : x(copy.x), y(copy.y), z(copy.z), w(copy.w) { } + + explicit Vec4hf(const HalfFloat &scalar) : x(scalar), y(scalar), z(scalar), w(scalar) { } + explicit Vec4hf(const Vec2hf ©, const HalfFloat &p3, const HalfFloat &p4) : x(copy.x), y(copy.y), z(p3), w(p4) { } + explicit Vec4hf(const Vec2hf ©, const Vec2hf ©34) : x(copy.x), y(copy.y), z(copy34.x), w(copy34.y) { } + explicit Vec4hf(const Vec3hf ©, const HalfFloat &p4) : x(copy.x), y(copy.y), z(copy.z), w(p4) { } + explicit Vec4hf(const HalfFloat &p1, const HalfFloat &p2, const HalfFloat &p3, const HalfFloat &p4) : x(p1), y(p2), z(p3), w(p4) { } + explicit Vec4hf(const HalfFloat &p1, const HalfFloat &p2, const Vec2hf ©34) : x(p1), y(p2), z(copy34.x), w(copy34.y) { } + explicit Vec4hf(const HalfFloat *array_xyzw) : x(array_xyzw[0]), y(array_xyzw[1]), z(array_xyzw[2]), w(array_xyzw[3]) { } + + explicit Vec4hf(float scalar) : x(scalar), y(scalar), z(scalar), w(scalar) { } + explicit Vec4hf(const Vec2f ©, float p3, float p4) : x(copy.x), y(copy.y), z(p3), w(p4) { } + explicit Vec4hf(const Vec2f ©, const Vec2f ©34) : x(copy.x), y(copy.y), z(copy34.x), w(copy34.y) { } + explicit Vec4hf(const Vec3f ©, float p4) : x(copy.x), y(copy.y), z(copy.z), w(p4) { } + explicit Vec4hf(float p1, float p2, float p3, float p4) : x(p1), y(p2), z(p3), w(p4) { } + explicit Vec4hf(float p1, float p2, const Vec2f ©34) : x(p1), y(p2), z(copy34.x), w(copy34.y) { } + explicit Vec4hf(const float *array_xyzw) : x(array_xyzw[0]), y(array_xyzw[1]), z(array_xyzw[2]), w(array_xyzw[3]) { } + + public: + operator Vec4f() const { return to_float(); } + Vec4f to_float() const { return Vec4f((float)x, (float)y, (float)z, (float)w); } + }; + + inline Vec2hf::Vec2hf(const Vec3hf ©) : x(copy.x), y(copy.y) {} + inline Vec2hf::Vec2hf(const Vec4hf ©) : x(copy.x), y(copy.y) {} + + inline Vec3hf::Vec3hf(const Vec4hf ©) : x(copy.x), y(copy.y), z(copy.z) {} + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/intersection_test.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/intersection_test.h new file mode 100644 index 0000000..d1773e4 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/intersection_test.h @@ -0,0 +1,70 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "vec4.h" +#include "vec3.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + class AxisAlignedBoundingBox; + class OrientedBoundingBox; + class FrustumPlanes; + + class IntersectionTest + { + public: + enum Result + { + outside, + inside, + intersecting, + }; + + enum OverlapResult + { + disjoint, + overlap + }; + + static Result plane_aabb(const Vec4f &plane, const AxisAlignedBoundingBox &aabb); + static Result plane_obb(const Vec4f &plane, const OrientedBoundingBox &obb); + static OverlapResult sphere(const Vec3f ¢er1, float radius1, const Vec3f ¢er2, float radius2); + static OverlapResult sphere_aabb(const Vec3f ¢er, float radius, const AxisAlignedBoundingBox &aabb); + static OverlapResult aabb(const AxisAlignedBoundingBox &a, const AxisAlignedBoundingBox &b); + static Result frustum_aabb(const FrustumPlanes &frustum, const AxisAlignedBoundingBox &box); + static Result frustum_obb(const FrustumPlanes &frustum, const OrientedBoundingBox &box); + static OverlapResult ray_aabb(const Vec3f &ray_start, const Vec3f &ray_end, const AxisAlignedBoundingBox &box); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line.h new file mode 100644 index 0000000..101a3ea --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line.h @@ -0,0 +1,181 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + template + class Line2x; + + template + class Line3x; + + template + class Rectx; + + template + class Vec2; + + class Angle; + + /// \brief 3D line + /// + /// These line templates are defined for: int (Line3), float (Line3f), double (Line3d) + template + class Line3x + { + public: + Vec3 p; + Vec3 q; + + Line3x() : p(), q() {} + Line3x(const Line3x ©) : p(copy.p), q(copy.q) {} + Line3x(const Vec3 &point_p, const Vec3 &point_q) : p(point_p), q(point_q) {} + + /// \brief Return the intersection of this and other line + /// + /// \param second = The second line to use + /// \param intersect = On Return: true if the lines intersect, false if the lines are parallel + /// \param range = Rounding error delta, to use to judge whether of not the lines intersect + /// \return The point + Vec3 get_intersection(const Line3x &second, bool &intersect, Type range = (Type) 0.5) const; + + /// \brief = operator. + Line3x &operator = (const Line3x& copy) { p = copy.p; q = copy.q; return *this; } + + /// \brief == operator. + bool operator == (const Line3x& line) const { return ((p == line.p) && (q == line.q)); } + + /// \brief != operator. + bool operator != (const Line3x& line) const { return ((p != line.p) || (q != line.q)); } + }; + + /// \brief 2D line + /// + /// These line templates are defined for: int (Line2i), float (Line2f), double (Line2d) + template + class Line2x + { + public: + /// \brief First point on the line + Vec2 p; + + // \brief Another point on the line + Vec2 q; + + Line2x() : p(), q() { } + Line2x(const Line2x ©) : p(copy.p), q(copy.q) {} + Line2x(const Vec2 &point_p, const Vec2 &point_q) : p(point_p), q(point_q) {} + Line2x(const Vec2 &point_p, Type gradient) : p(point_p), q(static_cast (1), gradient) {} + + /// \brief Return the intersection of this and other line + /// + /// \param second = The second line to use + /// \param intersect = On Return: true if the lines intersect, false if the lines are parallel + /// \return The point + Vec2 get_intersection(const Line2x &second, bool &intersect) const; + + /// \brief Return [<0, 0, >0] if the Point P is right, on or left of the line trough A,B + /// + /// \param point = The point + /// \return Value representing - left (>0), centre (=0), or right (<0) + Type point_right_of_line(Vec2 point) const { return (q.x - p.x) * (point.y - p.y) - (point.x - p.x) * (q.y - p.y); } + + /// \brief = operator. + Line2x &operator = (const Line2x& copy) { p = copy.p; q = copy.q; return *this; } + + /// \brief == operator. + bool operator == (const Line2x& line) const { return ((p == line.p) && (q == line.q)); } + + /// \brief != operator. + bool operator != (const Line2x& line) const { return ((p != line.p) || (q != line.q)); } + }; + + /// \brief 2D line - Integer + class Line2 : public Line2x + { + public: + Line2() : Line2x() { } + Line2(const Line2x ©) : Line2x(copy) { } + Line2(const Vec2 &point_p, const Vec2 &point_q) : Line2x(point_p, point_q) { } + Line2(const Vec2 &point_p, int gradient) : Line2x(point_p, gradient) { } + }; + + /// \brief 2D line - Float + class Line2f : public Line2x + { + public: + Line2f() : Line2x() { } + Line2f(const Line2x ©) : Line2x(copy) { } + Line2f(const Vec2 &point_p, const Vec2 &point_q) : Line2x(point_p, point_q) { } + Line2f(const Vec2 &point_p, float gradient) : Line2x(point_p, gradient) { } + }; + + /// \brief 2D line - Double + class Line2d : public Line2x + { + public: + Line2d() : Line2x() { } + Line2d(const Line2x ©) : Line2x(copy) { } + Line2d(const Vec2 &point_p, const Vec2 &point_q) : Line2x(point_p, point_q) { } + Line2d(const Vec2 &point_p, double gradient) : Line2x(point_p, gradient) { } + }; + + /// \brief 3D line - Integer + class Line3 : public Line3x + { + public: + Line3() : Line3x() { } + Line3(const Line3x ©) : Line3x(copy) { } + Line3(const Vec3 &point_p, const Vec3 &point_q) : Line3x(point_p, point_q) { } + }; + + /// \brief 3D line - Float + class Line3f : public Line3x + { + public: + Line3f() : Line3x() { } + Line3f(const Line3x ©) : Line3x(copy) { } + Line3f(const Vec3 &point_p, const Vec3 &point_q) : Line3x(point_p, point_q) { } + }; + + /// \brief 3D line - Double + class Line3d : public Line3x + { + public: + Line3d() : Line3x() { } + Line3d(const Line3x ©) : Line3x(copy) { } + Line3d(const Vec3 &podouble_p, const Vec3 &podouble_q) : Line3x(podouble_p, podouble_q) { } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line_math.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line_math.h new file mode 100644 index 0000000..97c3c4a --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line_math.h @@ -0,0 +1,100 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +** Magnus Norddahl +*/ + +#pragma once + +#include "point.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + /// \brief Math operations on 2D lines. + /// + /// Obsolete - Use Line, LineRay, LineSegment + class LineMath + { + public: + /// \brief Return [<0, 0, >0] if the Point P is right, on or left of the line trough A,B + /// + /// Also See Line and LineSegment + /// + /// \param x = x coordinate of the point being tested. + /// \param y = y coordinate of the point being tested. + /// \param line = The line. A pointer to a float array with the elements {x1,y1,x2,y2}. + static float point_right_of_line(float x, float y, float *line); + + /// \brief Point right of line + /// + /// \param x = value + /// \param y = value + /// \param line_x1 = value + /// \param line_y1 = value + /// \param line_x2 = value + /// \param line_y2 = value + /// + /// \return float + static float point_right_of_line(float x, float y, float line_x1, float line_y1, float line_x2, float line_y2); + + /// \brief Point right of line + /// + /// \param A = Pointf + /// \param B = Pointf + /// \param P = Pointf + /// + /// \return float + static float point_right_of_line(const Pointf &A, const Pointf &B, const Pointf &P); + + /// \brief Return the midpoint of the line from point A to point B. + /// + /// Also See LineSegment + /// + /// \param A = point A + /// \param B = point B + /// \return The point + static Pointf midpoint(const Pointf &A, const Pointf &B); + + /// \brief Return the Point on the line from A to B closest to point P + /// + /// \param P point P + /// \param A point A + /// \param B point B + static Pointf closest_point(const Pointf &P, const Pointf &A, const Pointf &B); + + /// \brief Return the relative position (0-1) of the point R on the line from A to B closest to point P + /// + /// \param P point P + /// \param A point A + /// \param B point B + static float closest_point_relative(const Pointf &P, const Pointf &A, const Pointf &B); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line_ray.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line_ray.h new file mode 100644 index 0000000..1b0fc23 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line_ray.h @@ -0,0 +1,173 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + template + class LineRay2x; + + template + class LineRay3x; + + template + class Vec2; + + template + class Vec3; + + class Angle; + + /// \brief 3D line ray + /// + /// A ray has a start point and a direction\n + /// These line templates are defined for: int (LineRay3), float (LineRay3f), double (LineRay3d) + template + class LineRay3x + { + public: + /// \brief Start point on the line ray + Vec3 p; + + // \brief Direction of the ray + Vec3 v; + + LineRay3x() : p(), v() {} + LineRay3x(const LineRay3x ©) : p(copy.p), v(copy.v) {} + LineRay3x(const Vec3 &point_p, const Vec3 &direction_v) : p(point_p), v(direction_v) {} + + /// \brief = operator. + LineRay3x &operator = (const LineRay3x& copy) { p = copy.p; v = copy.v; return *this; } + + /// \brief == operator. + bool operator == (const LineRay3x& line) const { return ((p == line.p) && (v == line.v)); } + + /// \brief != operator. + bool operator != (const LineRay3x& line) const { return ((p != line.p) || (v != line.v)); } + }; + + /// \brief 2D line ray + /// + /// A ray has a start point and a direction\n + /// These line templates are defined for: int (LineRay2i), float (LineRay2f), double (LineRay2d) + template + class LineRay2x + { + public: + /// \brief Start point on the line ray + Vec2 p; + + // \brief Direction of the ray + Vec2 v; + + LineRay2x() : p(), v() {} + LineRay2x(const LineRay2x ©) : p(copy.p), v(copy.v) {} + LineRay2x(const Vec2 &point_p, const Vec2 &direction_v) : p(point_p), v(direction_v) {} + + /// \brief = operator. + LineRay2x &operator = (const LineRay2x& copy) { p = copy.p; v = copy.v; return *this; } + + /// \brief == operator. + bool operator == (const LineRay2x& line) const { return ((p == line.p) && (v == line.v)); } + + /// \brief != operator. + bool operator != (const LineRay2x& line) const { return ((p != line.p) || (v != line.v)); } + }; + + /// \brief 2D line ray - Integer + /// + /// A ray has a start point and a direction\n + class LineRay2 : public LineRay2x + { + public: + LineRay2() : LineRay2x() {} + LineRay2(const LineRay2x ©) : LineRay2x(copy) {} + LineRay2(const Vec2 &point_p, const Vec2 &direction_v) : LineRay2x(point_p, direction_v) {} + }; + + /// \brief 2D line ray - Float + /// + /// A ray has a start point and a direction\n + class LineRay2f : public LineRay2x + { + public: + LineRay2f() : LineRay2x() {} + LineRay2f(const LineRay2x ©) : LineRay2x(copy) {} + LineRay2f(const Vec2 &point_p, const Vec2 &direction_v) : LineRay2x(point_p, direction_v) {} + }; + + /// \brief 2D line ray - Double + /// + /// A ray has a start point and a direction\n + class LineRay2d : public LineRay2x + { + public: + LineRay2d() : LineRay2x() {} + LineRay2d(const LineRay2x ©) : LineRay2x(copy) {} + LineRay2d(const Vec2 &point_p, const Vec2 &direction_v) : LineRay2x(point_p, direction_v) {} + }; + + /// \brief 3D line ray - Integer + /// + /// A ray has a start point and a direction\n + class LineRay3 : public LineRay3x + { + public: + LineRay3() : LineRay3x() {} + LineRay3(const LineRay3x ©) : LineRay3x(copy) {} + LineRay3(const Vec3 &point_p, const Vec3 &direction_v) : LineRay3x(point_p, direction_v) {} + }; + + /// \brief 3D line ray - Float + /// + /// A ray has a start point and a direction\n + class LineRay3f : public LineRay3x + { + public: + LineRay3f() : LineRay3x() {} + LineRay3f(const LineRay3x ©) : LineRay3x(copy) {} + LineRay3f(const Vec3 &point_p, const Vec3 &direction_v) : LineRay3x(point_p, direction_v) {} + }; + + /// \brief 3D line ray - Double + /// + /// A ray has a start point and a direction\n + class LineRay3d : public LineRay3x + { + public: + LineRay3d() : LineRay3x() {} + LineRay3d(const LineRay3x ©) : LineRay3x(copy) {} + LineRay3d(const Vec3 &point_p, const Vec3 &direction_v) : LineRay3x(point_p, direction_v) {} + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line_segment.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line_segment.h new file mode 100644 index 0000000..4a05378 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/line_segment.h @@ -0,0 +1,240 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + template + class LineSegment2x; + + template + class LineSegment3x; + + template + class Vec2; + + template + class Vec3; + + template + class Rectx; + + class Angle; + + /// \brief 3D line segment + /// + /// A line segment has a start point and an end point\n + /// These line templates are defined for: int (LineSegment3), float (LineSegment3f), double (LineSegment3d) + template + class LineSegment3x + { + public: + /// \brief Start point on the line + Vec3 p; + + // \brief End point on the line + Vec3 q; + + LineSegment3x() : p(), q() {} + LineSegment3x(const LineSegment3x ©) : p(copy.p), q(copy.q) {} + LineSegment3x(const Vec3 &point_p, const Vec3 &point_q) : p(point_p), q(point_q) {} + + /// \brief Get the midpoint of this line + /// + /// \return The midpoint + Vec3 get_midpoint() const { return Vec3((q.x + p.x) / ((Type)2), (q.y + p.y) / ((Type)2), (q.z + p.z) / ((Type)2)); }; + + /// \brief Calculate the distance from a line segment to a point + /// + /// \param point = The point + /// \param dest_intercept = On Return: The point on the line closest to the point + /// \return The Distance + Type point_distance(const Vec3 &point, Vec3 &dest_intercept) const; + + /// \brief = operator. + LineSegment3x &operator = (const LineSegment3x& copy) { p = copy.p; q = copy.q; return *this; } + + /// \brief == operator. + bool operator == (const LineSegment3x& line) const { return ((p == line.p) && (q == line.q)); } + + /// \brief != operator. + bool operator != (const LineSegment3x& line) const { return ((p != line.p) || (q != line.q)); } + }; + + /// \brief 2D line segment + /// + /// A line segment has a start point and an end point\n + /// These line templates are defined for: int (LineSegment2i), float (LineSegment2f), double (LineSegment2d) + template + class LineSegment2x + { + public: + /// \brief Start point on the line + Vec2 p; + + // \brief End point on the line + Vec2 q; + + LineSegment2x() : p(), q() {} + LineSegment2x(const LineSegment2x ©) : p(copy.p), q(copy.q) {} + LineSegment2x(const Vec2 &point_p, const Vec2 &point_q) : p(point_p), q(point_q) {} + + /// \brief Get the midpoint of this line + /// + /// \return The midpoint + Vec2 get_midpoint() const { return Vec2((q.x + p.x) / ((Type)2), (q.y + p.y) / ((Type)2)); }; + + /// \brief Return the distance from a point to a line. + /// + /// \param point = The point. + Type point_distance(const Vec2 &point); + + /// \brief Return true if two line segments are collinear. (All points are on the same line.) + /// + /// \param second = The second line to check with + /// \return true = They are collinear + bool collinear(const LineSegment2x &second) const; + + /// \brief Return true if two line segments intersect. + /// + /// \param second = Second line. + /// \param collinear_intersect = true if a collision is reported when all points are on the same line. + /// \return true = Intersects + bool intersects(const LineSegment2x &second, bool collinear_intersect) const; + + /// \brief Return the intersection point of two lines. + /// + /// \param second = Second line. + /// \param intersect = On Return: The intercept. If the lines are parallel, this contains this line's first point + /// \return true if the lines intersect, false if the lines are parallel + Vec2 get_intersection(const LineSegment2x &second, bool &intersect) const; + + /// \brief Return [<0, 0, >0] if the Point P is right, on or left of the line trough A,B + /// + /// \param point = The point + /// \return Value representing - left (>0), centre (=0), or right (<0) + Type point_right_of_line(const Vec2 &point) const { return (q.x - p.x) * (point.y - p.y) - (point.x - p.x) * (q.y - p.y); } + + /// \brief Return the normal vector of the line from point A to point B. + /// + /// When using Vec2i, the vector is an 8 bit fraction (multiplied by 256) + /// + /// \return The normal vector + Vec2 normal() const; + + /// \brief Clip this line to a rectangle + /// + /// If clipping was not successful, this object is undefined + /// + /// \param rect = Rectangle to clip to + /// \param clipped = On Return: true if the line could be clipped, false if line exists outside the rectangle + /// \return reference to this object + LineSegment2x &clip(const Rectx &rect, bool &clipped); + + /// \brief = operator. + LineSegment2x &operator = (const LineSegment2x& copy) { p = copy.p; q = copy.q; return *this; } + + /// \brief == operator. + bool operator == (const LineSegment2x& line) const { return ((p == line.p) && (q == line.q)); } + + /// \brief != operator. + bool operator != (const LineSegment2x& line) const { return ((p != line.p) || (q != line.q)); } + }; + + /// \brief 2D line segment - Integer + /// + /// A line segment has a start point and an end point\n + class LineSegment2 : public LineSegment2x + { + public: + LineSegment2() : LineSegment2x() {} + LineSegment2(const LineSegment2x ©) : LineSegment2x(copy) {} + LineSegment2(const Vec2 &point_p, const Vec2 &point_q) : LineSegment2x(point_p, point_q) {} + }; + + /// \brief 2D line segment - Float + /// + /// A line segment has a start point and an end point\n + class LineSegment2f : public LineSegment2x + { + public: + LineSegment2f() : LineSegment2x() {} + LineSegment2f(const LineSegment2x ©) : LineSegment2x(copy) {} + LineSegment2f(const Vec2 &point_p, const Vec2 &point_q) : LineSegment2x(point_p, point_q) {} + }; + + /// \brief 2D line segment - Double + /// + /// A line segment has a start point and an end point\n + class LineSegment2d : public LineSegment2x + { + public: + LineSegment2d() : LineSegment2x() {} + LineSegment2d(const LineSegment2x ©) : LineSegment2x(copy) {} + LineSegment2d(const Vec2 &point_p, const Vec2 &point_q) : LineSegment2x(point_p, point_q) {} + }; + + /// \brief 3D line segment - Integer + /// + /// A line segment has a start point and an end point\n + class LineSegment3 : public LineSegment3x + { + public: + LineSegment3() : LineSegment3x() {} + LineSegment3(const LineSegment3x ©) : LineSegment3x(copy) {} + LineSegment3(const Vec3 &point_p, const Vec3 &point_q) : LineSegment3x(point_p, point_q) {} + }; + + /// \brief 3D line segment - Float + /// + /// A line segment has a start point and an end point\n + class LineSegment3f : public LineSegment3x + { + public: + LineSegment3f() : LineSegment3x() {} + LineSegment3f(const LineSegment3x ©) : LineSegment3x(copy) {} + LineSegment3f(const Vec3 &point_p, const Vec3 &point_q) : LineSegment3x(point_p, point_q) {} + }; + + /// \brief 3D line segment - Double + /// + /// A line segment has a start point and an end point\n + class LineSegment3d : public LineSegment3x + { + public: + LineSegment3d() : LineSegment3x() {} + LineSegment3d(const LineSegment3x ©) : LineSegment3x(copy) {} + LineSegment3d(const Vec3 &point_p, const Vec3 &point_q) : LineSegment3x(point_p, point_q) {} + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/mat2.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/mat2.h new file mode 100644 index 0000000..6108722 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/mat2.h @@ -0,0 +1,238 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +** Harry Storbacka +*/ + +#pragma once + +#include "../System/cl_platform.h" +#include "mat3.h" +#include "mat4.h" +#include "vec2.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + template + class Mat2; + + template + class Mat3; + + template + class Mat4; + + class Angle; + + /// \brief 2D matrix + /// + /// These matrix templates are defined for: int (Mat2i), float (Mat2f), double (Mat2d) + template + class Mat2 + { + public: + /// \brief Constructs a 2x2 matrix (zero'ed) + Mat2() + { + for (auto & elem : matrix) + elem = 0; + } + /// \brief Constructs a 2x2 matrix (copied) + Mat2(const Mat2 ©) + { + for (int i = 0; i < 4; i++) + matrix[i] = copy.matrix[i]; + } + + /// \brief Constructs a 2x2 matrix (copied from a 3d matrix) + explicit Mat2(const Mat3 ©); + + /// \brief Constructs a 2x2 matrix (copied from a 4d matrix) + explicit Mat2(const Mat4 ©); + + /// \brief Constructs a 2x2 matrix (copied from 4 floats) + explicit Mat2(const float *init_matrix) + { + for (int i = 0; i < 4; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 2x2 matrix (copied from specified values) + explicit Mat2(Type m00, Type m01, Type m10, Type m11) + { + matrix[0 * 2 + 0] = m00; matrix[0 * 2 + 1] = m01; + matrix[1 * 2 + 0] = m10; matrix[1 * 2 + 1] = m11; + } + + /// \brief Constructs a 2x2 matrix (copied from 4 doubles) + explicit Mat2(const double *init_matrix) + { + for (int i = 0; i < 4; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 2x2 matrix (copied from 4, 64 bit integers) + explicit Mat2(const int64_t *init_matrix) + { + for (int i = 0; i < 4; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 2x2 matrix (copied from 4, 32 bit integers) + explicit Mat2(const int32_t *init_matrix) + { + for (int i = 0; i < 4; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 2x2 matrix (copied from 4, 16 bit integers) + explicit Mat2(const int16_t *init_matrix) + { + for (int i = 0; i < 4; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 2x2 matrix (copied from 4, 8 bit integers) + explicit Mat2(const int8_t *init_matrix) + { + for (int i = 0; i < 4; i++) + matrix[i] = (Type)init_matrix[i]; + } + + static Mat2 null(); + + static Mat2 identity(); + + /// \brief Multiply 2 matrices + /// + /// This multiplies the matrix as follows: result = matrix1 * matrix2\n + /// Matrix is multiplied in the Column-Major matrix format (opengl native) + /// + /// \param matrix_1 = First Matrix to multiply + /// \param matrix_2 = Second Matrix to multiply + /// \return The matrix + static Mat2 multiply(const Mat2 &matrix_1, const Mat2 &matrix_2); + + /// \brief Add 2 matrices + /// + /// This adds the matrix as follows: result = matrix1 + matrix2 + /// + /// \param matrix_1 = First Matrix to add + /// \param matrix_2 = Second Matrix to add + /// \return The matrix + static Mat2 add(const Mat2 &matrix_1, const Mat2 &matrix_2); + + /// \brief Subtract 2 matrices + /// + /// This subtract the matrix as follows: result = matrix1 - matrix2 + /// + /// \param matrix_1 = First Matrix to subtract + /// \param matrix_2 = Second Matrix to subtract + /// \return The matrix + static Mat2 subtract(const Mat2 &matrix_1, const Mat2 &matrix_2); + + /// \brief Returns true if equal within the bounds of an epsilon + /// + /// \param first = Value A + /// \param second = Value B + /// \param epsilon = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) + static bool is_equal(const Mat2 &first, const Mat2 &second, Type epsilon) + { + for (int i = 0; i < 4; i++) + { + Type diff = second.matrix[i] - first.matrix[i]; + if (diff < -epsilon || diff > epsilon) return false; + } + return true; + } + + /// The matrix (in column-major format) + Type matrix[4]; + + /// \brief Returns true if equal within the bounds of an epsilon + /// + /// \param other = Other value + /// \param epsilon = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) + bool is_equal(const Mat2 &other, Type epsilon) const { return Mat2::is_equal(*this, other, epsilon); } + + /// \brief Operator that returns the matrix as a array. + operator Type const*() const { return matrix; } + + /// \brief Operator that returns the matrix as a array. + operator Type *() { return matrix; } + + /// \brief Operator that returns the matrix cell at the given index. + Type &operator[](int i) { return matrix[i]; } + + /// \brief Operator that returns the matrix cell at the given index. + const Type &operator[](int i) const { return matrix[i]; } + + /// \brief Operator that returns the matrix cell at the given index. + Type &operator[](unsigned int i) { return matrix[i]; } + + /// \brief Operator that returns the matrix cell at the given index. + const Type &operator[](unsigned int i) const { return matrix[i]; } + + /// \brief Copy assignment operator. + Mat2 &operator =(const Mat2 ©) { memcpy(matrix, copy.matrix, sizeof(matrix)); return *this; } + + /// \brief Copy assignment operator. + Mat2 &operator =(const Mat4 ©); + + /// \brief Copy assignment operator. + Mat2 &operator =(const Mat3 ©); + + /// \brief Multiplication operator. + Mat2 operator *(const Mat2 &mult) const; + + /// \brief Addition operator. + Mat2 operator +(const Mat2 &add_matrix) const; + + /// \brief Subtract operator. + Mat2 operator -(const Mat2 &subtract_matrix) const; + + /// \brief Equality operator. + bool operator==(const Mat2 &other) const + { + for (int i = 0; i < 4; i++) + if (matrix[i] != other.matrix[i]) return false; + return true; + } + + /// \brief Not-equal operator. + bool operator!=(const Mat2 &other) const { return !((*this) == other); } + }; + + typedef Mat2 Mat2i; + typedef Mat2 Mat2f; + typedef Mat2 Mat2d; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/mat3.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/mat3.h new file mode 100644 index 0000000..c7160d8 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/mat3.h @@ -0,0 +1,376 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +** Harry Storbacka +*/ + +#pragma once + +#include "mat2.h" +#include "mat4.h" +#include "vec3.h" +#include "../System/cl_platform.h" +#include "angle.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + template + class Mat2; + + template + class Mat3; + + template + class Mat4; + + class Angle; + + /// \brief 3D matrix + /// + /// These matrix templates are defined for: int (Mat3i), float (Mat3f), double (Mat3d) + template + class Mat3 + { + public: + /// \brief Constructs a 3x3 matrix (zero'ed) + Mat3() + { + for (auto & elem : matrix) + elem = 0; + } + + /// \brief Constructs a 3x3 matrix (copied) + Mat3(const Mat3 ©) + { + for (int i = 0; i < 9; i++) + matrix[i] = copy.matrix[i]; + } + + /// \brief Constructs a 3x3 matrix (copied from a 2d matrix) + explicit Mat3(const Mat2 ©); + + /// \brief Constructs a 3x3 matrix (copied from a 4d matrix) + explicit Mat3(const Mat4 ©); + + /// \brief Constructs a 3x3 matrix (copied from 9 floats) + explicit Mat3(const float *init_matrix) + { + for (int i = 0; i < 9; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 3x3 matrix (copied from specified values) + explicit Mat3(Type m00, Type m01, Type m02, Type m10, Type m11, Type m12, Type m20, Type m21, Type m22) + { + matrix[0 * 3 + 0] = m00; matrix[0 * 3 + 1] = m01; matrix[0 * 3 + 2] = m02; + matrix[1 * 3 + 0] = m10; matrix[1 * 3 + 1] = m11; matrix[1 * 3 + 2] = m12; + matrix[2 * 3 + 0] = m20; matrix[2 * 3 + 1] = m21; matrix[2 * 3 + 2] = m22; + } + + /// \brief Constructs a 3x3 matrix (copied from 9 doubles) + explicit Mat3(const double *init_matrix) + { + for (int i = 0; i < 9; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 3x3 matrix (copied from 9, 64 bit integers) + explicit Mat3(const int64_t *init_matrix) + { + for (int i = 0; i < 9; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 3x3 matrix (copied from 9, 32 bit integers) + explicit Mat3(const int32_t *init_matrix) + { + for (int i = 0; i < 9; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 3x3 matrix (copied from 9, 16 bit integers) + explicit Mat3(const int16_t *init_matrix) + { + for (int i = 0; i < 9; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 3x3 matrix (copied from 9, 8 bit integers) + explicit Mat3(const int8_t *init_matrix) + { + for (int i = 0; i < 9; i++) + matrix[i] = (Type)init_matrix[i]; + } + + static Mat3 null(); + + static Mat3 identity(); + + /// \brief Create a 3d rotation matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \param angle = Angle to rotate by + /// \param x = Amount to rotate in the X axis + /// \param y = Amount to rotate in the Y axis + /// \param z = Amount to rotate in the Z axis + /// \param normalize = true = Normalize x,y,z before creating rotation matrix + /// \return The matrix (in column-major format) + static Mat3 rotate(const Angle &angle, Type x, Type y, Type z, bool normalize = true); + + /// \brief Create a 3d rotation matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \param angle = Angle to rotate by + /// \param rotation = Amount to rotate in the XYZ axes + /// \param normalize = true = Normalize x,y,z before creating rotation matrix + /// \return The matrix (in column-major format) + static Mat3 rotate(const Angle &angle, Vec3 rotation, bool normalize = true) + { + return rotate(angle, rotation.x, rotation.y, rotation.z, normalize); + } + + /// \brief Create a 3d rotation matrix using euler angles + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// + /// \return The matrix (in column-major format) + static Mat3 rotate(const Angle &angle_x, const Angle &angle_y, const Angle &angle_z, EulerOrder order); + + /// \brief Create a 2d rotation matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \param angle = Angle to rotate by + /// \return The matrix (in column-major format) + static Mat3 rotate(const Angle &angle); + + /// \brief Create a 2d scale matrix + /// + /// \param x = Scale X + /// \param y = Scale Y + /// \return The matrix + static Mat3 scale(Type x, Type y); + + /// \brief Create a 2d scale matrix + /// + /// \param xy = Scale XY + /// \return The matrix + static Mat3 scale(const Vec3 &xy) + { + return scale(xy.x, xy.y); + } + + /// \brief Create a 2d translation matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \param x = Translate X + /// \param y = Translate Y + /// \return The matrix (in column-major format) + static Mat3 translate(Type x, Type y); + + /// \brief Create a 2d translation matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \param xy = Translate XY + /// \return The matrix (in column-major format) + static Mat3 translate(const Vec2 &xy) + { + return translate(xy.x, xy.y); + } + + /// \brief Multiply 2 matrices + /// + /// This multiplies the matrix as follows: result = matrix1 * matrix2\n + /// Matrix is multiplied in the Column-Major matrix format (opengl native) + /// + /// \param matrix_1 = First Matrix to multiply + /// \param matrix_2 = Second Matrix to multiply + /// \return The matrix + static Mat3 multiply(const Mat3 &matrix_1, const Mat3 &matrix_2); + + /// \brief Add 2 matrices + /// + /// This adds the matrix as follows: result = matrix1 + matrix2 + /// + /// \param matrix_1 = First Matrix to add + /// \param matrix_2 = Second Matrix to add + /// \return The matrix + static Mat3 add(const Mat3 &matrix_1, const Mat3 &matrix_2); + + /// \brief Subtract 2 matrices + /// + /// This subtracts the matrix as follows: result = matrix1 - matrix2 + /// + /// \param matrix_1 = First Matrix to subtract + /// \param matrix_2 = Second Matrix to subtract + /// \return The matrix + static Mat3 subtract(const Mat3 &matrix_1, const Mat3 &matrix_2); + + /// \brief Calculate the adjoint (or known as Adjugate or Conjugate Transpose) of a matrix + /// + /// \param matrix = The matrix to use + /// \return The adjoint matrix + static Mat3 adjoint(const Mat3 &matrix); + + /// \brief Calculate the matrix inverse of a matrix + /// + /// Creates a zero matrix if the determinent == 0 + /// \param matrix = The matrix to use + /// \return The inversed matrix + static Mat3 inverse(const Mat3 &matrix); + + /// \brief Calculate the transpose of a matrix + /// + /// \param matrix = The matrix to use + /// \return The transposed matrix + static Mat3 transpose(const Mat3 &matrix); + + /// \brief Returns true if equal within the bounds of an epsilon + /// + /// \param first = Value A + /// \param second = Value B + /// \param epsilon = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) + static bool is_equal(const Mat3 &first, const Mat3 &second, Type epsilon) + { + for (int i = 0; i < 9; i++) + { + Type diff = second.matrix[i] - first.matrix[i]; + if (diff < -epsilon || diff > epsilon) return false; + } + return true; + } + + /// The matrix (in column-major format) + Type matrix[9]; + + /// \brief Calculate the matrix determinant + double det() const; + + /// \brief Creates the adjoint (or known as adjugate) of the matrix + /// + /// \return reference to this object + Mat3 &adjoint(); + + /// \brief Create the matrix inverse. (Returns a zero matrix if the determinent = 0) + /// + /// \return reference to this object + Mat3 &inverse(); + + /// \brief Calculate the transpose of this matrix + /// + /// \return reference to this object + Mat3 &transpose(); + + /// \brief Returns true if equal within the bounds of an epsilon + /// + /// \param other = Other value + /// \param epsilon = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) + bool is_equal(const Mat3 &other, Type epsilon) const { return Mat3::is_equal(*this, other, epsilon); } + + /// \brief Operator that returns the matrix as a array. + operator Type const*() const { return matrix; } + + /// \brief Operator that returns the matrix as a array. + operator Type *() { return matrix; } + + /// \brief Operator that returns the matrix cell at the given index. + Type &operator[](int i) { return matrix[i]; } + + /// \brief Operator that returns the matrix cell at the given index. + const Type &operator[](int i) const { return matrix[i]; } + + /// \brief Operator that returns the matrix cell at the given index. + Type &operator[](unsigned int i) { return matrix[i]; } + + /// \brief Operator that returns the matrix cell at the given index. + const Type &operator[](unsigned int i) const { return matrix[i]; } + + /// \brief Copy assignment operator. + Mat3 &operator =(const Mat3 ©) { memcpy(matrix, copy.matrix, sizeof(matrix)); return *this; } + + /// \brief Copy assignment operator. + Mat3 &operator =(const Mat4 ©); + + /// \brief Copy assignment operator. + Mat3 &operator =(const Mat2 ©); + + /// \brief Multiplication operator. + Mat3 operator *(const Mat3 &mult) const; + + /// \brief Addition operator. + Mat3 operator +(const Mat3 &add_matrix) const; + + /// \brief Subtraction operator. + Mat3 operator -(const Mat3 &sub_matrix) const; + + /// \brief Multiplication operator. + Vec2 operator *(const Vec2 &mult) const; + + /// \brief Equality operator. + bool operator==(const Mat3 &other) const + { + for (int i = 0; i < 9; i++) + if (matrix[i] != other.matrix[i]) return false; + return true; + } + + /// \brief Not-equal operator. + bool operator!=(const Mat3 &other) { return !((*this) == other); } + }; + + template + inline Mat3 Mat3::multiply(const Mat3 &matrix_1, const Mat3 &matrix_2) { return matrix_1 * matrix_2; } + + template + inline Mat3 Mat3::add(const Mat3 &matrix_1, const Mat3 &matrix_2) { return matrix_1 + matrix_2; } + + template + inline Mat3 Mat3::subtract(const Mat3 &matrix_1, const Mat3 &matrix_2) { return matrix_1 - matrix_2; } + + template + inline Mat3 Mat3::adjoint(const Mat3 &matrix) { Mat3 dest(matrix); dest.adjoint(); return dest; } + + template + inline Mat3 Mat3::inverse(const Mat3 &matrix) { Mat3 dest(matrix); dest.inverse(); return dest; } + + template + inline Mat3 Mat3::transpose(const Mat3 &matrix) { Mat3 dest(matrix); dest.transpose(); return dest; } + + template + inline Mat3 Mat3::null() { Mat3 m; memset(m.matrix, 0, sizeof(m.matrix)); return m; } + + template + inline Mat3 Mat3::identity() { Mat3 m = null(); m.matrix[0] = 1; m.matrix[4] = 1; m.matrix[8] = 1; return m; } + + typedef Mat3 Mat3i; + typedef Mat3 Mat3f; + typedef Mat3 Mat3d; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/mat4.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/mat4.h new file mode 100644 index 0000000..7542da2 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/mat4.h @@ -0,0 +1,529 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +** Harry Storbacka +*/ + +#pragma once + +#include "../System/cl_platform.h" +#include "mat2.h" +#include "mat3.h" +#include "vec3.h" +#include "angle.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + enum Handedness + { + handed_left, + handed_right + }; + + enum ClipZRange + { + clip_negative_positive_w, // OpenGL, -wclip <= zclip <= wclip + clip_zero_positive_w // Direct3D, 0 <= zclip <= wclip + }; + + template + class Mat2; + + template + class Mat3; + + template + class Mat4; + + template + class Vec3; + + template + class Quaternionx; + + class Angle; + + /// \brief 4D matrix + /// + /// These matrix templates are defined for: int (Mat4i), float (Mat4f), double (Mat4d) + template + class Mat4 + { + public: + /// \brief Constructs a 4x4 matrix (zero'ed) + Mat4() + { + for (auto & elem : matrix) + elem = 0; + } + + /// \brief Constructs a 4x4 matrix (copied) + Mat4(const Mat4 ©) + { + for (int i = 0; i < 16; i++) + matrix[i] = copy.matrix[i]; + } + + /// \brief Constructs a 4x4 matrix (copied from a 2d matrix) + explicit Mat4(const Mat2 ©); + + /// \brief Constructs a 4x4 matrix (copied from a 3d matrix) + explicit Mat4(const Mat3 ©); + + /// \brief Constructs a 4x4 matrix (copied from a array of floats) + explicit Mat4(const float *init_matrix) + { + for (int i = 0; i < 16; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 4x4 matrix (copied from a array of doubles) + explicit Mat4(const double *init_matrix) + { + for (int i = 0; i < 16; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 4x4 matrix (copied from a array of 64 bit integers) + explicit Mat4(const int64_t *init_matrix) + { + for (int i = 0; i < 16; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 4x4 matrix (copied from a array of 32 bit integers) + explicit Mat4(const int32_t *init_matrix) + { + for (int i = 0; i < 16; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 4x4 matrix (copied from a array of 16 bit integers) + explicit Mat4(const int16_t *init_matrix) + { + for (int i = 0; i < 16; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Constructs a 4x4 matrix (copied from a array of 8 bit integers) + explicit Mat4(const int8_t *init_matrix) + { + for (int i = 0; i < 16; i++) + matrix[i] = (Type)init_matrix[i]; + } + + /// \brief Create a zero matrix + /// + /// \return The matrix + static Mat4 null(); + + /// \brief Create the identity matrix + /// \return The matrix + static Mat4 identity(); + + /// \brief Create a frustum matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \return The matrix (in column-major format) + static Mat4 frustum(Type left, Type right, Type bottom, Type top, Type z_near, Type z_far, Handedness handedness, ClipZRange clip_z); + + /// \brief Create a perspective matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \return The matrix (in column-major format) + static Mat4 perspective( + Type field_of_view_y_degrees, + Type aspect, + Type z_near, + Type z_far, + Handedness handedness, + ClipZRange clip_z); + + /// \brief Create a ortho matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \return The matrix (in column-major format) + static Mat4 ortho(Type left, Type right, Type bottom, Type top, Type z_near, Type z_far, Handedness handedness, ClipZRange clip_z); + + /// \brief Create a ortho_2d matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \return The matrix (in column-major format) + static Mat4 ortho_2d(Type left, Type right, Type bottom, Type top, Handedness handedness, ClipZRange clip_z); + + /// \brief Create a rotation matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \param angle = Angle to rotate by + /// \param x = Amount to rotate in the X axis + /// \param y = Amount to rotate in the Y axis + /// \param z = Amount to rotate in the Z axis + /// \param normalize = true = Normalize x,y,z before creating rotation matrix + /// \return The matrix (in column-major format) + static Mat4 rotate(const Angle &angle, Type x, Type y, Type z, bool normalize = true); + + /// \brief Create a rotation matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \param angle = Angle to rotate by + /// \param rotate = Amount to rotate in the XYZ axes + /// \param normalize = true = Normalize x,y,z before creating rotation matrix + /// \return The matrix (in column-major format) + static Mat4 rotate(const Angle &angle, Vec3 rotation, bool normalize = true) + { + return rotate(angle, rotation.x, rotation.y, rotation.z, normalize); + } + + /// \brief Create a rotation matrix using euler angles + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// + /// \return The matrix (in column-major format) + static Mat4 rotate(const Angle &angle_x, const Angle &angle_y, const Angle &angle_z, EulerOrder order); + + /// \brief Create a scale matrix + /// + /// \param x = Scale X + /// \param y = Scale Y + /// \param z = Scale Z + /// \return The matrix + static Mat4 scale(Type x, Type y, Type z); + + /// \brief Create a scale matrix + /// + /// \param xyz = Scale XYZ + /// \return The matrix + static Mat4 scale(const Vec3 &xyz) + { + return scale(xyz.x, xyz.y, xyz.z); + } + + /// \brief Create a translation matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \param x = Translate X + /// \param y = Translate Y + /// \param z = Translate Z + /// \return The matrix (in column-major format) + static Mat4 translate(Type x, Type y, Type z); + + /// \brief Create a translation matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \param xyz = Translate XYZ + /// \return The matrix (in column-major format) + static Mat4 translate(const Vec3 &xyz) + { + return translate(xyz.x, xyz.y, xyz.z); + } + + /// \brief Create the "look at" matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \param eye_x = Eye position X + /// \param eye_y = Eye position Y + /// \param eye_z = Eye position Z + /// \param center_x = Center X + /// \param center_y = Center Y + /// \param center_z = Center Z + /// \param up_x = Camera up direction X + /// \param up_y = Camera up direction Y + /// \param up_z = Camera up direction Z + /// \return The matrix (in column-major format) + static Mat4 look_at( + Type eye_x, Type eye_y, Type eye_z, + Type center_x, Type center_y, Type center_z, + Type up_x, Type up_y, Type up_z); + + /// \brief Create the "look at" matrix + /// + /// Matrix is created in the Column-Major matrix format (opengl native) + /// \param eye = Eye position + /// \param center = Center position + /// \param up = Camera up direction + /// \return The matrix (in column-major format) + static Mat4 look_at( + Vec3 eye, + Vec3 center, + Vec3 up) + { + return look_at(eye.x, eye.y, eye.z, center.x, center.y, center.z, up.x, up.y, up.z); + } + + /// \brief Multiply 2 matrices + /// + /// This multiplies the matrix as follows: result = matrix1 * matrix2\n + /// Matrix is multiplied in the Column-Major matrix format (opengl native) + /// + /// \param matrix_1 = First Matrix to multiply + /// \param matrix_2 = Second Matrix to multiply + /// \return The matrix + static Mat4 multiply(const Mat4 &matrix_1, const Mat4 &matrix_2); + + /// \brief Add 2 matrices + /// + /// This adds the matrix as follows: result = matrix1 + matrix2 + /// + /// \param matrix_1 = First Matrix to add + /// \param matrix_2 = Second Matrix to add + /// \return The matrix + static Mat4 add(const Mat4 &matrix_1, const Mat4 &matrix_2); + + /// \brief Subtract 2 matrices + /// + /// This subtracts the matrix as follows: result = matrix1 - matrix2 + /// + /// \param matrix_1 = First Matrix to subtract + /// \param matrix_2 = Second Matrix to subtract + /// \return The matrix + static Mat4 subtract(const Mat4 &matrix_1, const Mat4 &matrix_2); + + /// \brief Calculate the adjoint (or known as Adjugate or Conjugate Transpose) of a matrix + /// + /// \param matrix = The matrix to use + /// \return The adjoint matrix + static Mat4 adjoint(const Mat4 &matrix); + + /// \brief Calculate the matrix inverse of a matrix + /// + /// Creates a zero matrix if the determinent == 0 + /// \param matrix = The matrix to use + /// \return The inversed matrix + static Mat4 inverse(const Mat4 &matrix); + + /// \brief Calculate the transpose of a matrix + /// + /// \param matrix = The matrix to use + /// \return The transposed matrix + static Mat4 transpose(const Mat4 &matrix); + + /// \brief Returns true if equal within the bounds of an epsilon + /// + /// \param first = Value A + /// \param second = Value B + /// \param epsilon = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) + static bool is_equal(const Mat4 &first, const Mat4 &second, Type epsilon) + { + for (int i = 0; i < 16; i++) + { + Type diff = second.matrix[i] - first.matrix[i]; + if (diff < -epsilon || diff > epsilon) return false; + } + return true; + } + + /// The matrix (in column-major format) + Type matrix[16]; + + /// \brief Returns the translation coordinates for this matrix (in column-major format) + Vec3 get_translate() const { return Vec3(matrix[12], matrix[13], matrix[14]); } + + /// \brief Extract the euler angles (in radians) from a matrix (in column-major format) + /// + /// \return The x,y,z angles (in radians) + Vec3 get_euler(EulerOrder order) const; + + /// \brief Get a transformed point from the matrix (in column-major format) + /// + /// \return The transformed point + Vec3 get_transformed_point(const Vec3 &vector) const; + + /// \brief Scale this matrix + /// + /// This is faster than using: multiply(Mat4::scale(x,y,z) ) + /// + /// \param x = Scale X + /// \param y = Scale Y + /// \param z = Scale Z + /// + /// \return reference to this object + Mat4 &scale_self(Type x, Type y, Type z); + + /// \brief Scale this matrix + /// + /// This is faster than using: multiply(Mat4::scale(x,y,z) ) + /// + /// \param scale = Scale XYZ + /// + /// \return reference to this object + Mat4 &scale_self(const Vec3 &scale) { return scale_self(scale.x, scale.y, scale.z); } + + /// \brief Translate this matrix + /// + /// Matrix is assumed to be in the Column-Major matrix format (opengl native)\n + /// This is faster than using: multiply(Mat4::translate(x,y,z) ) + /// + /// \param x = Translate X + /// \param y = Translate Y + /// \param z = Translate Z + /// + /// \return reference to this object + Mat4 &translate_self(Type x, Type y, Type z); + + /// \brief Translate this matrix + /// + /// Matrix is assumed to be in the Column-Major matrix format (opengl native)\n + /// This is faster than using: multiply(Mat4::translate(x,y,z) ) + /// + /// \param translation = Translate XYZ + /// + /// \return reference to this object + Mat4 &translate_self(const Vec3 &translation) { return translate_self(translation.x, translation.y, translation.z); } + + /// \brief Set this matrix translation values + /// + /// Matrix is assumed to be in the Column-Major matrix format (opengl native)\n + /// This does not translate the matrix, see translate_self() if this is desired + /// + /// \param x = Translate X + /// \param y = Translate Y + /// \param z = Translate Z + /// + /// \return reference to this object + Mat4 &set_translate(Type x, Type y, Type z) { matrix[3 * 4 + 0] = x; matrix[3 * 4 + 1] = y; matrix[3 * 4 + 2] = z; return *this; } + + /// \brief Set this matrix translation values + /// + /// Matrix is assumed to be in the Column-Major matrix format (opengl native)\n + /// This does not translate the matrix, see translate_self() if this is desired + /// + /// \param translation = Translate XYZ + /// + /// \return reference to this object + Mat4 &set_translate(const Vec3 &translation) { matrix[3 * 4 + 0] = translation.x; matrix[3 * 4 + 1] = translation.y; matrix[3 * 4 + 2] = translation.z; return *this; } + + /// \brief Calculate the matrix determinant of this matrix + /// + /// \return The determinant + double det() const; + + /// \brief Calculate the adjoint (or known as adjugate) of this matrix + /// + /// \return reference to this object + Mat4 &adjoint(); + + /// \brief Calculate the matrix inverse of this matrix + /// + /// Creates a zero matrix if the determinent == 0 + /// \return reference to this object + Mat4 &inverse(); + + /// \brief Calculate the transpose of this matrix + /// + /// \return reference to this object + Mat4 &transpose(); + + /// \brief Decompose matrix into position, orientation/rotation and scale + void decompose(Vec3 &out_position, Quaternionx &out_orientation, Vec3 &out_scale) const; + + /// \brief Returns true if equal within the bounds of an epsilon + /// + /// \param other = Other value + /// \param epsilon = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) + bool is_equal(const Mat4 &other, Type epsilon) const { return Mat4::is_equal(*this, other, epsilon); } + + /// \brief Operator that returns the matrix as a array. + operator Type const*() const { return matrix; } + + /// \brief Operator that returns the matrix as a array. + operator Type *() { return matrix; } + + /// \brief Operator that returns the matrix cell at the given index. + Type &operator[](int i) { return matrix[i]; } + + /// \brief Operator that returns the matrix cell at the given index. + const Type &operator[](int i) const { return matrix[i]; } + + /// \brief Operator that returns the matrix cell at the given index. + Type &operator[](unsigned int i) { return matrix[i]; } + + /// \brief Operator that returns the matrix cell at the given index. + const Type &operator[](unsigned int i) const { return matrix[i]; } + + /// \brief Copy assignment operator. + Mat4 &operator =(const Mat4 ©) { memcpy(matrix, copy.matrix, sizeof(matrix)); return *this; } + + /// \brief Copy assignment operator. + Mat4 &operator =(const Mat3 ©); + + /// \brief Copy assignment operator. + Mat4 &operator =(const Mat2 ©); + + /// \brief Multiplication operator. + Mat4 operator *(const Mat4 &mult) const; + + /// \brief Addition operator. + Mat4 operator +(const Mat4 &add_matrix) const; + + /// \brief Subtraction operator. + Mat4 operator -(const Mat4 &sub_matrix) const; + + /// \brief Equality operator. + bool operator==(const Mat4 &other) const + { + for (int i = 0; i < 16; i++) + if (matrix[i] != other.matrix[i]) return false; + return true; + } + + /// \brief Not-equal operator. + bool operator!=(const Mat4 &other) { return !((*this) == other); } + }; + + template + inline Mat4 Mat4::null() { Mat4 m; memset(m.matrix, 0, sizeof(m.matrix)); return m; } + + template + inline Mat4 Mat4::identity() { Mat4 m = null(); m.matrix[0] = 1; m.matrix[5] = 1; m.matrix[10] = 1; m.matrix[15] = 1; return m; } + + template + inline Mat4 Mat4::multiply(const Mat4 &matrix_1, const Mat4 &matrix_2) { return matrix_1 * matrix_2; } + + template + inline Mat4 Mat4::add(const Mat4 &matrix_1, const Mat4 &matrix_2) { return matrix_1 + matrix_2; } + + template + inline Mat4 Mat4::subtract(const Mat4 &matrix_1, const Mat4 &matrix_2) { return matrix_1 - matrix_2; } + + template + inline Mat4 Mat4::adjoint(const Mat4 &matrix) { Mat4 dest(matrix); dest.adjoint(); return dest; } + + template + inline Mat4 Mat4::inverse(const Mat4 &matrix) { Mat4 dest(matrix); dest.inverse(); return dest; } + + template + inline Mat4 Mat4::transpose(const Mat4 &matrix) { Mat4 dest(matrix); dest.transpose(); return dest; } + + typedef Mat4 Mat4i; + typedef Mat4 Mat4f; + typedef Mat4 Mat4d; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/obb.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/obb.h new file mode 100644 index 0000000..4f89670 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/obb.h @@ -0,0 +1,49 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "vec3.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + class OrientedBoundingBox + { + public: + Vec3f center; + Vec3f extents; + Vec3f axis_x; + Vec3f axis_y; + Vec3f axis_z; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/origin.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/origin.h new file mode 100644 index 0000000..eb7fffa --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/origin.h @@ -0,0 +1,52 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Kenneth Gangstoe +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + /// \brief Alignment origins. + enum Origin + { + origin_top_left, + origin_top_center, + origin_top_right, + origin_center_left, + origin_center, + origin_center_right, + origin_bottom_left, + origin_bottom_center, + origin_bottom_right + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/outline_triangulator.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/outline_triangulator.h new file mode 100644 index 0000000..799552e --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/outline_triangulator.h @@ -0,0 +1,68 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + class OutlineTriangulator_Impl; + + /// \brief Polygon Tesselator. + /// + /// This class uses constrained delauney triangulation to convert polygon outlines into triangles. + class OutlineTriangulator + { + public: + /// \brief Creates a tessellation object. + OutlineTriangulator(); + + virtual ~OutlineTriangulator(); + + /// \brief This function specifies a vertex on a polygon. + void add_vertex(float x, float y, void *data); + + /// \brief Mark next contour in polygon path. + void next_contour(); + + /// \brief Mark next polygon. + void next_polygon(); + + /// \brief Converts passed polygons into triangles. + void generate(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/point.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/point.h new file mode 100644 index 0000000..cc296be --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/point.h @@ -0,0 +1,91 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Kenneth Gangstoe +** Harry Storbacka +** Mark Page +*/ + +#pragma once + +#include "vec2.h" +#include "angle.h" +#include "origin.h" +#include "size.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + class Pointf; + class Pointd; + + /// \brief 2D (x,y) point structure. + /// + /// These point templates are defined for: int (Point), float (Pointf), double (Pointd) + template + class Pointx : public Vec2 + { + public: + Pointx() : Vec2() {} + Pointx(Type x, Type y) : Vec2(x, y) {} + Pointx(const Pointx &p) : Vec2(p.x, p.y) {} + Pointx(const Vec2 &p) : Vec2(p.x, p.y) {} + }; + + /// \brief 2D (x,y) point structure - Integer + class Point : public Pointx + { + public: + Point() : Pointx() {} + Point(int x, int y) : Pointx(x, y) {} + Point(const Pointx &p) : Pointx(p.x, p.y) {} + Point(const Vec2 &p) : Pointx(p.x, p.y) {} + }; + + /// \brief 2D (x,y) point structure - Float + class Pointf : public Pointx + { + public: + Pointf() : Pointx() {} + Pointf(float x, float y) : Pointx(x, y) {} + Pointf(const Pointx &p) : Pointx(p.x, p.y) {} + Pointf(const Vec2 &p) : Pointx(p.x, p.y) {} + }; + + /// \brief 2D (x,y) point structure - Double + class Pointd : public Pointx + { + public: + Pointd() : Pointx() {} + Pointd(double x, double y) : Pointx(x, y) {} + Pointd(const Pointx &p) : Pointx(p.x, p.y) {} + Pointd(const Vec2 &p) : Pointx(p.x, p.y) {} + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/pointset_math.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/pointset_math.h new file mode 100644 index 0000000..06d3e7c --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/pointset_math.h @@ -0,0 +1,88 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Emanuel Griesen +** Harry Storbacka +*/ + +#pragma once + +#include +#include "point.h" +#include "circle.h" +#include "rect.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + /// \brief Math operations related to point sets. + class PointSetMath + { + public: + /// \brief Find minimum spanning circle for the set of points + /// + /// \param points the points to calulate on + static Circlef minimum_enclosing_disc( + const std::vector &points); + + /// \brief Return the convex hull of the given set of points + /// + /// \param points the set of points + static std::vector convex_hull_from_polygon(std::vector &points); + + static Rect bounding_box(const std::vector &points); + + static void calculate_minimum_enclosing_disc( + Circlef &smalldisc, + const std::vector &points, + int start, + int end); + + static void minimum_disc_with_1point( + Circlef &smalldisc, + const std::vector &points, + int start, + unsigned int i); + + static void minimum_disc_with_2points( + Circlef &smalldisc, + const std::vector &points, + int start, + unsigned int i, + unsigned int j); + + static void minimum_disc_with_3points( + Circlef &smalldisc, + const std::vector &points, + unsigned int i, + unsigned int j, + unsigned int k); + + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/quad.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/quad.h new file mode 100644 index 0000000..66bc191 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/quad.h @@ -0,0 +1,236 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include "rect.h" +#include "size.h" +#include "point.h" +#include "origin.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + /// \brief 2D quad structure. + /// + /// These quads templates are defined for: int (Quad), float (Quadf), double (Quadd) + /// + template + class Quadx + { + public: + /// \brief Constructs a quad. + Quadx() : p(), q(), r(), s() {} + + /// \brief Constructs a quad. + /// + /// \param new_p = coord for first point of quad. + /// \param new_q = coord for second point of quad. + /// \param new_r = coord for third point of quad. + /// \param new_s = coord for forth point of quad. + Quadx(const Vec2 &new_p, const Vec2 &new_q, const Vec2 &new_r, const Vec2 &new_s) + : p(new_p), q(new_q), r(new_r), s(new_s) {} + + /// \brief Constructs a quad. + /// + /// \param rect Rectangle used to initialize the quad. + ///

The corners of the rect are mapped to the quad member variables as follows: + ///

    + ///
  • Top-left: p
  • + ///
  • Top-right: q
  • + ///
  • Bottom-right: r
  • + ///
  • Bottom-left: s
  • + ///
+ ///

+ Quadx(const Rectx &rect) : p(rect.left, rect.top), q(rect.right, rect.top), + r(rect.right, rect.bottom), s(rect.left, rect.bottom) {} + + /// \brief Constructs a quad. + /// + /// \param quad = Quad used to initialize this quad. + Quadx(const Quadx &quad) : p(quad.p), q(quad.q), r(quad.r), s(quad.s) {} + + /// \brief Quad += Quad operator. + Quadx &operator+=(const Quadx &quad) + { + p += quad.p; q += quad.q; r += quad.r; s += quad.s; return *this; + } + + /// \brief Quad -= Quad operator. + Quadx &operator-=(const Quadx &quad) + { + p -= quad.p; q -= quad.q; r -= quad.r; s -= quad.s; return *this; + } + + /// \brief Quad += Point operator. + Quadx &operator+=(const Vec2 &point) + { + p += point; q += point; r += point; s += point; return *this; + } + + /// \brief Quad -= Point operator. + Quadx &operator-=(const Vec2 &point) + { + p -= point; q -= point; r -= point; s -= point; return *this; + } + + /// \brief Quad + Quad operator. + Quadx operator+(const Quadx &quad) const + { + return Quadx(p + quad.p, q + quad.q, r + quad.r, s + quad.s); + } + + /// \brief Quad - Quad operator. + Quadx operator-(const Quadx &quad) const + { + return Quadx(p - quad.p, q - quad.q, r - quad.r, s - quad.s); + } + + /// \brief Quad + Point operator. + Quadx operator+(const Vec2 &point) const + { + return Quadx(p + point, q + point, r + point, s + point); + } + + /// \brief Quad - Point operator. + Quadx operator-(const Vec2 &point) const + { + return Quadx(p - point, q - point, r - point, s - point); + } + + /// \brief Quad == Quad operator. + bool operator==(const Quadx &quad) const + { + return (p == quad.p && q == quad.q && r == quad.r && s == quad.s); + } + + /// \brief Quad != Quad operator. + bool operator!=(const Quadx &quad) const + { + return (p != quad.p || q != quad.q || r != quad.r || s != quad.s); + } + + /// \brief First Point + Vec2 p; + + /// \brief Second Point + Vec2 q; + + /// \brief Third Point + Vec2 r; + + /// \brief Fourth Point + Vec2 s; + + /// \brief Returns the width of the quad. + Type get_width() const; + + /// \brief Returns the height of the quad. + Type get_height() const; + + /// \brief Returns the size of the rectangle. + Sizex get_size() const { return Sizex(get_width(), get_height()); } + + /// \brief Returns the bounding box of the quad as a Rect + Rect get_bounds() const; + + /// \brief Rotates the Quad + /// + /// \param hotspot Point to rotate around. + /// \param angle Angle to rotate in degrees. + /// + /// \return reference to this object + Quadx &rotate(const Vec2 &hotspot, const Angle &angle); + + /// \brief Scale the Quad + /// + /// \param sx = Scale value in x-axis + /// \param sy = Scale value in y-axis + /// + /// \return reference to this object + Quadx &scale(float sx, float sy); + + /// \brief Scale the Quad + /// + /// \param sx = Scale value in x-axis + /// \param sy = Scale value in y-axis + /// \param hotspot = Point to scale around. + /// + /// \return reference to this object + Quadx &scale(const Vec2 &hotspot, float sx, float sy); + + /// \brief Returns the center point of the quad + Vec2 center() const; + + /// \brief Applies an origin and offset pair to this rectangle + /// + /// \param origin The new origin to adjust to from default upper-left position + /// \param x, y Offsets applied negatively to each corner of the rectangle + /// + /// \return reference to this object + Quadx &apply_alignment(Origin origin, Type x, Type y); + + /// \brief Check if a point is inside or outside the quad + bool is_inside(const Vec2 &point) const; + }; + + /// \brief 2D quad structure - Integer + class Quad : public Quadx + { + public: + Quad() : Quadx() {} + Quad(const Vec2 &new_p, const Vec2 &new_q, const Vec2 &new_r, const Vec2 &new_s) : Quadx(new_p, new_q, new_r, new_s) {} + Quad(const Rect &rect) : Quadx(rect) {} + Quad(const Quadx &quad) : Quadx(quad) {} + }; + + /// \brief 2D quad structure - Float + class Quadf : public Quadx + { + public: + Quadf() : Quadx() {} + Quadf(const Vec2 &new_p, const Vec2 &new_q, const Vec2 &new_r, const Vec2 &new_s) : Quadx(new_p, new_q, new_r, new_s) {} + Quadf(const Rectf &rect) : Quadx(rect) {} + Quadf(const Quadx &quad) : Quadx(quad) {} + }; + + /// \brief 2D quad structure - Double + class Quadd : public Quadx + { + public: + Quadd() : Quadx() {} + Quadd(const Vec2 &new_p, const Vec2 &new_q, const Vec2 &new_r, const Vec2 &new_s) : Quadx(new_p, new_q, new_r, new_s) {} + Quadd(const Rectd &rect) : Quadx(rect) {} + Quadd(const Quadx &quad) : Quadx(quad) {} + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/quaternion.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/quaternion.h new file mode 100644 index 0000000..b8ff8a5 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/quaternion.h @@ -0,0 +1,202 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +#include "vec3.h" +#include "angle.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + /// \brief Quaternion + /// + /// These quaternion templates are defined for: float (Quaternionf), double (Quaterniond) + template + class Quaternionx + { + public: + /// \brief The real scalar part + Type w; + + /// \brief The imaginary vector part + union { Type i; Type x; }; + union { Type j; Type y; }; + union { Type k; Type z; }; + + Quaternionx() : w(1), i(0), j(0), k(0) { } + explicit Quaternionx(Type real, Type i, Type j, Type k) : w(real), i(i), j(j), k(k) { } + explicit Quaternionx(Type real, const Vec3 &imag) : w(real), i(imag.x), j(imag.y), k(imag.z) { } + Quaternionx(const Quaternionx ©) : w(copy.w), i(copy.i), j(copy.j), k(copy.k) { } + explicit Quaternionx(Type euler_x, Type euler_y, Type euler_z, AngleUnit unit, EulerOrder order); + explicit Quaternionx(const Vec3 &euler, AngleUnit unit, EulerOrder order); + explicit Quaternionx(const Angle &euler_x, const Angle &euler_y, const Angle &euler_z, EulerOrder order); + explicit Quaternionx(const Mat4 &rotation_matrix); + + static Quaternionx axis_angle(const Angle &angle, const Vec3f &axis); + static Quaternionx multiply(const Quaternionx &quaternion_1, const Quaternionx &quaternion_2); + + /// \brief Calculates the shortest arc quaternion between two vectors + static Quaternionx rotation_between(Vec3 v0, Vec3 v1); + + /// \brief Calculates the shortest arc quaternion between two vectors + static Quaternionx rotation_between(Vec4 v0, Vec4 v1); + + /// \brief Linear Quaternion Interpolation + /// + /// \param quaternion_initial = Source quaternion + /// \param quaternion_final = Destination quaternion + /// \param lerp_time = Time in the range of 0.0 to 1.0 + static Quaternionx lerp(const Quaternionx &quaternion_initial, const Quaternionx &quaternion_final, Type lerp_time); + + /// \brief Spherical Quaternion Interpolation + /// + /// \param quaternion_initial = Source quaternion + /// \param quaternion_final = Destination quaternion + /// \param slerp_time = Time in the range of 0.0 to 1.0 + static Quaternionx slerp(const Quaternionx &quaternion_initial, const Quaternionx &quaternion_final, Type slerp_time); + + /// \brief Convert the quaternion to a rotation matrix + /// + /// This function assumes that the quarternion is normalized. + Mat4 to_matrix() const; + + /// \brief Get the quaternion magnitude + Type magnitude() const; + + void set(Type euler_x, Type euler_y, Type euler_z, AngleUnit unit, EulerOrder order); + void set(const Vec3 &euler, AngleUnit unit, EulerOrder order); + void set(const Angle &euler_x, const Angle &euler_y, const Angle &euler_z, EulerOrder order); + + Quaternionx &rotate(const Angle &angle, const Vec3f &axis); + + Quaternionx &rotate(const Angle &euler_x, const Angle &euler_y, const Angle &euler_z, EulerOrder order); + + /// \brief Normalizes this quaternion + /// + /// \return reference to this object + Quaternionx &normalize(); + + /// \brief Inverse this quaternion + /// + /// This is the same as the conjugate of a quaternion + /// + /// \return reference to this object + Quaternionx &inverse(); + + /// \brief Rotates vector by this quaternion. + /// + /// \param v = Vertex to rotate + /// + /// \return rotated vector + Vec3 rotate_vector(const Vec3 &v) const; + + Vec4 rotate_vector(const Vec4 &v) const; + + /// \brief Normalizes this quaternion + /// + /// \return reference to this object + static Quaternionx normalize(Quaternionx q) { return q.normalize(); } + + /// \brief Inverse this quaternion + /// + /// This is the same as the conjugate of a quaternion + /// + /// \return reference to this object + static Quaternionx inverse(Quaternionx q) { return q.inverse(); } + + /// \brief Multiplication operator. + Quaternionx operator *(const Quaternionx &mult) const { return Quaternionx::multiply(*this, mult); } + + Quaternionx operator *(const Mat4 &matrix) const; + + /// \brief Less operator. + bool operator<(const Quaternionx &other) const + { + if (x != other.x) return x < other.x; + else if (y != other.y) return y < other.y; + else if (z != other.z) return z < other.z; + else return w < other.w; + } + + /// \brief Greater operator. + bool operator>(const Quaternionx &other) const + { + if (x != other.x) return x > other.x; + else if (y != other.y) return y > other.y; + else if (z != other.z) return z > other.z; + else return w > other.w; + } + + /// \brief Less equal operator. + bool operator<=(const Quaternionx &other) const { return *this < other || *this == other; } + + /// \brief Greater equal operator. + bool operator>=(const Quaternionx &other) const { return *this > other || *this == other; } + + /// \brief Equal operator. + bool operator==(const Quaternionx &other) const { return x == other.x && y == other.y && z == other.z && w == other.w; } + + /// \brief Not equal operator. + bool operator!=(const Quaternionx &other) const { return x != other.x || y != other.y || z != other.z || w == other.w; } + }; + + /// \brief Quaternion - Float + class Quaternionf : public Quaternionx + { + public: + Quaternionf() : Quaternionx() { } + Quaternionf(const Quaternionx ©) : Quaternionx(copy) { } + explicit Quaternionf(const Mat4 &rotation_matrix) : Quaternionx(rotation_matrix) { }; + + explicit Quaternionf(float real, float i, float j, float k) : Quaternionx(real, i, j, k) { } + explicit Quaternionf(float real, const Vec3 &imag) : Quaternionx(real, imag) { } + explicit Quaternionf(float euler_x, float euler_y, float euler_z, AngleUnit unit, EulerOrder order) : Quaternionx(euler_x, euler_y, euler_z, unit, order) { } + explicit Quaternionf(const Vec3 &euler, AngleUnit unit, EulerOrder order) : Quaternionx(euler, unit, order) { } + explicit Quaternionf(const Angle &euler_x, const Angle &euler_y, const Angle &euler_z, EulerOrder order) : Quaternionx(euler_x, euler_y, euler_z, order) { } + + }; + + /// \brief Quaternion - Double + class Quaterniond : public Quaternionx + { + public: + Quaterniond() : Quaternionx() { } + Quaterniond(const Quaternionx ©) : Quaternionx(copy) { } + explicit Quaterniond(const Mat4 &rotation_matrix) : Quaternionx(rotation_matrix) { } + explicit Quaterniond(double real, double i, double j, double k) : Quaternionx(real, i, j, k) { } + explicit Quaterniond(double real, const Vec3 &imag) : Quaternionx(real, imag) { } + explicit Quaterniond(double euler_x, double euler_y, double euler_z, AngleUnit unit, EulerOrder order) : Quaternionx(euler_x, euler_y, euler_z, unit, order) { } + explicit Quaterniond(const Vec3 &euler, AngleUnit unit, EulerOrder order) : Quaternionx(euler, unit, order) { } + explicit Quaterniond(const Angle &euler_x, const Angle &euler_y, const Angle &euler_z, EulerOrder order) : Quaternionx(euler_x, euler_y, euler_z, order) { } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/rect.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/rect.h new file mode 100644 index 0000000..2a46377 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/rect.h @@ -0,0 +1,548 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Kenneth Gangstoe +** Harry Storbacka +** Mark Page +*/ + +#pragma once + +#include "vec2.h" +#include "size.h" +#include "point.h" +#include "origin.h" +#include "cl_math.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + /// \brief 2D (left,top,right,bottom) rectangle structure. + /// + /// These line templates are defined for: int (Rect), float (Rectf), double (Rectd) + /// + template + class Rectx + { + public: + /// \brief Constructs an rectangle. + /// + /// Initialised to zero + Rectx() : left(0), top(0), right(0), bottom(0) {} + + /// \brief Constructs an rectangle. + /// + /// \param s = Size + Rectx(const Sizex &s) : left(0), top(0), right(s.width), bottom(s.height) {} + + /// \brief Constructs an rectangle. + /// + /// \param new_left Initial left position of rectangle. + /// \param new_top Initial top position of rectangle. + /// \param new_right Initial right position of rectangle. + /// \param new_bottom Initial bottom position of rectangle. + Rectx(Type new_left, Type new_top, Type new_right, Type new_bottom) + : left(new_left), top(new_top), right(new_right), bottom(new_bottom) {} + + /// \brief Constructs an rectangle. + /// + /// \param p = Initial top-left position of rectangle. + /// \param size Initial size of rectangle. + Rectx(const Pointx &p, const Sizex &size) + : left(p.x), top(p.y), right(p.x + size.width), bottom(p.y + size.height) {} + + /// \brief Constructs an rectangle. + /// + /// \param new_left Initial left position of rectangle. + /// \param new_top Initial top position of rectangle. + /// \param size Initial size of rectangle. + Rectx(Type new_left, Type new_top, const Sizex &size) + : left(new_left), top(new_top), right(new_left + size.width), bottom(new_top + size.height) {} + + /// \brief Constructs an rectangle. + /// + /// \param rect Initial rectangle position and size. + Rectx(const Rectx &rect); + + /// \brief Constructs an rectangle. + /// + /// \param rect Initial rectangle position and size. + Rectx(const Rectx &rect); + + /// \brief Constructs an rectangle. + /// + /// \param rect Initial rectangle position and size. + Rectx(const Rectx &rect); + + /// \brief Rect == Rect operator. + bool operator==(const Rectx &r) const + { + return (left == r.left && top == r.top && right == r.right && bottom == r.bottom); + } + + /// \brief Rect != Rect operator. + bool operator!=(const Rectx &r) const + { + return (left != r.left || top != r.top || right != r.right || bottom != r.bottom); + } + + /// \brief Rect *= operator. + Rectx &operator*=(const Type &s) + { + left *= s; top *= s; right *= s; bottom *= s; return *this; + } + + /// \brief Rect * operator. + Rectx operator*(const Type &s) const + { + return Rectx(left*s, top*s, right*s, bottom *s); + } + + static Rectx xywh(Type x, Type y, Type width, Type height) { return Rectx(x, y, x + width, y + height); } + static Rectx ltrb(Type left, Type top, Type right, Type bottom) { return Rectx(left, top, right, bottom); } + + /// \brief X1-coordinate (left point inside the rectangle) + Type left; + + /// \brief Y1-coordinate (top point inside the rectangle) + Type top; + + /// \brief X2-coordinate (point outside the rectangle) + Type right; + + /// \brief Y2-coordinate (point outside the rectange) + Type bottom; + + /// \brief Returns the width of the rectangle. + Type get_width() const { return right - left; } + + /// \brief Returns the height of the rectangle. + Type get_height() const { return bottom - top; } + + /// \brief Returns the size of the rectangle. + Sizex get_size() const { return Sizex(right - left, bottom - top); } + + /// \brief Returns true if the rectangle contains the point. + bool contains(const Vec2 &p) const + { + return (p.x >= left && p.x < right) + && (p.y >= top && p.y < bottom); + } + + /// \brief Returns the top-left point inside the rectangle + Pointx get_top_left() const + { + return Pointx(left, top); + } + + /// \brief Returns the top-right point outside the rectangle + Pointx get_top_right() const + { + return Pointx(right, top); + } + + /// \brief Returns the bottom-right point outside the rectangle + Pointx get_bottom_right() const + { + return Pointx(right, bottom); + } + + /// \brief Returns the bottom-left point outside the rectangle + Pointx get_bottom_left() const + { + return Pointx(left, bottom); + } + + /// \brief Returns true if rectangle passed is overlapping or inside this rectangle. + bool is_overlapped(const Rectx &r) const + { + return (r.left < right && r.right > left && r.top < bottom && r.bottom > top); + } + + /// \brief Returns true if rectangle passed is inside this rectangle + bool is_inside(const Rectx &r) const + { + return ((left <= r.left) + && (top <= r.top) + && (right >= r.right) + && (bottom >= r.bottom)); + } + + /// \brief Returns another Rectx containing a rotated version of this one. + /// + /// \param hotspot Point to rotate around. + /// \param angle Angle to rotate. + Rectx get_rot_bounds(const Vec2 &hotspot, const Angle &angle) const; + + /// \brief Returns another Rectx containing a rotated version of this one. + /// + /// \param origin Determines the hotspot point within the rectangle + /// \param x Offsets applied negatively to the hotspot point + /// \param y Offsets applied negatively to the hotspot point + /// \param angle Angle + Rectx get_rot_bounds(Origin origin, Type x, Type y, const Angle &angle) const; + + /// \brief Returns the center point of the rectangle. + Pointx get_center() const + { + return Pointx((left + right) / 2, (top + bottom) / 2); + } + + /// \brief Sets the top-left point of the rectangle. + /// + /// \return reference to this object + Rectx &set_top_left(const Vec2& p) + { + left = p.x; + top = p.y; + return *this; + } + + /// \brief Sets the bottom-right point of the rectangle. + /// + /// \return reference to this object + Rectx &set_bottom_right(const Vec2& p) + { + right = p.x; + bottom = p.y; + return *this; + } + + /// \brief Sets the width of the rectangle. + /// + /// \return reference to this object + Rectx &set_width(Type width) + { + right = left + width; + return *this; + } + + /// \brief Sets the height of the rectangle. + /// + /// \return reference to this object + Rectx &set_height(Type height) + { + bottom = top + height; + return *this; + } + + /// \brief Shrink the rectangle + /// + /// \return reference to this object + Rectx &shrink(const Type &new_left, const Type &new_top, const Type &new_right, const Type &new_bottom) + { + left += new_left; top += new_top; right -= new_right; bottom -= new_bottom; + return *this; + }; + + /// \brief Shrink the rectangle + /// + /// \return reference to this object + Rectx &shrink(const Type &left_right, const Type &top_bottom) + { + left += left_right; top += top_bottom; right -= left_right; bottom -= top_bottom; + return *this; + }; + + /// \brief Shrink the rectangle + /// + /// \return reference to this object + Rectx &shrink(const Type &shrink) + { + left += shrink; top += shrink; right -= shrink; bottom -= shrink; + return *this; + }; + + /// \brief Expand the rectangle + /// + /// \return reference to this object + Rectx &expand(const Type &expand_left, const Type &expand_top, const Type &expand_right, const Type &expand_bottom) + { + left -= expand_left; top -= expand_top; right += expand_right; bottom += expand_bottom; + return *this; + }; + + /// \brief Expand the rectangle + /// + /// \return reference to this object + Rectx &expand(const Type &left_and_right, const Type &top_and_bottom) + { + left -= left_and_right; + right += left_and_right; + top -= top_and_bottom; + bottom += top_and_bottom; + return *this; + }; + + /// \brief Expand the rectangle + /// + /// \return reference to this object + Rectx &expand(const Type &expand) + { + left -= expand; + right += expand; + top -= expand; + bottom += expand; + return *this; + }; + + /// \brief Translate the rect + /// + /// \return reference to this object + Rectx &translate(const Vec2 &p) + { + left += p.x; top += p.y; right += p.x; bottom += p.y; + return *this; + }; + + /// \brief Translate the rect + /// + /// \return reference to this object + Rectx &translate(const Sizex &p) + { + left += p.width; top += p.height; right += p.width; bottom += p.height; + return *this; + }; + + /// \brief Translate the rect by another rect (only uses the left and top coords). + /// + /// \return reference to this object + Rectx &translate(const Rectx &p) + { + left += p.left; top += p.top; right += p.left; bottom += p.top; + return *this; + }; + + /// \brief Translate the rect + /// + /// \return reference to this object + Rectx &translate(Type x, Type y) + { + left += x; top += y; right += x; bottom += y; + return *this; + }; + + /// \brief Sets the size of the rectangle, maintaining top/left position. + /// + /// \return reference to this object + Rectx &set_size(const Sizex &size) + { + right = left + size.width; + bottom = top + size.height; + return *this; + } + + /// \brief Calculates the intersection of two rectangles. + /// + ///

Rect values become: max left, max top, min right, min bottom.

+ /// + /// \return reference to this object + Rectx &overlap(const Rectx &rect) + { + Rectx result; + result.left = max(left, rect.left); + result.right = min(right, rect.right); + result.top = max(top, rect.top); + result.bottom = min(bottom, rect.bottom); + if (result.right < result.left) + result.left = result.right; + if (result.bottom < result.top) + result.top = result.bottom; + + *this = result; + return *this; + } + + /// \brief Calculates the bounding rectangle of the rectangles. + /// + ///

Rect values become: min left, min top, max right, max bottom.

+ /// + /// \return reference to this object + Rectx &bounding_rect(const Rectx &rect) + { + Rectx result; + result.left = min(left, rect.left); + result.right = max(right, rect.right); + result.top = min(top, rect.top); + result.bottom = max(bottom, rect.bottom); + *this = result; + return *this; + } + + /// \brief Normalize rectangle. + /// + /// Sets the width to 0 if found a negative width + /// Sets the height to 0 if found a negative height + /// + /// \return reference to this object + Rectx &normalize() + { + if (left > right) + right = left; + + if (top > bottom) + bottom = top; + + return *this; + } + + /// \brief Applies an origin and offset pair to this rectangle + /// + /// \param origin The new origin to adjust to from default upper-left position + /// \param x, y Offsets applied negatively to each corner of the rectangle + /// + /// \return reference to this object + Rectx &apply_alignment(Origin origin, Type x, Type y) + { + Vec2 offset = Vec2::calc_origin(origin, get_size()); + offset.x -= x; + offset.y -= y; + + left += offset.x; + top += offset.y; + right += offset.x; + bottom += offset.y; + return *this; + } + + /// \brief Clip according to the specified clip rectangle. + /// + /// \return reference to this object + Rectx &clip(const Rectx &cr) + { + top = max(top, cr.top); + left = max(left, cr.left); + right = min(right, cr.right); + bottom = min(bottom, cr.bottom); + top = min(top, bottom); + left = min(left, right); + return *this; + } + }; + + template<> + inline Rectx::Rectx(const Rectx &rect) + : left(static_cast (floor(rect.left + 0.5f))), + top(static_cast (floor(rect.top + 0.5f))), + right(static_cast (floor(rect.right + 0.5f))), + bottom(static_cast (floor(rect.bottom + 0.5f))) + { + } + + template<> + inline Rectx::Rectx(const Rectx &rect) + : left(static_cast (floor(rect.left + 0.5))), + top(static_cast (floor(rect.top + 0.5))), + right(static_cast (floor(rect.right + 0.5))), + bottom(static_cast (floor(rect.bottom + 0.5))) + { + } + + template + inline Rectx::Rectx(const Rectx &rect) + : left(static_cast (rect.left)), top(static_cast (rect.top)), + right(static_cast (rect.right)), bottom(static_cast (rect.bottom)) + { + } + + template + inline Rectx::Rectx(const Rectx &rect) + : left(static_cast (rect.left)), top(static_cast (rect.top)), + right(static_cast (rect.right)), bottom(static_cast (rect.bottom)) + { + } + + template + inline Rectx::Rectx(const Rectx &rect) + : left(static_cast (rect.left)), top(static_cast (rect.top)), + right(static_cast (rect.right)), bottom(static_cast (rect.bottom)) + { + } + + /// \brief 2D (left,top,right,bottom) rectangle structure - Integer + class Rect : public Rectx + { + public: + Rect() : Rectx() {} + Rect(const Sizex &s) : Rectx(s) {} + Rect(int new_left, int new_top, int new_right, int new_bottom) : Rectx(new_left, new_top, new_right, new_bottom) {} + Rect(const Pointx &p, const Sizex &size) : Rectx(p, size) {} + Rect(const Rectx &rect) : Rectx(rect) {} + Rect(const Rectx &rect) : Rectx(rect) {} + Rect(const Rectx &rect) : Rectx(rect) {} + Rect(int new_left, int new_top, const Sizex &size) : Rectx(new_left, new_top, size) {} + }; + + /// \brief 2D (left,top,right,bottom) rectangle structure - Float + class Rectf : public Rectx + { + public: + Rectf() : Rectx() {} + Rectf(const Sizex &s) : Rectx(s) {} + Rectf(const Sizex &s) : Rectx(s) {} + Rectf(float new_left, float new_top, float new_right, float new_bottom) : Rectx(new_left, new_top, new_right, new_bottom) {} + Rectf(const Pointx &p, const Sizex &size) : Rectx(p, size) {} + Rectf(const Rectx &rect) : Rectx(rect) {} + Rectf(const Rectx &rect) : Rectx(rect) {} + Rectf(const Rectx &rect) : Rectx(rect) {} + Rectf(float new_left, float new_top, const Sizex &size) : Rectx(new_left, new_top, size) {} + }; + + /// \brief 2D (left,top,right,bottom) rectangle structure - Double + class Rectd : public Rectx + { + public: + Rectd() : Rectx() {} + Rectd(const Sizex &s) : Rectx(s) {} + Rectd(const Sizex &s) : Rectx(s) {} + Rectd(const Sizex &s) : Rectx(s) {} + Rectd(double new_left, double new_top, double new_right, double new_bottom) : Rectx(new_left, new_top, new_right, new_bottom) {} + Rectd(const Pointx &p, const Sizex &size) : Rectx(p, size) {} + Rectd(const Rectx &rect) : Rectx(rect) {} + Rectd(const Rectx &rect) : Rectx(rect) {} + Rectd(const Rectx &rect) : Rectx(rect) {} + Rectd(double new_left, double new_top, const Sizex &size) : Rectx(new_left, new_top, size) {} + }; + + inline Rect RectPS(int x, int y, int width, int height) + { + return Rect(x, y, x + width, y + height); + } + + inline Rectf RectfPS(float x, float y, float width, float height) + { + return Rectf(x, y, x + width, y + height); + } + + inline Rectd RectdPS(double x, double y, double width, double height) + { + return Rectd(x, y, x + width, y + height); + } + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/rect_packer.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/rect_packer.h new file mode 100644 index 0000000..612a80f --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/rect_packer.h @@ -0,0 +1,102 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Kenneth Gangstoe +*/ + +#pragma once + +#include +#include "rect.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + class Size; + class RectPacker_Impl; + + /// \brief Generic rect packer class. Implements an algorithm to pack rects into groups efficiently. + class RectPacker + { + public: + /// \brief Allocation policy. + enum AllocationPolicy + { + create_new_group, + search_previous_groups, + fail_if_full + }; + + struct AllocatedRect + { + public: + AllocatedRect(int group_index, Rect rect) : group_index(group_index), rect(rect) {} + int group_index; + Rect rect; + }; + + /// \brief Constructs a null instance. + RectPacker(); + + /// \brief Constructs a rect group. + RectPacker(const Size &max_group_size, AllocationPolicy policy = create_new_group); + + ~RectPacker(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns the allocation policy. + AllocationPolicy get_allocation_policy() const; + + /// \brief Returns the max group size. + Size get_max_group_size() const; + + /// \brief Returns the total amount of rects. + int get_total_rect_count() const; + + /// \brief Returns the amount of rects in a group. + int get_rect_count(unsigned int group_index = 0) const; + + /// \brief Returns the amount of rects used by group. + int get_group_count() const; + + /// \brief Set the allocation policy. + void set_allocation_policy(AllocationPolicy policy); + + /// \brief Allocate space for another rect. + AllocatedRect add(const Size &size); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/size.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/size.h new file mode 100644 index 0000000..ed3f8a3 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/size.h @@ -0,0 +1,209 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Kenneth Gangstoe +*/ + + +#pragma once + +#include "vec2.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + template + class Vec2; + + template + class Vec3; + + template + class Vec4; + + /// \brief 2D (width,height) size structure. + /// + /// These line templates are defined for: int (Size), float (Sizef), double (Sized) + /// + template + class Sizex + { + public: + /// \brief Constructs a size structure. + Sizex() : width(0), height(0) { return; } + + /// \brief Constructs a size structure. + /// + /// \param width Initial width of size structure. + /// \param height Initial height of size structure. + Sizex(Type width, Type height) + : width(width), height(height) { } + + /// \brief Constructs a size structure. + /// + /// \param s = Size structure to construct this one from. + Sizex(const Sizex &s) + : width(s.width), height(s.height) {} + + /// \brief Size width. + Type width; + + /// \brief Size height. + Type height; + + operator Vec2() const + { + return Vec2(width, height); + } + + /// \brief Size += Size operator. + Sizex &operator+=(const Sizex &s) + { + width += s.width; height += s.height; return *this; + } + + /// \brief Size -= Size operator. + Sizex &operator-=(const Sizex &s) + { + width -= s.width; height -= s.height; return *this; + } + + /// \brief Size + Size operator. + Sizex operator+(const Sizex &s) const + { + return Sizex(width + s.width, height + s.height); + } + + /// \brief Size - Size operator. + Sizex operator-(const Sizex &s) const + { + return Sizex(width - s.width, height - s.height); + } + + /// \brief Size += operator. + Sizex &operator+=(const Type &s) + { + width += s; height += s; return *this; + } + + /// \brief Size -= operator. + Sizex &operator-=(const Type &s) + { + width -= s; height -= s; return *this; + } + + /// \brief Size *= operator. + Sizex &operator*=(const Type &s) + { + width *= s; height *= s; return *this; + } + + /// \brief Size /= operator. + Sizex &operator/=(const Type &s) + { + width /= s; height /= s; return *this; + } + + /// \brief Size + operator. + Sizex operator+(const Type &s) const + { + return Sizex(width + s, height + s); + } + + /// \brief Size - operator. + Sizex operator-(const Type &s) const + { + return Sizex(width - s, height - s); + } + + /// \brief Size * operator. + Sizex operator*(const Type &s) const + { + return Sizex(width * s, height * s); + } + + /// \brief Size / operator. + Sizex operator/(const Type &s) const + { + return Sizex(width / s, height / s); + } + + /// \brief Size == Size operator (deep compare). + bool operator==(const Sizex &s) const + { + return (width == s.width) && (height == s.height); + } + + /// \brief Size != Size operator (deep compare). + bool operator!=(const Sizex &s) const + { + return (width != s.width) || (height != s.height); + } + }; + + /// \brief 2D (width,height) size structure - Integer + class Size : public Sizex + { + public: + Size() : Sizex() {} + Size(int width, int height) : Sizex(width, height) {} + Size(const Sizex &s) : Sizex(s) {} + Size(const Vec2 &s) : Sizex(s.x, s.y) {} + + explicit Size(const Sizex ©) { width = (int)(copy.width + 0.5f); height = (int)(copy.height + 0.5f); } + explicit Size(const Sizex ©) { width = (int)(copy.width + 0.5); height = (int)(copy.height + 0.5); } + }; + + /// \brief 2D (width,height) size structure - Float + class Sizef : public Sizex + { + public: + Sizef() : Sizex() {} + Sizef(float width, float height) : Sizex(width, height) {} + Sizef(const Sizex &s) : Sizex(s) {} + Sizef(const Vec2 &s) : Sizex(s.x, s.y) {} + + Sizef(const Sizex ©) { width = (float)copy.width; height = (float)copy.height; } + explicit Sizef(const Sizex ©) { width = (float)copy.width; height = (float)copy.height; } + }; + + /// \brief 2D (width,height) size structure - Double + class Sized : public Sizex + { + public: + Sized() : Sizex() {} + Sized(double width, double height) : Sizex(width, height) {} + Sized(const Sizex &s) : Sizex(s) {} + Sized(const Vec2 &s) : Sizex(s.x, s.y) {} + + Sized(const Sizex ©) { width = (double)copy.width; height = (double)copy.height; } + Sized(const Sizex ©) { width = (double)copy.width; height = (double)copy.height; } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/triangle_math.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/triangle_math.h new file mode 100644 index 0000000..f5a3ee7 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/triangle_math.h @@ -0,0 +1,98 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +** Mark Page +*/ + +#pragma once + +#include "vec3.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + /// \brief Triangles + /// + /// These triangle templates are defined for: int (Triangle), float (Trianglef), double (Triangled) + template + class Trianglex + { + public: + /// \brief First triangle point + Vec2 p; + + // \brief Second triangle point + Vec2 q; + + // \brief Third triangle point + Vec2 r; + + Trianglex() : p(), q(), r() {} + Trianglex(const Trianglex ©) : p(copy.p), q(copy.q), r(copy.r) {} + Trianglex(const Vec2 &point_p, const Vec2 &point_q, const Vec2 &point_r) : p(point_p), q(point_q), r(point_r) {} + + /// \brief Return true if the point is inside the triangle. + /// + /// \param point = point to test. + /// \return true if the point is inside the triangle + bool point_inside(const Vec2 &point) const; + + Trianglex &operator = (const Trianglex& copy) { p = copy.p; q = copy.q; r = copy.r; return *this; } + bool operator == (const Trianglex& triangle) const { return ((p == triangle.p) && (q == triangle.q) && (r == triangle.r)); } + bool operator != (const Trianglex& triangle) const { return ((p != triangle.p) || (q != triangle.q) || (r != triangle.r)); } + }; + + /// \brief Triangles - Integer + class Triangle : public Trianglex + { + public: + Triangle() { } + Triangle(const Trianglex ©) : Trianglex(copy) {} + Triangle(const Vec2 &point_p, const Vec2 &point_q, const Vec2 &point_r) : Trianglex(point_p, point_q, point_r) {} + }; + + /// \brief Triangles - Float + class Trianglef : public Trianglex + { + public: + Trianglef() { } + Trianglef(const Trianglex ©) : Trianglex(copy) {} + Trianglef(const Vec2 &point_p, const Vec2 &point_q, const Vec2 &point_r) : Trianglex(point_p, point_q, point_r) {} + }; + + /// \brief Triangles - Double + class Triangled : public Trianglex + { + public: + Triangled() { } + Triangled(const Trianglex ©) : Trianglex(copy) {} + Triangled(const Vec2 &point_p, const Vec2 &point_q, const Vec2 &point_r) : Trianglex(point_p, point_q, point_r) {} + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/vec2.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/vec2.h new file mode 100644 index 0000000..cf1fe56 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/vec2.h @@ -0,0 +1,429 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +** Harry Storbacka +*/ + +#pragma once + +#include +#include "vec3.h" +#include "vec4.h" +#include "origin.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + template + class Vec2; + + template + class Vec3; + + template + class Vec4; + + template + class Mat2; + + template + class Mat3; + + template + class Mat4; + + template + class Sizex; + + template + class Pointx; + + class Angle; + + /// \brief 2D vector + /// + /// These vector templates are defined for:\n + /// char (Vec2c), unsigned char (Vec2uc), short (Vec2s),\n + /// unsigned short (Vec2us), int (Vec2i), unsigned int (Vec2ui), float (Vec2f), double (Vec2d) + template + class Vec2 + { + public: + typedef Type datatype; + + union { Type x; Type s; Type r; }; + union { Type y; Type t; Type g; }; + + Vec2() : x(0), y(0) { } + explicit Vec2(const Type &scalar) : x(scalar), y(scalar) { } + explicit Vec2(const Vec3 ©) { x = copy.x; y = copy.y; } + explicit Vec2(const Vec4 ©) { x = copy.x; y = copy.y; } + explicit Vec2(const Type &p1, const Type &p2) : x(p1), y(p2) { } + explicit Vec2(const Type *array_xy) : x(array_xy[0]), y(array_xy[1]) { } + + Vec2(const Vec2 ©); + Vec2(const Vec2 ©); + Vec2(const Vec2 ©); + + /// \brief Normalizes a vector + /// + /// Operates in the native datatype + /// + /// \param vector = Vector to use + /// \return normalized vector + static Vec2 normalize(const Vec2& vector); + + /// \brief Dot products a vector with an other vector. + /// + /// Operates in the native datatype + /// + /// \param vector_1 = First vector used for the dot product. + /// \param vector_2 = Second vector used for the dot product. + /// \return The resulting dot product of the two vectors. + static Type dot(const Vec2& vector_1, const Vec2& vector_2) { return vector_1.x*vector_2.x + vector_1.y*vector_2.y; } + + /// \brief Rounds all components on a vector + /// + /// Uses Asymmetric Arithmetic Rounding + /// + /// \param vector = Vector to use + /// \return The rounded vector + static Vec2 round(const Vec2& vector); + + /// \brief Rotate a vector around another point. + /// + /// \param vector = Vector to use + /// \param hotspot The point around which to rotate. + /// \param angle = Angle to rotate. + static Vec2 rotate(const Vec2& vector, const Vec2& hotspot, const Angle &angle); + + /// \brief Returns the anchor point for the origin within the dimensions of the size structure. + /// + /// \param origin = The origin + /// \param size = The size + /// \return The point + static Pointx calc_origin(Origin origin, const Sizex &size); + + /// \brief Returns true if equal within the bounds of an epsilon + /// + /// \param first = Value A + /// \param second = Value B + /// \param epsilon = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) + static bool is_equal(const Vec2 &first, const Vec2 &second, Type epsilon) + { + Type diff_x = second.x - first.x; Type diff_y = second.y - first.y; + return (diff_x >= -epsilon && diff_x <= epsilon && diff_y >= -epsilon && diff_y <= epsilon); + } + + /// \brief Returns the length (magnitude) of this vector. + /// + /// Operates in the native datatype + /// + /// \return the length of the vector + Type length() const; + + /// \brief Normalizes this vector + /// + /// Operates in the native datatype + /// + /// \return reference to this object + Vec2 &normalize(); + + /// \brief Dot products this vector with an other vector. + /// + /// Operates in the native datatype + /// + /// \param vector Second vector used for the dot product. + /// + /// \return The resulting dot product of the two vectors. + Type dot(const Vec2& vector) const { return x*vector.x + y*vector.y; } + + /// \brief Calculate the angle between this vector and an other vector. + /// + /// \param vector = Second vector used to calculate angle. + /// + /// \return The angle between the two vectors + Angle angle(const Vec2& vector) const; + + /// \brief Calculate the angle between this vector and an other vector, where the vectors are unit vectors + /// + /// \param vector = Second vector used to calculate angle. + /// + /// \return The angle between the two vectors + Angle angle_normed(const Vec2& vector) const; + + /// \brief Calculate the angle of the line joining this point and other point + /// + /// \param point = Second point in the line + /// + /// \return The angle + Angle angle_line(const Vec2& point) const; + + /// \brief Calculate the distance between this vector and an other vector. + /// + /// \param vector = Second vector used to calculate distance. + /// + /// \return The distance between the two vectors. + Type distance(const Vec2& vector) const; + + /// \brief Rounds all components of this vector + /// + /// Uses Asymmetric Arithmetic Rounding + /// + /// \return reference to this object + Vec2 &round(); + + /// \brief Rotate this vector around another point. + /// + /// \param hotspot The point around which to rotate. + /// \param angle = Angle to rotate. + /// + /// \return reference to this object + Vec2 &rotate(const Vec2& hotspot, const Angle &angle); + + /// \brief Rounds a value for the datatype + /// + /// For doubles and floats, this function does not round. + /// \param value = Value to round + /// \return The rounded value + Type round_value(float value) const; + + /// \brief Returns true if equal within the bounds of an epsilon + /// + /// \param other = Other value + /// \param epsilon = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) + bool is_equal(const Vec2 &other, Type epsilon) const { return Vec2::is_equal(*this, other, epsilon); } + + /// \brief += operator. + void operator += (const Vec2& vector) { x += vector.x; y += vector.y; } + + /// \brief += operator. + void operator += (Type value) { x += value; y += value; } + + /// \brief -= operator. + void operator -= (const Vec2& vector) { x -= vector.x; y -= vector.y; } + + /// \brief -= operator. + void operator -= (Type value) { x -= value; y -= value; } + + /// \brief - operator. + Vec2 operator - () const { return Vec2(-x, -y); } + + /// \brief *= operator. + void operator *= (const Vec2& vector) { x *= vector.x; y *= vector.y; } + + /// \brief *= operator. + void operator *= (Type value) { x *= value; y *= value; } + + /// \brief /= operator. + void operator /= (const Vec2& vector) { x /= vector.x; y /= vector.y; } + + /// \brief /= operator. + void operator /= (Type value) { x /= value; y /= value; } + + /// \brief = operator. + Vec2 &operator = (const Vec2& vector) { x = vector.x; y = vector.y; return *this; } + + /// \brief == operator. + bool operator == (const Vec2& vector) const { return ((x == vector.x) && (y == vector.y)); } + + /// \brief != operator. + bool operator != (const Vec2& vector) const { return ((x != vector.x) || (y != vector.y)); } + + /// \brief < operator. + bool operator < (const Vec2& vector) const { return y < vector.y || (y == vector.y && x < vector.x); } + /// \} + }; + + /// \brief + operator. + template + Vec2 operator + (const Vec2& v1, const Vec2& v2) { return Vec2(v1.x + v2.x, v1.y + v2.y); } + + /// \brief + operator. + template + Vec2 operator + (Type s, const Vec2& v) { return Vec2(s + v.x, s + v.y); } + + /// \brief + operator. + template + Vec2 operator + (const Vec2& v, Type s) { return Vec2(v.x + s, v.y + s); } + + /// \brief - operator. + template + Vec2 operator - (const Vec2& v1, const Vec2& v2) { return Vec2(v1.x - v2.x, v1.y - v2.y); } + + /// \brief - operator. + template + Vec2 operator - (Type s, const Vec2& v) { return Vec2(s - v.x, s - v.y); } + + /// \brief - operator. + template + Vec2 operator - (const Vec2& v, Type s) { return Vec2(v.x - s, v.y - s); } + + /// \brief * operator. + template + Vec2 operator * (const Vec2& v1, const Vec2& v2) { return Vec2(v1.x * v2.x, v1.y * v2.y); } + + /// \brief * operator. + template + Vec2 operator * (Type s, const Vec2& v) { return Vec2(s * v.x, s * v.y); } + + /// \brief * operator. + template + Vec2 operator * (const Vec2& v, Type s) { return Vec2(v.x * s, v.y * s); } + + /// \brief / operator. + template + Vec2 operator / (const Vec2& v1, const Vec2& v2) { return Vec2(v1.x / v2.x, v1.y / v2.y); } + + /// \brief / operator. + template + Vec2 operator / (Type s, const Vec2& v) { return Vec2(s / v.x, s / v.y); } + + /// \brief / operator. + template + Vec2 operator / (const Vec2& v, Type s) { return Vec2(v.x / s, v.y / s); } + + template + Vec2 operator * (const Vec2& v, const Mat2& matrix) + { + return Vec2( + matrix[0 * 2 + 0] * v.x + matrix[0 * 2 + 1] * v.y, + matrix[1 * 2 + 0] * v.x + matrix[1 * 2 + 1] * v.y); + } + + template + Vec2 operator * (const Mat2& matrix, const Vec2& v) + { + return Vec2( + matrix[0 * 2 + 0] * v.x + matrix[1 * 2 + 0] * v.y, + matrix[0 * 2 + 1] * v.x + matrix[1 * 2 + 1] * v.y); + } + + ////////////////////////////////////////////////////////////////////////// + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (unsigned char)std::floor(copy.x + 0.5f); y = (unsigned char)std::floor(copy.y + 0.5f); } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (unsigned char)std::floor(copy.x + 0.5); y = (unsigned char)std::floor(copy.y + 0.5); } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (unsigned char)copy.x; y = (unsigned char)copy.y; } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (char)std::floor(copy.x + 0.5f); y = (char)std::floor(copy.y + 0.5f); } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (char)std::floor(copy.x + 0.5); y = (char)std::floor(copy.y + 0.5); } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (char)copy.x; y = (char)copy.y; } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (unsigned short)std::floor(copy.x + 0.5f); y = (unsigned short)std::floor(copy.y + 0.5f); } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (unsigned short)std::floor(copy.x + 0.5); y = (unsigned short)std::floor(copy.y + 0.5); } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (unsigned short)copy.x; y = (unsigned short)copy.y; } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (short)std::floor(copy.x + 0.5f); y = (short)std::floor(copy.y + 0.5f); } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (short)std::floor(copy.x + 0.5); y = (short)std::floor(copy.y + 0.5); } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (short)copy.x; y = (short)copy.y; } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (int)std::floor(copy.x + 0.5f); y = (int)std::floor(copy.y + 0.5f); } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (int)std::floor(copy.x + 0.5); y = (int)std::floor(copy.y + 0.5); } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (int)copy.x; y = (int)copy.y; } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (unsigned int)std::floor(copy.x + 0.5f); y = (unsigned int)std::floor(copy.y + 0.5f); } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (unsigned int)std::floor(copy.x + 0.5); y = (unsigned int)std::floor(copy.y + 0.5); } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (unsigned int)copy.x; y = (unsigned int)copy.y; } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (float)copy.x; y = (float)copy.y; } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (float)copy.x; y = (float)copy.y; } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (float)copy.x; y = (float)copy.y; } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (double)copy.x; y = (double)copy.y; } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (double)copy.x; y = (double)copy.y; } + + template<> + inline Vec2::Vec2(const Vec2 ©) { x = (double)copy.x; y = (double)copy.y; } + + template + inline Type Vec2::length() const { return (Type)floor(sqrt(float(x*x + y*y)) + 0.5f); } + + template<> + inline double Vec2::length() const { return sqrt(x*x + y*y); } + + template<> + inline float Vec2::length() const { return sqrt(x*x + y*y); } + + template + inline Vec2 &Vec2::normalize() { Type f = length(); if (f != 0) { x /= f; y /= f; } return *this; } + + template + inline Vec2 Vec2::normalize(const Vec2& vector) { Vec2 dest(vector); dest.normalize(); return dest; } + + ////////////////////////////////////////////////////////////////////////// + + typedef Vec2 Vec2ub; + typedef Vec2 Vec2b; + typedef Vec2 Vec2us; + typedef Vec2 Vec2s; + typedef Vec2 Vec2ui; + typedef Vec2 Vec2i; + typedef Vec2 Vec2f; + typedef Vec2 Vec2d; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/vec3.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/vec3.h new file mode 100644 index 0000000..59f6834 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/vec3.h @@ -0,0 +1,419 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +** Harry Storbacka +*/ + +#pragma once + +#include +#include "vec2.h" +#include "vec4.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + template + class Vec2; + + template + class Vec3; + + template + class Vec4; + + template + class Mat2; + + template + class Mat3; + + template + class Mat4; + + template + class Sizex; + + template + class Pointx; + + class Angle; + + /// \brief 3D vector + /// + /// These vector templates are defined for:\n + /// char (Vec3c), unsigned char (Vec3uc), short (Vec3s),\n + /// unsigned short (Vec3us), int (Vec3i), unsigned int (Vec3ui), float (Vecdf), double (Vec3d) + template + class Vec3 + { + public: + typedef Type datatype; + + union { Type x; Type s; Type r; }; + union { Type y; Type t; Type g; }; + union { Type z; Type u; Type b; }; + + Vec3() : x(0), y(0), z(0) { } + explicit Vec3(const Type &scalar) : x(scalar), y(scalar), z(scalar) { } + explicit Vec3(const Vec2 ©, const Type &p3) { x = copy.x; y = copy.y; z = p3; } + explicit Vec3(const Vec4 ©) { x = copy.x; y = copy.y; z = copy.z; } + + Vec3(const Vec3 ©); + Vec3(const Vec3 ©); + Vec3(const Vec3 ©); + + explicit Vec3(const Type &p1, const Type &p2, const Type &p3) : x(p1), y(p2), z(p3) { } + explicit Vec3(const Type *array_xyz) : x(array_xyz[0]), y(array_xyz[1]), z(array_xyz[2]) { } + + /// \brief Normalizes a vector + /// + /// \param vector = Vector to use + /// + /// Operates in the native datatype + static Vec3 normalize(const Vec3& vector); + + /// \brief Dot products between two vectors. + /// + /// \return The dot product + static Type dot(const Vec3& vector1, const Vec3& vector2) { return vector1.x*vector2.x + vector1.y*vector2.y + vector1.z*vector2.z; } + + /// \brief Calculate the cross product between two vectors. + /// + /// \param vector1 = The first vector + /// \param vector2 = The second vector + /// \return The cross product + static Vec3 cross(const Vec3& vector1, const Vec3& vector2); + + /// \brief Rotate a vector around an axis. Same as glRotate[f|d](angle, a); + /// + /// \param vector = Vector to use + /// \param angle = Angle to rotate. + /// \param axis = Rotation axis. + /// \return The rotated vector + static Vec3 rotate(const Vec3& vector, const Angle &angle, const Vec3& axis); + + /// \brief Rounds all components on a vector + /// + /// Uses Asymmetric Arithmetic Rounding + /// \param vector = Vector to use + /// \return The rounded vector + static Vec3 round(const Vec3& vector); + + /// \brief Calculate the reflection direction for an incident vector + /// + /// Normal vector should be normalized + static Vec3 reflect(const Vec3& incident, const Vec3& normal); + + /// \brief Returns true if equal within the bounds of an epsilon + /// + /// \param first = Value A + /// \param second = Value B + /// \param epsilon = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) + static bool is_equal(const Vec3 &first, const Vec3 &second, Type epsilon) + { + Type diff_x = second.x - first.x; Type diff_y = second.y - first.y; Type diff_z = second.z - first.z; + return (diff_x >= -epsilon && diff_x <= epsilon && diff_y >= -epsilon && diff_y <= epsilon && diff_z >= -epsilon && diff_z <= epsilon); + } + + /// \brief Returns the length (magnitude) of this vector. + /// + /// Operates in the native datatype + /// \return the length of the vector + Type length() const; + + /// \brief Normalizes this vector + /// + /// Operates in the native datatype + /// \return reference to this object + Vec3 &normalize(); + + /// \brief Dot products this vector with an other vector. + /// + /// Operates in the native datatype + /// + /// \param vector Second vector used for the dot product. + /// \return The resulting dot product of the two vectors. + Type dot(const Vec3& vector) const { return x*vector.x + y*vector.y + z*vector.z; } + + /// \brief Calculate the angle between this vector and an other vector. + /// + /// \param vector Second vector used to calculate angle. + /// + /// \return The angle between the two vectors. + Angle angle(const Vec3& vector) const; + + /// \brief Calculate the angle between this vector and an other vector, where the vectors are unit vectors + /// + /// \param vector Second vector used to calculate angle. + /// + /// \return The angle between the two vectors. + Angle angle_normed(const Vec3& vector) const; + + /// \brief Calculate the distance between this vector and an other vector. + /// + /// \param vector = Second vector used to calculate distance. + /// + /// \return The distance between the two vectors. + Type distance(const Vec3& vector) const; + + /// \brief Calculate the cross product between this vector and an other vector. + /// + /// Operates in the native datatype + /// \param vector = Second vector used to perform the calculation. + /// \return reference to this object + Vec3 &cross(const Vec3& vector); + + /// \brief Rotate this vector around an axis. Same as glRotate[f|d](angle, a); + /// + /// \param angle Angle to rotate. + /// \param axis Rotation axis. + /// \return reference to this object + Vec3 &rotate(const Angle &angle, const Vec3& axis); + + /// \brief Rounds all components on this vector + /// + //// Uses Asymmetric Arithmetic Rounding + /// \return reference to this object + Vec3 &round(); + + /// \brief Returns true if equal within the bounds of an epsilon + /// + /// \param other = Other value + /// \param epsilon = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) + bool is_equal(const Vec3 &other, Type epsilon) const { return Vec3::is_equal(*this, other, epsilon); } + + /// \brief += operator. + void operator += (const Vec3& vector) { x += vector.x; y += vector.y; z += vector.z; } + + /// \brief += operator. + void operator += (Type value) { x += value; y += value; z += value; } + + /// \brief -= operator. + void operator -= (const Vec3& vector) { x -= vector.x; y -= vector.y; z -= vector.z; } + + /// \brief -= operator. + void operator -= (Type value) { x -= value; y -= value; z -= value; } + + /// \brief - operator. + Vec3 operator - () const { return Vec3(-x, -y, -z); } + + /// \brief *= operator. + void operator *= (const Vec3& vector) { x *= vector.x; y *= vector.y; z *= vector.z; } + + /// \brief *= operator. + void operator *= (Type value) { x *= value; y *= value; z *= value; } + + /// \brief /= operator. + void operator /= (const Vec3& vector) { x /= vector.x; y /= vector.y; z /= vector.z; } + + /// \brief /= operator. + void operator /= (Type value) { x /= value; y /= value; z /= value; } + + /// \brief = operator. + Vec3 &operator = (const Vec3& vector) { x = vector.x; y = vector.y; z = vector.z; return *this; } + + /// \brief == operator. + bool operator == (const Vec3& vector) const { return ((x == vector.x) && (y == vector.y) && (z == vector.z)); } + + /// \brief != operator. + bool operator != (const Vec3& vector) const { return ((x != vector.x) || (y != vector.y) || (z != vector.z)); } + + /// \brief < operator. + bool operator < (const Vec3& vector) const { return z < vector.z || (z == vector.z && (y < vector.y || (y == vector.y && x < vector.x))); } + }; + + /// \brief + operator. + template + Vec3 operator + (const Vec3& v1, const Vec3& v2) { return Vec3(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z); } + + /// \brief + operator. + template + Vec3 operator + (Type s, const Vec3& v) { return Vec3(s + v.x, s + v.y, s + v.z); } + + /// \brief + operator. + template + Vec3 operator + (const Vec3& v, Type s) { return Vec3(v.x + s, v.y + s, v.z + s); } + + /// \brief - operator. + template + Vec3 operator - (const Vec3& v1, const Vec3& v2) { return Vec3(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z); } + + /// \brief - operator. + template + Vec3 operator - (Type s, const Vec3& v) { return Vec3(s - v.x, s - v.y, s - v.z); } + + /// \brief - operator. + template + Vec3 operator - (const Vec3& v, Type s) { return Vec3(v.x - s, v.y - s, v.z - s); } + + /// \brief * operator. + template + Vec3 operator * (const Vec3& v1, const Vec3& v2) { return Vec3(v1.x * v2.x, v1.y * v2.y, v1.z * v2.z); } + + /// \brief * operator. + template + Vec3 operator * (Type s, const Vec3& v) { return Vec3(s * v.x, s * v.y, s * v.z); } + + /// \brief * operator. + template + Vec3 operator * (const Vec3& v, Type s) { return Vec3(v.x * s, v.y * s, v.z * s); } + + /// \brief / operator. + template + Vec3 operator / (const Vec3& v1, const Vec3& v2) { return Vec3(v1.x / v2.x, v1.y / v2.y, v1.z / v2.z); } + + /// \brief / operator. + template + Vec3 operator / (Type s, const Vec3& v) { return Vec3(s / v.x, s / v.y, s / v.z); } + + /// \brief / operator. + template + Vec3 operator / (const Vec3& v, Type s) { return Vec3(v.x / s, v.y / s, v.z / s); } + + /// Matrix is assumed to be in the Column-Major matrix format (opengl native)\n + /// Note: "vec = vector * matrix" is different to "vec = matrix * vector" + template + Vec3 operator * (const Vec3& v, const Mat3& matrix) + { + return Vec3( + matrix[0 * 3 + 0] * v.x + matrix[0 * 3 + 1] * v.y + matrix[0 * 3 + 2] * v.z, + matrix[1 * 3 + 0] * v.x + matrix[1 * 3 + 1] * v.y + matrix[1 * 3 + 2] * v.z, + matrix[2 * 3 + 0] * v.x + matrix[2 * 3 + 1] * v.y + matrix[2 * 3 + 2] * v.z); + } + + /// Matrix is assumed to be in the Column-Major matrix format (opengl native)\n + /// Note: "vec = vector * matrix" is different to "vec = matrix * vector" + template + Vec3 operator * (const Mat3& matrix, const Vec3& v) + { + return Vec3( + matrix[0 * 3 + 0] * v.x + matrix[1 * 3 + 0] * v.y + matrix[2 * 3 + 0] * v.z, + matrix[0 * 3 + 1] * v.x + matrix[1 * 3 + 1] * v.y + matrix[2 * 3 + 1] * v.z, + matrix[0 * 3 + 2] * v.x + matrix[1 * 3 + 2] * v.y + matrix[2 * 3 + 2] * v.z); + } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (unsigned char)floor(copy.x + 0.5f); y = (unsigned char)floor(copy.y + 0.5f); z = (unsigned char)floor(copy.z + 0.5f); } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (unsigned char)floor(copy.x + 0.5); y = (unsigned char)floor(copy.y + 0.5); z = (unsigned char)floor(copy.z + 0.5); } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (unsigned char)copy.x; y = (unsigned char)copy.y; z = (unsigned char)copy.z; } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (char)floor(copy.x + 0.5f); y = (char)floor(copy.y + 0.5f); z = (char)floor(copy.z + 0.5f); } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (char)floor(copy.x + 0.5); y = (char)floor(copy.y + 0.5); z = (char)floor(copy.z + 0.5); } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (char)copy.x; y = (char)copy.y; z = (char)copy.z; } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (unsigned short)floor(copy.x + 0.5f); y = (unsigned short)floor(copy.y + 0.5f); z = (unsigned short)floor(copy.z + 0.5f); } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (unsigned short)floor(copy.x + 0.5); y = (unsigned short)floor(copy.y + 0.5); z = (unsigned short)floor(copy.z + 0.5); } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (unsigned short)copy.x; y = (unsigned short)copy.y; z = (unsigned short)copy.z; } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (short)floor(copy.x + 0.5f); y = (short)floor(copy.y + 0.5f); z = (short)floor(copy.z + 0.5f); } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (short)floor(copy.x + 0.5); y = (short)floor(copy.y + 0.5); z = (short)floor(copy.z + 0.5); } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (short)copy.x; y = (short)copy.y; z = (short)copy.z; } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (int)floor(copy.x + 0.5f); y = (int)floor(copy.y + 0.5f); z = (int)floor(copy.z + 0.5f); } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (int)floor(copy.x + 0.5); y = (int)floor(copy.y + 0.5); z = (int)floor(copy.z + 0.5); } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (int)copy.x; y = (int)copy.y; z = (int)copy.z; } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (unsigned int)floor(copy.x + 0.5f); y = (unsigned int)floor(copy.y + 0.5f); z = (unsigned int)floor(copy.z + 0.5f); } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (unsigned int)floor(copy.x + 0.5); y = (unsigned int)floor(copy.y + 0.5); z = (unsigned int)floor(copy.z + 0.5); } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (unsigned int)copy.x; y = (unsigned int)copy.y; z = (unsigned int)copy.z; } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (float)copy.x; y = (float)copy.y; z = (float)copy.z; } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (float)copy.x; y = (float)copy.y; z = (float)copy.z; } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (float)copy.x; y = (float)copy.y; z = (float)copy.z; } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (double)copy.x; y = (double)copy.y; z = (double)copy.z; } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (double)copy.x; y = (double)copy.y; z = (double)copy.z; } + + template<> + inline Vec3::Vec3(const Vec3 ©) { x = (double)copy.x; y = (double)copy.y; z = (double)copy.z; } + + template + inline Type Vec3::length() const { return (Type)floor(sqrt(float(x*x + y*y + z*z)) + 0.5f); } + + template<> + inline double Vec3::length() const { return sqrt(x*x + y*y + z*z); } + + template<> + inline float Vec3::length() const { return sqrt(x*x + y*y + z*z); } + + template + inline Vec3 &Vec3::normalize() { Type f = length(); if (f != 0) { x /= f; y /= f; z /= f; } return *this; } + + template + inline Vec3 Vec3::normalize(const Vec3& vector) { Vec3 dest(vector); dest.normalize(); return dest; } + + typedef Vec3 Vec3ub; + typedef Vec3 Vec3b; + typedef Vec3 Vec3us; + typedef Vec3 Vec3s; + typedef Vec3 Vec3ui; + typedef Vec3 Vec3i; + typedef Vec3 Vec3f; + typedef Vec3 Vec3d; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/vec4.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/vec4.h new file mode 100644 index 0000000..eb9f6fb --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Math/vec4.h @@ -0,0 +1,395 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +** Harry Storbacka +*/ + +#pragma once + +#include +#include "vec2.h" +#include "vec3.h" + +namespace clan +{ + /// \addtogroup clanCore_Math clanCore Math + /// \{ + + template + class Vec2; + + template + class Vec3; + + template + class Vec4; + + template + class Mat2; + + template + class Mat3; + + template + class Mat4; + + template + class Sizex; + + template + class Pointx; + + class Angle; + + /// \brief 4D vector + /// + /// These vector templates are defined for:\n + /// char (Vec4c), unsigned char (Vec4uc), short (Vec4s),\n + /// unsigned short (Vec4us), int (Vec4i), unsigned int (Vec4ui), float (Vec4f), double (Vec4d) + template + class Vec4 + { + public: + typedef Type datatype; + + union { Type x; Type s; Type r; }; + union { Type y; Type t; Type g; }; + union { Type z; Type u; Type b; }; + union { Type w; Type v; Type a; }; + + Vec4() : x(0), y(0), z(0), w(0) { } + explicit Vec4(const Type &scalar) : x(scalar), y(scalar), z(scalar), w(scalar) { } + explicit Vec4(const Vec2 ©, const Type &p3, const Type &p4) { x = copy.x; y = copy.y; z = p3; w = p4; } + explicit Vec4(const Vec2 ©, const Vec2 ©34) { x = copy.x; y = copy.y; z = copy34.x; w = copy34.y; } + explicit Vec4(const Vec3 ©, const Type &p4) { x = copy.x; y = copy.y; z = copy.z; w = p4; } + explicit Vec4(const Type &p1, const Type &p2, const Type &p3, const Type &p4) : x(p1), y(p2), z(p3), w(p4) { } + explicit Vec4(const Type &p1, const Type &p2, const Vec2 ©34) : x(p1), y(p2), z(copy34.x), w(copy34.y) { } + explicit Vec4(const Type *array_xyzw) : x(array_xyzw[0]), y(array_xyzw[1]), z(array_xyzw[2]), w(array_xyzw[3]) { } + + /// \brief Normalizes a vector (not taking into account the w ordinate) + /// + /// Operates in the native datatype + /// \param vector = The vector to use + /// \return the normalized vector + static Vec4 normalize3(const Vec4 &vector); + + /// \brief Normalizes a vector (taking into account the w ordinate) + /// + /// Operates in the native datatype + /// \param vector = The vector to use + /// \return the normalized vector + static Vec4 normalize4(const Vec4 &vector); + + /// \brief Dot products between two vectors (not taking into account the w ordinate). + /// + /// Operates in the native datatype + /// + /// \param vector1 First vector used for the dot product. + /// \param vector2 Second vector used for the dot product. + /// \return The resulting dot product of the two vectors. + static Type dot3(const Vec4& vector1, const Vec4& vector2) { return vector1.x*vector2.x + vector1.y*vector2.y + vector1.z*vector2.z; } + + /// \brief Dot products between two vectors (taking into account the w ordinate). + /// + /// Operates in the native datatype + /// + /// \param vector1 First vector used for the dot product. + /// \param vector2 Second vector used for the dot product. + /// \return The resulting dot product of the two vectors. + static Type dot4(const Vec4& vector1, const Vec4& vector2) { return vector1.x*vector2.x + vector1.y*vector2.y + vector1.z*vector2.z + vector1.w*vector2.w; } + + /// \brief Calculate the cross product between two vectors (not taking into account the w ordinate). + /// + /// \vector1 = The first vector + /// \vector2 = The second vector + /// \return = Cross product + static Vec4 cross3(const Vec4& vector1, const Vec4& vector2); + + /// \brief Rotate a vector around an axis. Same as glRotate[f|d](angle, a); + /// + /// Not taking into account the w ordinate\n + /// The w ordinate is not modified + /// + /// \param vector = The vector to use + /// \param angle Angle to rotate + /// \param axis Rotation axis. + /// \return The rotated vector + static Vec4 rotate3(const Vec4& vector, const Angle &angle, const Vec4& axis); + + /// \brief Rounds all components on a vector. + /// + /// Includes the w ordinate\n + /// Uses Asymmetric Arithmetic Rounding + /// \param vector = The vector to use + /// \return The rounded vector + static Vec4 round(const Vec4& vector); + + /// \brief Returns true if equal within the bounds of an epsilon + /// + /// \param first = Value A + /// \param second = Value B + /// \param epsilon = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) + static bool is_equal(const Vec4 &first, const Vec4 &second, Type epsilon) + { + Type diff_x = second.x - first.x; Type diff_y = second.y - first.y; Type diff_z = second.z - first.z; Type diff_w = second.w - first.w; + return (diff_x >= -epsilon && diff_x <= epsilon && diff_y >= -epsilon && diff_y <= epsilon && diff_z >= -epsilon && diff_z <= epsilon && diff_w >= -epsilon && diff_w <= epsilon); + } + + void set_xy(const Vec2 &new_v) { x = new_v.x; y = new_v.y; } + void set_zw(const Vec2 &new_v) { z = new_v.x; w = new_v.y; } + + /// \brief Returns the length (magnitude) of this vector (not taking into account the w ordinate). + /// + /// Operates in the native datatype + /// + /// \return the length of the vector */ + Type length3() const; + + /// \brief Returns the length (magnitude) of this vector (taking into account the w ordinate). + /// + /// Operates in the native datatype + /// + /// \return the length of the vector */ + Type length4() const; + + /// \brief Normalizes this vector (not taking into account the w ordinate) + /// + /// Operates in the native datatype + /// \return reference to this object + Vec4 &normalize3(); + + /// \brief Normalizes this vector (taking into account the w ordinate) + /// + /// Operates in the native datatype + /// \return reference to this object + Vec4 &normalize4(); + + /// \brief Dot products this vector with an other vector (not taking into account the w ordinate). + /// + /// Operates in the native datatype + /// + /// \param vector Second vector used for the dot product. + /// \return The resulting dot product of the two vectors. + Type dot3(const Vec4& vector) const { return x*vector.x + y*vector.y + z*vector.z; } + + /// \brief Dot products this vector with an other vector (taking into account the w ordinate). + /// + /// Operates in the native datatype + /// + /// \param vector Second vector used for the dot product. + /// \return The resulting dot product of the two vectors. + Type dot4(const Vec4& vector) const { return x*vector.x + y*vector.y + z*vector.z + w*vector.w; } + + /// \brief Calculate the angle between this vector and an other vector (not taking into account the w ordinate). + /// + /// \param vector = Second vector used to calculate angle. + /// + /// \return The angle between the two vectors. + Angle angle3(const Vec4& vector) const; + + /// \brief Calculate the distance between this vector and an other vector (not taking into account the w ordinate). + /// + /// \param vector = Second vector used to calculate distance. + /// + /// \return The distance between the two vectors. + Type distance3(const Vec4& vector) const; + + /// \brief Calculate the distance between this vector and an other vector (taking into account the w ordinate). + /// + /// \param vector = Second vector used to calculate distance. + /// + /// \return The distance between the two vectors. + Type distance4(const Vec4& vector) const; + + /// \brief Calculate the cross product between this vector and an other vector (not taking into account the w ordinate). + /// + /// Operates in the native datatype + /// + /// \param vector Second vector used to perform the calculation. + /// \return reference to this object + Vec4 &cross3(const Vec4& vector); + + /// \brief Rotate this vector around an axis. Same as glRotate[f|d](angle, a); + /// + /// Not taking into account the w ordinate\n + /// The w ordinate is not modified + /// + /// \param angle Angle to rotate + /// \param axis Rotation axis. + /// \return reference to this object + Vec4 &rotate3(const Angle &angle, const Vec4& axis); + + /// \brief Rounds all components on this vector. + /// + /// Includes the w ordinate\n + /// Uses Asymmetric Arithmetic Rounding + /// \return reference to this object + Vec4 &round(); + + /// \brief Returns true if equal within the bounds of an epsilon + /// + /// \param other = Other value + /// \param epsilon = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) + bool is_equal(const Vec4 &other, Type epsilon) const { return Vec4::is_equal(*this, other, epsilon); } + + /// \brief += operator. + void operator += (const Vec4& vector) { x += vector.x; y += vector.y; z += vector.z; w += vector.w; } + + /// \brief += operator. + void operator += (Type value) { x += value; y += value; z += value; w += value; } + + /// \brief -= operator. + void operator -= (const Vec4& vector) { x -= vector.x; y -= vector.y; z -= vector.z; w -= vector.w; } + + /// \brief -= operator. + void operator -= (Type value) { x -= value; y -= value; z -= value; w -= value; } + + /// \brief - operator. + Vec4 operator - () const { return Vec4(-x, -y, -z, -w); } + + /// \brief *= operator. + void operator *= (const Vec4& vector) { x *= vector.x; y *= vector.y; z *= vector.z; w *= vector.w; } + + /// \brief *= operator. + void operator *= (Type value) { x *= value; y *= value; z *= value; w *= value; } + + /// \brief /= operator. + void operator /= (const Vec4& vector) { x /= vector.x; y /= vector.y; z /= vector.z; w /= vector.w; } + + /// \brief /= operator. + void operator /= (Type value) { x /= value; y /= value; z /= value; w /= value; } + + /// \brief = operator. + Vec4 &operator = (const Vec4& vector) { x = vector.x; y = vector.y; z = vector.z; w = vector.w; return *this; } + + /// \brief == operator. + bool operator == (const Vec4& vector) const { return ((x == vector.x) && (y == vector.y) && (z == vector.z) && (w == vector.w)); } + + /// \brief != operator. + bool operator != (const Vec4& vector) const { return ((x != vector.x) || (y != vector.y) || (z != vector.z) || (w != vector.w)); } + + /// \brief < operator. + bool operator < (const Vec4& vector) const { return w < vector.w || (w == vector.w && (z < vector.z || (z == vector.z && (y < vector.y || (y == vector.y && x < vector.x))))); } + }; + + /// \brief + operator. + template + Vec4 operator + (const Vec4& v1, const Vec4& v2) { return Vec4(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z, v1.w + v2.w); } + + /// \brief + operator. + template + Vec4 operator + (Type s, const Vec4& v) { return Vec4(s + v.x, s + v.y, s + v.z, s + v.w); } + + /// \brief + operator. + template + Vec4 operator + (const Vec4& v, Type s) { return Vec4(v.x + s, v.y + s, v.z + s, v.w + s); } + + /// \brief - operator. + template + Vec4 operator - (const Vec4& v1, const Vec4& v2) { return Vec4(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z, v1.w - v2.w); } + + /// \brief - operator. + template + Vec4 operator - (Type s, const Vec4& v) { return Vec4(s - v.x, s - v.y, s - v.z, s - v.w); } + + /// \brief - operator. + template + Vec4 operator - (const Vec4& v, Type s) { return Vec4(v.x - s, v.y - s, v.z - s, v.w - s); } + + /// \brief * operator. + template + Vec4 operator * (const Vec4& v1, const Vec4& v2) { return Vec4(v1.x * v2.x, v1.y * v2.y, v1.z * v2.z, v1.w * v2.w); } + + /// \brief * operator. + template + Vec4 operator * (Type s, const Vec4& v) { return Vec4(s * v.x, s * v.y, s * v.z, s * v.w); } + + /// \brief * operator. + template + Vec4 operator * (const Vec4& v, Type s) { return Vec4(v.x * s, v.y * s, v.z * s, v.w * s); } + + /// \brief / operator. + template + Vec4 operator / (const Vec4& v1, const Vec4& v2) { return Vec4(v1.x / v2.x, v1.y / v2.y, v1.z / v2.z, v1.w / v2.w); } + + /// \brief / operator. + template + Vec4 operator / (Type s, const Vec4& v) { return Vec4(s / v.x, s / v.y, s / v.z, s / v.w); } + + /// \brief / operator. + template + Vec4 operator / (const Vec4& v, Type s) { return Vec4(v.x / s, v.y / s, v.z / s, v.w / s); } + + template + Vec4 operator * (const Vec4& v, const Mat4& matrix) + { + return Vec4( + matrix[0 * 4 + 0] * v.x + matrix[0 * 4 + 1] * v.y + matrix[0 * 4 + 2] * v.z + matrix[0 * 4 + 3] * v.w, + matrix[1 * 4 + 0] * v.x + matrix[1 * 4 + 1] * v.y + matrix[1 * 4 + 2] * v.z + matrix[1 * 4 + 3] * v.w, + matrix[2 * 4 + 0] * v.x + matrix[2 * 4 + 1] * v.y + matrix[2 * 4 + 2] * v.z + matrix[2 * 4 + 3] * v.w, + matrix[3 * 4 + 0] * v.x + matrix[3 * 4 + 1] * v.y + matrix[3 * 4 + 2] * v.z + matrix[3 * 4 + 3] * v.w); + } + + template + Vec4 operator * (const Mat4& matrix, const Vec4& v) + { + return Vec4( + matrix[0 * 4 + 0] * v.x + matrix[1 * 4 + 0] * v.y + matrix[2 * 4 + 0] * v.z + matrix[3 * 4 + 0] * v.w, + matrix[0 * 4 + 1] * v.x + matrix[1 * 4 + 1] * v.y + matrix[2 * 4 + 1] * v.z + matrix[3 * 4 + 1] * v.w, + matrix[0 * 4 + 2] * v.x + matrix[1 * 4 + 2] * v.y + matrix[2 * 4 + 2] * v.z + matrix[3 * 4 + 2] * v.w, + matrix[0 * 4 + 3] * v.x + matrix[1 * 4 + 3] * v.y + matrix[2 * 4 + 3] * v.z + matrix[3 * 4 + 3] * v.w); + } + + template + inline Type Vec4::length3() const { return (Type)floor(sqrt(float(x*x + y*y + z*z)) + 0.5f); } + + template<> + inline double Vec4::length3() const { return sqrt(x*x + y*y + z*z); } + + template<> + inline float Vec4::length3() const { return sqrt(x*x + y*y + z*z); } + + template + inline Type Vec4::length4() const { return (Type)floor(sqrt(float(x*x + y*y + z*z + w*w)) + 0.5f); } + + template<> + inline double Vec4::length4() const { return sqrt(x*x + y*y + z*z + w*w); } + + template<> + inline float Vec4::length4() const { return sqrt(x*x + y*y + z*z + w*w); } + + typedef Vec4 Vec4ub; + typedef Vec4 Vec4b; + typedef Vec4 Vec4us; + typedef Vec4 Vec4s; + typedef Vec4 Vec4ui; + typedef Vec4 Vec4i; + typedef Vec4 Vec4f; + typedef Vec4 Vec4d; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/file_resource_document.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/file_resource_document.h new file mode 100644 index 0000000..15bb43d --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/file_resource_document.h @@ -0,0 +1,67 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include "../IOData/file_system.h" +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_Resources clanCore Resources + /// \{ + + class IODevice; + class FileSystem; + class FileResourceDocument_Impl; + + /// \brief File Resource Document. + class FileResourceDocument + { + public: + /// \brief Construct a FileResourceDocument. + FileResourceDocument(); + + /// \brief Constructs a FileResourceDocument + /// + /// \param fs = File system + FileResourceDocument(const FileSystem &fs); + + ~FileResourceDocument(); + + // \brief Get the file system + FileSystem get_file_system() const; + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/file_resource_manager.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/file_resource_manager.h new file mode 100644 index 0000000..542aba9 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/file_resource_manager.h @@ -0,0 +1,62 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include +#include +#include + +#include "file_resource_document.h" + +namespace clan +{ + /// \addtogroup clanCore_Resources clanCore Resources + /// \{ + + class ResourceManager; + + /// \brief Resource manager loading from FileResourceDocument + class FileResourceManager + { + public: + /// \brief Creates a resource manager + static ResourceManager create(const FileResourceDocument &doc = FileResourceDocument()); + + /// \brief Adds a cache factory callback + /// + /// Each factory callback is invoked every time a resource manager is created. + static void add_cache_factory(std::function factory_callback); + + /// \brief Gets the XML resource document used by a resource manager. + static FileResourceDocument &get_doc(const ResourceManager &manager); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource.h new file mode 100644 index 0000000..6440858 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource.h @@ -0,0 +1,126 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_Resources clanCore Resources + /// \{ + + class Resource_BaseImpl + { + public: + virtual ~Resource_BaseImpl() { } + }; + + template + class Resource_Impl : public Resource_BaseImpl + { + public: + Resource_Impl() : value(), generation(0) { } + Resource_Impl(const Type &initial_value) : value(initial_value), generation(0) { } + Type value; + int generation; + }; + + /// \brief Resource proxy of a specific type + template + class Resource + { + public: + Resource() + : object(new Resource_Impl()), generation(-1) + { + } + + Resource(std::shared_ptr > object) + : object(object), generation(-1) + { + } + + Resource(const Type &initial_value) + : object(new Resource_Impl(initial_value)), generation(-1) + { + } + + Type *operator->() + { + return &object->value; + } + + const Type *operator->() const + { + return &object->value; + } + + bool updated() + { + bool updated = (generation != object->generation); + generation = object->generation; + return updated; + } + + void set(const Type &value) + { + object->value = value; + generation = ++object->generation; + } + + Type &get() + { + return object->value; + } + + const Type &get() const + { + return object->value; + } + + operator Type&() { return object->value; } + operator const Type&() const { return object->value; } + + const std::shared_ptr > &handle() const { return object; } + + bool operator<(const Resource &other) const { return object < other.object; } + bool operator<=(const Resource &other) const { return object <= other.object; } + bool operator>(const Resource &other) const { return object > other.object; } + bool operator>=(const Resource &other) const { return object >= other.object; } + bool operator==(const Resource &other) const { return object == other.object; } + bool operator!=(const Resource &other) const { return object != other.object; } + + private: + std::shared_ptr > object; + int generation; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource_container.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource_container.h new file mode 100644 index 0000000..263eb08 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource_container.h @@ -0,0 +1,70 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "resource_object.h" +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_Resources clanCore Resources + /// \{ + + class ResourceContainer_Impl + { + public: + std::map resources; + }; + + class ResourceContainer + { + public: + ResourceContainer() : impl(std::make_shared()) + { + } + + template + Resource get(const std::string &name) + { + auto it = impl->resources.find(name); + if (it != impl->resources.end()) + return it->second.cast(); + + Resource resource; + impl->resources[name] = resource; + return resource; + } + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource_manager.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource_manager.h new file mode 100644 index 0000000..9ed8d80 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource_manager.h @@ -0,0 +1,70 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../System/userdata.h" +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_Resources clanCore Resources + /// \{ + + class ResourceManager_Impl; + + /// \brief Resource manager. + class ResourceManager + { + public: + /// \brief Construct a ResourceManager. + ResourceManager(); + ~ResourceManager(); + + template + std::shared_ptr get_cache(const std::string &name) const + { + return get_cache_owner(name).get_data(); + } + + template + void set_cache(const std::string &name, const std::shared_ptr &cache) + { + set_cache_owner(name).set_data(cache); + } + + private: + UserDataOwner &get_cache_owner(const std::string &name) const; + UserDataOwner &set_cache_owner(const std::string &name); + + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource_object.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource_object.h new file mode 100644 index 0000000..3628188 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Resources/resource_object.h @@ -0,0 +1,82 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "resource.h" + +namespace clan +{ + /// \addtogroup clanCore_Resources clanCore Resources + /// \{ + + /// \brief Resource proxy of any type + class ResourceObject + { + public: + ResourceObject() + { + } + + template + ResourceObject(const Resource &resource) + : object(resource.handle()) + { + } + + bool is_null() const { return !object; } + + template + Resource cast() + { + if (object) + { + std::shared_ptr > resource = std::dynamic_pointer_cast>(object); + if (!resource) + throw Exception("ResourceObject type mismatch"); + return Resource(resource); + } + else + { + throw Exception("ResourceObject is null"); + } + } + + bool operator<(const ResourceObject &other) const { return object < other.object; } + bool operator<=(const ResourceObject &other) const { return object <= other.object; } + bool operator>(const ResourceObject &other) const { return object > other.object; } + bool operator>=(const ResourceObject &other) const { return object >= other.object; } + bool operator==(const ResourceObject &other) const { return object == other.object; } + bool operator!=(const ResourceObject &other) const { return object != other.object; } + + private: + std::shared_ptr object; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Signals/bind_member.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Signals/bind_member.h new file mode 100644 index 0000000..2ef99fd --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Signals/bind_member.h @@ -0,0 +1,43 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Marcel Hellwig +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Signals clanCore Signals + /// \{ + + template + std::function bind_member(T* instance, R(T::*method)(Args...)) { return [=](Args && ... args) -> R { return (instance->*method)(std::forward(args)...); }; } + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Signals/signal.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Signals/signal.h new file mode 100644 index 0000000..0b13695 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Signals/signal.h @@ -0,0 +1,160 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "bind_member.h" +#include +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_Signals clanCore Signals + /// \{ + + class SlotImpl; + + class Slot + { + public: + Slot() { } + + operator bool() const { return static_cast(impl); } + + template + explicit Slot(T impl) : impl(impl) { } + + private: + std::shared_ptr impl; + }; + + class SlotImpl + { + public: + SlotImpl() { } + SlotImpl(const SlotImpl &) = delete; + SlotImpl &operator=(const SlotImpl &) = delete; + virtual ~SlotImpl() { } + }; + + template + class SignalImpl + { + public: + std::vector> slots; + }; + + template + class SlotImplT : public SlotImpl + { + public: + SlotImplT(const std::weak_ptr> &signal, const std::function &callback) : signal(signal), callback(callback) + { + } + + ~SlotImplT() + { + std::shared_ptr> sig = signal.lock(); + if (sig) + { + for (auto it = sig->slots.begin(); it != sig->slots.end(); ++it) + { + // todo: investigate if "it->lock().get() == this" is required + if (it->expired() || it->lock().get() == this) + { + it = sig->slots.erase(it); + if (it == sig->slots.end()) + break; + } + } + } + } + + std::weak_ptr> signal; + std::function callback; + }; + + template + class Signal + { + public: + Signal() : impl(std::make_shared>>()) { } + + template + void operator()(Args&&... args) + { + std::vector>> slots = impl->slots; + for (std::weak_ptr> &weak_slot : slots) + { + std::shared_ptr> slot = weak_slot.lock(); + if (slot) + { + slot->callback(std::forward(args)...); + } + } + } + + Slot connect(const std::function &func) + { + auto slot_impl = std::make_shared>(impl, func); + impl->slots.push_back(slot_impl); + return Slot(slot_impl); + } + + template + Slot connect(InstanceType instance, MemberFuncType func) + { + return connect(bind_member(instance, func)); + } + + private: + std::shared_ptr>> impl; + }; + + class SlotContainer + { + public: + template + void connect(Signal &signal, InstanceType instance, MemberFuncType func) + { + slots.push_back(signal.connect(instance, func)); + } + + template + void connect(Signal &signal, CallbackType func) + { + slots.push_back(signal.connect(func)); + } + + private: + std::vector slots; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/block_allocator.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/block_allocator.h new file mode 100644 index 0000000..7fc8511 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/block_allocator.h @@ -0,0 +1,91 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "system.h" +#include + +namespace clan +{ + /// \addtogroup clanCore_System clanCore System + /// \{ + + class BlockAllocator_Impl; + + /// \brief Memory allocator that allocates in blocks. + /// + ///

This allocator will never free any memory until free() is called or + /// the allocator object is destroyed. If any objects have been new'ed using + /// BlockAllocated they have to be delete'ed before free() is called, + /// otherwise the destructors of the objects will not get called. Same rules + /// apply to the new_obj and delete_obj template functions.

+ ///

The allocator allocates memory from the heap in blocks. Each time the + /// allocated block is exhausted, the allocator will double the block size + /// and allocate more memory.

+ class BlockAllocator + { + public: + /// \brief Block Allocator constructor + BlockAllocator(); + + /// \brief Allocate memory (See note on this class for the allocation method) + /** + param: size = Size to allocate (in bytes) + \return The memory*/ + void *allocate(int size); + + /// \brief Free the allocated memory + /** If required, use delete_obj() to call the destructor before using this function*/ + void free(); + + private: + std::shared_ptr impl; + }; + + /// \brief Class with operator new/delete overloads for BlockAllocator. + /// + ///

To use this class, derive your class from BlockAllocated. Then, to + /// allocate your class, use the following operator new syntax:

+ ///
+	///      BlockAllocator allocator;
+	///      MyObject *obj = new(&allocator) MyObject(..);
+	///    
+ ///

Before freeing up the memory using BlockAllocator::free() you have + /// to delete the object first using operator delete. If you fail to do this + /// the destructor will not get called.

+ class BlockAllocated + { + public: + void *operator new(size_t size, BlockAllocator *allocator); + void operator delete(void *data, size_t size); + void operator delete(void *data, BlockAllocator *allocator); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/cl_platform.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/cl_platform.h new file mode 100644 index 0000000..0a35d18 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/cl_platform.h @@ -0,0 +1,52 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include +#include + +#ifndef __GNUC__ // GCC automatically sets __SSE2__ +#ifndef CL_DISABLE_SSE2 +#define __SSE__ +#define __SSE2__ +#endif +#endif + +namespace clan +{ + /// \addtogroup clanCore_System clanCore System + /// \{ + + const float PI_F = 3.14159274101257f; + const double PI_D = 3.141592653589793115998; + const float PI = 3.14159274101257f; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/comptr.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/comptr.h new file mode 100644 index 0000000..72ddc49 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/comptr.h @@ -0,0 +1,83 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +namespace clan +{ + /// \brief ComPtr + template + class ComPtr + { + public: + ComPtr() : ptr(0) { } + explicit ComPtr(Type *ptr) : ptr(ptr) { } + ComPtr(const ComPtr ©) : ptr(copy.ptr) { if (ptr) ptr->AddRef(); } + ~ComPtr() { clear(); } + ComPtr &operator =(const ComPtr ©) + { + if (this == ©) + return *this; + if (copy.ptr) + copy.ptr->AddRef(); + if (ptr) + ptr->Release(); + ptr = copy.ptr; + return *this; + } + + template + explicit ComPtr(const ComPtr &that) + : ptr(static_cast(that.ptr)) + { + if (ptr) + ptr->AddRef(); + } + + bool operator ==(const ComPtr &other) const { return ptr == other.ptr; } + bool operator !=(const ComPtr &other) const { return ptr != other.ptr; } + bool operator <(const ComPtr &other) const { return ptr < other.ptr; } + bool operator <=(const ComPtr &other) const { return ptr <= other.ptr; } + bool operator >(const ComPtr &other) const { return ptr > other.ptr; } + bool operator >=(const ComPtr &other) const { return ptr >= other.ptr; } + + // const does not exist in COM, so we drop the const qualifier on returned objects to avoid needing mutable variables elsewhere + + Type * const operator ->() const { return const_cast(ptr); } + Type *operator ->() { return ptr; } + operator Type *() const { return const_cast(ptr); } + operator bool() const { return ptr != 0; } + + bool is_null() const { return ptr == 0; } + void clear() { if (ptr) ptr->Release(); ptr = 0; } + Type *get() const { return const_cast(ptr); } + Type **output_variable() { clear(); return &ptr; } + + Type *ptr; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/console_window.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/console_window.h new file mode 100644 index 0000000..a6c254a --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/console_window.h @@ -0,0 +1,73 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanCore_System clanCore System + /// \{ + + class ConsoleWindow_Impl; + + /// \brief Text console window. + /// + /// Note: This class has no effect under Linux. + class ConsoleWindow + { + public: + /// \brief Console Window constructor. + /// + /// \param title Window title of console window. + /// \param width Columns in console window. + /// \param height Rows in console window. + ConsoleWindow( + const std::string &title, + int width = 80, + int height = 25); + + /// \brief Console Window destructor. + ~ConsoleWindow(); + + /// \brief Waits until user hits a key. + /// + /// This function does not do anything on Linux. + void wait_for_key(); + + /// \brief Displays 'press any key to close this console window', + /// \brief and waits until user hits a key. + /// + /// This function does not do anything on Linux. + void display_close_message(); + + private: + ConsoleWindow_Impl *impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/databuffer.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/databuffer.h new file mode 100644 index 0000000..f85e45a --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/databuffer.h @@ -0,0 +1,90 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_System clanCore System + /// \{ + + class DataBuffer_Impl; + + /// \brief General purpose data buffer. + class DataBuffer + { + public: + /// \brief Constructs a data buffer of 0 size. + DataBuffer(); + DataBuffer(unsigned int size); + DataBuffer(const void *data, unsigned int size); + DataBuffer(const DataBuffer &data, unsigned int pos, unsigned int size); + ~DataBuffer(); + + /// \brief Returns a pointer to the data. + char *get_data(); + + const char *get_data() const; + + template + Type *get_data() { return reinterpret_cast(get_data()); } + + template + const Type *get_data() const { return reinterpret_cast(get_data()); } + + /// \brief Returns the size of the data. + unsigned int get_size() const; + + /// \brief Returns the capacity of the data buffer object. + unsigned int get_capacity() const; + + /// \brief Returns a char in the buffer. + char &operator[](int i); + const char &operator[](int i) const; + char &operator[](unsigned int i); + const char &operator[](unsigned int i) const; + + /// \brief Returns true if the buffer is 0 in size. + bool is_null() const; + + DataBuffer &operator =(const DataBuffer ©); + + /// \brief Resize the buffer. + void set_size(unsigned int size); + + /// \brief Preallocate enough memory. + void set_capacity(unsigned int capacity); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/datetime.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/datetime.h new file mode 100644 index 0000000..4996b46 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/datetime.h @@ -0,0 +1,174 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Kenneth Gangstoe +** Harry Storbacka +*/ + +#pragma once + +#include "../System/cl_platform.h" + +namespace clan +{ + /// \addtogroup clanCore_System clanCore System + /// \{ + + /// \brief Date/Time class. + class DateTime + { + public: + enum TimeZone + { + local_timezone, + utc_timezone + }; + + /// \brief Constructs a date/time object. + DateTime(); + DateTime(int year, int month, int day, int hour = 0, int minute = 0, int seconds = 0, int nanoseconds = 0, TimeZone timezone = utc_timezone); + ~DateTime(); + + /// \brief Get current system time in local time zone. + static DateTime get_current_local_time(); + + /// \brief Get current system time in UTC. + static DateTime get_current_utc_time(); + + /// \brief Converts a time tick value (number of 100-nanosecond intervals since January 1, 1601 UTC) to a date time in the local time zone. + static DateTime get_local_time_from_ticks(int64_t ticks); + + /// \brief Converts a time tick value (number of 100-nanosecond intervals since January 1, 1601 UTC) to a date time in UTC. + static DateTime get_utc_time_from_ticks(int64_t ticks); + + static DateTime from_short_date_string(const std::string &value); + + bool is_null() const; + unsigned short get_year() const; + + /// \brief Returns the month number in range 1-12. + /// + /// \return 1 = Jan ... 12 = December + unsigned char get_month() const; + unsigned char get_day() const; + unsigned char get_hour() const; + unsigned char get_minutes() const; + unsigned char get_seconds() const; + unsigned int get_nanoseconds() const; + TimeZone get_timezone() const; + + /// \brief Returns the ISO 8601 week number of the date. + /// + /// \return Week number: 1-53. + unsigned char get_week() const; + + /// \brief Returns the difference in days between two dates. + /// This function is only accurate for the next few millenniums. + /// \return Number of days between dates. Returns a negative value if 'other' is before 'this'. + int get_difference_in_days(const DateTime &other) const; + + /// \brief Get the day of the week + /// + /// \return 0 = Sunday ... 6 = Saturday + unsigned int get_day_of_week() const; + + /// \brief Returns the number of days in the given month. + /// + /// \return number of days: 28-31. + static int get_days_in_month(int month, int year); + + void set_null(); + void set_date(int year, int month, int day, int hour = 0, int minute = 0, int seconds = 0, int nanoseconds = 0, TimeZone timezone = utc_timezone); + void set_year(int year); + void set_month(int month); + void set_day(int day); + void set_hour(int hour); + void set_minutes(int minutes); + void set_seconds(int seconds); + void set_nanoseconds(int nanoseconds); + void set_timezone(TimeZone timezone); + + DateTime &add_years(int years); + DateTime &add_days(int days); + DateTime &add_months(int months); + /* + void add_hours(int hours); + void add_minutes(int minutes); + void add_seconds(int seconds); + void add_nanoseconds(int nanoseconds); + */ + DateTime to_utc() const; + DateTime to_local() const; + + /// \brief Converts the date to the number of 100-nanosecond intervals since January 1, 1601 UTC. + int64_t to_ticks() const; + + /// \brief Mon Mar 3 2007 + std::string to_long_date_string() const; + + /// \brief yyyy-mm-dd + std::string to_short_date_string() const; + + /// \brief yyyy-mm-dd hh:mm:ss + std::string to_short_datetime_string() const; + + /// \brief hh:mm:ss + std::string to_long_time_string() const; + + /// \brief hh:mm + std::string to_short_time_string() const; + + /// \brief Mon Feb 3 12:32:54 2008 + std::string to_string() const; + + bool operator <(const DateTime &other) const; + bool operator <=(const DateTime &other) const; + bool operator >(const DateTime &other) const; + bool operator >=(const DateTime &other) const; + bool operator ==(const DateTime &other) const; + bool operator !=(const DateTime &other) const; + + private: + void throw_if_invalid_date(int year, int month, int day, int hour, int minute, int seconds, int nanoseconds) const; + void throw_if_null() const; + + int get_day_number() const; + void set_date_from_daynumber(int g); + + unsigned short year; + unsigned char month; + unsigned char day; + unsigned char hour; + unsigned char minute; + unsigned char seconds; + unsigned int nanoseconds; + + TimeZone timezone; + static const int64_t ticks_from_1601_to_1900; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/disposable_object.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/disposable_object.h new file mode 100644 index 0000000..2675ff4 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/disposable_object.h @@ -0,0 +1,49 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +namespace clan +{ + /// \brief DisposableObject + class DisposableObject + { + public: + DisposableObject(); + + void dispose(); + void throw_if_disposed() const; + bool is_disposed() const; + + protected: + virtual void on_dispose() = 0; + + private: + bool disposed; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/exception.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/exception.h new file mode 100644 index 0000000..00ccef7 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/exception.h @@ -0,0 +1,72 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_System clanCore System + /// \{ + + /// \brief Top-level exception class. + class Exception : public std::exception + { + public: + /// \brief Constructs an exception object. + Exception(const std::string &message); + + /// \brief Destructs an exception object + virtual ~Exception() throw() {} + + /// \brief Description of exception. + std::string message; + + /// \brief Returns description of exception + virtual const char* what() const throw() override; + + /// \brief Returns the call stack present when the exception object was created. + /**

On Linux, to obtain function names, remember to link with the -rdynamic flag

*/ + std::vector get_stack_trace() const; + + /// \brief Returns the message and call stack present when the exception object was created, formatted using newlines. + /**

On Linux, to obtain function names, remember to link with the -rdynamic flag

*/ + std::string get_message_and_stack_trace() const; + + private: + enum { max_frames = 32 }; + mutable void *frames[max_frames]; + int num_frames; + mutable std::string buffer; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/game_time.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/game_time.h new file mode 100644 index 0000000..f393b86 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/game_time.h @@ -0,0 +1,97 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../System/cl_platform.h" +#include + +namespace clan +{ + /// \addtogroup clanCore_System clanCore System + /// \{ + + class GameTime_Impl; + + /// \brief Tracks time elapsed in various forms useful for games + class GameTime + { + public: + /// \brief GameTime constructor + /// + /// \param ticks_per_second = Number of ticks per second + /// \param max_updates_per_second = Maximum number of updates per second (aka FPS, frames per second). 0 = Unlimited + GameTime(int ticks_per_second = 20, int max_updates_per_second = 0); + + /// \brief Returns the time elapsed in seconds since last update. + float get_time_elapsed() const; + + /// \brief Returns the time elapsed in seconds since last update in milliseconds + int get_time_elapsed_ms() const; + + /// \brief Returns the number of ticks that elapsed since last update. + int get_ticks_elapsed() const; + + /// \brief Returns the time elapsed per tick. + float get_tick_time_elapsed() const; + + /// \brief Returns the time elapsed per tick in milliseconds + int get_tick_time_elapsed_ms() const; + + /// \brief Returns the current time between ticks as a normalized number. + /// + /// If the current time is half-way between two tick updates this function returns 0.5, + /// at the start of a tick its 0.0, and at the end its 1.0. + float get_tick_interpolation_time() const; + + /// \brief Returns the number of updates that occurred every second (aka fps, frames per second) + float get_updates_per_second() const; + + /// \brief Returns the number of seconds since this class was reset() + float get_current_time() const; + + /// \brief Returns the number of microseconds since this class was reset() + uint64_t get_current_time_microseconds() const; + + /// \brief Returns the number of milliseconds since this class was reset() + uint64_t get_current_time_ms() const; + + /// \brief Updates time data for the frame to be rendered + /// + /// Call this function once at the start of a frame. + void update(); + + /// \brief Resets the timer. + void reset(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/registry_key.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/registry_key.h new file mode 100644 index 0000000..11779c9 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/registry_key.h @@ -0,0 +1,101 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#if defined(WIN32) || defined(DOXYGEN) + +#include "databuffer.h" +#include + +namespace clan +{ + /// \addtogroup clanCore_System clanCore System + /// \{ + + class RegistryKey_Impl; + + /// \brief Registry key class. + /**

This class is only available on Windows.

+ !group=Core/System! !header=core.h!*/ + class RegistryKey + { + public: + enum PredefinedKey + { + key_classes_root, + key_current_config, + key_current_user, + key_local_machine, + key_users + }; + + enum CreateFlags + { + create_always = 0, + create_new = 1, + create_volatile = 2 + }; + + RegistryKey(); + RegistryKey(PredefinedKey key, const std::string &subkey, unsigned int access_rights = KEY_ALL_ACCESS, unsigned int create_flags = create_always); + RegistryKey(HKEY key); + ~RegistryKey(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + HKEY get_key() const; + std::vector get_subkey_names() const; + std::vector get_value_names() const; + int get_value_int(const std::string &name, int default_value = 0) const; + DataBuffer get_value_binary(const std::string &name, const DataBuffer &default_value = DataBuffer()) const; + std::string get_value_string(const std::string &name, const std::string &default_value = std::string()) const; + std::vector get_value_multi_string(const std::string &name, const std::vector &default_value = std::vector()) const; + + RegistryKey open_key(const std::string &subkey, unsigned int access_rights = KEY_ALL_ACCESS); + RegistryKey create_key(const std::string &subkey, unsigned int access_rights = KEY_ALL_ACCESS, CreateFlags create_flags = create_always); + void delete_key(const std::string &subkey, bool recursive); + static void delete_key(PredefinedKey key, const std::string &subkey, bool recursive); + void set_value_int(const std::string &name, int value); + void set_value_binary(const std::string &name, const DataBuffer &value); + void set_value_string(const std::string &name, const std::string &value); + // void set_value_multi_string(const std::string &name, const std::vector &value); + void delete_value(const std::string &name); + + private: + std::shared_ptr impl; + }; + + /// \} +} + +#endif diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/service.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/service.h new file mode 100644 index 0000000..1095c5a --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/service.h @@ -0,0 +1,75 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../Signals/signal.h" + +namespace clan +{ + /// \addtogroup clanCore_System clanCore System + /// \{ + + class Service_Impl; + + /// \brief Service/daemon class. + class Service + { + public: + /// \brief Constructs a service object. + Service(const std::string &service_name); + ~Service(); + + /// \brief Returns the service name. + const std::string &get_service_name() const; + + /// \brief Process command line and run service. + int main(int argc, char **argv); + + protected: + /// \brief Called when the service is asked to start. + virtual void service_start(std::vector &args) = 0; + + /// \brief Called when the service is asked to stop. + virtual void service_stop() = 0; + + /// \brief Called when the service is asked to reload its configuration. + virtual void service_reload() = 0; + + private: + inline Service(const Service &/*copy*/) { } + inline Service &operator =(const Service &) { return *this; } + + std::shared_ptr impl; + + friend class Service_Impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/system.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/system.h new file mode 100644 index 0000000..607b274 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/system.h @@ -0,0 +1,98 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Animehunter +*/ + +#pragma once + +#include "../System/cl_platform.h" +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_System clanCore System + /// \{ + + /// \brief General system helper functions. + class System + { + public: + /// \brief Get the current time (since system boot), in milliseconds. + static uint64_t get_time(); + + /// \brief Get the current time microseconds. + static uint64_t get_microseconds(); + + enum CPU_ExtensionX86 { mmx, mmx_ex, _3d_now, _3d_now_ex, sse, sse2, sse3, ssse3, sse4_a, sse4_1, sse4_2, xop, avx, aes, fma3, fma4 }; + enum CPU_ExtensionPPC { altivec }; + + static bool detect_cpu_extension(CPU_ExtensionX86 ext); + static bool detect_cpu_extension(CPU_ExtensionPPC ext); + + /// \brief Return the number of CPU cores + static int get_num_cores(); + + /// \brief Allocates aligned memory + static void *aligned_alloc(size_t size, size_t alignment = 16); + + /// \brief Frees aligned memory + static void aligned_free(void *ptr); + + /// \brief Captures a stack back trace by walking up the stack and recording the information for each frame + static int capture_stack_trace(int frames_to_skip, int max_frames, void **out_frames, unsigned int *out_hash = nullptr); + + /// \brief Returns the function names and lines for the specified stack frame addresses + /**

On Linux, to obtain function names, remember to link with the -rdynamic flag

*/ + static std::vector get_stack_frames_text(void **frames, int num_frames); + + /// \brief Sleep for 'millis' milliseconds. + /// + /// It is possible for this function to sleep for more than millis, depending on the OS scheduler. + /// If you require a more accurate sleep, consider pause. + static void sleep(int millis); + + /// \brief Pause for 'millis' milliseconds. + /// + /// This function acts as sleep, but the function "may" perform a spinlock on some operating systems + /// to give a more accurate pause. This may have a side effect of causing 100% cpu usage. + /// If you do not require an accurate pause, use sleep instead. + static void pause(int millis); + + /// \brief Returns the full dirname of the executable that started this + /// \brief process (aka argv[0]) + /**

This is necessary since when programms are started from + the PATH there is no clean and simple way to figure out + the location of the data files, thus information is read + from /proc/self/exe under GNU/Linux and from + GetModuleFileName() on Win32.

+ \return full dirname of the executable, trailing slash is included*/ + static std::string get_exe_path(); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/thread_local_storage.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/thread_local_storage.h new file mode 100644 index 0000000..050ac67 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/thread_local_storage.h @@ -0,0 +1,77 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ + +#pragma once + +#include + +#if defined(_MSC_VER) +#define cl_tls_variable _declspec(thread) +#elif defined(__APPLE__) // To do: change check to only apply to iOS/ARM target +#define cl_tls_variable +#else +#define cl_tls_variable __thread +#endif + +namespace clan +{ + /// \addtogroup clanCore_System clanCore System + /// \{ + + class ThreadLocalStorage_Instance; + + class ThreadLocalStorageData + { + public: + virtual ~ThreadLocalStorageData() { } + }; + + class ThreadLocalStorage_Impl; + + /// \brief ThreadLocalStorage class. + class ThreadLocalStorage + { + public: + /// \brief Constructs a Thread Local Storage object. + ThreadLocalStorage(); + ~ThreadLocalStorage(); + + /// \brief Get a variable. + static std::shared_ptr get_variable(const std::string &name); + + /// \brief Set a variable. + static void set_variable(const std::string &name, std::shared_ptr ptr); + + private: + static void init_core(); + static ThreadLocalStorage_Instance *instance; + friend class ThreadLocalStorage_Instance; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/userdata.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/userdata.h new file mode 100644 index 0000000..d87a62c --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/userdata.h @@ -0,0 +1,106 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_System clanCore System + /// \{ + + class UserDataBase + { + public: + virtual ~UserDataBase() { } + }; + + template + class UserData : public UserDataBase + { + public: + UserData(const std::shared_ptr &data) : data(data) { } + std::shared_ptr data; + }; + + /// \brief Helper class to store any shared_ptr as user data on an object. + class UserDataOwner + { + public: + UserDataOwner() + : user_data(nullptr) + { + } + + ~UserDataOwner() + { + if (user_data) + { + user_data->~UserDataBase(); + user_data = nullptr; + } + } + + template + void set_data(const std::shared_ptr &data) + { + if (user_data) + { + user_data->~UserDataBase(); + user_data = nullptr; + } + + static_assert(sizeof(UserData) <= 32, "userdata_storage is too small!"); + user_data = new(userdata_storage)UserData(data); + } + + template + std::shared_ptr get_data() + { + UserData *d = dynamic_cast *>(user_data); + if (d) + { + return d->data; + } + else + { + return std::shared_ptr(); + } + } + + private: + UserDataOwner(const UserDataOwner &that); // do not implement + UserDataOwner &operator=(const UserDataOwner &that); // do not implement + + UserDataBase *user_data; + char userdata_storage[32]; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/work_queue.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/work_queue.h new file mode 100644 index 0000000..eadcfcd --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/System/work_queue.h @@ -0,0 +1,87 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_System clanCore System + /// \{ + + /// \brief Interface for executing work on a worker thread + class WorkItem + { + public: + virtual ~WorkItem() { } + + /// \brief Called by a worker thread to process work + virtual void process_work() = 0; + + /// \brief Called by the WorkQueue thread to complete the work + virtual void work_completed() { } + }; + + class WorkQueue_Impl; + + /// \brief Thread pool for worker threads + class WorkQueue + { + public: + /// \brief Constructs a work queue + /// \param serial_queue If true, executes items in the order they are queued, one at a time + WorkQueue(bool serial_queue = false); + ~WorkQueue(); + + /// \brief Queue some work to be executed on a worker thread + /// + /// Transfers ownership of the item queued. WorkQueue will delete the item. + void queue(WorkItem *item); + + /// \brief Queue some work to be executed on a worker thread + void queue(const std::function &func); + + /// \brief Queue some work to be executed on the main WorkQueue thread + void work_completed(const std::function &func); + + /// \brief Returns the number of items currently queued + int get_items_queued() const; + + /// \brief Process work completed queue + /// + /// Needs to be called on the main WorkQueue thread periodically to finish queued work + void process_work_completed(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/console.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/console.h new file mode 100644 index 0000000..9268f1d --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/console.h @@ -0,0 +1,328 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Kenneth Gangstoe +** Mark Page +*/ + +#pragma once + +// 'kbhit' was declared deprecated +#ifdef WIN32 +#pragma warning(disable: 4996) +#endif + +#include "string_format.h" +#include "string_help.h" +#ifdef WIN32 +#include +#else +#include +#endif + +namespace clan +{ + /// \addtogroup clanCore_Text clanCore Text + /// \{ + + /// \brief Console access helper class. + class Console + { + public: + /// \brief Writes text to the console window. + static void write(const std::string &text); + + /// \brief Write + /// + /// \param format = String Ref + /// \param arg1 = Arg1 + template + static void write(const std::string &format, Arg1 arg1) + { + StringFormat f(format); + f.set_arg(1, arg1); + write(f.get_result()); + } + + /// \brief Write + /// + /// \param format = String Ref + /// \param arg1 = Arg1 + /// \param arg2 = Arg2 + template + static void write(const std::string &format, Arg1 arg1, Arg2 arg2) + { + StringFormat f(format); + f.set_arg(1, arg1); + f.set_arg(2, arg2); + write(f.get_result()); + } + + /// \brief Write + /// + /// \param format = String Ref + /// \param arg1 = Arg1 + /// \param arg2 = Arg2 + /// \param arg3 = Arg3 + template + static void write(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3) + { + StringFormat f(format); + f.set_arg(1, arg1); + f.set_arg(2, arg2); + f.set_arg(3, arg3); + write(f.get_result()); + } + + /// \brief Write + /// + /// \param format = String Ref + /// \param arg1 = Arg1 + /// \param arg2 = Arg2 + /// \param arg3 = Arg3 + /// \param arg4 = Arg4 + template + static void write(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) + { + StringFormat f(format); + f.set_arg(1, arg1); + f.set_arg(2, arg2); + f.set_arg(3, arg3); + f.set_arg(4, arg4); + write(f.get_result()); + } + + /// \brief Write + /// + /// \param format = String Ref + /// \param arg1 = Arg1 + /// \param arg2 = Arg2 + /// \param arg3 = Arg3 + /// \param arg4 = Arg4 + /// \param arg5 = Arg5 + template + static void write(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) + { + StringFormat f(format); + f.set_arg(1, arg1); + f.set_arg(2, arg2); + f.set_arg(3, arg3); + f.set_arg(4, arg4); + f.set_arg(arg5); + write(f.get_result()); + } + + /// \brief Write + /// + /// \param format = String Ref + /// \param arg1 = Arg1 + /// \param arg2 = Arg2 + /// \param arg3 = Arg3 + /// \param arg4 = Arg4 + /// \param arg5 = Arg5 + /// \param arg6 = Arg6 + template + static void write(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6) + { + StringFormat f(format); + f.set_arg(1, arg1); + f.set_arg(2, arg2); + f.set_arg(3, arg3); + f.set_arg(4, arg4); + f.set_arg(arg5); + f.set_arg(arg6); + write(f.get_result()); + } + + /// \brief Write + /// + /// \param format = String Ref + /// \param arg1 = Arg1 + /// \param arg2 = Arg2 + /// \param arg3 = Arg3 + /// \param arg4 = Arg4 + /// \param arg5 = Arg5 + /// \param arg6 = Arg6 + /// \param arg7 = Arg7 + template + static void write(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6, Arg7 arg7) + { + StringFormat f(format); + f.set_arg(1, arg1); + f.set_arg(2, arg2); + f.set_arg(3, arg3); + f.set_arg(4, arg4); + f.set_arg(arg5); + f.set_arg(arg6); + f.set_arg(arg7); + write(f.get_result()); + } + + /// \brief Writes text to the console window and then advances to a new line. + static void write_line(const std::string &text) + { + write(text); +#ifdef WIN32 + write("\r\n"); +#else + write("\n"); +#endif + } + + /// \brief Write line + /// + /// \param format = String Ref + /// \param arg1 = Arg1 + template + static void write_line(const std::string &format, Arg1 arg1) + { + StringFormat f(format); + f.set_arg(1, arg1); + write_line(f.get_result()); + } + + /// \brief Write line + /// + /// \param format = String Ref + /// \param arg1 = Arg1 + /// \param arg2 = Arg2 + template + static void write_line(const std::string &format, Arg1 arg1, Arg2 arg2) + { + StringFormat f(format); + f.set_arg(1, arg1); + f.set_arg(2, arg2); + write_line(f.get_result()); + } + + /// \brief Write line + /// + /// \param format = String Ref + /// \param arg1 = Arg1 + /// \param arg2 = Arg2 + /// \param arg3 = Arg3 + template + static void write_line(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3) + { + StringFormat f(format); + f.set_arg(1, arg1); + f.set_arg(2, arg2); + f.set_arg(3, arg3); + write_line(f.get_result()); + } + + /// \brief Write line + /// + /// \param format = String Ref + /// \param arg1 = Arg1 + /// \param arg2 = Arg2 + /// \param arg3 = Arg3 + /// \param arg4 = Arg4 + template + static void write_line(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) + { + StringFormat f(format); + f.set_arg(1, arg1); + f.set_arg(2, arg2); + f.set_arg(3, arg3); + f.set_arg(4, arg4); + write_line(f.get_result()); + } + + /// \brief Write line + /// + /// \param format = String Ref + /// \param arg1 = Arg1 + /// \param arg2 = Arg2 + /// \param arg3 = Arg3 + /// \param arg4 = Arg4 + /// \param arg5 = Arg5 + template + static void write_line(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) + { + StringFormat f(format); + f.set_arg(1, arg1); + f.set_arg(2, arg2); + f.set_arg(3, arg3); + f.set_arg(4, arg4); + f.set_arg(5, arg5); + write_line(f.get_result()); + } + + /// \brief Write line + /// + /// \param format = String Ref + /// \param arg1 = Arg1 + /// \param arg2 = Arg2 + /// \param arg3 = Arg3 + /// \param arg4 = Arg4 + /// \param arg5 = Arg5 + /// \param arg6 = Arg6 + template + static void write_line(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6) + { + StringFormat f(format); + f.set_arg(1, arg1); + f.set_arg(2, arg2); + f.set_arg(3, arg3); + f.set_arg(4, arg4); + f.set_arg(5, arg5); + f.set_arg(6, arg6); + write_line(f.get_result()); + } + + /// \brief Write line + /// + /// \param format = String Ref + /// \param arg1 = Arg1 + /// \param arg2 = Arg2 + /// \param arg3 = Arg3 + /// \param arg4 = Arg4 + /// \param arg5 = Arg5 + /// \param arg6 = Arg6 + /// \param arg7 = Arg7 + template + static void write_line(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6, Arg7 arg7) + { + StringFormat f(format); + f.set_arg(1, arg1); + f.set_arg(2, arg2); + f.set_arg(3, arg3); + f.set_arg(4, arg4); + f.set_arg(5, arg5); + f.set_arg(6, arg6); + f.set_arg(7, arg7); + write_line(f.get_result()); + } + + /// \brief Block until a key is pressed in the console window. + /// + /// This function does not do anything on Linux. + static void wait_for_key(); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/console_logger.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/console_logger.h new file mode 100644 index 0000000..a6405b2 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/console_logger.h @@ -0,0 +1,51 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "logger.h" + +namespace clan +{ + /// \addtogroup clanCore_Text clanCore Text + /// \{ + + /// \brief Console logger. + class ConsoleLogger : public Logger + { + public: + /// \brief Constructs a console logger. + ConsoleLogger(); + ~ConsoleLogger(); + + /// \brief Log text to console. + void log(const std::string &type, const std::string &text) override; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/file_logger.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/file_logger.h new file mode 100644 index 0000000..6ad7324 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/file_logger.h @@ -0,0 +1,56 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "logger.h" + +namespace clan +{ + /// \addtogroup clanCore_Text clanCore Text + /// \{ + + class File; + + /// \brief File logger. + class FileLogger : public Logger + { + public: + /// \brief Constructs a file logger. + FileLogger(const std::string &filename); + ~FileLogger(); + + /// \brief Log text to file. + void log(const std::string &type, const std::string &text) override; + + private: + File *file; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/logger.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/logger.h new file mode 100644 index 0000000..68c5590 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/logger.h @@ -0,0 +1,115 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "string_format.h" +#include "string_help.h" +#include + +namespace clan +{ + /// \addtogroup clanCore_Text clanCore Text + /// \{ + + /// \brief Logger interface. + class Logger + { + public: + /// \brief Constructs a logger. + Logger(); + virtual ~Logger(); + + /// \brief Pointers to currently enabled logger. + static std::vector instances; + + /// \brief Logger mutex object. + static std::recursive_mutex mutex; + + /// \brief Enable logger for logging. + void enable(); + + /// \brief Disable logging. + void disable(); + + /// \brief Log text. + virtual void log(const std::string &type, const std::string &text) = 0; + + protected: + static StringFormat get_log_string(const std::string &type, const std::string &text); + }; + + /// \brief Log text to logger. + /// + void log_event(const std::string &type, const std::string &text); + + template + void log_event(const std::string &type, const std::string &format, Arg1 arg1) + { + StringFormat f(format); f.set_arg(1, arg1); log_event(type, f.get_result()); + } + + template + void log_event(const std::string &type, const std::string &format, Arg1 arg1, Arg2 arg2) + { + StringFormat f(format); f.set_arg(1, arg1); f.set_arg(2, arg2); log_event(type, f.get_result()); + } + + template + void log_event(const std::string &type, const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3) + { + StringFormat f(format); f.set_arg(1, arg1); f.set_arg(2, arg2); f.set_arg(3, arg3); log_event(type, f.get_result()); + } + + template + void log_event(const std::string &type, const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) + { + StringFormat f(format); f.set_arg(1, arg1); f.set_arg(2, arg2); f.set_arg(3, arg3); f.set_arg(4, arg4); log_event(type, f.get_result()); + } + + template + void log_event(const std::string &type, const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) + { + StringFormat f(format); f.set_arg(1, arg1); f.set_arg(2, arg2); f.set_arg(3, arg3); f.set_arg(4, arg4); f.set_arg(5, arg5); log_event(type, f.get_result()); + } + + template + void log_event(const std::string &type, const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6) + { + StringFormat f(format); f.set_arg(1, arg1); f.set_arg(2, arg2); f.set_arg(3, arg3); f.set_arg(4, arg4); f.set_arg(5, arg5); f.set_arg(6, arg6); log_event(type, f.get_result()); + } + + template + void log_event(const std::string &type, const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6, Arg7 arg7) + { + StringFormat f(format); f.set_arg(1, arg1); f.set_arg(2, arg2); f.set_arg(3, arg3); f.set_arg(4, arg4); f.set_arg(5, arg5); f.set_arg(6, arg6); f.set_arg(7, arg7); log_event(type, f.get_result()); + } + + /// \} +} + diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/string_format.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/string_format.h new file mode 100644 index 0000000..e65781b --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/string_format.h @@ -0,0 +1,212 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Text clanCore Text + /// \{ + + /// \brief String formatting class. + /// + /// Combines a format string with arbitrary arguments to + /// create a resulting string that contains the inserted + /// arguments. + /// + /// A format string consists of normal text and placeholders + /// that are replaced by the given arguments. A placeholder + /// is identified by a percentage symbol '%%' followed by an + /// integer that represents the argument index. + /// + /// Example: + /// + /// \code{.cpp} + /// clan::StringFormat format("Arg0: %0, Arg1: %1"); + /// format.set_arg(0, 10); + /// format.set_arg(1, "test"); + /// std::string result = format.get_result(); + /// // result will now contain "Arg0: 10, Arg1: test" + /// \endcode + /// + /// The global function clan::string_format is a shortcut to + /// create formatted strings. Note that the indexing starts + /// at 1 when using this function. Therefore the first argument + /// is automatically referenced by the placeholder %1. + /// + /// Example: + /// + /// \code{.cpp} + /// std::string result = clan::string_format("1st arg: %1, 2nd arg: %2", 10, "test"); + /// // result will now contain "1st arg: 10, 2nd arg: test" + /// \endcode + class StringFormat + { + public: + /// \brief Constructs a formatted string object. + /// + /// \param format_string = Format string (see detailed description) + StringFormat(const std::string &format_string); + ~StringFormat(); + + /// \brief Retrieves the formatted string with all argument replacements + const std::string &get_result() const; + + /// \brief Sets an argument (string version) + /// + /// \param index = Argument index + /// \param text = Argument value as a string + void set_arg(int index, const std::string &text); + + /// \brief Sets an argument (int version) + /// + /// \param index = Argument index + /// \param value = Argument value as an integer + /// \param min_length = Minimum amount of digits to display + void set_arg(int index, int value, int min_length = 0); + + /// \brief Sets an argument (unsigned int version) + /// + /// \param index = Argument index + /// \param value = Argument value as an unsigned integer + /// \param min_length = Minimum amount of digits to display + void set_arg(int index, unsigned int value, int min_length = 0); + + /// \brief Sets an argument (long unsigned int version) + /// + /// \param index = Argument index + /// \param value = Argument value as a long unsigned integer + /// \param min_length = Minimum amount of digits to display + void set_arg(int index, long unsigned int value, int min_length = 0); + + /// \brief Sets an argument (long long version) + /// + /// \param index = Argument index + /// \param value = Argument value as a long long + /// \param min_length = Minimum amount of digits to display + void set_arg(int index, long long value, int min_length = 0); + + /// \brief Sets an argument (unsigned long long version) + /// + /// \param index = Argument index + /// \param value = Argument value as an unsigned long long + /// \param min_length = Minimum amount of digits to display + void set_arg(int index, unsigned long long value, int min_length = 0); + + /// \brief Sets an argument (float version) + /// + /// \param index = Argument index + /// \param value = Argument value as a floating point value + void set_arg(int index, float value); + + /// \brief Sets an argument (double version) + /// + /// \param index = Argument index + /// \param value = Argument value as a floating point value with double precision + void set_arg(int index, double value); + + private: + /// \brief Creates an argument (placeholder) + /// + /// \param index = Argument index + /// \param start = Start position inside format string + /// \param length = Length inside format string + void create_arg(int index, int start, int length); + + std::string string; + + struct ArgPosition + { + ArgPosition() : start(0), length(-1) { } + ArgPosition(int s, int l) : start(s), length(l) {} + int start; + int length; + }; + + std::vector args; + }; + + /// \brief See clan::StringFormat for details. + inline std::string string_format(const std::string &format) + { + return format; + } + + /// \brief See clan::StringFormat for details. + template + std::string string_format(const std::string &format, Arg1 arg1) + { + StringFormat f(format); f.set_arg(1, arg1); return f.get_result(); + } + + /// \brief See clan::StringFormat for details. + template + std::string string_format(const std::string &format, Arg1 arg1, Arg2 arg2) + { + StringFormat f(format); f.set_arg(1, arg1); f.set_arg(2, arg2); return f.get_result(); + } + + /// \brief See clan::StringFormat for details. + template + std::string string_format(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3) + { + StringFormat f(format); f.set_arg(1, arg1); f.set_arg(2, arg2); f.set_arg(3, arg3); return f.get_result(); + } + + /// \brief See clan::StringFormat for details. + template + std::string string_format(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) + { + StringFormat f(format); f.set_arg(1, arg1); f.set_arg(2, arg2); f.set_arg(3, arg3); f.set_arg(4, arg4); return f.get_result(); + } + + /// \brief See clan::StringFormat for details. + template + std::string string_format(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) + { + StringFormat f(format); f.set_arg(1, arg1); f.set_arg(2, arg2); f.set_arg(3, arg3); f.set_arg(4, arg4); f.set_arg(5, arg5); return f.get_result(); + } + + /// \brief See clan::StringFormat for details. + template + std::string string_format(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6) + { + StringFormat f(format); f.set_arg(1, arg1); f.set_arg(2, arg2); f.set_arg(3, arg3); f.set_arg(4, arg4); f.set_arg(5, arg5); f.set_arg(6, arg6); return f.get_result(); + } + + /// \brief See clan::StringFormat for details. + template + std::string string_format(const std::string &format, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6, Arg7 arg7) + { + StringFormat f(format); f.set_arg(1, arg1); f.set_arg(2, arg2); f.set_arg(3, arg3); f.set_arg(4, arg4); f.set_arg(5, arg5); f.set_arg(6, arg6); f.set_arg(7, arg7); return f.get_result(); + } + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/string_help.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/string_help.h new file mode 100644 index 0000000..786867c --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/string_help.h @@ -0,0 +1,595 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + + +#pragma once + +#include + +#ifdef __cplusplus_cli +#pragma managed(push, on) +#include +#endif + +namespace clan +{ + /// \addtogroup clanCore_Text clanCore Text + /// \{ + + /// \brief String helper functions. + class StringHelp + { + public: + static std::vector split_text( + const std::string &text, + const std::string &split_string, + bool skip_empty = true); + + /// \brief Wide char to utf-8 + /// + /// \param value = Wide char value + /// \return The UTF-8 String + static std::string wchar_to_utf8(wchar_t value); + + /// \brief unicode char to utf-8 + /// + /// \param value = unicode char value + /// \return The UTF-8 String + static std::string unicode_to_utf8(unsigned int value); + + /// \brief Trim + /// + /// \param text = String Ref + /// + /// \return Temp String + static std::string trim(const std::string &text); + + /// \brief Removes trailing zeros from floating point numbers + /// + /// If the input string is "42.21000", then this function returns "42.21". + /// If the string is "42.00000", then it returns "42". + static std::string remove_trailing_zeros(std::string text); + static std::wstring remove_trailing_zeros(std::wstring text); + + /// \brief Compare + /// + /// \param a = String Ref8 + /// \param b = String Ref8 + /// \param case_insensitive = bool + /// + /// \return int + static int compare(const std::string &a, const std::string &b, bool case_insensitive = false); + + /// \brief Compare + /// + /// \param a = String Ref16 + /// \param b = String Ref16 + /// \param case_insensitive = bool + /// + /// \return int + static int compare(const std::wstring &a, const std::wstring &b, bool case_insensitive = false); + + /// \brief Text to upper + /// + /// \param s = String Ref + /// + /// \return Temp String + static std::string text_to_upper(const std::string &s); + + /// \brief Local8 to upper + /// + /// \param s = String Ref8 + /// + /// \return Temp String8 + static std::string local8_to_upper(const std::string &s); + + /// \brief Ucs2 to upper + /// + /// \param s = String Ref16 + /// + /// \return Temp String16 + static std::wstring ucs2_to_upper(const std::wstring &s); + + /// \brief Text to lower + /// + /// \param s = String Ref + /// + /// \return Temp String + static std::string text_to_lower(const std::string &s); + + /// \brief Local8 to lower + /// + /// \param s = String Ref8 + /// + /// \return Temp String8 + static std::string local8_to_lower(const std::string &s); + + /// \brief Ucs2 to lower + /// + /// \param s = String Ref16 + /// + /// \return Temp String16 + static std::wstring ucs2_to_lower(const std::wstring &s); + + /// \brief Float to text + /// + /// \param value = value + /// \param num_decimal_places = value + /// + /// \return Temp String + static std::string float_to_text(float value, int num_decimal_places = 6, bool remove_trailing_zeros = true); + + /// \brief Float to local8 + /// + /// \param value = value + /// \param num_decimal_places = value + /// + /// \return Temp String8 + static std::string float_to_local8(float value, int num_decimal_places = 6, bool remove_trailing_zeros = true); + + /// \brief Float to ucs2 + /// + /// \param value = value + /// \param num_decimal_places = value + /// + /// \return Temp String16 + static std::wstring float_to_ucs2(float value, int num_decimal_places = 6, bool remove_trailing_zeros = true); + + /// \brief Text to float + /// + /// \param value = String Ref + /// + /// \return float + static float text_to_float(const std::string &value); + + /// \brief Local8 to float + /// + /// \param value = String Ref8 + /// + /// \return float + static float local8_to_float(const std::string &value); + + /// \brief Ucs2 to float + /// + /// \param value = String Ref16 + /// + /// \return float + static float ucs2_to_float(const std::wstring &value); + + /// \brief Double to text + /// + /// \param value = value + /// \param num_decimal_places = value + /// + /// \return Temp String + static std::string double_to_text(double value, int num_decimal_places = 6); + + /// \brief Double to local8 + /// + /// \param value = value + /// \param num_decimal_places = value + /// + /// \return Temp String8 + static std::string double_to_local8(double value, int num_decimal_places = 6); + + /// \brief Double to ucs2 + /// + /// \param value = value + /// \param num_decimal_places = value + /// + /// \return Temp String16 + static std::wstring double_to_ucs2(double value, int num_decimal_places = 6); + + /// \brief Text to double + /// + /// \param value = String Ref + /// + /// \return double + static double text_to_double(const std::string &value); + + /// \brief Local8 to double + /// + /// \param value = String Ref8 + /// + /// \return double + static double local8_to_double(const std::string &value); + + /// \brief Ucs2 to double + /// + /// \param value = String Ref16 + /// + /// \return double + static double ucs2_to_double(const std::wstring &value); + + /// \brief Int to text + /// + /// \param value = value + /// + /// \return Temp String + static std::string int_to_text(int value); + + /// \brief Int to local8 + /// + /// \param value = value + /// + /// \return Temp String8 + static std::string int_to_local8(int value); + + /// \brief Int to ucs2 + /// + /// \param value = value + /// + /// \return Temp String16 + static std::wstring int_to_ucs2(int value); + + /// \brief Text to int + /// + /// \param value = String Ref + /// \param base = value + /// + /// \return int + static int text_to_int(const std::string &value, int base = 10); + + /// \brief Local8 to int + /// + /// \param value = String Ref8 + /// \param base = value + /// + /// \return int + static int local8_to_int(const std::string &value, int base = 10); + + /// \brief Ucs2 to int + /// + /// \param value = String Ref16 + /// \param base = value + /// + /// \return int + static int ucs2_to_int(const std::wstring &value, int base = 10); + + /// \brief Uint to text + /// + /// \param value = value + /// + /// \return Temp String + static std::string uint_to_text(unsigned int value); + + /// \brief Uint to local8 + /// + /// \param value = value + /// + /// \return Temp String8 + static std::string uint_to_local8(unsigned int value); + + /// \brief Uint to ucs2 + /// + /// \param value = value + /// + /// \return Temp String16 + static std::wstring uint_to_ucs2(unsigned int value); + + static unsigned int text_to_uint(const std::string &value, int base = 10); + + static unsigned int local8_to_uint(const std::string &value, int base = 10); + + static unsigned int ucs2_to_uint(const std::wstring &value, int base = 10); + + /// \brief Long long to text + /// + /// \param value = value + /// + /// \return Temp String + static std::string ll_to_text(long long value); + + /// \brief Long long to local8 + /// + /// \param value = value + /// + /// \return Temp String8 + static std::string ll_to_local8(long long value); + + /// \brief Long long to ucs2 + /// + /// \param value = value + /// + /// \return Temp String16 + static std::wstring ll_to_ucs2(long long value); + + /// \brief Text to long long + /// + /// \param value = String Ref + /// \param base = value + /// + /// \return long long + static long long text_to_ll(const std::string &value, int base = 10); + + /// \brief Local8 to long long + /// + /// \param value = String Ref8 + /// \param base = value + /// + /// \return long long + static long long local8_to_ll(const std::string &value, int base = 10); + + /// \brief Ucs2 to long long + /// + /// \param value = String Ref16 + /// \param base = value + /// + /// \return long long + static long long ucs2_to_ll(const std::wstring &value, int base = 10); + + /// \brief Unsigned long long to text + /// + /// \param value = value + /// + /// \return Temp String + static std::string ull_to_text(unsigned long long value); + + /// \brief Unsigned long long to local8 + /// + /// \param value = value + /// + /// \return Temp String8 + static std::string ull_to_local8(unsigned long long value); + + /// \brief Unsigned long long to ucs2 + /// + /// \param value = value + /// + /// \return Temp String16 + static std::wstring ull_to_ucs2(unsigned long long value); + + /// \brief Text to unsigned long long + /// + /// \param value = String Ref + /// \param base = value + /// + /// \return unsigned long long + static unsigned long long text_to_ull(const std::string &value, int base = 10); + + /// \brief Local8 to unsigned long long + /// + /// \param value = String Ref8 + /// \param base = value + /// + /// \return unsigned long long + static unsigned long long local8_to_ull(const std::string &value, int base = 10); + + /// \brief Ucs2 to unsigned long long + /// + /// \param value = String Ref16 + /// \param base = value + /// + /// \return unsigned long long + static unsigned long long ucs2_to_ull(const std::wstring &value, int base = 10); + + /// \brief Bool to text + /// + /// \param value = bool + /// + /// \return Temp String + static std::string bool_to_text(bool value); + + /// \brief Bool to local8 + /// + /// \param value = bool + /// + /// \return Temp String8 + static std::string bool_to_local8(bool value); + + /// \brief Bool to ucs2 + /// + /// \param value = bool + /// + /// \return Temp String16 + static std::wstring bool_to_ucs2(bool value); + + /// \brief Text to bool + /// + /// \param value = String Ref + /// + /// \return bool + static bool text_to_bool(const std::string &value); + + /// \brief Local8 to bool + /// + /// \param value = String Ref8 + /// + /// \return bool + static bool local8_to_bool(const std::string &value); + + /// \brief Ucs2 to bool + /// + /// \param value = String Ref16 + /// + /// \return bool + static bool ucs2_to_bool(const std::wstring &value); + + /// \brief Text to cp437 + /// + /// \param text = String Ref + /// + /// \return Temp String8 + static std::string text_to_cp437(const std::string &text); + + /// \brief Ucs2 to cp437 + /// + /// \param text = String Ref16 + /// + /// \return Temp String8 + static std::string ucs2_to_cp437(const std::wstring &text); + + /// \brief Cp437 to text + /// + /// \param cp437 = String Ref8 + /// + /// \return Temp String + static std::string cp437_to_text(const std::string &cp437); + + /// \brief Cp437 to ucs2 + /// + /// \param cp437 = String Ref8 + /// + /// \return Temp String16 + static std::wstring cp437_to_ucs2(const std::string &cp437); + + /// \brief Ucs2 to latin1 + /// + /// \param ucs2 = String Ref16 + /// + /// \return Temp String8 + static std::string ucs2_to_latin1(const std::wstring &ucs2); + + /// \brief Ucs2 to latin9 + /// + /// \param ucs2 = String Ref16 + /// + /// \return Temp String8 + static std::string ucs2_to_latin9(const std::wstring &ucs2); + + /// \brief Ucs2 to local8 + /// + /// \param ucs2 = String Ref16 + /// + /// \return Temp String8 + static std::string ucs2_to_local8(const std::wstring &ucs2); + + /// \brief Ucs2 to utf8 + /// + /// \param ucs2 = String Ref16 + /// + /// \return Temp String8 + static std::string ucs2_to_utf8(const std::wstring &ucs2); + + /// \brief Ucs2 to text + /// + /// \param ucs2 = String Ref16 + /// + /// \return Temp String + static std::string ucs2_to_text(const std::wstring &ucs2); + + /// \brief Latin1 to ucs2 + /// + /// \param latin1 = String Ref8 + /// + /// \return Temp String16 + static std::wstring latin1_to_ucs2(const std::string &latin1); + + /// \brief Latin9 to ucs2 + /// + /// \param latin9 = String Ref8 + /// + /// \return Temp String16 + static std::wstring latin9_to_ucs2(const std::string &latin9); + + /// \brief Local8 to ucs2 + /// + /// \param local8 = String Ref8 + /// + /// \return Temp String16 + static std::wstring local8_to_ucs2(const std::string &local8); + + /// \brief Utf8 to ucs2 + /// + /// \param utf8 = String Ref8 + /// + /// \return Temp String16 + static std::wstring utf8_to_ucs2(const std::string &utf8); + + /// \brief Utf8 to text + /// + /// \param utf8 = String Ref8 + /// + /// \return Temp String + static std::string utf8_to_text(const std::string &utf8); + + static std::string::size_type utf8_length(const std::string &str); + + enum BOMType + { + bom_none, + bom_utf32_be, + bom_utf32_le, + bom_utf16_be, + bom_utf16_le, + bom_utf8 + }; + + /// \brief Detect bom + /// + /// \param data = void + /// \param size_type = String + /// + /// \return BOMType + static BOMType detect_bom(const void *data, std::string::size_type length); + +#ifdef __cplusplus_cli + /// \brief Clr to text + /// + /// \param String = System + /// + /// \return Temp String + static std::string clr_to_text(const System::String ^str) + { + return ucs2_to_utf8(clr_to_ucs2(str)); + } + + static System::String ^text_to_clr(const std::string &str) + { + return ucs2_to_clr(utf8_to_ucs2(str)); + } + + /// \brief Clr to ucs2 + /// + /// \param String = System + /// + /// \return Temp String16 + static std::wstring clr_to_ucs2(const System::String ^str) + { + cli::pin_ptr chars = PtrToStringChars(str); + return std::wstring(chars); + } + + static System::String ^ucs2_to_clr(const std::wstring &str) + { + return gcnew System::String(str.c_str()); + } +#endif + + private: + static const char trailing_bytes_for_utf8[256]; + static const unsigned char bitmask_leadbyte_for_utf8[6]; + }; + + /// \} +} + +#ifdef __cplusplus_cli +#pragma managed(pop) +#endif + diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/utf8_reader.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/utf8_reader.h new file mode 100644 index 0000000..7a0a9c6 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Text/utf8_reader.h @@ -0,0 +1,78 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanCore_Text clanCore Text + /// \{ + + class UTF8_Reader_Impl; + + /// \brief UTF8 reader helper functions. + class UTF8_Reader + { + public: + /// Important: text is not copied by this class and must remain valid during its usage. + UTF8_Reader(const std::string::value_type *text, std::string::size_type length); + + /// \brief Returns true if the current position is at the end of the string + bool is_end(); + + /// \brief Get the character at the current position + unsigned int get_char(); + + /// \brief Returns the length of the current character + std::string::size_type get_char_length(); + + /// \brief Moves position to the previous character + void prev(); + + /// \brief Moves position to the next character + void next(); + + /// \brief Moves position to the lead byte of the character + void move_to_leadbyte(); + + /// \brief Get the current position of the reader + std::string::size_type get_position(); + + /// \brief Set the current position of the reader + void set_position(std::string::size_type position); + + private: + std::string::size_type current_position = 0; + std::string::size_type length = 0; + const unsigned char *data = nullptr; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_archive.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_archive.h new file mode 100644 index 0000000..c10f3f7 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_archive.h @@ -0,0 +1,121 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include +#include "zip_file_entry.h" +#include + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + class IODevice; + class ZipArchive_Impl; + + /// \brief Zip archive. + class ZipArchive + { + public: + /// \brief Constructs or loads a ZIP archive. + /// + /// \param filename .zip archive to load. + ZipArchive(); + + /// \brief Constructs a ZipArchive + /// + /// \param input = IODevice + ZipArchive(IODevice &input); + + /// \brief Constructs a ZipArchive + /// + /// \param filename = String Ref + ZipArchive(const std::string &filename); + + /// \brief Constructs a ZipArchive + /// + /// \param copy = Zip Archive + ZipArchive(const ZipArchive ©); + + ~ZipArchive(); + + /// \brief List of file entries in archive. + std::vector get_file_list(); + + std::vector get_file_list(const std::string &path); + + /// \brief Opens a file in the archive. + IODevice open_file(const std::string &filename); + + /// \brief Get full path to source: + std::string get_pathname(const std::string &filename); + + /// \brief Creates a new file entry + IODevice create_file(const std::string &filename, bool compress = true); + + /// \brief Adds a file to zip archive. + /**

File is not added to zip file until it save() is called.

+ \param filename Filename of file.*/ + void add_file(const std::string &input_filename, const std::string &filename_in_archive); + + /// \brief Saves zip archive. + /// + /// \param filename Filename of zip archive. Must not be used to save to the same as loaded from. + ///

If no filename parameter was passed, it will modify the zip + /// archive loaded at construction time. It does this by creating a + /// temporary file, saving the new archive, deletes the old one and + /// renames the temp file to the original archive filename.

+ /// - + ///

If the archive was created instead of loaded, a filename must + /// be specify a filename. Likewise, if saving to same archive as + /// loaded from, a filename must not be specified. Doing so will + /// cause the save operation to fail.

+ void save(); + + /// \brief Save + /// + /// \param filename = the filename to save to + void save(const std::string &filename); + + /// \brief Save + /// + /// \param iodev = The file to save to + void save(IODevice iodev); + + /// \brief Loads the zip archive from a input device (done automatically at construction). + void load(IODevice &input); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_file_entry.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_file_entry.h new file mode 100644 index 0000000..fc260af --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_file_entry.h @@ -0,0 +1,93 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../System/cl_platform.h" + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + class ZipFileEntry_Impl; + + /// \brief File entry in zip file. + class ZipFileEntry + { + public: + ZipFileEntry(); + + /// \brief Constructs a ZipFileEntry + /// + /// \param copy = Zip File Entry + ZipFileEntry(const ZipFileEntry ©); + + ~ZipFileEntry(); + + /// \brief Returns the filename of file entry. + std::string get_archive_filename() const; + + /// \brief Returns the filename of file entry. + std::string get_input_filename() const; + + /// \brief Returns the uncompressed size of file entry. + int64_t get_uncompressed_size(); + + /// \brief Returns the compressed size of file entry. + int64_t get_compressed_size(); + + /// \brief Is Directory + /// + /// \return true = directory + bool is_directory() const; + + /// \brief Copy assignment operator. + ZipFileEntry &operator =(const ZipFileEntry ©); + + /// \brief Sets the filename of the file to be added to the archive. + void set_input_filename(const std::string &filename); + + /// \brief Sets the filename of the file inside the archive. + void set_archive_filename(const std::string &filename); + + /// \brief Set directory + /// + /// \param is_directory = bool + void set_directory(bool is_directory); + + private: + std::shared_ptr impl; + + friend class ZipArchive; + friend class ZipIODevice_FileEntry; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_reader.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_reader.h new file mode 100644 index 0000000..0d3b378 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_reader.h @@ -0,0 +1,82 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../System/cl_platform.h" +#include + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + class IODevice; + class ZipReader_Impl; + + /// \brief Zip file reader. + class ZipReader + { + public: + /// \brief Constructs a ZipReader + /// + /// \param input = IODevice + ZipReader(IODevice &input); + + /// \brief Begins reading a file entry in the zip file. + /**

If allow_data_descriptor is set to false, an exception will be thrown + if the file entry sizes and crc32 values are written in a data descriptor + instead of the local file header.

+

Returns false if there are no more file entries.

*/ + bool read_local_file_header(bool allow_data_descriptor = false); + + /// \brief Returns the file name that was stored in the local file header. + std::string get_filename(); + + /// \brief Returns true if the file entry is followed by a data descriptor. + bool has_data_descriptor() const; + + /// \brief Returns the compressed size of the file entry. + int64_t get_compressed_size() const; + + /// \brief Returns the uncompressed size of the file entry. + int64_t get_uncompressed_size() const; + + /// \brief Informs the zip reader what the data descriptor contains. + void set_data_descriptor_data(int64_t compressed_size, int64_t uncompressed_size, uint32_t crc32); + + /// \brief Reads some file data from the zip file. + int64_t read_file_data(void *data, int64_t size, bool read_all = true); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_writer.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_writer.h new file mode 100644 index 0000000..08a6f41 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zip_writer.h @@ -0,0 +1,70 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../System/cl_platform.h" +#include + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + class IODevice; + class ZipWriter_Impl; + + /// \brief Zip file writer. + class ZipWriter + { + public: + /// \brief Constructs a ZipWriter + /// + /// \param output = IODevice + /// \param storeFilenamesAsUTF8 = bool + ZipWriter(IODevice &output, bool storeFilenamesAsUTF8 = false); + + /// \brief Begins file entry in the zip file. + void begin_file(const std::string &filename, bool compress); + + /// \brief Writes some file data to the zip file. + void write_file_data(const void *data, int64_t size); + + /// \brief Ends the file entry. + void end_file(); + + /// \brief Writes the table of contents part of the zip file. + void write_toc(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zlib_compression.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zlib_compression.h new file mode 100644 index 0000000..9c04243 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/Zip/zlib_compression.h @@ -0,0 +1,65 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanCore_I_O_Data clanCore I/O Data + /// \{ + + class DataBuffer; + + /// \brief Deflate compressor + class ZLibCompression + { + public: + enum CompressionMode + { + default_strategy, + filtered, + huffman_only, + rle, + fixed + }; + + // \brief Compress data + // \param data Data to compress + // \param raw Skips header if true + // \param compression_level Compression level in range 0-9. 0 = no compression, 1 = best speed, 6 = default, 9 = best compression. + // \param mode Compression strategy + static DataBuffer compress(const DataBuffer &data, bool raw = true, int compression_level = 6, CompressionMode mode = default_strategy); + + // \brief Decompress data + // \param data Data to compress + // \param raw Skips header if true + static DataBuffer decompress(const DataBuffer &data, bool raw = true); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/core_iostream.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/core_iostream.h new file mode 100644 index 0000000..bd4a49e --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Core/core_iostream.h @@ -0,0 +1,84 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Ingo Ruhnke +*/ + +#pragma once + +#include +#include + +namespace clan +{ + class Rect; + class Rectf; + class Rectd; + class Point; + class Pointf; + class Pointd; + class Size; + class Sizef; + class Sized; + + std::ostream& operator<<(std::ostream& s, const Rect& rect); + std::ostream& operator<<(std::ostream& s, const Rectf& rect); + std::ostream& operator<<(std::ostream& s, const Rectd& rect); + std::ostream& operator<<(std::ostream& s, const Point& point); + std::ostream& operator<<(std::ostream& s, const Pointf& point); + std::ostream& operator<<(std::ostream& s, const Pointd& point); + std::ostream& operator<<(std::ostream& s, const Size& size); + std::ostream& operator<<(std::ostream& s, const Sizef& size); + + template + std::ostream& operator<<(std::ostream& s, const Vec2& vec) + { + s << "[" + << vec.x << ", " + << vec.y << "]"; + return s; + } + + template + std::ostream& operator<<(std::ostream& s, const Vec3& vec) + { + s << "[" + << vec.x << ", " + << vec.y << ", " + << vec.z << "]"; + return s; + } + + template + std::ostream& operator<<(std::ostream& s, const Vec4& vec) + { + s << "[" + << vec.x << ", " + << vec.y << ", " + << vec.z << ", " + << vec.w << "]"; + return s; + } +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/D3D/d3d_target.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/D3D/d3d_target.h new file mode 100644 index 0000000..860400b --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/D3D/d3d_target.h @@ -0,0 +1,120 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../Display/display_target.h" +#include +#include + +namespace clan +{ + /// \addtogroup clanD3D_Display clanD3D Display + /// \{ + + class Texture; + class PixelBuffer; + class VertexArrayBuffer; + class ElementArrayBuffer; + class RenderBuffer; + class UniformBuffer; + class GraphicContext; + + /// \brief Display target for clanDisplay. + class D3DTarget + { + public: + /// \brief Returns true if this display target is the current target + /// + /// This may change after a display window has been created + static bool is_current(); + + /// \brief Returns the Direct3D handle used by the texture object + /// + /// The reference count on the COM object is not increased (AddRef is not called). + static ID3D11Texture2D *get_texture2d_handle(const GraphicContext &gc, const Texture &texture); + + /// \brief Returns the Direct3D handle used by the pixel buffer object + /// + /// The reference count on the COM object is not increased (AddRef is not called). + static ID3D11Texture2D *get_texture2d_handle(const GraphicContext &gc, const PixelBuffer &pixel_buffer); + + /// \brief Returns the Direct3D handle used by the render buffer object + /// + /// The reference count on the COM object is not increased (AddRef is not called). + static ID3D11Texture2D *get_texture2d_handle(const GraphicContext &gc, const RenderBuffer &render_buffer); + + /// \brief Returns the Direct3D handle used by the buffer object + /// + /// The reference count on the COM object is not increased (AddRef is not called). + static ID3D11Buffer *get_buffer_handle(const GraphicContext &gc, const VertexArrayBuffer &buffer); + + /// \brief Returns the Direct3D handle used by the buffer object + /// + /// The reference count on the COM object is not increased (AddRef is not called). + static ID3D11Buffer *get_buffer_handle(const GraphicContext &gc, const ElementArrayBuffer &buffer); + + /// \brief Returns the Direct3D handle used by the buffer object + /// + /// The reference count on the COM object is not increased (AddRef is not called). + static ID3D11Buffer *get_buffer_handle(const GraphicContext &gc, const UniformBuffer &buffer); + + /// \brief Returns the Direct3D shader resource view handle used by the texture object + /// + /// The reference count on the COM object is not increased (AddRef is not called). + static ID3D11ShaderResourceView *get_srv_handle(const GraphicContext &gc, const Texture &texture); + + /// \brief Returns the Direct3D device handle used by the graphic context + /// + /// The reference count on the COM object is not increased (AddRef is not called). + static ID3D11Device *get_device_handle(const GraphicContext &gc); + + /// \brief Returns the Direct3D device context handle used by the graphic context + /// + /// The reference count on the COM object is not increased (AddRef is not called). + static ID3D11DeviceContext *get_device_context_handle(const GraphicContext &gc); + + /// \brief Returns the Direct3D swap chain handle used by the graphic context + /// + /// The reference count on the COM object is not increased (AddRef is not called). + static IDXGISwapChain *get_swap_chain_handle(const GraphicContext &gc); + + /// \brief Returns the Direct3D render target view for the swap chain back buffer + /// + /// The reference count on the COM object is not increased (AddRef is not called). + static ID3D11RenderTargetView *get_back_buffer_rtv_handle(const GraphicContext &gc); + + /// \brief Throws an exception with the specified text if the passed result is an error condition + static void throw_if_failed(const char *text, HRESULT result); + + /// \brief Set this display target to be the current target + static void set_current(); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/brush.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/brush.h new file mode 100644 index 0000000..518eb85 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/brush.h @@ -0,0 +1,131 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include "../../Core/Math/mat3.h" +#include "../../Display/2D/color.h" +#include "image.h" +#include + +namespace clan +{ + class BrushGradientStop + { + public: + BrushGradientStop() { } + BrushGradientStop(const Colorf &color, float position) : color(color), position(position) { } + + Colorf color; + float position = 0.0f; + }; + + enum class BrushType + { + solid, + linear, + radial, + image + }; + + enum class BrushWrapMode + { + clamp, + wrap, + mirror + }; + + enum class BrushInterpolateMode + { + nearest, + linear + }; + + class Brush + { + public: + Brush() { } + Brush(const Colorf &color) : color(color) { } + + BrushType type = BrushType::solid; + + // Generic brush properties + float opacity = 1.0f; + Mat3f transform = Mat3f::identity(); + + // Solid color + Colorf color; + + // Gradient color stops + std::vector stops; + + // Linear gradient + Pointf start_point; + Pointf end_point; + + // Radial gradient + Pointf center_point; + Pointf gradient_origin_offset; + float radius_x = 0.0f; + float radius_y = 0.0f; + + // Texture + Image image; + BrushWrapMode wrap_x = BrushWrapMode::wrap; + BrushWrapMode wrap_y = BrushWrapMode::wrap; + BrushInterpolateMode interpolate = BrushInterpolateMode::linear; + + static Brush solid(float r, float g, float b, float a = 1.0f) + { + Brush brush; + brush.color = Colorf(r, g, b, a); + return brush; + } + static Brush solid(const Colorf &color) + { + Brush brush; + brush.color = color; + return brush; + } + static Brush solid_rgb8(int r, int g, int b) + { + Brush brush; + brush.color = Colorf(r, g, b); + return brush; + } + + static Brush solid_rgba8(int r, int g, int b, int a) + { + Brush brush; + brush.color = Colorf(r, g, b, a); + return brush; + } + }; + +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/canvas.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/canvas.h new file mode 100644 index 0000000..b9d9dcc --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/canvas.h @@ -0,0 +1,458 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +** Kenneth Gangstoe +** Mark Page +*/ + +#pragma once + +#include "../Render/graphic_context.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class Canvas_Impl; + class GraphicContext; + class PrimitivesArray; + class Sprite_Impl; + class Image; + class GlyphCache; + class Draw; + class RenderBatcher; + class Colorf; + class Pointf; + class Gradient; + class LineSegment2f; + class LineSegment2; + class Trianglef; + class Triangle; + class DisplayWindow; + class DisplayWindowDescription; + class Path; + class Pen; + class Brush; + + /// \brief Mapping modes. + enum MapMode + { + map_2d_upper_left, + map_2d_lower_left, + map_user_projection + }; + + /// \brief 2D Graphics Canvas + class Canvas + { + public: + /// \brief Constructs a null instance. + Canvas(); + + /// \brief Constructs a Canvas based on a framebuffer. (based on the copy of the canvas) + Canvas(Canvas &canvas, FrameBuffer &framebuffer); + + /// \brief Constructs a Canvas + explicit Canvas(DisplayWindow &window); + + ~Canvas(); + + /// \brief Create a copy of a canvas + Canvas create(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Get gc + /// + /// \return Graphic Context + GraphicContext& get_gc() const; + + /// \brief Returns the current effective transform matrix. + const Mat4f &get_transform() const; + + /// \brief Returns the inverse of the current effective transform matrix + /// + /// This is cached + Mat4f &get_inverse_transform(); + + /// \brief Returns the current effective projection matrix. + const Mat4f &get_projection() const; + + operator GraphicContext&() const { return get_gc(); } + + /// \brief Returns the current width of the context. + inline float get_width() const { return get_gc().get_dip_width(); } + + /// \brief Returns the current height of the context. + inline float get_height() const { return get_gc().get_dip_height(); } + + /// \brief Returns the current size of the context. + inline Sizef get_size() const { return get_gc().get_dip_size(); } + + /// \brief Returns the current clipping rectangle + Rectf get_cliprect() const; + + /// \brief Return the content of the read buffer into a pixel buffer. + PixelBuffer get_pixeldata(const Rect& rect, TextureFormat texture_format = tf_rgba8, bool clamp = true); + + /// \brief Return the content of the read buffer into a pixel buffer. + PixelBuffer get_pixeldata(TextureFormat texture_format = tf_rgba8, bool clamp = true); + + /// Retrieves the display pixel ratio of the context. + /// \seealso Resolution Independence + float get_pixel_ratio() const { return get_gc().get_pixel_ratio(); } + + /// \brief Set active rasterizer state + void set_rasterizer_state(const RasterizerState &state); + + /// \brief Set active blend state + void set_blend_state(const BlendState &state, const Colorf &blend_color = StandardColorf::white(), unsigned int sample_mask = 0xffffffff); + + /// \brief Set active depth stencil state + void set_depth_stencil_state(const DepthStencilState &state, int stencil_ref = 0); + + /// \brief Set active rasterizer state + void reset_rasterizer_state(); + + /// \brief Set active blend state + void reset_blend_state(); + + /// \brief Set active depth stencil state + void reset_depth_stencil_state(); + + /// \brief Set the current clipping rectangle. + void set_cliprect(const Rectf &rect); + + /// \brief Push current clipping rectangle to stack. + /**

If a rectangle is passed, it afterwards sets clipping + rectangle to the union of the current rectangle and the passed + rectangle.

*/ + void push_cliprect(const Rectf &rect); + + /// \brief Push cliprect + void push_cliprect(); + + /// \brief Pop current clipping rectangle from the stack. + void pop_cliprect(); + + /// \brief Removes the set clipping rectangle and empties the cliprect stack. + void reset_cliprect(); + + /// \brief Clears the whole context using the specified color. + void clear(const Colorf &color = StandardColorf::black()); + + /// \brief Clear the stencil buffer + /// + /// \param value value to clear to. + void clear_stencil(int value = 0); + + /// \brief Clear the depth buffer + /// + /// \param value: value to clear to. Range 0.0 - 1.0. + void clear_depth(float value = 0); + + /// \brief Set active program object to the standard program specified. + void set_program_object(StandardProgram standard_program); + + /// \brief Set the projection mapping mode. + void set_map_mode(MapMode mode); + + /// Set the viewport to be used in user projection map mode. + /// + /// \param viewport = The viewport to set + void set_viewport(const Rectf &viewport); + + /// \brief Set the projection matrix to be used in user projection map mode. + void set_projection(const Mat4f &matrix); + + /// \brief Specifies which render batcher is to be currently active + /// + /// If the render batcher is already active, nothing happens. If a different render batcher + /// is currently active, it is flushed before the new batcher is made active. + void set_batcher(RenderBatcher *batcher); + + /// \brief Sets the transform matrix to a new matrix. + void set_transform(const Mat4f &matrix); + + /// \brief Multiplies the passed matrix onto the transform matrix. + void mult_transform(const Mat4f &matrix); + + /// \brief Flushes the render batcher currently active. + void flush(); + + /// \brief Draw a point. + void draw_point(float x1, float y1, const Colorf &color); + + /// \brief Point + /// + /// \param gc = Graphic Context + /// \param point = Pointf + /// \param color = Colorf + void draw_point(const Pointf &point, const Colorf &color); + + /// \brief Draw a line. + void draw_line(float x1, float y1, float x2, float y2, const Colorf &color = StandardColorf::white()); + + /// \brief Line + /// + /// \param gc = Graphic Context + /// \param start = Pointf + /// \param end = Pointf + /// \param color = Colorf + void draw_line(const Pointf &start, const Pointf &end, const Colorf &color = StandardColorf::white()); + + /// \brief Line + /// + /// \param gc = Graphic Context + /// \param line_segment = The line + /// \param color = Colorf + void draw_line(const LineSegment2f &line_segment, const Colorf &color = StandardColorf::white()); + + /// \brief Lines + void draw_lines(const Vec2f *positions, int num_vertices, const Colorf &color = StandardColorf::white()); + + /// \brief Lines + void draw_lines(const Vec2f *line_positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf &line_color = StandardColorf::white()); + + /// \brief Line Strip + void draw_line_strip(const Vec2f *positions, int num_vertices, const Colorf &color = StandardColorf::white()); + + /// \brief Draw a box / rectangle. + void draw_box(float x1, float y1, float x2, float y2, const Colorf &color = StandardColorf::white()); + + /// \brief Box + /// + /// \param gc = Graphic Context + /// \param start = Pointf + /// \param end = Pointf + /// \param color = Colorf + void draw_box(const Pointf &start, const Pointf &end, const Colorf &color = StandardColorf::white()); + + /// \brief Box + /// + /// \param gc = Graphic Context + /// \param rect = Rectf + /// \param color = Colorf + void draw_box(const Rectf &rect, const Colorf &color); + + /// \brief Draw a filled box / rectangle. + void fill_rect(float x1, float y1, float x2, float y2, const Colorf &color = StandardColorf::white()); + + /// \brief Fill + /// + /// \param gc = Graphic Context + /// \param start = Pointf + /// \param end = Pointf + /// \param color = Colorf + void fill_rect(const Pointf &start, const Pointf &end, const Colorf &color = StandardColorf::white()); + + /// \brief Fill + /// + /// \param gc = Graphic Context + /// \param rect = Rectf + /// \param color = Colorf + void fill_rect(const Rectf &rect, const Colorf &color); + + /// \brief Gradient fill + /// + /// \param gc = Graphic Context + /// \param x1 = value + /// \param y1 = value + /// \param x2 = value + /// \param y2 = value + /// \param color = Gradient + void fill_rect(float x1, float y1, float x2, float y2, const Gradient &color); + + /// \brief Gradient fill + /// + /// \param gc = Graphic Context + /// \param start = Pointf + /// \param end = Pointf + /// \param gradient = Gradient + void fill_rect(const Pointf &start, const Pointf &end, const Gradient &gradient); + + /// \brief Gradient fill + /// + /// \param gc = Graphic Context + /// \param rect = Rectf + /// \param gradient = Gradient + void fill_rect(const Rectf &rect, const Gradient &gradient); + + /// \brief Draw a circle. + void fill_circle(float center_x, float center_y, float radius, const Colorf &color = StandardColorf::white()); + + /// \brief Circle + /// + /// \param gc = Graphic Context + /// \param center = Pointf + /// \param radius = value + /// \param color = Colorf + void fill_circle(const Pointf ¢er, float radius, const Colorf &color = StandardColorf::white()); + + /// \brief Gradient circle + /// + /// \param gc = Graphic Context + /// \param center = Pointf + /// \param radius = value + /// \param gradient = Gradient + void fill_circle(const Pointf ¢er, float radius, const Gradient &gradient); + + /// \brief Gradient circle + /// + /// \param gc = Graphic Context + /// \param center = Pointf + /// \param centergradient = Pointf + /// \param radius = value + /// \param gradient = Gradient + void fill_circle(const Pointf ¢er, const Pointf ¢ergradient, float radius, const Gradient &gradient); + + /// \brief Draw a triangle. + void fill_triangle(const Pointf &a, const Pointf &b, const Pointf &c, const Colorf &color = StandardColorf::white()); + + /// \brief Draw a triangle. + void fill_triangle(const Trianglef &dest_triangle, const Colorf &color = StandardColorf::white()); + + /// \brief Draw triangles + void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Colorf &color = StandardColorf::white()); + + /// \brief Draw triangles + void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Gradient &gradient); + + /// \brief Draw triangles + void fill_triangles(const Vec2f *triangle_positions, const Colorf *colors, int num_vertices); + + /// \brief Draw triangles + void fill_triangles(const std::vector &triangles, const Colorf *colors); + + /// \brief Draw triangles + void fill_triangles(const std::vector &triangles, const Colorf &color = StandardColorf::white()); + + /// \brief Draw triangles + void fill_triangles(const std::vector &triangles, const Gradient &gradient); + + /// \brief Draw triangles + void fill_triangles(const Vec2f *positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf &color = StandardColorf::white()); + + /// \brief Draw triangles + void fill_triangles(const Vec2f *positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf *colors); + + /// \brief Draw triangles + void fill_triangles(const std::vector &positions, const std::vector &texture_positions, const Texture2D &texture, const Colorf &color = StandardColorf::white()); + + /// \brief Draw triangles + void fill_triangles(const std::vector &positions, const std::vector &texture_positions, const Texture2D &texture, const std::vector &colors); + + /// \brief Draw triangles + void fill_triangles(const std::vector &positions, const Texture2D &texture, const Colorf &color = StandardColorf::white()); + + /// \brief Draw triangles + void fill_triangles(const std::vector &positions, const Texture2D &texture, const Rect &texture_rect, const Colorf &color = StandardColorf::white()); + + /// \brief Draw triangles + void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Colorf &color = StandardColorf::white()); + + /// \brief Draw triangles + void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Rect &texture_rect, const Colorf &color = StandardColorf::white()); + + /// \brief Draw triangles + void fill_triangles(const std::vector &positions, const Texture2D &texture, const Gradient &gradient); + + /// \brief Draw triangles + void fill_triangles(const std::vector &positions, const Texture2D &texture, const Rect &texture_rect, const Gradient &gradient); + + /// \brief Draw triangles + void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Gradient &gradient); + + /// \brief Draw triangles + void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Rect &texture_rect, const Gradient &gradient); + + /// \brief Draw a filled ellipse. + void fill_ellipse(const Pointf ¢er, float radius_x, float radius_y, const Colorf &color = StandardColorf::white()); + + /// \brief Draw a gradient filled ellipse. + void fill_ellipse(const Pointf ¢er, float radius_x, float radius_y, const Gradient &gradient); + + /// \brief Snaps the point to the nearest pixel corner + Pointf grid_fit(const Pointf &pos); + + private: + std::shared_ptr impl; + + friend class Sprite_Impl; + friend class Image; + friend class Font_Impl; + friend class Font_DrawSubPixel; + friend class Font_DrawFlat; + friend class Font_DrawScaled; + friend class Path; + }; + + // Helper class to save the transform state for exception safety + class TransformState + { + public: + TransformState(Canvas *current_canvas) : canvas(current_canvas), matrix(current_canvas->get_transform()) {} + ~TransformState() { canvas->set_transform(matrix); } + const Mat4f matrix; + private: + Canvas *canvas; + }; + + // Helper class to save the clip rect state for exception safety + class ClipRectState + { + public: + ClipRectState(Canvas *current_canvas) : canvas(current_canvas), cliprect(current_canvas->get_cliprect()) {} + ~ClipRectState() { (Rectf(canvas->get_size()) == cliprect) ? canvas->reset_cliprect() : canvas->set_cliprect(cliprect); } + const Rectf cliprect; + private: + Canvas *canvas; + }; + + // Helper class to control the cliprect stack state for exception safety + class ClipRectStack + { + public: + ClipRectStack(Canvas *current_canvas) : canvas(current_canvas) {} + ~ClipRectStack() { for (; push_count > 0; --push_count) canvas->pop_cliprect(); } + + void push_cliprect(const Rectf &rect) { push_count++; canvas->push_cliprect(rect); } + void push_cliprect() { push_count++; canvas->push_cliprect(); } + void pop_cliprect() { if (push_count) { --push_count; canvas->pop_cliprect(); } } + private: + unsigned int push_count = 0; + clan::Canvas *canvas; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/color.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/color.h new file mode 100644 index 0000000..51ef678 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/color.h @@ -0,0 +1,1900 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +** Mark Page +*/ + +#pragma once + +#include "../../Core/Math/vec4.h" +#include + +namespace clan +{ + /// \addtogroup clanDisplay_2D clanDisplay 2D + /// \{ + + class PixelFormat; + class Colorf; + + /// \brief Color description class. + class Color : public Vec4ub + { + public: + /// \brief Constructs a color. + Color() {} + + explicit Color(const Colorf&); + + /// \brief Constructs a color. + /// + /// Color components are specified in the range 0 to 255.\n + /// An alpha value of 0 means complete transparency, while 255 means completely opaque (solid). + /// + /// \param red Red color component. + /// \param green Green color component. + /// \param blue Blue color component. + /// \param alpha Alpha (transparency) color component. + Color(unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha = 255) + : Vec4ub(red, green, blue, alpha) { return; } + + /// \brief Constructs a color. + /// + /// Color components are specified in the range 0 to 255.\n + /// An alpha value of 0 means complete transparency, while 255 means completely opaque (solid). + /// + /// \param hexstr The colors rgba components as a hexadecimal string of the format "#rrggbbaa", where the '#' and "aa" parts are optional. + Color(const std::string &hexstr); + + /// \brief Returns the alpha color component, in the range 0-255. + unsigned char get_alpha() const { return a; } + + /// \brief Returns the red color component, in the range 0-255. + unsigned char get_red() const { return r; } + + /// \brief Returns the green color component, in the range 0-255. + unsigned char get_green() const { return g; } + + /// \brief Returns the blue color component, in the range 0-255. + unsigned char get_blue() const { return b; } + + /// \brief Returns the alpha color component, in the range 0-1. + float get_alpha_f() const { return float(a) / 255.0f; } + + /// \brief Returns the red color component, in the range 0-1. + float get_red_f() const { return float(r) / 255.0f; } + + /// \brief Returns the green color component, in the range 0-1. + float get_green_f() const { return float(g) / 255.0f; } + + /// \brief Returns the blue color component, in the range 0-1. + float get_blue_f() const { return float(b) / 255.0f; } + + /// \brief Returns the color in ARGB8888 format. + unsigned int get_argb8() const { return (((unsigned int)a) << 24) | (((unsigned int)r) << 16) | (((unsigned int)g) << 8) | (unsigned int)b; } + + /// \brief Returns the color in ABGR8888 format. + unsigned int get_abgr8() const { return (((unsigned int)a) << 24) | (((unsigned int)b) << 16) | (((unsigned int)g) << 8) | (unsigned int)r; } + + /// \brief Returns the color in 0BGR8888 format. + unsigned int get_bgr8() const { return (((unsigned int)b) << 16) | (((unsigned int)g) << 8) | (unsigned int)r; } + + /// \brief Returns the color in RGBA8888 format. + unsigned int get_rgba8() const { return (((unsigned int)r) << 24) | (((unsigned int)g) << 16) | (((unsigned int)b) << 8) | (unsigned int)a; } + + /// \brief Returns the color in BGRA8888 format. + unsigned int get_bgra8() const { return (((unsigned int)b) << 24) | (((unsigned int)g) << 16) | (((unsigned int)r) << 8) | (unsigned int)a; } + + // Operations: + public: + /// \brief Color == Color operator (deep compare) + bool operator==(const Color &c) const + { + return (r == c.r) && (g == c.g) && (b == c.b) && (a == c.a); + } + + /// \brief Color != Color operator (deep compare) + bool operator!=(const Color &c) const + { + return (r != c.r) || (g != c.g) || (b != c.b) || (a != c.a); + } + + /// \brief rgb(240, 248, 255). + //[[deprecated("Please use StandardColor::aliceblue() instead")]] + static Color aliceblue; + + /// \brief rgb(250, 235, 215). + //[[deprecated("Please use StandardColor::antiquewhite() instead")]] + static Color antiquewhite; + + /// \brief rgb( 0, 255, 255). + //[[deprecated("Please use StandardColor::aqua() instead")]] + static Color aqua; + + /// \brief rgb(127, 255, 212). + //[[deprecated("Please use StandardColor::aquamarine() instead")]] + static Color aquamarine; + + /// \brief rgb(240, 255, 255). + //[[deprecated("Please use StandardColor::azure() instead")]] + static Color azure; + + /// \brief rgb(245, 245, 220). + //[[deprecated("Please use StandardColor::beige() instead")]] + static Color beige; + + /// \brief rgb(255, 228, 196). + //[[deprecated("Please use StandardColor::bisque() instead")]] + static Color bisque; + + /// \brief rgb( 0, 0, 0). + //[[deprecated("Please use StandardColor::black() instead")]] + static Color black; + + /// \brief rgb(255, 235, 205). + //[[deprecated("Please use StandardColor::blanchedalmond() instead")]] + static Color blanchedalmond; + + /// \brief rgb( 0, 0, 255). + //[[deprecated("Please use StandardColor::blue() instead")]] + static Color blue; + + /// \brief rgb(138, 43, 226). + //[[deprecated("Please use StandardColor::blueviolet() instead")]] + static Color blueviolet; + + /// \brief rgb(165, 42, 42). + //[[deprecated("Please use StandardColor::brown() instead")]] + static Color brown; + + /// \brief rgb(222, 184, 135). + //[[deprecated("Please use StandardColor::burlywood() instead")]] + static Color burlywood; + + /// \brief rgb( 95, 158, 160). + //[[deprecated("Please use StandardColor::cadetblue() instead")]] + static Color cadetblue; + + /// \brief rgb(127, 255, 0). + //[[deprecated("Please use StandardColor::chartreuse() instead")]] + static Color chartreuse; + + /// \brief rgb(210, 105, 30). + //[[deprecated("Please use StandardColor::chocolate() instead")]] + static Color chocolate; + + /// \brief rgb(255, 127, 80). + //[[deprecated("Please use StandardColor::coral() instead")]] + static Color coral; + + /// \brief rgb(100, 149, 237). + //[[deprecated("Please use StandardColor::cornflowerblue() instead")]] + static Color cornflowerblue; + + /// \brief rgb(255, 248, 220). + //[[deprecated("Please use StandardColor::cornsilk() instead")]] + static Color cornsilk; + + /// \brief rgb(220, 20, 60). + //[[deprecated("Please use StandardColor::crimson() instead")]] + static Color crimson; + + /// \brief rgb( 0, 255, 255). + //[[deprecated("Please use StandardColor::cyan() instead")]] + static Color cyan; + + /// \brief rgb( 0, 0, 139). + //[[deprecated("Please use StandardColor::darkblue() instead")]] + static Color darkblue; + + /// \brief rgb( 0, 139, 139). + //[[deprecated("Please use StandardColor::darkcyan() instead")]] + static Color darkcyan; + + /// \brief rgb(184, 134, 11). + //[[deprecated("Please use StandardColor::darkgoldenrod() instead")]] + static Color darkgoldenrod; + + /// \brief rgb(169, 169, 169). + //[[deprecated("Please use StandardColor::darkgray() instead")]] + static Color darkgray; + + /// \brief rgb( 0, 100, 0). + //[[deprecated("Please use StandardColor::darkgreen() instead")]] + static Color darkgreen; + + /// \brief rgb(169, 169, 169). + //[[deprecated("Please use StandardColor::darkgrey() instead")]] + static Color darkgrey; + + /// \brief rgb(189, 183, 107). + //[[deprecated("Please use StandardColor::darkkhaki() instead")]] + static Color darkkhaki; + + /// \brief rgb(139, 0, 139). + //[[deprecated("Please use StandardColor::darkmagenta() instead")]] + static Color darkmagenta; + + /// \brief rgb( 85, 107, 47). + //[[deprecated("Please use StandardColor::darkolivegreen() instead")]] + static Color darkolivegreen; + + /// \brief rgb(255, 140, 0). + //[[deprecated("Please use StandardColor::darkorange() instead")]] + static Color darkorange; + + /// \brief rgb(153, 50, 204). + //[[deprecated("Please use StandardColor::darkorchid() instead")]] + static Color darkorchid; + + /// \brief rgb(139, 0, 0). + //[[deprecated("Please use StandardColor::darkred() instead")]] + static Color darkred; + + /// \brief rgb(233, 150, 122). + //[[deprecated("Please use StandardColor::darksalmon() instead")]] + static Color darksalmon; + + /// \brief rgb(143, 188, 143). + //[[deprecated("Please use StandardColor::darkseagreen() instead")]] + static Color darkseagreen; + + /// \brief rgb( 72, 61, 139). + //[[deprecated("Please use StandardColor::darkslateblue() instead")]] + static Color darkslateblue; + + /// \brief rgb( 47, 79, 79). + //[[deprecated("Please use StandardColor::darkslategray() instead")]] + static Color darkslategray; + + /// \brief rgb( 47, 79, 79). + //[[deprecated("Please use StandardColor::darkslategrey() instead")]] + static Color darkslategrey; + + /// \brief rgb( 0, 206, 209). + //[[deprecated("Please use StandardColor::darkturquoise() instead")]] + static Color darkturquoise; + + /// \brief rgb(148, 0, 211). + //[[deprecated("Please use StandardColor::darkviolet() instead")]] + static Color darkviolet; + + /// \brief rgb(255, 20, 147). + //[[deprecated("Please use StandardColor::deeppink() instead")]] + static Color deeppink; + + /// \brief rgb( 0, 191, 255). + //[[deprecated("Please use StandardColor::deepskyblue() instead")]] + static Color deepskyblue; + + /// \brief rgb(105, 105, 105). + //[[deprecated("Please use StandardColor::dimgray() instead")]] + static Color dimgray; + + /// \brief rgb(105, 105, 105). + //[[deprecated("Please use StandardColor::dimgrey() instead")]] + static Color dimgrey; + + /// \brief rgb( 30, 144, 255). + //[[deprecated("Please use StandardColor::dodgerblue() instead")]] + static Color dodgerblue; + + /// \brief rgb(178, 34, 34). + //[[deprecated("Please use StandardColor::firebrick() instead")]] + static Color firebrick; + + /// \brief rgb(255, 250, 240). + //[[deprecated("Please use StandardColor::floralwhite() instead")]] + static Color floralwhite; + + /// \brief rgb( 34, 139, 34). + //[[deprecated("Please use StandardColor::forestgreen() instead")]] + static Color forestgreen; + + /// \brief rgb(255, 0, 255). + //[[deprecated("Please use StandardColor::fuchsia() instead")]] + static Color fuchsia; + + /// \brief rgb(220, 220, 220). + //[[deprecated("Please use StandardColor::gainsboro() instead")]] + static Color gainsboro; + + /// \brief rgb(248, 248, 255). + //[[deprecated("Please use StandardColor::ghostwhite() instead")]] + static Color ghostwhite; + + /// \brief rgb(255, 215, 0). + //[[deprecated("Please use StandardColor::gold() instead")]] + static Color gold; + + /// \brief rgb(218, 165, 32). + //[[deprecated("Please use StandardColor::goldenrod() instead")]] + static Color goldenrod; + + /// \brief rgb(128, 128, 128). + //[[deprecated("Please use StandardColor::gray() instead")]] + static Color gray; + + /// \brief rgb(128, 128, 128). + //[[deprecated("Please use StandardColor::grey() instead")]] + static Color grey; + + /// \brief rgb( 0, 128, 0). + //[[deprecated("Please use StandardColor::green() instead")]] + static Color green; + + /// \brief rgb(173, 255, 47). + //[[deprecated("Please use StandardColor::greenyellow() instead")]] + static Color greenyellow; + + /// \brief rgb(240, 255, 240). + //[[deprecated("Please use StandardColor::honeydew() instead")]] + static Color honeydew; + + /// \brief rgb(255, 105, 180). + //[[deprecated("Please use StandardColor::hotpink() instead")]] + static Color hotpink; + + /// \brief rgb(205, 92, 92). + //[[deprecated("Please use StandardColor::indianred() instead")]] + static Color indianred; + + /// \brief rgb( 75, 0, 130). + //[[deprecated("Please use StandardColor::indigo() instead")]] + static Color indigo; + + /// \brief rgb(255, 255, 240). + //[[deprecated("Please use StandardColor::ivory() instead")]] + static Color ivory; + + /// \brief rgb(240, 230, 140). + //[[deprecated("Please use StandardColor::khaki() instead")]] + static Color khaki; + + /// \brief rgb(230, 230, 250). + //[[deprecated("Please use StandardColor::lavender() instead")]] + static Color lavender; + + /// \brief rgb(255, 240, 245). + //[[deprecated("Please use StandardColor::lavenderblush() instead")]] + static Color lavenderblush; + + /// \brief rgb(124, 252, 0). + //[[deprecated("Please use StandardColor::lawngreen() instead")]] + static Color lawngreen; + + /// \brief rgb(255, 250, 205). + //[[deprecated("Please use StandardColor::lemonchiffon() instead")]] + static Color lemonchiffon; + + /// \brief rgb(173, 216, 230). + //[[deprecated("Please use StandardColor::lightblue() instead")]] + static Color lightblue; + + /// \brief rgb(240, 128, 128). + //[[deprecated("Please use StandardColor::lightcoral() instead")]] + static Color lightcoral; + + /// \brief rgb(224, 255, 255). + //[[deprecated("Please use StandardColor::lightcyan() instead")]] + static Color lightcyan; + + /// \brief rgb(250, 250, 210). + //[[deprecated("Please use StandardColor::lightgoldenrodyellow() instead")]] + static Color lightgoldenrodyellow; + + /// \brief rgb(211, 211, 211). + //[[deprecated("Please use StandardColor::lightgray() instead")]] + static Color lightgray; + + /// \brief rgb(144, 238, 144). + //[[deprecated("Please use StandardColor::lightgreen() instead")]] + static Color lightgreen; + + /// \brief rgb(211, 211, 211). + //[[deprecated("Please use StandardColor::lightgrey() instead")]] + static Color lightgrey; + + /// \brief rgb(255, 182, 193). + //[[deprecated("Please use StandardColor::lightpink() instead")]] + static Color lightpink; + + /// \brief rgb(255, 160, 122). + //[[deprecated("Please use StandardColor::lightsalmon() instead")]] + static Color lightsalmon; + + /// \brief rgb( 32, 178, 170). + //[[deprecated("Please use StandardColor::lightseagreen() instead")]] + static Color lightseagreen; + + /// \brief rgb(135, 206, 250). + //[[deprecated("Please use StandardColor::lightskyblue() instead")]] + static Color lightskyblue; + + /// \brief rgb(119, 136, 153). + //[[deprecated("Please use StandardColor::lightslategray() instead")]] + static Color lightslategray; + + /// \brief rgb(119, 136, 153). + //[[deprecated("Please use StandardColor::lightslategrey() instead")]] + static Color lightslategrey; + + /// \brief rgb(176, 196, 222). + //[[deprecated("Please use StandardColor::lightsteelblue() instead")]] + static Color lightsteelblue; + + /// \brief rgb(255, 255, 224). + //[[deprecated("Please use StandardColor::lightyellow() instead")]] + static Color lightyellow; + + /// \brief rgb( 0, 255, 0). + //[[deprecated("Please use StandardColor::lime() instead")]] + static Color lime; + + /// \brief rgb( 50, 205, 50). + //[[deprecated("Please use StandardColor::limegreen() instead")]] + static Color limegreen; + + /// \brief rgb(250, 240, 230). + //[[deprecated("Please use StandardColor::linen() instead")]] + static Color linen; + + /// \brief rgb(255, 0, 255). + //[[deprecated("Please use StandardColor::magenta() instead")]] + static Color magenta; + + /// \brief rgb(128, 0, 0). + //[[deprecated("Please use StandardColor::maroon() instead")]] + static Color maroon; + + /// \brief rgb(102, 205, 170). + //[[deprecated("Please use StandardColor::mediumaquamarine() instead")]] + static Color mediumaquamarine; + + /// \brief rgb( 0, 0, 205). + //[[deprecated("Please use StandardColor::mediumblue() instead")]] + static Color mediumblue; + + /// \brief rgb(186, 85, 211). + //[[deprecated("Please use StandardColor::mediumorchid() instead")]] + static Color mediumorchid; + + /// \brief rgb(147, 112, 219). + //[[deprecated("Please use StandardColor::mediumpurple() instead")]] + static Color mediumpurple; + + /// \brief rgb( 60, 179, 113). + //[[deprecated("Please use StandardColor::mediumseagreen() instead")]] + static Color mediumseagreen; + + /// \brief rgb(123, 104, 238). + //[[deprecated("Please use StandardColor::mediumslateblue() instead")]] + static Color mediumslateblue; + + /// \brief rgb( 0, 250, 154). + //[[deprecated("Please use StandardColor::mediumspringgreen() instead")]] + static Color mediumspringgreen; + + /// \brief rgb( 72, 209, 204). + //[[deprecated("Please use StandardColor::mediumturquoise() instead")]] + static Color mediumturquoise; + + /// \brief rgb(199, 21, 133). + //[[deprecated("Please use StandardColor::mediumvioletred() instead")]] + static Color mediumvioletred; + + /// \brief rgb( 25, 25, 112). + //[[deprecated("Please use StandardColor::midnightblue() instead")]] + static Color midnightblue; + + /// \brief rgb(245, 255, 250). + //[[deprecated("Please use StandardColor::mintcream() instead")]] + static Color mintcream; + + /// \brief rgb(255, 228, 225). + //[[deprecated("Please use StandardColor::mistyrose() instead")]] + static Color mistyrose; + + /// \brief rgb(255, 228, 181). + //[[deprecated("Please use StandardColor::moccasin() instead")]] + static Color moccasin; + + /// \brief rgb(255, 222, 173). + //[[deprecated("Please use StandardColor::navajowhite() instead")]] + static Color navajowhite; + + /// \brief rgb( 0, 0, 128). + //[[deprecated("Please use StandardColor::navy() instead")]] + static Color navy; + + /// \brief rgb(253, 245, 230). + //[[deprecated("Please use StandardColor::oldlace() instead")]] + static Color oldlace; + + /// \brief rgb(128, 128, 0). + //[[deprecated("Please use StandardColor::olive() instead")]] + static Color olive; + + /// \brief rgb(107, 142, 35). + //[[deprecated("Please use StandardColor::olivedrab() instead")]] + static Color olivedrab; + + /// \brief rgb(255, 165, 0). + //[[deprecated("Please use StandardColor::orange() instead")]] + static Color orange; + + /// \brief rgb(255, 69, 0). + //[[deprecated("Please use StandardColor::orangered() instead")]] + static Color orangered; + + /// \brief rgb(218, 112, 214). + //[[deprecated("Please use StandardColor::orchid() instead")]] + static Color orchid; + + /// \brief rgb(238, 232, 170). + //[[deprecated("Please use StandardColor::palegoldenrod() instead")]] + static Color palegoldenrod; + + /// \brief rgb(152, 251, 152). + //[[deprecated("Please use StandardColor::palegreen() instead")]] + static Color palegreen; + + /// \brief rgb(175, 238, 238). + //[[deprecated("Please use StandardColor::paleturquoise() instead")]] + static Color paleturquoise; + + /// \brief rgb(219, 112, 147). + //[[deprecated("Please use StandardColor::palevioletred() instead")]] + static Color palevioletred; + + /// \brief rgb(255, 239, 213). + //[[deprecated("Please use StandardColor::papayawhip() instead")]] + static Color papayawhip; + + /// \brief rgb(255, 218, 185). + //[[deprecated("Please use StandardColor::peachpuff() instead")]] + static Color peachpuff; + + /// \brief rgb(205, 133, 63). + //[[deprecated("Please use StandardColor::peru() instead")]] + static Color peru; + + /// \brief rgb(255, 192, 203). + //[[deprecated("Please use StandardColor::pink() instead")]] + static Color pink; + + /// \brief rgb(221, 160, 221). + //[[deprecated("Please use StandardColor::plum() instead")]] + static Color plum; + + /// \brief rgb(176, 224, 230). + //[[deprecated("Please use StandardColor::powderblue() instead")]] + static Color powderblue; + + /// \brief rgb(128, 0, 128). + //[[deprecated("Please use StandardColor::purple() instead")]] + static Color purple; + + /// \brief rgb(255, 0, 0). + //[[deprecated("Please use StandardColor::red() instead")]] + static Color red; + + /// \brief rgb(188, 143, 143). + //[[deprecated("Please use StandardColor::rosybrown() instead")]] + static Color rosybrown; + + /// \brief rgb( 65, 105, 225). + //[[deprecated("Please use StandardColor::royalblue() instead")]] + static Color royalblue; + + /// \brief rgb(139, 69, 19). + //[[deprecated("Please use StandardColor::saddlebrown() instead")]] + static Color saddlebrown; + + /// \brief rgb(250, 128, 114). + //[[deprecated("Please use StandardColor::salmon() instead")]] + static Color salmon; + + /// \brief rgb(244, 164, 96). + //[[deprecated("Please use StandardColor::sandybrown() instead")]] + static Color sandybrown; + + /// \brief rgb( 46, 139, 87). + //[[deprecated("Please use StandardColor::seagreen() instead")]] + static Color seagreen; + + /// \brief rgb(255, 245, 238). + //[[deprecated("Please use StandardColor::seashell() instead")]] + static Color seashell; + + /// \brief rgb(160, 82, 45). + //[[deprecated("Please use StandardColor::sienna() instead")]] + static Color sienna; + + /// \brief rgb(192, 192, 192). + //[[deprecated("Please use StandardColor::silver() instead")]] + static Color silver; + + /// \brief rgb(135, 206, 235). + //[[deprecated("Please use StandardColor::skyblue() instead")]] + static Color skyblue; + + /// \brief rgb(106, 90, 205). + //[[deprecated("Please use StandardColor::slateblue() instead")]] + static Color slateblue; + + /// \brief rgb(112, 128, 144). + //[[deprecated("Please use StandardColor::slategray() instead")]] + static Color slategray; + + /// \brief rgb(112, 128, 144). + //[[deprecated("Please use StandardColor::slategrey() instead")]] + static Color slategrey; + + /// \brief rgb(255, 250, 250). + //[[deprecated("Please use StandardColor::snow() instead")]] + static Color snow; + + /// \brief rgb( 0, 255, 127). + //[[deprecated("Please use StandardColor::springgreen() instead")]] + static Color springgreen; + + /// \brief rgb( 70, 130, 180). + //[[deprecated("Please use StandardColor::steelblue() instead")]] + static Color steelblue; + + /// \brief rgb(210, 180, 140). + //[[deprecated("Please use StandardColor::tan() instead")]] + static Color tan; + + /// \brief rgb( 0, 128, 128). + //[[deprecated("Please use StandardColor::teal() instead")]] + static Color teal; + + /// \brief rgb(216, 191, 216). + //[[deprecated("Please use StandardColor::thistle() instead")]] + static Color thistle; + + /// \brief rgb(255, 99, 71). + //[[deprecated("Please use StandardColor::tomato() instead")]] + static Color tomato; + + /// \brief rgb( 64, 224, 208). + //[[deprecated("Please use StandardColor::turquoise() instead")]] + static Color turquoise; + + /// \brief rgb(238, 130, 238). + //[[deprecated("Please use StandardColor::violet() instead")]] + static Color violet; + + /// \brief rgb(245, 222, 179). + //[[deprecated("Please use StandardColor::wheat() instead")]] + static Color wheat; + + /// \brief rgb(255, 255, 255). + //[[deprecated("Please use StandardColor::white() instead")]] + static Color white; + + /// \brief rgb(245, 245, 245). + //[[deprecated("Please use StandardColor::whitesmoke() instead")]] + static Color whitesmoke; + + /// \brief rgb(255, 255, 0). + //[[deprecated("Please use StandardColor::yellow() instead")]] + static Color yellow; + + /// \brief rgb(154, 205, 50). + //[[deprecated("Please use StandardColor::yellowgreen() instead")]] + static Color yellowgreen; + + /// \brief rgba(0, 0, 0, 0). + //[[deprecated("Please use StandardColor::transparent() instead")]] + static Color transparent; + + //[[deprecated("Please use StandardColor::gray10() instead")]] + static Color gray10; + + //[[deprecated("Please use StandardColor::gray20() instead")]] + static Color gray20; + + //[[deprecated("Please use StandardColor::gray30() instead")]] + static Color gray30; + + //[[deprecated("Please use StandardColor::gray40() instead")]] + static Color gray40; + + //[[deprecated("Please use StandardColor::gray50() instead")]] + static Color gray50; + + //[[deprecated("Please use StandardColor::gray60() instead")]] + static Color gray60; + + //[[deprecated("Please use StandardColor::gray70() instead")]] + static Color gray70; + + //[[deprecated("Please use StandardColor::gray80() instead")]] + static Color gray80; + + //[[deprecated("Please use StandardColor::gray90() instead")]] + static Color gray90; + + /// \brief Set alpha color component, in the range 0-255. + void set_alpha(unsigned char value) { a = value; } + + /// \brief Set red color component, in the range 0-255. + void set_red(unsigned char value) { r = value; } + + /// \brief Set green color component, in the range 0-255. + void set_green(unsigned char value) { g = value; } + + /// \brief Set blue color component, in the range 0-255. + void set_blue(unsigned char value) { b = value; } + + /// \brief Set alpha color component, in the range 0-1. + void set_alpha_f(float value) { a = (unsigned char) (value*255.0f); } + + /// \brief Set red color component, in the range 0-1. + void set_red_f(float value) { r = (unsigned char) (value*255.0f); } + + /// \brief Set green color component, in the range 0-1. + void set_green_f(float value) { g = (unsigned char) (value*255.0f); } + + /// \brief Set blue color component, in the range 0-1. + void set_blue_f(float value) { b = (unsigned char) (value*255.0f); } + + /// \brief Set color based on rgba color components in the range 0-255. + void set_color(unsigned char new_red, unsigned char new_green, unsigned char new_blue, unsigned char new_alpha = 255) + { r = new_red; g = new_green; b = new_blue; a = new_alpha; } + + /// \brief Set color based on rgba color components + void set_rgba8(unsigned int color); + + /// \brief Set color based on rgba color components + void set_bgra8(unsigned int color); + + /// \brief Set color based on rgb color components. Alpha is set to 255 + void set_rgb8(unsigned int color); + + /// \brief Set color based on argb color components + void set_argb8(unsigned int color); + + /// \brief Set color based on rgba color components in the range 0-1. + void set_colorf(float new_red, float new_green, float new_blue, float new_alpha = 1.0f) + { + r = (unsigned char) (new_red * 255.0f); + g = (unsigned char) (new_green * 255.0f); + b = (unsigned char) (new_blue * 255.0f); + a = (unsigned char) (new_alpha * 255.0f); + } + + /// \} + }; + + /// \brief Floating point color description class (for float). + class Colorf : public Vec4f + { + public: + /// \brief Constructs a color. + Colorf() : Vec4f(0.0f, 0.0f, 0.0f, 0.0f) + { + } + + /// \brief Constructs a color. + /// + /// Color components are specified in the range 0 to 1.\n + /// An alpha value of 0 means complete transparency, while 1 means completely opaque (solid). + /// + /// \param r = Red color component. + /// \param g = Green color component. + /// \param b = Blue color component. + /// \param a = Alpha (transparency) color component. + Colorf(float r, float g, float b, float a = 1.0f) : Vec4f(r,g,b,a) + { + } + + /// \brief Constructs a color. + /// + /// Color components are specified in the range 0 to 1.\n + /// An alpha value of 0 means complete transparency, while 1 means completely opaque (solid). + /// + /// \param array_rgba = Red,Green,Blue,Alpha color component. + Colorf(const float *array_rgba) + : Vec4f((array_rgba[0]), (array_rgba[1]), (array_rgba[2]), (array_rgba[3])) + { + } + + /// \brief Constructs a color. + /// + /// \param color = The color + Colorf(const Vec4f &color) : Vec4f(color) + { + } + + /// \brief Constructs a color. + /// + /// Color components are specified in the range 0 to 255.\n + /// An alpha value of 0 means complete transparency, while 255 means completely opaque (solid). + /// + /// \param r = Red color component. + /// \param g = Green color component. + /// \param b = Blue color component. + /// \param a = Alpha (transparency) color component. + Colorf(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) + : Vec4f((r/255.0f), (g/255.0f), (b/255.0f), (a/255.0f)) + { + } + + /// \brief Constructs a color. + /// + /// Color components are specified in the range 0 to 255.\n + /// An alpha value of 0 means complete transparency, while 255 means completely opaque (solid). + /// + /// \param r = Red color component. + /// \param g = Green color component. + /// \param b = Blue color component. + /// \param a = Alpha (transparency) color component. + Colorf(int r, int g, int b, int a=255) + : Vec4f((r/255.0f), (g/255.0f), (b/255.0f), (a/255.0f)) + { + } + + explicit Colorf(const Color& color) + : Vec4f((color.get_red()/255.0f), (color.get_green()/255.0f), (color.get_blue()/255.0f), (color.get_alpha()/255.0f)) + { + } + + /// \brief Constructs a color. + /// + /// \param hexstr The colors rgba components as a hexadecimal string of the format "#rrggbbaa", where the '#' and "aa" parts are optional. + Colorf(const std::string &hexstr) + { + Colorf::find_color(hexstr, *this); + } + + /// \brief Get Red + /// + /// \return red + float get_red() const { return r; } + + /// \brief Get Green + /// + /// \return green + float get_green() const { return g; } + + /// \brief Get Blue + /// + /// \return blue + float get_blue() const { return b; } + + /// \brief Get Alpha + /// + /// \return alpha + float get_alpha() const { return a; } + + /// \brief Normalize the color by ensuring that all color values lie inbetween (0.0, 1.0) + void normalize() + { + r = (r < 0.0f) ? 0.0f : ((r > 1.0f) ? 1.0f : r); + g = (g < 0.0f) ? 0.0f : ((g > 1.0f) ? 1.0f : g); + b = (b < 0.0f) ? 0.0f : ((b > 1.0f) ? 1.0f : b); + a = (a < 0.0f) ? 0.0f : ((a > 1.0f) ? 1.0f : a); + } + + /// \brief Set alpha color component, in the range 0-1. + void set_alpha(float value) { a = value; } + + /// \brief Set red color component, in the range 0-1. + void set_red(float value) { r = value; } + + /// \brief Set green color component, in the range 0-1. + void set_green(float value) { g= value; } + + /// \brief Set blue color component, in the range 0-1. + void set_blue(float value) { b = value; } + + /// \brief Color == Color operator (deep compare) + bool operator==(const Colorf &c) const + { + return (r == c.r) && (g == c.g) && (b == c.b) && (a == c.a); + } + + /// \brief Color != Color operator (deep compare) + bool operator!=(const Colorf &c) const + { + return (r != c.r) || (g != c.g) || (b != c.b) || (a != c.a); + } + + /// \brief Type conversion operator. + operator Color() const + { + return Color(*this); + } + + /// \brief Find and returns the static color matching a string. + /// + /// \param name Name of color to match, eg. "blue". + /// + /// \param out_color = Matching static color, or transparent (rgba(0,0,0,0)) if there was no match. + /// \return false = No match found + static bool find_color(const std::string &name, Colorf &out_color); + + /// \brief rgb(240, 248, 255). + //[[deprecated("Please use StandardColorf::aliceblue() instead")]] + static Colorf aliceblue; + + /// \brief rgb(250, 235, 215). + //[[deprecated("Please use StandardColorf::antiquewhite() instead")]] + static Colorf antiquewhite; + + /// \brief rgb( 0, 255, 255). + //[[deprecated("Please use StandardColorf::aqua() instead")]] + static Colorf aqua; + + /// \brief rgb(127, 255, 212). + //[[deprecated("Please use StandardColorf::aquamarine() instead")]] + static Colorf aquamarine; + + /// \brief rgb(240, 255, 255). + //[[deprecated("Please use StandardColorf::azure() instead")]] + static Colorf azure; + + /// \brief rgb(245, 245, 220). + //[[deprecated("Please use StandardColorf::beige() instead")]] + static Colorf beige; + + /// \brief rgb(255, 228, 196). + //[[deprecated("Please use StandardColorf::bisque() instead")]] + static Colorf bisque; + + /// \brief rgb( 0, 0, 0). + //[[deprecated("Please use StandardColorf::black() instead")]] + static Colorf black; + + /// \brief rgb(255, 235, 205). + //[[deprecated("Please use StandardColorf::blanchedalmond() instead")]] + static Colorf blanchedalmond; + + /// \brief rgb( 0, 0, 255). + //[[deprecated("Please use StandardColorf::blue() instead")]] + static Colorf blue; + + /// \brief rgb(138, 43, 226). + //[[deprecated("Please use StandardColorf::blueviolet() instead")]] + static Colorf blueviolet; + + /// \brief rgb(165, 42, 42). + //[[deprecated("Please use StandardColorf::brown() instead")]] + static Colorf brown; + + /// \brief rgb(222, 184, 135). + //[[deprecated("Please use StandardColorf::burlywood() instead")]] + static Colorf burlywood; + + /// \brief rgb( 95, 158, 160). + //[[deprecated("Please use StandardColorf::cadetblue() instead")]] + static Colorf cadetblue; + + /// \brief rgb(127, 255, 0). + //[[deprecated("Please use StandardColorf::chartreuse() instead")]] + static Colorf chartreuse; + + /// \brief rgb(210, 105, 30). + //[[deprecated("Please use StandardColorf::chocolate() instead")]] + static Colorf chocolate; + + /// \brief rgb(255, 127, 80). + //[[deprecated("Please use StandardColorf::coral() instead")]] + static Colorf coral; + + /// \brief rgb(100, 149, 237). + //[[deprecated("Please use StandardColorf::cornflowerblue() instead")]] + static Colorf cornflowerblue; + + /// \brief rgb(255, 248, 220). + //[[deprecated("Please use StandardColorf::cornsilk() instead")]] + static Colorf cornsilk; + + /// \brief rgb(220, 20, 60). + //[[deprecated("Please use StandardColorf::crimson() instead")]] + static Colorf crimson; + + /// \brief rgb( 0, 255, 255). + //[[deprecated("Please use StandardColorf::cyan() instead")]] + static Colorf cyan; + + /// \brief rgb( 0, 0, 139). + //[[deprecated("Please use StandardColorf::darkblue() instead")]] + static Colorf darkblue; + + /// \brief rgb( 0, 139, 139). + //[[deprecated("Please use StandardColorf::darkcyan() instead")]] + static Colorf darkcyan; + + /// \brief rgb(184, 134, 11). + //[[deprecated("Please use StandardColorf::darkgoldenrod() instead")]] + static Colorf darkgoldenrod; + + /// \brief rgb(169, 169, 169). + //[[deprecated("Please use StandardColorf::darkgray() instead")]] + static Colorf darkgray; + + /// \brief rgb( 0, 100, 0). + //[[deprecated("Please use StandardColorf::darkgreen() instead")]] + static Colorf darkgreen; + + /// \brief rgb(169, 169, 169). + //[[deprecated("Please use StandardColorf::darkgrey() instead")]] + static Colorf darkgrey; + + /// \brief rgb(189, 183, 107). + //[[deprecated("Please use StandardColorf::darkkhaki() instead")]] + static Colorf darkkhaki; + + /// \brief rgb(139, 0, 139). + //[[deprecated("Please use StandardColorf::darkmagenta() instead")]] + static Colorf darkmagenta; + + /// \brief rgb( 85, 107, 47). + //[[deprecated("Please use StandardColorf::darkolivegreen() instead")]] + static Colorf darkolivegreen; + + /// \brief rgb(255, 140, 0). + //[[deprecated("Please use StandardColorf::darkorange() instead")]] + static Colorf darkorange; + + /// \brief rgb(153, 50, 204). + //[[deprecated("Please use StandardColorf::darkorchid() instead")]] + static Colorf darkorchid; + + /// \brief rgb(139, 0, 0). + //[[deprecated("Please use StandardColorf::darkred() instead")]] + static Colorf darkred; + + /// \brief rgb(233, 150, 122). + //[[deprecated("Please use StandardColorf::darksalmon() instead")]] + static Colorf darksalmon; + + /// \brief rgb(143, 188, 143). + //[[deprecated("Please use StandardColorf::darkseagreen() instead")]] + static Colorf darkseagreen; + + /// \brief rgb( 72, 61, 139). + //[[deprecated("Please use StandardColorf::darkslateblue() instead")]] + static Colorf darkslateblue; + + /// \brief rgb( 47, 79, 79). + //[[deprecated("Please use StandardColorf::darkslategray() instead")]] + static Colorf darkslategray; + + /// \brief rgb( 47, 79, 79). + //[[deprecated("Please use StandardColorf::darkslategrey() instead")]] + static Colorf darkslategrey; + + /// \brief rgb( 0, 206, 209). + //[[deprecated("Please use StandardColorf::darkturquoise() instead")]] + static Colorf darkturquoise; + + /// \brief rgb(148, 0, 211). + //[[deprecated("Please use StandardColorf::darkviolet() instead")]] + static Colorf darkviolet; + + /// \brief rgb(255, 20, 147). + //[[deprecated("Please use StandardColorf::deeppink() instead")]] + static Colorf deeppink; + + /// \brief rgb( 0, 191, 255). + //[[deprecated("Please use StandardColorf::deepskyblue() instead")]] + static Colorf deepskyblue; + + /// \brief rgb(105, 105, 105). + //[[deprecated("Please use StandardColorf::dimgray() instead")]] + static Colorf dimgray; + + /// \brief rgb(105, 105, 105). + //[[deprecated("Please use StandardColorf::dimgrey() instead")]] + static Colorf dimgrey; + + /// \brief rgb( 30, 144, 255). + //[[deprecated("Please use StandardColorf::dodgerblue() instead")]] + static Colorf dodgerblue; + + /// \brief rgb(178, 34, 34). + //[[deprecated("Please use StandardColorf::firebrick() instead")]] + static Colorf firebrick; + + /// \brief rgb(255, 250, 240). + //[[deprecated("Please use StandardColorf::floralwhite() instead")]] + static Colorf floralwhite; + + /// \brief rgb( 34, 139, 34). + //[[deprecated("Please use StandardColorf::forestgreen() instead")]] + static Colorf forestgreen; + + /// \brief rgb(255, 0, 255). + //[[deprecated("Please use StandardColorf::fuchsia() instead")]] + static Colorf fuchsia; + + /// \brief rgb(220, 220, 220). + //[[deprecated("Please use StandardColorf::gainsboro() instead")]] + static Colorf gainsboro; + + /// \brief rgb(248, 248, 255). + //[[deprecated("Please use StandardColorf::ghostwhite() instead")]] + static Colorf ghostwhite; + + /// \brief rgb(255, 215, 0). + //[[deprecated("Please use StandardColorf::gold() instead")]] + static Colorf gold; + + /// \brief rgb(218, 165, 32). + //[[deprecated("Please use StandardColorf::goldenrod() instead")]] + static Colorf goldenrod; + + /// \brief rgb(128, 128, 128). + //[[deprecated("Please use StandardColorf::gray() instead")]] + static Colorf gray; + + /// \brief rgb(128, 128, 128). + //[[deprecated("Please use StandardColorf::grey() instead")]] + static Colorf grey; + + /// \brief rgb( 0, 128, 0). + //[[deprecated("Please use StandardColorf::green() instead")]] + static Colorf green; + + /// \brief rgb(173, 255, 47). + //[[deprecated("Please use StandardColorf::greenyellow() instead")]] + static Colorf greenyellow; + + /// \brief rgb(240, 255, 240). + //[[deprecated("Please use StandardColorf::honeydew() instead")]] + static Colorf honeydew; + + /// \brief rgb(255, 105, 180). + //[[deprecated("Please use StandardColorf::hotpink() instead")]] + static Colorf hotpink; + + /// \brief rgb(205, 92, 92). + //[[deprecated("Please use StandardColorf::indianred() instead")]] + static Colorf indianred; + + /// \brief rgb( 75, 0, 130). + //[[deprecated("Please use StandardColorf::indigo() instead")]] + static Colorf indigo; + + /// \brief rgb(255, 255, 240). + //[[deprecated("Please use StandardColorf::ivory() instead")]] + static Colorf ivory; + + /// \brief rgb(240, 230, 140). + //[[deprecated("Please use StandardColorf::khaki() instead")]] + static Colorf khaki; + + /// \brief rgb(230, 230, 250). + //[[deprecated("Please use StandardColorf::lavender() instead")]] + static Colorf lavender; + + /// \brief rgb(255, 240, 245). + //[[deprecated("Please use StandardColorf::lavenderblush() instead")]] + static Colorf lavenderblush; + + /// \brief rgb(124, 252, 0). + //[[deprecated("Please use StandardColorf::lawngreen() instead")]] + static Colorf lawngreen; + + /// \brief rgb(255, 250, 205). + //[[deprecated("Please use StandardColorf::lemonchiffon() instead")]] + static Colorf lemonchiffon; + + /// \brief rgb(173, 216, 230). + //[[deprecated("Please use StandardColorf::lightblue() instead")]] + static Colorf lightblue; + + /// \brief rgb(240, 128, 128). + //[[deprecated("Please use StandardColorf::lightcoral() instead")]] + static Colorf lightcoral; + + /// \brief rgb(224, 255, 255). + //[[deprecated("Please use StandardColorf::lightcyan() instead")]] + static Colorf lightcyan; + + /// \brief rgb(250, 250, 210). + //[[deprecated("Please use StandardColorf::lightgoldenrodyellow() instead")]] + static Colorf lightgoldenrodyellow; + + /// \brief rgb(211, 211, 211). + //[[deprecated("Please use StandardColorf::lightgray() instead")]] + static Colorf lightgray; + + /// \brief rgb(144, 238, 144). + //[[deprecated("Please use StandardColorf::lightgreen() instead")]] + static Colorf lightgreen; + + /// \brief rgb(211, 211, 211). + //[[deprecated("Please use StandardColorf::lightgrey() instead")]] + static Colorf lightgrey; + + /// \brief rgb(255, 182, 193). + //[[deprecated("Please use StandardColorf::lightpink() instead")]] + static Colorf lightpink; + + /// \brief rgb(255, 160, 122). + //[[deprecated("Please use StandardColorf::lightsalmon() instead")]] + static Colorf lightsalmon; + + /// \brief rgb( 32, 178, 170). + //[[deprecated("Please use StandardColorf::lightseagreen() instead")]] + static Colorf lightseagreen; + + /// \brief rgb(135, 206, 250). + //[[deprecated("Please use StandardColorf::lightskyblue() instead")]] + static Colorf lightskyblue; + + /// \brief rgb(119, 136, 153). + //[[deprecated("Please use StandardColorf::lightslategray() instead")]] + static Colorf lightslategray; + + /// \brief rgb(119, 136, 153). + //[[deprecated("Please use StandardColorf::lightslategrey() instead")]] + static Colorf lightslategrey; + + /// \brief rgb(176, 196, 222). + //[[deprecated("Please use StandardColorf::lightsteelblue() instead")]] + static Colorf lightsteelblue; + + /// \brief rgb(255, 255, 224). + //[[deprecated("Please use StandardColorf::lightyellow() instead")]] + static Colorf lightyellow; + + /// \brief rgb( 0, 255, 0). + //[[deprecated("Please use StandardColorf::lime() instead")]] + static Colorf lime; + + /// \brief rgb( 50, 205, 50). + //[[deprecated("Please use StandardColorf::limegreen() instead")]] + static Colorf limegreen; + + /// \brief rgb(250, 240, 230). + //[[deprecated("Please use StandardColorf::linen() instead")]] + static Colorf linen; + + /// \brief rgb(255, 0, 255). + //[[deprecated("Please use StandardColorf::magenta() instead")]] + static Colorf magenta; + + /// \brief rgb(128, 0, 0). + //[[deprecated("Please use StandardColorf::maroon() instead")]] + static Colorf maroon; + + /// \brief rgb(102, 205, 170). + //[[deprecated("Please use StandardColorf::mediumaquamarine() instead")]] + static Colorf mediumaquamarine; + + /// \brief rgb( 0, 0, 205). + //[[deprecated("Please use StandardColorf::mediumblue() instead")]] + static Colorf mediumblue; + + /// \brief rgb(186, 85, 211). + //[[deprecated("Please use StandardColorf::mediumorchid() instead")]] + static Colorf mediumorchid; + + /// \brief rgb(147, 112, 219). + //[[deprecated("Please use StandardColorf::mediumpurple() instead")]] + static Colorf mediumpurple; + + /// \brief rgb( 60, 179, 113). + //[[deprecated("Please use StandardColorf::mediumseagreen() instead")]] + static Colorf mediumseagreen; + + /// \brief rgb(123, 104, 238). + //[[deprecated("Please use StandardColorf::mediumslateblue() instead")]] + static Colorf mediumslateblue; + + /// \brief rgb( 0, 250, 154). + //[[deprecated("Please use StandardColorf::mediumspringgreen() instead")]] + static Colorf mediumspringgreen; + + /// \brief rgb( 72, 209, 204). + //[[deprecated("Please use StandardColorf::mediumturquoise() instead")]] + static Colorf mediumturquoise; + + /// \brief rgb(199, 21, 133). + //[[deprecated("Please use StandardColorf::mediumvioletred() instead")]] + static Colorf mediumvioletred; + + /// \brief rgb( 25, 25, 112). + //[[deprecated("Please use StandardColorf::midnightblue() instead")]] + static Colorf midnightblue; + + /// \brief rgb(245, 255, 250). + //[[deprecated("Please use StandardColorf::mintcream() instead")]] + static Colorf mintcream; + + /// \brief rgb(255, 228, 225). + //[[deprecated("Please use StandardColorf::mistyrose() instead")]] + static Colorf mistyrose; + + /// \brief rgb(255, 228, 181). + //[[deprecated("Please use StandardColorf::moccasin() instead")]] + static Colorf moccasin; + + /// \brief rgb(255, 222, 173). + //[[deprecated("Please use StandardColorf::navajowhite() instead")]] + static Colorf navajowhite; + + /// \brief rgb( 0, 0, 128). + //[[deprecated("Please use StandardColorf::navy() instead")]] + static Colorf navy; + + /// \brief rgb(253, 245, 230). + //[[deprecated("Please use StandardColorf::oldlace() instead")]] + static Colorf oldlace; + + /// \brief rgb(128, 128, 0). + //[[deprecated("Please use StandardColorf::olive() instead")]] + static Colorf olive; + + /// \brief rgb(107, 142, 35). + //[[deprecated("Please use StandardColorf::olivedrab() instead")]] + static Colorf olivedrab; + + /// \brief rgb(255, 165, 0). + //[[deprecated("Please use StandardColorf::orange() instead")]] + static Colorf orange; + + /// \brief rgb(255, 69, 0). + //[[deprecated("Please use StandardColorf::orangered() instead")]] + static Colorf orangered; + + /// \brief rgb(218, 112, 214). + //[[deprecated("Please use StandardColorf::orchid() instead")]] + static Colorf orchid; + + /// \brief rgb(238, 232, 170). + //[[deprecated("Please use StandardColorf::palegoldenrod() instead")]] + static Colorf palegoldenrod; + + /// \brief rgb(152, 251, 152). + //[[deprecated("Please use StandardColorf::palegreen() instead")]] + static Colorf palegreen; + + /// \brief rgb(175, 238, 238). + //[[deprecated("Please use StandardColorf::paleturquoise() instead")]] + static Colorf paleturquoise; + + /// \brief rgb(219, 112, 147). + //[[deprecated("Please use StandardColorf::palevioletred() instead")]] + static Colorf palevioletred; + + /// \brief rgb(255, 239, 213). + //[[deprecated("Please use StandardColorf::papayawhip() instead")]] + static Colorf papayawhip; + + /// \brief rgb(255, 218, 185). + //[[deprecated("Please use StandardColorf::peachpuff() instead")]] + static Colorf peachpuff; + + /// \brief rgb(205, 133, 63). + //[[deprecated("Please use StandardColorf::peru() instead")]] + static Colorf peru; + + /// \brief rgb(255, 192, 203). + //[[deprecated("Please use StandardColorf::pink() instead")]] + static Colorf pink; + + /// \brief rgb(221, 160, 221). + //[[deprecated("Please use StandardColorf::plum() instead")]] + static Colorf plum; + + /// \brief rgb(176, 224, 230). + //[[deprecated("Please use StandardColorf::powderblue() instead")]] + static Colorf powderblue; + + /// \brief rgb(128, 0, 128). + //[[deprecated("Please use StandardColorf::purple() instead")]] + static Colorf purple; + + /// \brief rgb(255, 0, 0). + //[[deprecated("Please use StandardColorf::red() instead")]] + static Colorf red; + + /// \brief rgb(188, 143, 143). + //[[deprecated("Please use StandardColorf::rosybrown() instead")]] + static Colorf rosybrown; + + /// \brief rgb( 65, 105, 225). + //[[deprecated("Please use StandardColorf::royalblue() instead")]] + static Colorf royalblue; + + /// \brief rgb(139, 69, 19). + //[[deprecated("Please use StandardColorf::saddlebrown() instead")]] + static Colorf saddlebrown; + + /// \brief rgb(250, 128, 114). + //[[deprecated("Please use StandardColorf::salmon() instead")]] + static Colorf salmon; + + /// \brief rgb(244, 164, 96). + //[[deprecated("Please use StandardColorf::sandybrown() instead")]] + static Colorf sandybrown; + + /// \brief rgb( 46, 139, 87). + //[[deprecated("Please use StandardColorf::seagreen() instead")]] + static Colorf seagreen; + + /// \brief rgb(255, 245, 238). + //[[deprecated("Please use StandardColorf::seashell() instead")]] + static Colorf seashell; + + /// \brief rgb(160, 82, 45). + //[[deprecated("Please use StandardColorf::sienna() instead")]] + static Colorf sienna; + + /// \brief rgb(192, 192, 192). + //[[deprecated("Please use StandardColorf::silver() instead")]] + static Colorf silver; + + /// \brief rgb(135, 206, 235). + //[[deprecated("Please use StandardColorf::skyblue() instead")]] + static Colorf skyblue; + + /// \brief rgb(106, 90, 205). + //[[deprecated("Please use StandardColorf::slateblue() instead")]] + static Colorf slateblue; + + /// \brief rgb(112, 128, 144). + //[[deprecated("Please use StandardColorf::slategray() instead")]] + static Colorf slategray; + + /// \brief rgb(112, 128, 144). + //[[deprecated("Please use StandardColorf::slategrey() instead")]] + static Colorf slategrey; + + /// \brief rgb(255, 250, 250). + //[[deprecated("Please use StandardColorf::snow() instead")]] + static Colorf snow; + + /// \brief rgb( 0, 255, 127). + //[[deprecated("Please use StandardColorf::springgreen() instead")]] + static Colorf springgreen; + + /// \brief rgb( 70, 130, 180). + //[[deprecated("Please use StandardColorf::steelblue() instead")]] + static Colorf steelblue; + + /// \brief rgb(210, 180, 140). + //[[deprecated("Please use StandardColorf::tan() instead")]] + static Colorf tan; + + /// \brief rgb( 0, 128, 128). + //[[deprecated("Please use StandardColorf::teal() instead")]] + static Colorf teal; + + /// \brief rgb(216, 191, 216). + //[[deprecated("Please use StandardColorf::thistle() instead")]] + static Colorf thistle; + + /// \brief rgb(255, 99, 71). + //[[deprecated("Please use StandardColorf::tomato() instead")]] + static Colorf tomato; + + /// \brief rgb( 64, 224, 208). + //[[deprecated("Please use StandardColorf::turquoise() instead")]] + static Colorf turquoise; + + /// \brief rgb(238, 130, 238). + //[[deprecated("Please use StandardColorf::violet() instead")]] + static Colorf violet; + + /// \brief rgb(245, 222, 179). + //[[deprecated("Please use StandardColorf::wheat() instead")]] + static Colorf wheat; + + /// \brief rgb(255, 255, 255). + //[[deprecated("Please use StandardColorf::white() instead")]] + static Colorf white; + + /// \brief rgb(245, 245, 245). + //[[deprecated("Please use StandardColorf::whitesmoke() instead")]] + static Colorf whitesmoke; + + /// \brief rgb(255, 255, 0). + //[[deprecated("Please use StandardColorf::yellow() instead")]] + static Colorf yellow; + + /// \brief rgb(154, 205, 50). + //[[deprecated("Please use StandardColorf::yellowgreen() instead")]] + static Colorf yellowgreen; + + /// \brief rgba(0, 0, 0, 0). + //[[deprecated("Please use StandardColorf::transparent() instead")]] + static Colorf transparent; + + //[[deprecated("Please use StandardColorf::gray10() instead")]] + static Colorf gray10; + + //[[deprecated("Please use StandardColorf::gray20() instead")]] + static Colorf gray20; + + //[[deprecated("Please use StandardColorf::gray30() instead")]] + static Colorf gray30; + + //[[deprecated("Please use StandardColorf::gray40() instead")]] + static Colorf gray40; + + //[[deprecated("Please use StandardColorf::gray50() instead")]] + static Colorf gray50; + + //[[deprecated("Please use StandardColorf::gray60() instead")]] + static Colorf gray60; + + //[[deprecated("Please use StandardColorf::gray70() instead")]] + static Colorf gray70; + + //[[deprecated("Please use StandardColorf::gray80() instead")]] + static Colorf gray80; + + //[[deprecated("Please use StandardColorf::gray90() instead")]] + static Colorf gray90; + }; + + /// Standard X11/HTML named colors + class StandardColor + { + public: + static Color aliceblue() { return Color(240, 248, 255); } + static Color antiquewhite() { return Color(250, 235, 215); } + static Color aqua() { return Color(0, 255, 255); } + static Color aquamarine() { return Color(127, 255, 212); } + static Color azure() { return Color(240, 255, 255); } + static Color beige() { return Color(245, 245, 220); } + static Color bisque() { return Color(255, 228, 196); } + static Color black() { return Color(0, 0, 0); } + static Color blanchedalmond() { return Color(255, 235, 205); } + static Color blue() { return Color(0, 0, 255); } + static Color blueviolet() { return Color(138, 43, 226); } + static Color brown() { return Color(165, 42, 42); } + static Color burlywood() { return Color(222, 184, 135); } + static Color cadetblue() { return Color(95, 158, 160); } + static Color chartreuse() { return Color(127, 255, 0); } + static Color chocolate() { return Color(210, 105, 30); } + static Color coral() { return Color(255, 127, 80); } + static Color cornflowerblue() { return Color(100, 149, 237); } + static Color cornsilk() { return Color(255, 248, 220); } + static Color crimson() { return Color(220, 20, 60); } + static Color cyan() { return Color(0, 255, 255); } + static Color darkblue() { return Color(0, 0, 139); } + static Color darkcyan() { return Color(0, 139, 139); } + static Color darkgoldenrod() { return Color(184, 134, 11); } + static Color darkgray() { return Color(169, 169, 169); } + static Color darkgreen() { return Color(0, 100, 0); } + static Color darkgrey() { return Color(169, 169, 169); } + static Color darkkhaki() { return Color(189, 183, 107); } + static Color darkmagenta() { return Color(139, 0, 139); } + static Color darkolivegreen() { return Color(85, 107, 47); } + static Color darkorange() { return Color(255, 140, 0); } + static Color darkorchid() { return Color(153, 50, 204); } + static Color darkred() { return Color(139, 0, 0); } + static Color darksalmon() { return Color(233, 150, 122); } + static Color darkseagreen() { return Color(143, 188, 143); } + static Color darkslateblue() { return Color(72, 61, 139); } + static Color darkslategray() { return Color(47, 79, 79); } + static Color darkslategrey() { return Color(47, 79, 79); } + static Color darkturquoise() { return Color(0, 206, 209); } + static Color darkviolet() { return Color(148, 0, 211); } + static Color deeppink() { return Color(255, 20, 147); } + static Color deepskyblue() { return Color(0, 191, 255); } + static Color dimgray() { return Color(105, 105, 105); } + static Color dimgrey() { return Color(105, 105, 105); } + static Color dodgerblue() { return Color(30, 144, 255); } + static Color firebrick() { return Color(178, 34, 34); } + static Color floralwhite() { return Color(255, 250, 240); } + static Color forestgreen() { return Color(34, 139, 34); } + static Color fuchsia() { return Color(255, 0, 255); } + static Color gainsboro() { return Color(220, 220, 220); } + static Color ghostwhite() { return Color(248, 248, 255); } + static Color gold() { return Color(255, 215, 0); } + static Color goldenrod() { return Color(218, 165, 32); } + static Color gray() { return Color(128, 128, 128); } + static Color grey() { return Color(128, 128, 128); } + static Color green() { return Color(0, 128, 0); } + static Color greenyellow() { return Color(173, 255, 47); } + static Color honeydew() { return Color(240, 255, 240); } + static Color hotpink() { return Color(255, 105, 180); } + static Color indianred() { return Color(205, 92, 92); } + static Color indigo() { return Color(75, 0, 130); } + static Color ivory() { return Color(255, 255, 240); } + static Color khaki() { return Color(240, 230, 140); } + static Color lavender() { return Color(230, 230, 250); } + static Color lavenderblush() { return Color(255, 240, 245); } + static Color lawngreen() { return Color(124, 252, 0); } + static Color lemonchiffon() { return Color(255, 250, 205); } + static Color lightblue() { return Color(173, 216, 230); } + static Color lightcoral() { return Color(240, 128, 128); } + static Color lightcyan() { return Color(224, 255, 255); } + static Color lightgoldenrodyellow() { return Color(250, 250, 210); } + static Color lightgray() { return Color(211, 211, 211); } + static Color lightgreen() { return Color(144, 238, 144); } + static Color lightgrey() { return Color(211, 211, 211); } + static Color lightpink() { return Color(255, 182, 193); } + static Color lightsalmon() { return Color(255, 160, 122); } + static Color lightseagreen() { return Color(32, 178, 170); } + static Color lightskyblue() { return Color(135, 206, 250); } + static Color lightslategray() { return Color(119, 136, 153); } + static Color lightslategrey() { return Color(119, 136, 153); } + static Color lightsteelblue() { return Color(176, 196, 222); } + static Color lightyellow() { return Color(255, 255, 224); } + static Color lime() { return Color(0, 255, 0); } + static Color limegreen() { return Color(50, 205, 50); } + static Color linen() { return Color(250, 240, 230); } + static Color magenta() { return Color(255, 0, 255); } + static Color maroon() { return Color(128, 0, 0); } + static Color mediumaquamarine() { return Color(102, 205, 170); } + static Color mediumblue() { return Color(0, 0, 205); } + static Color mediumorchid() { return Color(186, 85, 211); } + static Color mediumpurple() { return Color(147, 112, 219); } + static Color mediumseagreen() { return Color(60, 179, 113); } + static Color mediumslateblue() { return Color(123, 104, 238); } + static Color mediumspringgreen() { return Color(0, 250, 154); } + static Color mediumturquoise() { return Color(72, 209, 204); } + static Color mediumvioletred() { return Color(199, 21, 133); } + static Color midnightblue() { return Color(25, 25, 112); } + static Color mintcream() { return Color(245, 255, 250); } + static Color mistyrose() { return Color(255, 228, 225); } + static Color moccasin() { return Color(255, 228, 181); } + static Color navajowhite() { return Color(255, 222, 173); } + static Color navy() { return Color(0, 0, 128); } + static Color oldlace() { return Color(253, 245, 230); } + static Color olive() { return Color(128, 128, 0); } + static Color olivedrab() { return Color(107, 142, 35); } + static Color orange() { return Color(255, 165, 0); } + static Color orangered() { return Color(255, 69, 0); } + static Color orchid() { return Color(218, 112, 214); } + static Color palegoldenrod() { return Color(238, 232, 170); } + static Color palegreen() { return Color(152, 251, 152); } + static Color paleturquoise() { return Color(175, 238, 238); } + static Color palevioletred() { return Color(219, 112, 147); } + static Color papayawhip() { return Color(255, 239, 213); } + static Color peachpuff() { return Color(255, 218, 185); } + static Color peru() { return Color(205, 133, 63); } + static Color pink() { return Color(255, 192, 203); } + static Color plum() { return Color(221, 160, 221); } + static Color powderblue() { return Color(176, 224, 230); } + static Color purple() { return Color(128, 0, 128); } + static Color red() { return Color(255, 0, 0); } + static Color rosybrown() { return Color(188, 143, 143); } + static Color royalblue() { return Color(65, 105, 225); } + static Color saddlebrown() { return Color(139, 69, 19); } + static Color salmon() { return Color(250, 128, 114); } + static Color sandybrown() { return Color(244, 164, 96); } + static Color seagreen() { return Color(46, 139, 87); } + static Color seashell() { return Color(255, 245, 238); } + static Color sienna() { return Color(160, 82, 45); } + static Color silver() { return Color(192, 192, 192); } + static Color skyblue() { return Color(135, 206, 235); } + static Color slateblue() { return Color(106, 90, 205); } + static Color slategray() { return Color(112, 128, 144); } + static Color slategrey() { return Color(112, 128, 144); } + static Color snow() { return Color(255, 250, 250); } + static Color springgreen() { return Color(0, 255, 127); } + static Color steelblue() { return Color(70, 130, 180); } + static Color tan() { return Color(210, 180, 140); } + static Color teal() { return Color(0, 128, 128); } + static Color thistle() { return Color(216, 191, 216); } + static Color tomato() { return Color(255, 99, 71); } + static Color transparent() { return Color(0, 0, 0, 0); } + static Color turquoise() { return Color(64, 224, 208); } + static Color violet() { return Color(238, 130, 238); } + static Color wheat() { return Color(245, 222, 179); } + static Color white() { return Color(255, 255, 255); } + static Color whitesmoke() { return Color(245, 245, 245); } + static Color yellow() { return Color(255, 255, 0); } + static Color yellowgreen() { return Color(154, 205, 50); } + static Color gray10() { return Color(26, 26, 26); } + static Color gray20() { return Color(51, 51, 51); } + static Color gray30() { return Color(77, 77, 77); } + static Color gray40() { return Color(104, 104, 104); } + static Color gray50() { return Color(128, 128, 128); } + static Color gray60() { return Color(153, 153, 153); } + static Color gray70() { return Color(178, 178, 178); } + static Color gray80() { return Color(204, 204, 204); } + static Color gray90() { return Color(230, 230, 230); } + }; + + /// Standard X11/HTML named colors (for float) + class StandardColorf + { + public: + /// \brief Find and returns the static color matching a string. + /// + /// \param name Name of color to match, eg. "blue". + /// + /// \param out_color = Matching static color, or transparent (rgba(0,0,0,0)) if there was no match. + /// \return false = No match found + static bool parse(const std::string &name, Colorf &out_color); + + static Colorf aliceblue() { return Colorf(40.0f / 255.0f, 248.0f / 255.0f, 255.0f / 255.0f); } + static Colorf antiquewhite() { return Colorf(250.0f / 255.0f, 235.0f / 255.0f, 215.0f / 255.0f); } + static Colorf aqua() { return Colorf(0.0f / 255.0f, 255.0f / 255.0f, 255.0f / 255.0f); } + static Colorf aquamarine() { return Colorf(127.0f / 255.0f, 255.0f / 255.0f, 212.0f / 255.0f); } + static Colorf azure() { return Colorf(240.0f / 255.0f, 255.0f / 255.0f, 255.0f / 255.0f); } + static Colorf beige() { return Colorf(245.0f / 255.0f, 245.0f / 255.0f, 220.0f / 255.0f); } + static Colorf bisque() { return Colorf(255.0f / 255.0f, 228.0f / 255.0f, 196.0f / 255.0f); } + static Colorf black() { return Colorf(0.0f / 255.0f, 0.0f / 255.0f, 0.0f / 255.0f); } + static Colorf blanchedalmond() { return Colorf(255.0f / 255.0f, 235.0f / 255.0f, 205.0f / 255.0f); } + static Colorf blue() { return Colorf(0.0f / 255.0f, 0.0f / 255.0f, 255.0f / 255.0f); } + static Colorf blueviolet() { return Colorf(138.0f / 255.0f, 43.0f / 255.0f, 226.0f / 255.0f); } + static Colorf brown() { return Colorf(165.0f / 255.0f, 42.0f / 255.0f, 42.0f / 255.0f); } + static Colorf burlywood() { return Colorf(222.0f / 255.0f, 184.0f / 255.0f, 135.0f / 255.0f); } + static Colorf cadetblue() { return Colorf(95.0f / 255.0f, 158.0f / 255.0f, 160.0f / 255.0f); } + static Colorf chartreuse() { return Colorf(127.0f / 255.0f, 255.0f / 255.0f, 0.0f / 255.0f); } + static Colorf chocolate() { return Colorf(210.0f / 255.0f, 105.0f / 255.0f, 30.0f / 255.0f); } + static Colorf coral() { return Colorf(255.0f / 255.0f, 127.0f / 255.0f, 80.0f / 255.0f); } + static Colorf cornflowerblue() { return Colorf(100.0f / 255.0f, 149.0f / 255.0f, 237.0f / 255.0f); } + static Colorf cornsilk() { return Colorf(255.0f / 255.0f, 248.0f / 255.0f, 220.0f / 255.0f); } + static Colorf crimson() { return Colorf(220.0f / 255.0f, 20.0f / 255.0f, 60.0f / 255.0f); } + static Colorf cyan() { return Colorf(0.0f / 255.0f, 255.0f / 255.0f, 255.0f / 255.0f); } + static Colorf darkblue() { return Colorf(0.0f / 255.0f, 0.0f / 255.0f, 139.0f / 255.0f); } + static Colorf darkcyan() { return Colorf(0.0f / 255.0f, 139.0f / 255.0f, 139.0f / 255.0f); } + static Colorf darkgoldenrod() { return Colorf(184.0f / 255.0f, 134.0f / 255.0f, 11.0f / 255.0f); } + static Colorf darkgray() { return Colorf(169.0f / 255.0f, 169.0f / 255.0f, 169.0f / 255.0f); } + static Colorf darkgreen() { return Colorf(0.0f / 255.0f, 100.0f / 255.0f, 0.0f / 255.0f); } + static Colorf darkgrey() { return Colorf(169.0f / 255.0f, 169.0f / 255.0f, 169.0f / 255.0f); } + static Colorf darkkhaki() { return Colorf(189.0f / 255.0f, 183.0f / 255.0f, 107.0f / 255.0f); } + static Colorf darkmagenta() { return Colorf(139.0f / 255.0f, 0.0f / 255.0f, 139.0f / 255.0f); } + static Colorf darkolivegreen() { return Colorf(85.0f / 255.0f, 107.0f / 255.0f, 47.0f / 255.0f); } + static Colorf darkorange() { return Colorf(255.0f / 255.0f, 140.0f / 255.0f, 0.0f / 255.0f); } + static Colorf darkorchid() { return Colorf(153.0f / 255.0f, 50.0f / 255.0f, 204.0f / 255.0f); } + static Colorf darkred() { return Colorf(139.0f / 255.0f, 0.0f / 255.0f, 0.0f / 255.0f); } + static Colorf darksalmon() { return Colorf(233.0f / 255.0f, 150.0f / 255.0f, 122.0f / 255.0f); } + static Colorf darkseagreen() { return Colorf(143.0f / 255.0f, 188.0f / 255.0f, 143.0f / 255.0f); } + static Colorf darkslateblue() { return Colorf(72.0f / 255.0f, 61.0f / 255.0f, 139.0f / 255.0f); } + static Colorf darkslategray() { return Colorf(47.0f / 255.0f, 79.0f / 255.0f, 79.0f / 255.0f); } + static Colorf darkslategrey() { return Colorf(47.0f / 255.0f, 79.0f / 255.0f, 79.0f / 255.0f); } + static Colorf darkturquoise() { return Colorf(0.0f / 255.0f, 206.0f / 255.0f, 209.0f / 255.0f); } + static Colorf darkviolet() { return Colorf(148.0f / 255.0f, 0.0f / 255.0f, 211.0f / 255.0f); } + static Colorf deeppink() { return Colorf(255.0f / 255.0f, 20.0f / 255.0f, 147.0f / 255.0f); } + static Colorf deepskyblue() { return Colorf(0.0f / 255.0f, 191.0f / 255.0f, 255.0f / 255.0f); } + static Colorf dimgray() { return Colorf(105.0f / 255.0f, 105.0f / 255.0f, 105.0f / 255.0f); } + static Colorf dimgrey() { return Colorf(105.0f / 255.0f, 105.0f / 255.0f, 105.0f / 255.0f); } + static Colorf dodgerblue() { return Colorf(30.0f / 255.0f, 144.0f / 255.0f, 255.0f / 255.0f); } + static Colorf firebrick() { return Colorf(178.0f / 255.0f, 34.0f / 255.0f, 34.0f / 255.0f); } + static Colorf floralwhite() { return Colorf(255.0f / 255.0f, 250.0f / 255.0f, 240.0f / 255.0f); } + static Colorf forestgreen() { return Colorf(34.0f / 255.0f, 139.0f / 255.0f, 34.0f / 255.0f); } + static Colorf fuchsia() { return Colorf(255.0f / 255.0f, 0.0f / 255.0f, 255.0f / 255.0f); } + static Colorf gainsboro() { return Colorf(220.0f / 255.0f, 220.0f / 255.0f, 220.0f / 255.0f); } + static Colorf ghostwhite() { return Colorf(248.0f / 255.0f, 248.0f / 255.0f, 255.0f / 255.0f); } + static Colorf gold() { return Colorf(255.0f / 255.0f, 215.0f / 255.0f, 0.0f / 255.0f); } + static Colorf goldenrod() { return Colorf(218.0f / 255.0f, 165.0f / 255.0f, 32.0f / 255.0f); } + static Colorf gray() { return Colorf(128.0f / 255.0f, 128.0f / 255.0f, 128.0f / 255.0f); } + static Colorf grey() { return Colorf(128.0f / 255.0f, 128.0f / 255.0f, 128.0f / 255.0f); } + static Colorf green() { return Colorf(0.0f / 255.0f, 128.0f / 255.0f, 0.0f / 255.0f); } + static Colorf greenyellow() { return Colorf(173.0f / 255.0f, 255.0f / 255.0f, 47.0f / 255.0f); } + static Colorf honeydew() { return Colorf(240.0f / 255.0f, 255.0f / 255.0f, 240.0f / 255.0f); } + static Colorf hotpink() { return Colorf(255.0f / 255.0f, 105.0f / 255.0f, 180.0f / 255.0f); } + static Colorf indianred() { return Colorf(205.0f / 255.0f, 92.0f / 255.0f, 92.0f / 255.0f); } + static Colorf indigo() { return Colorf(75.0f / 255.0f, 0.0f / 255.0f, 130.0f / 255.0f); } + static Colorf ivory() { return Colorf(255.0f / 255.0f, 255.0f / 255.0f, 240.0f / 255.0f); } + static Colorf khaki() { return Colorf(240.0f / 255.0f, 230.0f / 255.0f, 140.0f / 255.0f); } + static Colorf lavender() { return Colorf(230.0f / 255.0f, 230.0f / 255.0f, 250.0f / 255.0f); } + static Colorf lavenderblush() { return Colorf(255.0f / 255.0f, 240.0f / 255.0f, 245.0f / 255.0f); } + static Colorf lawngreen() { return Colorf(124.0f / 255.0f, 252.0f / 255.0f, 0.0f / 255.0f); } + static Colorf lemonchiffon() { return Colorf(255.0f / 255.0f, 250.0f / 255.0f, 205.0f / 255.0f); } + static Colorf lightblue() { return Colorf(173.0f / 255.0f, 216.0f / 255.0f, 230.0f / 255.0f); } + static Colorf lightcoral() { return Colorf(240.0f / 255.0f, 128.0f / 255.0f, 128.0f / 255.0f); } + static Colorf lightcyan() { return Colorf(224.0f / 255.0f, 255.0f / 255.0f, 255.0f / 255.0f); } + static Colorf lightgoldenrodyellow() { return Colorf(250.0f / 255.0f, 250.0f / 255.0f, 210.0f / 255.0f); } + static Colorf lightgray() { return Colorf(211.0f / 255.0f, 211.0f / 255.0f, 211.0f / 255.0f); } + static Colorf lightgreen() { return Colorf(144.0f / 255.0f, 238.0f / 255.0f, 144.0f / 255.0f); } + static Colorf lightgrey() { return Colorf(211.0f / 255.0f, 211.0f / 255.0f, 211.0f / 255.0f); } + static Colorf lightpink() { return Colorf(255.0f / 255.0f, 182.0f / 255.0f, 193.0f / 255.0f); } + static Colorf lightsalmon() { return Colorf(255.0f / 255.0f, 160.0f / 255.0f, 122.0f / 255.0f); } + static Colorf lightseagreen() { return Colorf(32.0f / 255.0f, 178.0f / 255.0f, 170.0f / 255.0f); } + static Colorf lightskyblue() { return Colorf(135.0f / 255.0f, 206.0f / 255.0f, 250.0f / 255.0f); } + static Colorf lightslategray() { return Colorf(119.0f / 255.0f, 136.0f / 255.0f, 153.0f / 255.0f); } + static Colorf lightslategrey() { return Colorf(119.0f / 255.0f, 136.0f / 255.0f, 153.0f / 255.0f); } + static Colorf lightsteelblue() { return Colorf(176.0f / 255.0f, 196.0f / 255.0f, 222.0f / 255.0f); } + static Colorf lightyellow() { return Colorf(255.0f / 255.0f, 255.0f / 255.0f, 224.0f / 255.0f); } + static Colorf lime() { return Colorf(0.0f / 255.0f, 255.0f / 255.0f, 0.0f / 255.0f); } + static Colorf limegreen() { return Colorf(50.0f / 255.0f, 205.0f / 255.0f, 50.0f / 255.0f); } + static Colorf linen() { return Colorf(250.0f / 255.0f, 240.0f / 255.0f, 230.0f / 255.0f); } + static Colorf magenta() { return Colorf(255.0f / 255.0f, 0.0f / 255.0f, 255.0f / 255.0f); } + static Colorf maroon() { return Colorf(128.0f / 255.0f, 0.0f / 255.0f, 0.0f / 255.0f); } + static Colorf mediumaquamarine() { return Colorf(102.0f / 255.0f, 205.0f / 255.0f, 170.0f / 255.0f); } + static Colorf mediumblue() { return Colorf(0.0f / 255.0f, 0.0f / 255.0f, 205.0f / 255.0f); } + static Colorf mediumorchid() { return Colorf(186.0f / 255.0f, 85.0f / 255.0f, 211.0f / 255.0f); } + static Colorf mediumpurple() { return Colorf(147.0f / 255.0f, 112.0f / 255.0f, 219.0f / 255.0f); } + static Colorf mediumseagreen() { return Colorf(60.0f / 255.0f, 179.0f / 255.0f, 113.0f / 255.0f); } + static Colorf mediumslateblue() { return Colorf(123.0f / 255.0f, 104.0f / 255.0f, 238.0f / 255.0f); } + static Colorf mediumspringgreen() { return Colorf(0.0f / 255.0f, 250.0f / 255.0f, 154.0f / 255.0f); } + static Colorf mediumturquoise() { return Colorf(72.0f / 255.0f, 209.0f / 255.0f, 204.0f / 255.0f); } + static Colorf mediumvioletred() { return Colorf(199.0f / 255.0f, 21.0f / 255.0f, 133.0f / 255.0f); } + static Colorf midnightblue() { return Colorf(25.0f / 255.0f, 25.0f / 255.0f, 112.0f / 255.0f); } + static Colorf mintcream() { return Colorf(245.0f / 255.0f, 255.0f / 255.0f, 250.0f / 255.0f); } + static Colorf mistyrose() { return Colorf(255.0f / 255.0f, 228.0f / 255.0f, 225.0f / 255.0f); } + static Colorf moccasin() { return Colorf(255.0f / 255.0f, 228.0f / 255.0f, 181.0f / 255.0f); } + static Colorf navajowhite() { return Colorf(255.0f / 255.0f, 222.0f / 255.0f, 173.0f / 255.0f); } + static Colorf navy() { return Colorf(0.0f / 255.0f, 0.0f / 255.0f, 128.0f / 255.0f); } + static Colorf oldlace() { return Colorf(253.0f / 255.0f, 245.0f / 255.0f, 230.0f / 255.0f); } + static Colorf olive() { return Colorf(128.0f / 255.0f, 128.0f / 255.0f, 0.0f / 255.0f); } + static Colorf olivedrab() { return Colorf(107.0f / 255.0f, 142.0f / 255.0f, 35.0f / 255.0f); } + static Colorf orange() { return Colorf(255.0f / 255.0f, 165.0f / 255.0f, 0.0f / 255.0f); } + static Colorf orangered() { return Colorf(255.0f / 255.0f, 69.0f / 255.0f, 0.0f / 255.0f); } + static Colorf orchid() { return Colorf(218.0f / 255.0f, 112.0f / 255.0f, 214.0f / 255.0f); } + static Colorf palegoldenrod() { return Colorf(238.0f / 255.0f, 232.0f / 255.0f, 170.0f / 255.0f); } + static Colorf palegreen() { return Colorf(152.0f / 255.0f, 251.0f / 255.0f, 152.0f / 255.0f); } + static Colorf paleturquoise() { return Colorf(175.0f / 255.0f, 238.0f / 255.0f, 238.0f / 255.0f); } + static Colorf palevioletred() { return Colorf(219.0f / 255.0f, 112.0f / 255.0f, 147.0f / 255.0f); } + static Colorf papayawhip() { return Colorf(255.0f / 255.0f, 239.0f / 255.0f, 213.0f / 255.0f); } + static Colorf peachpuff() { return Colorf(255.0f / 255.0f, 218.0f / 255.0f, 185.0f / 255.0f); } + static Colorf peru() { return Colorf(205.0f / 255.0f, 133.0f / 255.0f, 63.0f / 255.0f); } + static Colorf pink() { return Colorf(255.0f / 255.0f, 192.0f / 255.0f, 203.0f / 255.0f); } + static Colorf plum() { return Colorf(221.0f / 255.0f, 160.0f / 255.0f, 221.0f / 255.0f); } + static Colorf powderblue() { return Colorf(176.0f / 255.0f, 224.0f / 255.0f, 230.0f / 255.0f); } + static Colorf purple() { return Colorf(128.0f / 255.0f, 0.0f / 255.0f, 128.0f / 255.0f); } + static Colorf red() { return Colorf(255.0f / 255.0f, 0.0f / 255.0f, 0.0f / 255.0f); } + static Colorf rosybrown() { return Colorf(188.0f / 255.0f, 143.0f / 255.0f, 143.0f / 255.0f); } + static Colorf royalblue() { return Colorf(65.0f / 255.0f, 105.0f / 255.0f, 225.0f / 255.0f); } + static Colorf saddlebrown() { return Colorf(139.0f / 255.0f, 69.0f / 255.0f, 19.0f / 255.0f); } + static Colorf salmon() { return Colorf(250.0f / 255.0f, 128.0f / 255.0f, 114.0f / 255.0f); } + static Colorf sandybrown() { return Colorf(244.0f / 255.0f, 164.0f / 255.0f, 96.0f / 255.0f); } + static Colorf seagreen() { return Colorf(46.0f / 255.0f, 139.0f / 255.0f, 87.0f / 255.0f); } + static Colorf seashell() { return Colorf(255.0f / 255.0f, 245.0f / 255.0f, 238.0f / 255.0f); } + static Colorf sienna() { return Colorf(160.0f / 255.0f, 82.0f / 255.0f, 45.0f / 255.0f); } + static Colorf silver() { return Colorf(192.0f / 255.0f, 192.0f / 255.0f, 192.0f / 255.0f); } + static Colorf skyblue() { return Colorf(135.0f / 255.0f, 206.0f / 255.0f, 235.0f / 255.0f); } + static Colorf slateblue() { return Colorf(106.0f / 255.0f, 90.0f / 255.0f, 205.0f / 255.0f); } + static Colorf slategray() { return Colorf(112.0f / 255.0f, 128.0f / 255.0f, 144.0f / 255.0f); } + static Colorf slategrey() { return Colorf(112.0f / 255.0f, 128.0f / 255.0f, 144.0f / 255.0f); } + static Colorf snow() { return Colorf(255.0f / 255.0f, 250.0f / 255.0f, 250.0f / 255.0f); } + static Colorf springgreen() { return Colorf(0.0f / 255.0f, 255.0f / 255.0f, 127.0f / 255.0f); } + static Colorf steelblue() { return Colorf(70.0f / 255.0f, 130.0f / 255.0f, 180.0f / 255.0f); } + static Colorf tan() { return Colorf(210.0f / 255.0f, 180.0f / 255.0f, 140.0f / 255.0f); } + static Colorf teal() { return Colorf(0.0f / 255.0f, 128.0f / 255.0f, 128.0f / 255.0f); } + static Colorf thistle() { return Colorf(216.0f / 255.0f, 191.0f / 255.0f, 216.0f / 255.0f); } + static Colorf tomato() { return Colorf(255.0f / 255.0f, 99.0f / 255.0f, 71.0f / 255.0f); } + static Colorf transparent() { return Colorf(0.0f, 0.0f, 0.0f, 0.0f); } + static Colorf turquoise() { return Colorf(64.0f / 255.0f, 224.0f / 255.0f, 208.0f / 255.0f); } + static Colorf violet() { return Colorf(238.0f / 255.0f, 130.0f / 255.0f, 238.0f / 255.0f); } + static Colorf wheat() { return Colorf(245.0f / 255.0f, 222.0f / 255.0f, 179.0f / 255.0f); } + static Colorf white() { return Colorf(255.0f / 255.0f, 255.0f / 255.0f, 255.0f / 255.0f); } + static Colorf whitesmoke() { return Colorf(245.0f / 255.0f, 245.0f / 255.0f, 245.0f / 255.0f); } + static Colorf yellow() { return Colorf(255.0f / 255.0f, 255.0f / 255.0f, 0.0f / 255.0f); } + static Colorf yellowgreen() { return Colorf(154.0f / 255.0f, 205.0f / 255.0f, 50.0f / 255.0f); } + static Colorf gray10() { return Colorf(0.1f, 0.1f, 0.1f); } + static Colorf gray20() { return Colorf(0.2f, 0.2f, 0.2f); } + static Colorf gray30() { return Colorf(0.3f, 0.3f, 0.3f); } + static Colorf gray40() { return Colorf(0.4f, 0.4f, 0.4f); } + static Colorf gray50() { return Colorf(0.5f, 0.5f, 0.5f); } + static Colorf gray60() { return Colorf(0.6f, 0.6f, 0.6f); } + static Colorf gray70() { return Colorf(0.7f, 0.7f, 0.7f); } + static Colorf gray80() { return Colorf(0.8f, 0.8f, 0.8f); } + static Colorf gray90() { return Colorf(0.9f, 0.9f, 0.9f); } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/color_hsl.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/color_hsl.h new file mode 100644 index 0000000..facf93c --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/color_hsl.h @@ -0,0 +1,74 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanDisplay_2D clanDisplay 2D + /// \{ + + class Color; + class Colorf; + + /// \brief Color HSL description class. + /// + /// These templates are defined for: int (ColorHSLi), float (ColorHSLf), double (ColorHSLd) + template + class ColorHSLx + { + public: + /// \brief Constructs a color. + /// + ColorHSLx() : h((Type)0), s((Type)0), l((Type)0), a((Type)0) {} + ColorHSLx(Type h, Type s, Type l, Type a) : h(h), s(s), l(l), a(a) {} + ColorHSLx(const ColorHSLx ©) { h = copy.h; s = copy.s; l = copy.l; a = copy.a; } + ColorHSLx(const Color &color); + ColorHSLx(const Colorf &color); + + Type h, s, l, a; + + operator ColorType(); + + /// \brief = operator. + ColorHSLx &operator = (const ColorHSLx& copy) { h = copy.h; s = copy.s; l = copy.l; a = copy.a; return *this; } + + /// \brief == operator. + bool operator == (const ColorHSLx& color) const { return ((h == color.h) && (s == color.s) && (l == color.l) && (a == color.a)); } + + /// \brief != operator. + bool operator != (const ColorHSLx& color) const { return ((h != color.h) || (s != color.s) || (l != color.l) || (a != color.a)); } + }; + + typedef ColorHSLx ColorHSLi; + typedef ColorHSLx ColorHSLf; + typedef ColorHSLx ColorHSLd; + + /// \} +} + diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/color_hsv.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/color_hsv.h new file mode 100644 index 0000000..e36ebf2 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/color_hsv.h @@ -0,0 +1,73 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanDisplay_2D clanDisplay 2D + /// \{ + + class Color; + class Colorf; + + /// \brief Color HSV description class. + /// + /// These templates are defined for: int (ColorHSVi), float (ColorHSVf), double (ColorHSVd) + template + class ColorHSVx + { + public: + /// \brief Constructs a color. + /// + ColorHSVx() : h((Type)0), s((Type)0), v((Type)0), a((Type)0) {} + ColorHSVx(Type h, Type s, Type v, Type a) : h(h), s(s), v(v), a(a) {} + ColorHSVx(const ColorHSVx ©) { h = copy.h; s = copy.s; v = copy.v; a = copy.a; } + ColorHSVx(const Color &color); + ColorHSVx(const Colorf &color); + + Type h, s, v, a; + + operator ColorType(); + + /// \brief = operator. + ColorHSVx &operator = (const ColorHSVx& copy) { h = copy.h; s = copy.s; v = copy.v; a = copy.a; return *this; } + + /// \brief == operator. + bool operator == (const ColorHSVx& color) const { return ((h == color.h) && (s == color.s) && (v == color.v) && (a == color.a)); } + + /// \brief != operator. + bool operator != (const ColorHSVx& color) const { return ((h != color.h) || (s != color.s) || (v != color.v) || (a != color.a)); } + }; + + typedef ColorHSVx ColorHSVi; + typedef ColorHSVx ColorHSVf; + typedef ColorHSVx ColorHSVd; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/gradient.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/gradient.h new file mode 100644 index 0000000..dccc740 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/gradient.h @@ -0,0 +1,98 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Kenneth Gangstoe +** Harry Storbacka +*/ + +#pragma once + +#include "color.h" + +namespace clan +{ + /// \addtogroup clanDisplay_2D clanDisplay 2D + /// \{ + + /// \brief Colorgradient description class. + class Gradient + { + public: + /// \brief Constructs a color gradient. + Gradient() + { + } + + /// \brief Constructs a color gradient. + /// + /// \param top_left Top left color component. + /// \param top_right Top right color component. + /// \param bottom_left Bottom left color component. + /// \param bottom_right Bottom right color component. + Gradient(const Colorf &top_left, const Colorf &top_right, + const Colorf &bottom_left, const Colorf &bottom_right) + : top_left(top_left), top_right(top_right), bottom_left(bottom_left), + bottom_right(bottom_right) + { + } + + /// \brief Constructs a Gradient + /// + /// \param first_color = Colorf + /// \param second_color = Colorf + Gradient(const Colorf &first_color, const Colorf &second_color) + : top_left(first_color), top_right(first_color), bottom_left(second_color), + bottom_right(second_color) + { + } + + /// \brief Color of top left corner of gradient. + Colorf top_left; + + /// \brief Color of top right corner of gradient. + Colorf top_right; + + /// \brief Color of bottom left corner of gradient. + Colorf bottom_left; + + /// \brief Color of bottom right corner of gradient. + Colorf bottom_right; + + /// \brief Compares gradient to another one. + bool operator==(const Gradient &other) const + { + return top_left == other.top_left && top_right == other.top_right && + bottom_left == other.bottom_left && bottom_right == bottom_right; + } + + /// \brief Compares gradient to another one. + bool operator!=(const Gradient &other) const + { + return !(*this == other); + } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/image.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/image.h new file mode 100644 index 0000000..3ada2bb --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/image.h @@ -0,0 +1,262 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Kenneth Gangstoe +*/ + +#pragma once + +#include +#include "../../Core/Math/origin.h" +#include "../../Core/Resources/resource.h" +#include "color.h" +#include "../Image/image_import_description.h" +#include "../Render/texture.h" + +namespace clan +{ + /// \addtogroup clanDisplay_2D clanDisplay 2D + /// \{ + + class GraphicContext; + class FileSystem; + class Rect; + class Size; + class Rectf; + class Image_Impl; + class Texture2D; + class Subtexture; + class PixelBuffer; + class ResourceManager; + class XMLResourceDocument; + class Canvas; + class Quadf; + + /// \brief Image class. + class Image + { + public: + /// \brief Constructs a null instance. + Image(); + + /// \brief Constructs an image from a texture. + /// + /// \param texture = Texture to get image data from + /// \param rect = Position and size in texture to get image data from + Image(Texture2D texture, const Rect &rect); + + /// \brief Constructs an image from a subtexture. + /// + /// \param sub_texture = Subtexture to get image data from + Image(Subtexture &sub_texture); + + /// \brief Constructs a Image from a pixelbuffer. + /// + /// \param canvas = Canvas + /// \param pixelbuffer = Pixelbuffer to get image data from + /// \param rect = pixelbuffer rect + Image(Canvas &canvas, const PixelBuffer &pixelbuffer, const Rect &rect); + + /// \brief Constructs a Image + /// + /// \param canvas = Canvas + /// \param filename Filename of image to load + /// \param import_desc = Image Import Description + Image(Canvas &canvas, const std::string &filename, const ImageImportDescription &import_desc = ImageImportDescription()); + + /// \brief Constructs a Image + /// + /// \param canvas = Canvas + /// \param filename Filename of image to load + /// \param dir = Virtual directory to load filename from + /// \param import_desc = Image Import Description + Image(Canvas &canvas, const std::string &filename, const FileSystem &fs, const ImageImportDescription &import_desc = ImageImportDescription()); + + virtual ~Image(); + + /// \brief Retrieves a Sprite resource from the resource manager + /// + /// \param canvas = Canvas + /// \param resources = Resource manager + /// \param id = id + static Resource resource(Canvas &canvas, const std::string &id, const ResourceManager &resources); + + /// \brief Loads a Sprite from a XML resource definition + static Image load(Canvas &canvas, const std::string &id, const XMLResourceDocument &doc); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns x scale. + /**

1.0f is normal scale, 2.0f is twice the size, etc.

*/ + float get_scale_x() const; + + /// \brief Returns y scale. + /**

1.0f is normal scale, 2.0f is twice the size, etc.

*/ + float get_scale_y() const; + + /// \brief Returns current alpha. + /**

Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).

*/ + float get_alpha() const; + + /// \brief Returns current color. + /**

Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).

*/ + Colorf get_color() const; + + /// \brief Returns translation hot-spot. + void get_alignment(Origin &origin, float &x, float &y) const; + + /// \brief Return the texture of the image + Subtexture get_texture() const; + + /// \brief Return the size of the image. + Sizef get_size() const; + + /// \brief Return the width of the image. + float get_width() const; + + /// \brief Return the height of the image. + float get_height() const; + + /// \brief Equality operator + bool operator==(const Image &other) const + { + return impl == other.impl; + } + + /// \brief Inequality operator + bool operator!=(const Image &other) const + { + return impl != other.impl; + } + + /// \brief Less than operator + bool operator<(const Image &other) const + { + return impl < other.impl; + } + + /// \brief Copies all information from this image to another, excluding the graphics that remain shared + Image clone() const; + + /// \brief Draw image on graphic context. + /// + /// \param x, y Anchor position of where to render image. Actual rendering position depends on the anchor and the alignment mode. + /// \param gc Graphic context on which to render upon. + void draw( + Canvas &canvas, + float x, + float y) const; + + /// \brief Draw image on graphic context. + /// + /// \param gc Graphic context on which to render upon. + /// \param src Source rectangle to draw. Use this is draw only part of the image. + /// \param dest Rectangle to draw image in. + void draw( + Canvas &canvas, + const Rectf &src, + const Rectf &dest) const; + + /// \brief Draw image on graphic context. + /// + /// \param gc Graphic context on which to render upon. + /// \param dest Rectangle to draw image in. + void draw( + Canvas &canvas, + const Rectf &dest) const; + + /// \brief Draw image on graphic context. + /// + /// \param gc Graphic context on which to render upon. + /// \param src Source rectangle to draw. Use this is draw only part of the image. + /// \param dest Quad to draw image in. + void draw( + Canvas &canvas, + const Rectf &src, + const Quadf &dest) const; + + /// \brief Draw image on graphic context. + /// + /// \param gc Graphic context on which to render upon. + /// \param dest Quad to draw image in. + void draw( + Canvas &canvas, + const Quadf &dest) const; + + /// \brief Set scale for x and y directions individually. + /**

1.0f is normal scale, 2.0f is twice the size, etc.

*/ + void set_scale(float x, float y); + + /// \brief Sets transparency. + /**

Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).

*/ + void set_alpha(float alpha); + + /// \brief Sets the color. + /**

Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).

*/ + void set_color(const Colorf &color); + + /// \brief Set color + /// + /// \param c = Color + void set_color(const Color& c) { Colorf color; color.r = c.get_red() / 255.0f; color.g = c.get_green() / 255.0f; color.b = c.get_blue() / 255.0f; color.a = c.get_alpha() / 255.0f; set_color(color); } + + /// \brief Sets translation hotspot. + void set_alignment(Origin origin, float x = 0, float y = 0); + + void set_wrap_mode( + TextureWrapMode wrap_s, + TextureWrapMode wrap_t); + + /// \brief Set to true if a linear filter should be used for scaling up and down, false if a nearest-point filter should be used. + void set_linear_filter(bool linear_filter = true); + + /** Upload image to sub-texture. + * \param canvas Canvas to use for the request. + * \param x The horizontal point in the texture to write the new + * sub-texture image onto. + * \param y The vertical point in the texture to write the new + * sub-texture image onto. + * \param image Image to upload. + * \param level Mipmap level-of-detail number. + */ + void set_subimage( + Canvas &canvas, + int x, + int y, + const PixelBuffer &image, + const Rect &src_rect, + int level = 0); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/path.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/path.h new file mode 100644 index 0000000..4f003e6 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/path.h @@ -0,0 +1,116 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include +#include "../../Core/Math/rect.h" +#include "../../Core/Math/mat4.h" +#include "../../Display/2D/color.h" + +namespace clan +{ + class Font; + class PathImpl; + class GlyphMetrics; + class Canvas; + class Pen; + class Brush; + + enum class PathFillMode + { + alternate, + winding + }; + + class Path + { + public: + Path(); + + void set_fill_mode(PathFillMode fill_mode); + + void move_to(const Pointf &point); + void move_to(float x, float y) { move_to(Pointf(x, y)); } + void line_to(const Pointf &point); + void line_to(float x, float y) { line_to(Pointf(x, y)); } + void bezier_to(const Pointf &control, const Pointf &point); + void bezier_to(const Pointf &control1, const Pointf &control2, const Pointf &point); + void close(); + + /// \brief Strokes a path + void stroke(Canvas &canvas, const Pen &pen); + + /// \brief Fills a path + void fill(Canvas &canvas, const Brush &brush); + + /// \brief First fills a path, then strokes on top + void fill_and_stroke(Canvas &canvas, const Pen &pen, const Brush &brush); + + // \brief Copy the entire description (not just the implementation) + Path clone() const; + + static Path rect(const Rectf &box); + static Path rect(float x, float y, float width, float height) { return Path::rect(Rectf(x, y, Sizef(width, height))); } + static Path line(const Pointf &start, const Pointf &end); + static Path line(float x1, float y1, float x2, float y2) { return Path::line(Pointf(x1, y1), Pointf(x2, y2)); } + + static Path rect(const Rectf &box, const clan::Sizef &corner); + + static Path circle(float center_x, float center_y, float radius) { return Path::ellipse(Pointf(center_x, center_y), Sizef(radius, radius)); } + static Path ellipse(float center_x, float center_y, float radius_x, float radius_y) { return Path::ellipse(Pointf(center_x, center_y), Sizef(radius_x, radius_y)); } + static Path circle(const Pointf ¢er, float radius) { return Path::ellipse(center, Sizef(radius, radius)); } + static Path ellipse(const Pointf ¢er, const Sizef &radius); + + // This function is to assist in debugging, it has not been decided if it will be removed. Don't use at the moment. + static Path glyph(Canvas &canvas, Font &font, unsigned int glyph, GlyphMetrics &out_metrics); + + std::shared_ptr get_impl() const { return impl; } + + /// \brief += operator to concatenate a path onto this path. + /// + /// Useful when manually building complex paths from primitives + void operator += (const Path& path); + + /// \brief Transform this path + /// + /// Useful when manually building complex paths from primitives + /// + /// \param transform = Transform matrix + /// + /// \return reference to this object + Path &transform_self(const Mat3f &transform); + + private: + std::shared_ptr impl; + friend class CanvasImpl; + }; + /// \brief + operator. + Path operator + (const Path& v1, const Path& v2); +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/pen.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/pen.h new file mode 100644 index 0000000..cbf736a --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/pen.h @@ -0,0 +1,45 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include "../../Display/2D/color.h" + +namespace clan +{ + class Pen + { + public: + Pen() {} + Pen(const Colorf &color, float width = 1.0f) : color(color), width(width) { } + + Colorf color; + float width = 1.0f; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/span_layout.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/span_layout.h new file mode 100644 index 0000000..6d39efb --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/span_layout.h @@ -0,0 +1,224 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../../Core/Math/rect.h" +#include "../../Core/Math/size.h" +#include "color.h" + +namespace clan +{ + /// \addtogroup clanDisplay_2D clanDisplay 2D + /// \{ + + class Font; + class GraphicContext; + class Point; + class Size; + class SpanLayout_Impl; + class Image; + class SpanComponent; + class Canvas; + + /// \brief Span Align + enum SpanAlign + { + span_left, + span_right, + span_center, + span_justify + }; + + /// \brief Span layout class + class SpanLayout + { + public: + SpanLayout(); + ~SpanLayout(); + + struct HitTestResult + { + HitTestResult() : object_id(-1), offset(0) {} + + enum Type + { + no_objects_available, + outside_top, + outside_left, + outside_right, + outside_bottom, + inside + } type; + + int object_id; + int offset; + }; + + /// \brief Clear + void clear(); + + /// \brief Add text + /// + /// \param text = String + /// \param font = Font + /// \param color = Colorf + /// \param id = value + void add_text(const std::string &text, const Font &font, const Colorf &color = StandardColorf::white(), int id = -1); + + /// \brief Add image + /// + /// \param image = Image + /// \param baseline_offset = value + /// \param id = value + void add_image(const Image &image, int baseline_offset = 0, int id = -1); + + template + + /// \brief Add component + /// + /// \param component = T + /// \param baseline_offset = value + /// \param id = value + void add_component(T *component, int baseline_offset = 0, int id = -1); + + /// \brief Layout + /// + /// \param canvas = Canvas + /// \param max_width = value + void layout(Canvas &canvas, int max_width); + + /// \brief Set position + /// + /// \param pos = Point + void set_position(const Point &pos); + + /// \brief Get Size + /// + /// \return size + Size get_size() const; + + /// \brief Get Rect + /// + /// \return rect + Rect get_rect() const; + + /// \brief Get Rect By Id + /// + /// \return rect + std::vector get_rect_by_id(int id) const; + + /// \brief Hit test + /// + /// \param canvas = Canvas + /// \param pos = Point + /// + /// \return Hit Test Result + HitTestResult hit_test(Canvas &canvas, const Point &pos); + + /// \brief Draw layout + /// + /// \param canvas = Canvas + void draw_layout(Canvas &canvas); + + /// \brief Draw layout generating ellipsis for clipped text + /// + /// \param canvas = Canvas + /// \param content_rect = Clipping rectangle + void draw_layout_ellipsis(Canvas &canvas, const Rect &content_rect); + + /// \brief Set component geometry + void set_component_geometry(); + + /// \brief Find preferred size + /// + /// \param canvas = Canvas + /// + /// \return Size + Size find_preferred_size(Canvas &canvas); + + /// \brief Set selection range + /// + /// \param size_type = String + /// \param size_type = String + void set_selection_range(std::string::size_type start, std::string::size_type end); + + /// \brief Set selection colors + /// + /// \param foreground = Colorf + /// \param background = Colorf + void set_selection_colors(const Colorf &foreground, const Colorf &background); + + /// \brief Shows the cursor caret + void show_cursor(); + + /// \brief Hides the cursor caret + void hide_cursor(); + + /// \brief Sets the cursor position + /// + /// \param pos = Index of cursor + void set_cursor_pos(std::string::size_type pos); + + /// \brief Toggles whether the cursor caret is shown as a solid box or a line + /// + /// \param enable = Shows the cursor as a solid box if set to true + void set_cursor_overwrite_mode(bool enable); + + /// \brief Sets the cursor color + /// + /// \param color = Color of cursor + void set_cursor_color(const Colorf &color); + + /// \brief Get Combined text + /// + /// \return combined_text + std::string get_combined_text() const; + + /// \brief Sets the text alignment + /// + /// Alignment is applied when layout() is called + /// + /// \param align = The alignment + void set_align(SpanAlign align); + + /// \brief Returns the baseline offset for the first baseline + int get_first_baseline_offset(); + + /// \brief Returns the baseline offset for the last baseline + int get_last_baseline_offset(); + + private: + void add_component_helper(SpanComponent *component, int baseline_offset, int id); + + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/sprite.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/sprite.h new file mode 100644 index 0000000..6ab5b5d --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/sprite.h @@ -0,0 +1,429 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Kenneth Gangstoe +** Mark Page +*/ + +#pragma once + +#include +#include "../../Core/Math/origin.h" +#include "../../Core/Signals/signal.h" +#include "../../Core/IOData/file_system.h" +#include "../../Core/Resources/resource.h" +#include "../Render/graphic_context.h" +#include "../Image/image_import_description.h" +#include "color.h" + +namespace clan +{ + /// \addtogroup clanDisplay_2D clanDisplay 2D + /// \{ + + class Sprite_Impl; + class Canvas; + class ResourceManager; + class Font_Impl; + class Subtexture; + class XMLResourceDocument; + + /// \brief Sprite class. + class Sprite + { + public: + enum ShowOnFinish + { + show_blank, show_last_frame, show_first_frame + }; + + /// \brief Constructs a null instance. + Sprite(); + + /// \brief Constructs a Sprite + /// + /// \param canvas = Canvas + /// \param fullname = String Ref + Sprite(Canvas &canvas, const std::string &fullname, const ImageImportDescription &import_desc = ImageImportDescription()); + + /// \brief Constructs a Sprite + /// + /// \param canvas = Canvas + /// \param filename = String Ref + /// \param dir = Virtual Directory + Sprite(Canvas &canvas, const std::string &filename, const FileSystem &file_system, const ImageImportDescription &import_desc = ImageImportDescription()); + + /// \brief Constructs a Sprite + /// + /// \param canvas = Canvas + /// \param file = IODevice + /// \param image_type = String + Sprite(Canvas &canvas, IODevice &file, const std::string &image_type, const ImageImportDescription &import_desc = ImageImportDescription()); + + /// \brief Constructs an empty Sprite + /// + /// \param gc = Graphic Context + Sprite(Canvas &canvas); + + virtual ~Sprite(); + + /// \brief Retrieves a Sprite resource from the resource manager + /// + /// \param gc = canvas = Canvas + /// \param resources = Resource manager + /// \param id = id + static Resource resource(Canvas &canvas, const std::string &id, const ResourceManager &resources); + + /// \brief Loads a Sprite from a XML resource definition + static Sprite load(Canvas &canvas, const std::string &id, const XMLResourceDocument &doc); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns current angle in degrees. + Angle get_angle() const; + + /// \brief Returns the base angle in degrees - angle added to any rotation set with set_rotate() or rotate(). + Angle get_base_angle() const; + + /// \brief Returns scale for x and y. + /**

1.0f is normal scale, 2.0f is twice the size, etc.

*/ + void get_scale(float &x, float &y) const; + + /// \brief Returns current alpha. + /**

Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).

*/ + float get_alpha() const; + + /// \brief Returns current color. + /**

Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).

*/ + Colorf get_color() const; + + /// \brief Returns true if the sprite uses a linear filter for scaling up and down, false if a nearest-point filter is used. + bool get_linear_filter() const; + + /// \brief Returns translation hot-spot. + void get_alignment(Origin &origin, int &x, int &y) const; + + /// \brief Returns rotation hot-spot. + void get_rotation_hotspot(Origin &origin, int &x, int &y) const; + + /// \brief Returns current frame in animation. 0 is first frame. + int get_current_frame() const; + + /// \brief Returns number of frames in animation. + int get_frame_count() const; + + /// \brief Returns the delay of a frame. + /// + /// \param frame = The frame. 0 is first frame. + /// \return The delay in milliseconds + int get_frame_delay(int frame) const; + + /// \brief Returns the translation offset of a frame. 0 is first frame. + Point get_frame_offset(int frame) const; + + /// \brief Returns the size of a frame. 0 is first frame. + Size get_frame_size(int frame) const; + + /// \brief Return the texture of a frame. 0 is first frame + Subtexture get_frame_texture(int frame) const; + + /// \brief Return the width of the current frame, shortcut for 'get_frame_size(get_current_frame()).width' + int get_width() const; + + /// \brief Return the height of the current frame, shortcut for 'get_frame_size(get_current_frame()).height' + int get_height() const; + + /// \brief Return the size of the current frame, shortcut for 'get_frame_size(get_current_frame())' + Size get_size() const; + + /// \brief Returns the attached id (if exists). + int get_id() const; + + /// \brief Returns true if animation is played in loop (more than once). + bool is_play_loop() const; + + /// \brief Returns true if animation is played in from right to left (starts at end). + bool is_play_backward() const; + + /// \brief Returns true if animation is played in ping-pong mode. + bool is_play_pingpong() const; + + /// \brief Returns an enum for what is shown when the animation is finished. + /**

If show_blank is returned, nothing is shown when animation is done.

*/ + ShowOnFinish get_show_on_finish() const; + + /// \brief Returns true if animation is finished. + /**

When an animation is finished, it will no longer show, unless ShowLastFrame is set + to anything other than show_blank

*/ + bool is_finished() const; + + /// \brief Returns true if animation has looped in the last update cycle + bool is_looping() const; + + /// \brief Equality operator + bool operator==(const Sprite &other) const + { + return impl == other.impl; + } + + /// \brief Inequality operator + bool operator!=(const Sprite &other) const + { + return impl != other.impl; + } + + /// \brief Less than operator + bool operator<(const Sprite &other) const + { + return impl < other.impl; + } + + /// \brief Copy assignment operator. + Sprite &operator =(const Sprite ©); + + /// \brief Sets the image data from another sprite, sharing animation state. + /** Use this to change the look of your sprite.*/ + void set_image_data(const Sprite &image_source); + + /// \brief Copies all information from this sprite to another, excluding the graphics that remain shared + Sprite clone() const; + + /// \brief Draw sprite on graphic context. + /// + /// \param x, y Anchor position of where to render sprite. Actual rendering position depends on the anchor and the alignment mode. + /// \param gc Graphic context on which to render upon. If null, will use Display's current graphic context. + /// \param src Source rectangle to draw. Use this is draw only part of the sprite. + /// \param dest Rectangle to draw sprite in. + void draw( + Canvas &canvas, + float x, + float y); + + void draw( + Canvas &canvas, + int x, + int y); + + void draw( + Canvas &canvas, + const Rectf &src, + const Rectf &dest); + + void draw( + Canvas &canvas, + const Rectf &dest); + + /// \brief Call this function to update the animation. + /// + /// \param time_elapsed_ms = Time elapsed in milliseconds. + void update(int time_elapsed_ms); + + /// \brief Set absolute rotation angle. + void set_angle(Angle angle); + + /// \brief Set absolute rotation pitch angle. + void set_angle_pitch(Angle angle); + + /// \brief Set absolute rotation yaw angle. + void set_angle_yaw(Angle angle); + + /// \brief Add angle in degrees to current angle. + void rotate(Angle angle); + + /// \brief Add angle in degrees to current pitch angle. + void rotate_pitch(Angle angle); + + /// \brief Add angle in degrees to current yaw angle. + void rotate_yaw(Angle angle); + + /// \brief Sets the base angle in degrees - angle added to any rotation set with set_rotate() or rotate(). + void set_base_angle(Angle angle); + + /// \brief Set scale for x and y directions individually. + /**

1.0f is normal scale, 2.0f is twice the size, etc.

*/ + void set_scale(float x, float y); + + /// \brief Sets transparency. + /**

Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).

*/ + void set_alpha(float alpha); + + /// \brief Sets the color. + /**

Alpha 0.0f is full transparency, and 1.0f is full visibility (solid).

*/ + void set_color(const Colorf &color); + + /// \brief Set color + /// + /// \param c = Color + void set_color(const Color& c) { Colorf color; color.r = c.get_red() / 255.0f; color.g = c.get_green() / 255.0f; color.b = c.get_blue() / 255.0f; color.a = c.get_alpha() / 255.0f; set_color(color); } + + /// \brief Set to true if a linear filter should be used for scaling up and down, false if a nearest-point filter should be used. + void set_linear_filter(bool linear_filter = true); + + /// \brief Sets translation hotspot. + void set_alignment(Origin origin, int x = 0, int y = 0); + + /// \brief Sets rotation hotspot. + void set_rotation_hotspot(Origin origin, int x = 0, int y = 0); + + /// \brief Sets current animation frame. 0 is first frame. + /// \brief It will cap to available range. + void set_frame(unsigned int frame); + + /// \brief Sets the delay for all frames. + /// + /// \param delay_ms = Delay in milliseconds + void set_delay(int delay_ms); + + /// \brief Sets the delay of a specific frame. + /// + /// \param frame = Frame number. 0 is first frame. + /// \param delay_ms = Delay in milliseconds + void set_frame_delay(int frame, int delay_ms); + + /// \brief Sets the translate offset of a specific frame. 0 is first frame. + void set_frame_offset(int frame, Point offset); + + /// \brief Sets an attached id. + void set_id(int id); + + /// \brief Finish animation. + /**

When an animation is finished, it will no longer show, unless ShowLastFrame is set to anything + other than show_blank

*/ + void finish(); + + /// \brief Restart animation. + void restart(); + + /// \brief Set to true if animation should loop, false otherwise. + void set_play_loop(bool loop = true); + + /// \brief Set to true if animation should loop, false otherwise. + void set_play_pingpong(bool pingpong = true); + + /// \brief Set to true if animation should go backward (start at end). + void set_play_backward(bool backward = true); + + /// \brief Set what is shown when the animation is finished. + void set_show_on_finish(Sprite::ShowOnFinish show_on_finish); + + /// \brief Add frame + /// + /// \param texture = Texture + void add_frame(const Texture2D &texture); + + /// \brief Add frame + /// + /// \param fullname = String Ref + void add_frame(Canvas &canvas, const std::string &fullname, const ImageImportDescription &import_desc = ImageImportDescription()); + + /// \brief Add frame + /// + /// \param file = IODevice + /// \param image_type = String + void add_frame(Canvas &canvas, IODevice &file, const std::string &image_type, const ImageImportDescription &import_desc = ImageImportDescription()); + + /// \brief Add frame + /// + /// \param filename = String Ref + /// \param dir = Virtual Directory + void add_frame(Canvas &canvas, const std::string &filename, const FileSystem &file_system, const ImageImportDescription &import_desc = ImageImportDescription()); + + /// \brief Add frames + /// + /// \param texture = Texture + /// \param frames = Rect + /// \param num_frames = value + void add_frames(const Texture2D &texture, Rect *frames, int num_frames); + + /// \brief Add frame + /// + /// \param texture = Texture + /// \param frame = Rect + void add_frame(const Texture2D &texture, const Rect &frame); + + /// \brief Adds images formed in a grid. + /**

This function will cut out a grid of frames from one image.

+ \param pixelbuffer Image source. + \param texture Image source. + \param xpos, ypos Position of where image grid starts. + \param width, height Size of a frame in the grid. + \param xarray, yarray Number of columns and rows in grid. + \param array_skipframes Number of frames to skip at last gridline. + \param xspacing, yspacing Pixel interspacing between grid frames.*/ + void add_gridclipped_frames(Canvas &canvas, + const Texture2D &texture, + int xpos, int ypos, + int width, int height, + int xarray = 1, int yarray = 1, + int array_skipframes = 0, + int xspacing = 0, int yspacing = 0); + + /// \brief Adds images separated with pure alpha (within trans_limit). + /**

The alpha clipper will cut out frames from an image based on + the transparency in the picture. It first determines the height + of a row by searching for the first line that it considers + completely transparent. Then it finds the width of each frame on + this line by looking for columns that are completely transparency.

+ \param pixelbuffer Image source. + \param texture Image source. + \param xpos, ypos Upper left position where alpha cutting should begin. + \param trans_limit Amount of non-transparent alpha allowed before a pixel is not considered transparent.*/ + void add_alphaclipped_frames(Canvas &canvas, + const Texture2D &texture, + int xpos = 0, int ypos = 0, + float trans_limit = 0.05f); + + /// \brief Adds images separated with pure alpha (within trans_limit). + /**

The alpha clipper will cut out frames from an image based on + the transparency in the picture. It scans the lines horizontally + from top to bottom. As soon as a non-transarent pixel is discovered, + the clipper finds the bounding box for that region and then moves on.

+ \param pixelbuffer Image source. + \param texture Image source. + \param xpos, ypos Upper left position where alpha cutting should begin. + \param trans_limit Amount of non-transparent alpha allowed before a pixel is not considered transparent.*/ + void add_alphaclipped_frames_free(Canvas &canvas, + const Texture2D &texture, + int xpos = 0, int ypos = 0, + float trans_limit = 0.05f); + + /// \brief Sig animation finished + /// + /// \return Signal + Signal &sig_animation_finished(); + + private: + std::shared_ptr impl; + + friend class FontFamily_Impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/subtexture.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/subtexture.h new file mode 100644 index 0000000..616d615 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/subtexture.h @@ -0,0 +1,75 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanDisplay_2D clanDisplay 2D + /// \{ + + class Size; + class Rect; + class Texture2D; + class Subtexture_Impl; + + /// \brief Sub-texture description. + class Subtexture + { + public: + /// \brief Constructs a null instance. + Subtexture(); + + /// \brief Constructs a Subtexture + /// + /// \param texture = Texture + /// \param geometry = Rect + Subtexture(Texture2D texture, const Rect &geometry); + ~Subtexture(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns the texture. + Texture2D get_texture(); + + /// \brief Returns the part of the texture used by this object. + Rect get_geometry() const; + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/texture_group.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/texture_group.h new file mode 100644 index 0000000..8026a05 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/2D/texture_group.h @@ -0,0 +1,114 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Kenneth Gangstoe +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanDisplay_2D clanDisplay 2D + /// \{ + + class Size; + class Rect; + class Texture2D; + class Subtexture; + class TextureGroup_Impl; + class GraphicContext; + + /// \brief Texture grouping class. + class TextureGroup + { + public: + /// \brief Texture allocation policy. + enum TextureAllocationPolicy + { + create_new_texture, + search_previous_textures + }; + + /// \brief Constructs a null instance + TextureGroup(); + + /// \brief Constructs a texture group + TextureGroup(const Size &texture_sizes); + + ~TextureGroup(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns the amount of sub-textures allocated in group. + int get_subtexture_count() const; + + /// \brief Returns the amount of sub-textures for a specific texture index. + int get_subtexture_count(unsigned int texture_index) const; + + /// \brief Returns the amount of textures used by group. + int get_texture_count() const; + + /// \brief Returns the texture allocation policy. + TextureAllocationPolicy get_texture_allocation_policy() const; + + /// \brief Returns the size of the textures used by this texture group. + Size get_texture_sizes() const; + + /// \brief Returns the textures. + std::vector get_textures() const; + + /// \brief Allocate space for another sub texture. + Subtexture add(GraphicContext &context, const Size &size); + + /// \brief Deallocate space, from a previously allocated texture + /// + /// Warning - It is advised to set TextureAllocationPolicy to search_previous_textures + /// if using this function. Also be aware of texture fragmentation. + /// Empty textures are not removed. + void remove(Subtexture &subtexture); + + /// \brief Set the texture allocation policy. + void set_texture_allocation_policy(TextureAllocationPolicy policy); + + /// \brief Insert an existing texture into the texture group + /// + /// \param texture = Texture to insert + /// \param texture_rect = Free space within the texture that the texture group can use + void insert_texture(Texture2D &texture, const Rect &texture_rect); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font.h new file mode 100644 index 0000000..8b4029a --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font.h @@ -0,0 +1,205 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include +#include "../Render/graphic_context.h" +#include "../Image/pixel_buffer.h" +#include "../2D/sprite.h" +#include "font_description.h" +#include "glyph_metrics.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Font clanDisplay Font + /// \{ + + class FontProvider; + class FontFamily; + class Canvas; + class Font_Impl; + class GlyphMetrics; + + class FontHandle + { + public: + virtual ~FontHandle() = 0; + }; + + /// \brief Font class + /// + /// A Font is a collection of images that can be used to represent text on a screen. + class Font + { + public: + /// \brief Constructs a null font. + Font(); + + // \brief Create font using the specified font family + Font(FontFamily &font_family, float height); + + // \brief Create font using the specified font family + Font(FontFamily &font_family, const FontDescription &desc); + + /// \brief Constructs standard font + Font(const std::string &typeface_name, float height); + + // \brief Constructs standard font + Font(const std::string &typeface_name, const FontDescription &desc); + + // \brief Constructs standard font + Font(const FontDescription &desc, const std::string &ttf_filename); + + // \brief Constructs standard font + Font(const FontDescription &desc, const std::string &ttf_filename, FileSystem fs); + + /// \brief Constructs a Font based on a sprite + /// + /// \param sprite = Sprite with glyphs + /// \param glyph_list = Letter to glyph mapping + /// \param spacelen = Width of space character + /// \param monospace = Force monospaced font (using widest sprite character) + /// \param metrics = Font metrics for the sprite font + Font(Canvas &canvas, const std::string &typeface_name, Sprite &sprite, const std::string &glyph_list, float spacelen, bool monospace, const FontMetrics &metrics); + + /// \brief Retrieves a Font resource from the resource manager + /// + /// \param canvas = Canvas + /// \param resources = Resource manager + /// \param id = id + static Resource resource(Canvas &canvas, const std::string &family_name, const FontDescription &desc, const ResourceManager &resources); + + /// \brief Loads a Font from a XML resource definition + static Font load(Canvas &canvas, const std::string &family_name, const FontDescription &reference_desc, FontFamily &font_family, const XMLResourceDocument &doc, std::function(Canvas &, const std::string &)> cb_get_sprite = std::function(Canvas &, const std::string &)>()); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Sets the font height + void set_height(float value); + + /// \brief Sets the font weight + void set_weight(FontWeight value = FontWeight::normal); + + /// \brief Sets the distance between each line + void set_line_height(float height); + + /// \brief Sets the font style setting + void set_style(FontStyle setting = FontStyle::normal); + + /// \brief Sets the threshold to determine if the font can be drawn scaled + /// + /// All font sizes are scalable when using sprite fonts + void set_scalable(float height_threshold = 64.0f); + + /// \brief Print text + /// + /// \param canvas = Canvas + /// \param position = Dest position + /// \param text = The text to draw + /// \param color = The text color + void draw_text(Canvas &canvas, const Pointf &position, const std::string &text, const Colorf &color = StandardColorf::white()); + void draw_text(Canvas &canvas, float xpos, float ypos, const std::string &text, const Colorf &color = StandardColorf::white()) { draw_text(canvas, Pointf(xpos, ypos), text, color); } + + /// \brief Gets the glyph metrics + /// + /// \param glyph = The glyph to get + /// \return The glyph metrics + GlyphMetrics get_metrics(Canvas &canvas, unsigned int glyph) const; + + /// \brief Measure text size + /// + /// \param string = The text to use + /// \return The metrics + GlyphMetrics measure_text(Canvas &canvas, const std::string &string) const; + + /// \brief Retrieves font metrics description for the selected font. + FontMetrics get_font_metrics(Canvas &canvas) const; + + /// \brief Retrieves clipped version of the text that will fit into a box + /// + /// \return The string + std::string get_clipped_text(Canvas &canvas, const Sizef &box_size, const std::string &text, const std::string &ellipsis_text = "...") const; + + /// \brief Get the character index at a specified point + /// + /// \param canvas = Canvas + /// \param text = The string + /// \param point = The point + /// \return The character index. -1 = Not at specified point + int get_character_index(Canvas &canvas, const std::string &text, const Pointf &point) const; + + /// \brief Get the rectangles of each glyph in a string of text + /// + /// \return A list of Rects for every glyph + std::vector get_character_indices(Canvas &canvas, const std::string &text) const; + + // Finds the offset for the last visible character when clipping the head + size_t clip_from_left(Canvas &canvas, const std::string &text, float width) const; + + // Finds the offset for the first visible character when clipping the tail + size_t clip_from_right(Canvas &canvas, const std::string &text, float width) const; + + // Get the font description + FontDescription get_description() const; + + /// \brief Get the font handle interface + /// + /// For example, use auto handle = dynamic_cast(font.get_handle()); if (handle) {...} to obtain a specific interface + /// + /// \return The font handle interface + FontHandle *get_handle(Canvas &canvas); + + private: + std::shared_ptr impl; + + friend class Path; + }; + + #ifdef WIN32 + class FontEngine_Win32; // GCC needs to be explicitly told this is a class + + class FontHandle_Win32 : public FontHandle + { + public: + /// \brief Get the font HFONT + HFONT hfont(); + private: + friend class FontEngine_Win32; + FontEngine_Win32 *engine = nullptr; + }; + #endif + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font_description.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font_description.h new file mode 100644 index 0000000..e68b0de --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font_description.h @@ -0,0 +1,195 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +** Harry Storbacka +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Font clanDisplay Font + /// \{ + + class DisplayWindow; + class FontDescription_Impl; + + enum class FontWeight : int + { + thin = 100, + extra_light = 200, + light = 300, + normal = 400, + medium = 500, + semi_bold = 600, + bold = 700, + extra_bold = 800, + heavy = 900 + }; + + enum class FontStyle + { + normal, + italic, + oblique // Currently not supported by ClanLib + }; + + /// \brief Font description class. + /// + /// This class allows you to setup a more advanced description when creating a font. + class FontDescription + { + public: + /// \brief Constructs a font description with default values. + FontDescription(); + + virtual ~FontDescription(); + + /// \brief Create null object + /// + /// \return Font Description + static FontDescription create_null_object(); + + enum Charset + { + charset_default, + charset_ansi, + charset_baltic, + charset_chinesebig5, + charset_easteurope, + charset_gb2312, + charset_greek, + charset_hangul, + charset_mac, + charset_oem, + charset_russian, + charset_shiftjis, + charset_symbol, + charset_turkish, + charset_vietnamese, + charset_johab, + charset_arabic, + charset_hebrew, + charset_thai + }; + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns the font height + float get_height() const; + + /// \brief Returns the distance between each line + float get_line_height() const; + + /// \brief Returns the font average width + /// + /// 0.0f = Use default + float get_average_width() const; + + /// \brief Returns the font escapement + float get_escapement() const; + + /// \brief Returns the font orientation + float get_orientation() const; + + /// \brief Returns the font weight + FontWeight get_weight() const; + + /// \brief Returns the font style + FontStyle get_style() const; + + /// \brief Get the font anti-alias setting (defaults to true) + bool get_anti_alias() const; + + /// \brief Get the font subpixel rendering setting (defaults to true) + bool get_subpixel() const; + + /// \biref Get the font charset + Charset get_charset() const; + + /// \brief Returns true if the font is identical + /// Line_height is excluded. + bool operator==(const FontDescription &other) const; + + /// \brief Returns an unique string identifying this font description + /// + /// This is useful for placing font descriptions in a map. + /// Line_height is excluded. + std::string get_unique_id() const; + + /// \brief Copy assignment operator (does not copy the description, use clone() if you want that) + FontDescription &operator =(const FontDescription ©); + + // \brief Copy the entire font description (not just the implementation) + FontDescription clone() const; + + /// \brief Sets the font height + void set_height(float value = 20.0f); + + /// \brief Sets the font average width + /// + /// 0.0f = Use default + void set_average_width(float value = 0.0f); + + /// \brief Sets the font escapement + void set_escapement(float value); + + /// \brief Sets the font orientation + void set_orientation(float value); + + /// \brief Sets the font weight + void set_weight(FontWeight value = FontWeight::normal); + + /// \brief Sets the distance between each line + void set_line_height(float height); + + /// \brief Sets the font style + void set_style(FontStyle setting = FontStyle::normal); + + /// \brief Sets the font anti-alias setting (defaults to true) + void set_anti_alias(bool setting = true); + + /// \brief Sets the font subpixel rendering setting (defaults to true) + void set_subpixel(bool setting = true); + + /// \brief Sets the font charset (defaults to charset_default) + /// + /// \param new_charset = The charset. charset_default = Use operating systems default + void set_charset(Charset new_charset); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font_family.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font_family.h new file mode 100644 index 0000000..bdf6e42 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font_family.h @@ -0,0 +1,99 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include +#include "../Render/graphic_context.h" +#include "../Image/pixel_buffer.h" +#include "../2D/sprite.h" +#include "font_description.h" +#include "glyph_metrics.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Font clanDisplay FontFamily + /// \{ + + class FontProvider; + class Canvas; + class FontFamily_Impl; + class GlyphMetrics; + + /// \brief FontFamily class + /// + /// A FontFamily is a collection of font descriptions + class FontFamily + { + public: + /// \brief Constructs a null font family + FontFamily(); + + /// \brief Constructs a font family with the given family name + FontFamily(const std::string &family_name); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Font family name used for this font family + const std::string &get_family_name() const; + + /// \brief Add standard font + void add(const std::string &typeface_name, float height); + + // \brief Add standard font + void add(const std::string &typeface_name, const FontDescription &desc); + + // \brief Add standard font + void add(const FontDescription &desc, const std::string &ttf_filename); + + // \brief Add standard font + void add(const FontDescription &desc, const std::string &ttf_filename, FileSystem fs); + + /// \brief Add a Font based on a sprite + /// + /// \param sprite = Sprite with glyphs + /// \param glyph_list = Letter to glyph mapping + /// \param spacelen = Width of space character + /// \param monospace = Force monospaced font (using widest sprite character) + /// \param metrics = Font metrics for the sprite font + void add(Canvas &canvas, Sprite &sprite, const std::string &glyph_list, float spacelen, bool monospace, const FontMetrics &metrics); + + private: + std::shared_ptr impl; + + friend class Font_Impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font_metrics.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font_metrics.h new file mode 100644 index 0000000..ff49b0b --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/font_metrics.h @@ -0,0 +1,88 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +** Mark Page +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Font clanDisplay Font + /// \{ + + class FontMetrics_Impl; + + /// \brief Font metrics class. + /// + /// + class FontMetrics + { + public: + FontMetrics(); + + FontMetrics( + float height, + float ascent, + float descent, + float internal_leading, + float external_leading, + float line_height, // If 0, then line_height is calculated as height + external_leading + float pixel_ratio + ); + + ~FontMetrics(); + + /// \brief Returns the height of the font. + float get_height() const; + + /// \brief Return the distance between lines. + float get_line_height() const; + + /// \brief Returns the baseline offset from the top of a line + float get_baseline_offset() const; + + /// \brief Returns the font ascender. + float get_ascent() const; + + /// \brief Returns the font descender. + float get_descent() const; + + /// \brief Returns the amount of leading (space) inside the bounds set by the get_height() function. + float get_internal_leading() const; + + /// \brief Returns the amount of extra leading (space) that to add between rows. + float get_external_leading() const; + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/glyph_metrics.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/glyph_metrics.h new file mode 100644 index 0000000..7ecf1d5 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Font/glyph_metrics.h @@ -0,0 +1,58 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include "../../Core/Math/rect.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Font clanDisplay Font + /// \{ + + /// \brief Glyph metrics class. + class GlyphMetrics + { + public: + GlyphMetrics() { } + GlyphMetrics(const Pointf &bbox_offset, const Sizef &bbox_size, const Sizef &advance) : bbox_offset(bbox_offset), bbox_size(bbox_size), advance(advance) { } + + /// \brief Bounding box offset relative to the write cursor position + Pointf bbox_offset; + + /// \brief Bounding box size + /// The bounding box is the smallest rectangle that completely encloses the glyph + Sizef bbox_size; + + /// \brief Distance the write cursor is moved + Sizef advance; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/buffer_usage.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/buffer_usage.h new file mode 100644 index 0000000..295dfbd --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/buffer_usage.h @@ -0,0 +1,61 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Array Buffer usage enum + enum BufferUsage + { + usage_stream_draw, + usage_stream_read, + usage_stream_copy, + usage_static_draw, + usage_static_read, + usage_static_copy, + usage_dynamic_draw, + usage_dynamic_read, + usage_dynamic_copy + }; + + /// \brief Array Buffer access enum + enum BufferAccess + { + access_read_only, + access_write_only, + access_read_write, + access_write_discard // TBD; requires usage usage_stream_draw on object + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/icon_set.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/icon_set.h new file mode 100644 index 0000000..6452b34 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/icon_set.h @@ -0,0 +1,63 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class DataBuffer; + class PixelBuffer; + class IconSet_Impl; + + /// \brief Icon set class. + class IconSet + { + public: + /// \brief Constructs an icon set. + IconSet(); + + /// \brief Returns all the images in the icon set + std::vector get_images() const; + + /// \brief Adds an image to the icon set + void add_image(const PixelBuffer &image); + + /// \brief Generates a Windows .ICO format icon from the set + DataBuffer create_win32_icon(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/image_import_description.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/image_import_description.h new file mode 100644 index 0000000..6f3f70d --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/image_import_description.h @@ -0,0 +1,104 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +#include +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class Size; + class Rect; + class ImageImportDescription_Impl; + class PixelBuffer; + + /// \brief Image Import Description Class. + /// + /// This class allows you to setup a more advanced description when importing images. + class ImageImportDescription + { + public: + /// \brief Constructs a image import description with default values. + ImageImportDescription(); + ~ImageImportDescription(); + + /// \brief Returns the premultiply alpha setting + bool get_premultiply_alpha() const; + + /// \brief Returns the flip vertical setting + bool flip_vertical() const; + + /// \brief Returns the sRGB setting + bool is_srgb() const; + + /// \brief Returns if this image should be cached + bool is_cached() const; + + /// \brief Process the pixel buffers depending of the chosen settings + /// + /// Note, the output may point to a different pixel buffer than the input\n + /// The input image may be written to. + PixelBuffer process(PixelBuffer &image) const; + + /// \brief Set the premultiply alpha setting + /// + /// (This defaults to off) + void set_premultiply_alpha(bool enable); + + /// \brief Set the flip vertical setting + /// + /// (This defaults to off) + void set_flip_vertical(bool enable); + + /// \brief Controls if the image is uploaded as a sRGB texture or not + /// + /// (This defaults to off) + void set_srgb(bool enable); + + /// \brief Controls if this image can be cached + /// + /// (This defaults to true) + void set_cached(bool enable); + + /// \brief User defined fine control of the pixel buffer + /// + /// Note, the output maybe different to the input, if desired\n + /// \n + /// PixelBuffer func_process(PixelBuffer &input) + std::function &func_process(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/perlin_noise.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/perlin_noise.h new file mode 100644 index 0000000..742a8b0 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/perlin_noise.h @@ -0,0 +1,159 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +#include +#include "pixel_buffer.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class PerlinNoise_Impl; + + /// \brief Perlin Noise Generator class + class PerlinNoise + { + public: + /// \brief Constructor + PerlinNoise(); + + /// \brief Destructor + virtual ~PerlinNoise(); + + /// \brief Create the perlin noise + /// + /// Remember to call set_size() with the height set to 1.\n + /// The period of these parameters are from 0 to 255 + /// + /// \param start_x = Start x position of the noise + /// \param end_x = End x position of the noise + /// \param start_y = Start y position of the noise + /// \param end_y = End y position of the noise + PixelBuffer create_noise1d(float start_x, float end_x); + + /// \brief Create the perlin noise + /// + /// The period of these parameters are from 0 to 255 + /// + /// \param start_x = Start x position of the noise + /// \param end_x = End x position of the noise + /// \param start_y = Start y position of the noise + /// \param end_y = End y position of the noise + PixelBuffer create_noise2d(float start_x, float end_x, float start_y, float end_y); + + /// \brief Create the perlin noise + /// + /// The period of these parameters are from 0 to 255 + /// + /// \param start_x = Start x position of the noise + /// \param end_x = End x position of the noise + /// \param start_y = Start y position of the noise + /// \param end_y = End y position of the noise + /// \param z_position = The z position of the noise + PixelBuffer create_noise3d(float start_x, float end_x, float start_y, float end_y, float z_position); + + /// \brief Create the perlin noise + /// + /// The period of these parameters are from 0 to 255 + /// + /// \param start_x = Start x position of the noise + /// \param end_x = End x position of the noise + /// \param start_y = Start y position of the noise + /// \param end_y = End y position of the noise + /// \param z_position = The z position of the noise + /// \param w_position = The w position of the noise + PixelBuffer create_noise4d(float start_x, float end_x, float start_y, float end_y, float z_position, float w_position); + + /// \brief Get the size of the output pixelbuffer + Size get_size() const; + + /// \brief Get the format of the output pixelbuffer + TextureFormat get_format() const; + + /// \brief Get the amplitude of the perlin noise + float get_amplitude() const; + + /// \brief Get the number of octaves of the perlin noise + int get_octaves() const; + + /// \brief Set the permutation table + /// + /// If this function is not used, this class uses rand() to create a permutation table instead + /// + /// \param table = The permutation table + /// \param size = The permutation table size (2,4,8,16,32,64,128,256). Usually 256 (the maximum) unless a lower periodic table is required + void set_permutations(const unsigned char *table, unsigned int size = 256); + + /// \brief Set the size of the output pixelbuffer + /// + /// If this function is not used, the size defaults to 256x256 + /// + /// \param width = Output pixelbuffer width + /// \param height = Output pixelbuffer height + void set_size(int width = 256, int height = 256); + + /// \brief Set the size of the output pixelbuffer + /// + /// If this function is not used, the size defaults to 256x256 + /// + /// \param width = Output pixelbuffer width + /// \param height = Output pixelbuffer height + void set_size(const Size &size); + + /// \brief Set the format of the output pixelbuffer + /// + /// If this function is not used, the format defaults to tf_rgb8\n + /// These following formats are supported:\n + /// tf_rgba8, tf_rgb8, tf_r8, tf_r32f + /// + /// \param format = The specified format + void set_format(TextureFormat texture_format = tf_rgb8); + + /// \brief Set the amplitude of the perlin noise + /// + /// If this function is not used, the amplitude defaults to 1.0f + /// + /// \param amplitude = The amplitude to set + void set_amplitude(float amplitude = 1.0f); + + /// \brief Set the number of octaves of the perlin noise + /// + /// If this function is not used, the octaves count defaults to 1 + /// + /// \param octaves = The number of octaves to set + void set_octaves(int octaves = 1); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer.h new file mode 100644 index 0000000..924e942 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer.h @@ -0,0 +1,307 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +** Mark Page +*/ + +#pragma once + +#include +#include "../../Core/Math/rect.h" +#include "texture_format.h" +#include "buffer_usage.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class Size; + class Rect; + class PixelFormat; + class Color; + class Colorf; + class PixelBuffer; + class PixelBuffer_Impl; + class FileSystem; + class IODevice; + class GraphicContext; + class PixelBufferProvider; + class PixelConverter; + + /// \brief Pixel buffer prefered direction + enum PixelBufferDirection + { + /// \brief Use of the pixel buffer is to send data to the gpu + data_to_gpu, + + /// \brief Use of the pixel buffer is to retrieve data from the gpu + data_from_gpu + }; + + /// \brief Pixel data container. + class PixelBuffer + { + public: + /// \brief Constructs a null instance + PixelBuffer(); + + /// \brief Constructs a PixelBuffer + /// + /// \param width = value + /// \param height = value + /// \param sized_format = Pixel Format + /// \param data = The data (0 = Allocate automatically to a boundary of 16 bytes) + /// \param only_reference_data : true = Reference the data. false = Copy the data + PixelBuffer(int width, int height, TextureFormat texture_format, const void *data = nullptr, bool only_reference_data = false); + + /// \brief Constructs a PixelBuffer + /// + /// \param fullname = String Ref + PixelBuffer(const std::string &fullname, bool srgb = false); + + /// \brief Constructs a PixelBuffer + /// + /// \param filename = String Ref + /// \param dir = Virtual Directory + PixelBuffer(const std::string &filename, const FileSystem &file_system, bool srgb = false); + + /// \brief Constructs a PixelBuffer + /// + /// \param file = IODevice + /// \param image_type = String + PixelBuffer(IODevice &file, const std::string &image_type, bool srgb = false); + + /// \brief Constructs a PixelBuffer + /// + /// \param provider = Font Provider + PixelBuffer(PixelBufferProvider *provider); + + virtual ~PixelBuffer(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Create a copy of the pixelbuffer that doesn't share data with the original pixel buffer. + PixelBuffer copy() const; + + /// \brief Create a copy of the pixelbuffer that doesn't share data with the original pixel buffer. + PixelBuffer copy(const Rect &rect) const; + + /// Retrieves the actual width of the buffer. + int get_width() const; + + /// Retrieves the actual height of the buffer. + int get_height() const; + + /// Retrieves the actual size of the buffer. + Size get_size() const { return Size{ get_width(), get_height() }; } + + /// Returns the pitch (in bytes per scanline). + int get_pitch() const; + + /** Retrieves the pixel ratio of this texture. + * \return The display pixel ratio set for this texture. + * A zero value implies that no pixel ratio has been set + */ + float get_pixel_ratio() const; + + /// Returns the device independent width of this texture. + float get_dip_width() const { return get_width() / get_pixel_ratio(); } + + /// Returns the device independent height of this texture. + float get_dip_height() const { return get_height() / get_pixel_ratio(); } + + /// Returns the device independent size of this texture. + Sizef get_dip_size() const { return Sizef{ get_dip_width(), get_dip_height() }; } + + /// \brief Returns a pointer to the beginning of the pixel buffer. + void *get_data(); + + const void *get_data() const; + + /// \brief Returns true if this pixel buffer is a GPU based one + bool is_gpu() const; + + template Type *get_data() { return reinterpret_cast(get_data()); } + template const Type *get_data() const { return reinterpret_cast(get_data()); } + + /// \brief Returns a pointer to the beginning of the pixel buffer as 8 bit data. + unsigned char *get_data_uint8() { return reinterpret_cast(get_data()); } + const unsigned char *get_data_uint8() const { return reinterpret_cast(get_data()); } + + /// \brief Returns a pointer to the beginning of the pixel buffer as 16 bit data. + unsigned short *get_data_uint16() { return reinterpret_cast(get_data()); } + const unsigned short *get_data_uint16() const { return reinterpret_cast(get_data()); } + + /// \brief Returns a pointer to the beginning of the pixel buffer as 32 bit data. + unsigned int *get_data_uint32() { return reinterpret_cast(get_data()); } + const unsigned int *get_data_uint32() const { return reinterpret_cast(get_data()); } + + /// \brief Returns a pointer to the beginning of a specific line. + void *get_line(int line) { unsigned char *d = get_data_uint8(); return d + line * get_pitch(); } + const void *get_line(int line) const { const unsigned char *d = get_data_uint8(); return d + line * get_pitch(); } + + /// \brief Returns a pointer to the beginning of a specific line as 8 bit data. + unsigned char *get_line_uint8(int line) { return reinterpret_cast(get_line(line)); } + const unsigned char *get_line_uint8(int line) const { return reinterpret_cast(get_line(line)); } + + /// \brief Returns a pointer to the beginning of a specific line as 16 bit data. + unsigned short *get_line_uint16(int line) { return reinterpret_cast(get_line(line)); } + const unsigned short *get_line_uint16(int line) const { return reinterpret_cast(get_line(line)); } + + /// \brief Returns a pointer to the beginning of a specific line as 32 bit data. + unsigned int *get_line_uint32(int line) { return reinterpret_cast(get_line(line)); } + const unsigned int *get_line_uint32(int line) const { return reinterpret_cast(get_line(line)); } + + /// \brief Returns true if format has an alpha channel + bool has_transparency() const; + + /// \brief Returns the number of bytes per pixel + /// + /// \return Bytes per pixel. Exception thrown if not available (hint, use is_compressed() ) + unsigned int get_bytes_per_pixel() const; + + /// \brief Returns the number of bytes per compression block + /// + /// \return Bytes per block. Exception thrown if not available (hint, use is_compressed() ) + unsigned int get_bytes_per_block() const; + + /// \brief Returns the size in bytes of the image data + /// + /// \return The data size + unsigned int get_data_size() const; + + /// \brief Returns the size in bytes of the image data + /// + /// \return The data size + static unsigned int get_data_size(const Size &size, TextureFormat texture_format); + + /// \brief Returns the number of bytes per pixel + /// + /// \return Bytes per pixel. Exception thrown if not available (hint, use is_compressed() ) + static unsigned int get_bytes_per_pixel(TextureFormat texture_format); + + /// \brief Returns the number of bytes per compression block + /// + /// \return Bytes per block. Exception thrown if not available (hint, use is_compressed() ) + static unsigned int get_bytes_per_block(TextureFormat texture_format); + + /// \brief Returns true if compressed + bool is_compressed() const; + + /// \brief Returns true if compressed + static bool is_compressed(TextureFormat texture_format); + + /// \brief Returns the pixel format + TextureFormat get_format() const; + + /// \brief Get Provider + /// + /// \return provider + PixelBufferProvider *get_provider() const; + + /// \brief Return color of pixel at the specified coordinates. + Colorf get_pixel(int x, int y); + + /// \brief Maps buffer into system memory. + void lock(GraphicContext &gc, BufferAccess access); + + /// \brief Unmaps element buffer. + void unlock(); + + /// \brief Uploads data to buffer. + void upload_data(GraphicContext &gc, const Rect &dest_rect, const void *data); + + /// \brief Copy source pixel buffer into this buffer, doing a format conversion if needed + /// + /// \param source Source pixel buffer. + void set_image(const PixelBuffer &source); + + /// \brief Copy source pixel buffer into this buffer, doing a format conversion if needed + /// + /// \param source Source pixel buffer. + void set_image(const PixelBuffer &source, PixelConverter &converter); + + /// \brief Copy source pixel buffer into this buffer, doing a format conversion if needed + /// + /// \param source Source pixel buffer. + /// \param dest_rect Destination position for copy. + /// \param src_rect Source rectangle for copy. + void set_subimage(const PixelBuffer &source, const Point &dest_pos, const Rect &src_rect); + + /// \brief Copy source pixel buffer into this buffer, doing a format conversion if needed + /// + /// \param source Source pixel buffer. + /// \param dest_rect Destination position for copy. + /// \param src_rect Source rectangle for copy. + void set_subimage(const PixelBuffer &source, const Point &dest_pos, const Rect &src_rect, PixelConverter &converter); + + /// \brief Downloads the pixel buffer to CPU memory + /// + /// If the pixel buffer is already in CPU memory the function returns the current pixel buffer. + PixelBuffer to_cpu(GraphicContext &gc); + + /// \brief Uploads the pixel buffer to GPU memory + /// + /// If the pixel buffer is already in GPU memory the function returns the current pixel buffer. + PixelBuffer to_gpu(GraphicContext &gc); + + /// \brief Converts current buffer to a new pixel format and returns the result. + PixelBuffer to_format(TextureFormat texture_format) const; + + /// \brief Converts current buffer to a new pixel format and returns the result. + PixelBuffer to_format(TextureFormat texture_format, PixelConverter &converter) const; + + /// \brief Flip the entire image vertically (turn it upside down) + void flip_vertical(); + + /// \brief Multiply the RGB components by the Alpha component + /// + /// This is useful with certain blending functions + void premultiply_alpha(); + + /// \brief Multiply the RGB components by gamma value + /// + /// Calling this function with 2.2 gamma converts a sRGB image into linear space. + /// To convert from linear to sRGB use 1.0/2.2 + void premultiply_gamma(float gamma); + + /// Sets the display pixel ratio for this texture. + void set_pixel_ratio(float ratio); + + private: + std::shared_ptr impl; + friend class PixelBuffer_Impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer_help.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer_help.h new file mode 100644 index 0000000..ab45917 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer_help.h @@ -0,0 +1,47 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +#include "pixel_buffer.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Pixel data helper class + class PixelBufferHelp + { + public: + /// \brief Add a border around a pixelbuffer, duplicating the edge pixels + static PixelBuffer add_border(const PixelBuffer &pb, int border_size, const Rect &rect); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer_lock.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer_lock.h new file mode 100644 index 0000000..29744f5 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer_lock.h @@ -0,0 +1,185 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Mark Page +*/ + +#pragma once + +#include +#include "../../Core/System/exception.h" +#include "../../Core/Math/vec2.h" +#include "../../Core/Math/vec3.h" +#include "../../Core/Math/vec4.h" +#include "../../Core/Math/half_float_vector.h" +#include "pixel_buffer.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief PixelBuffer locking helper. + /// + template + class PixelBufferLock + { + public: + /// \brief Constructs a gpu pixel buffer lock + PixelBufferLock(GraphicContext &gc, PixelBuffer &pixel_buffer, BufferAccess access, bool lock_pixelbuffer = true) + : pixel_buffer(pixel_buffer), lock_count(0), pitch(0), data(nullptr) + { + width = pixel_buffer.get_width(); + height = pixel_buffer.get_height(); + if (lock_pixelbuffer) + lock(gc, access); + } + + /// \brief Constructs a system pixel buffer lock + PixelBufferLock(PixelBuffer &pixel_buffer, bool lock_pixelbuffer = true) + : pixel_buffer(pixel_buffer), lock_count(0), pitch(0), data(nullptr) + { + width = pixel_buffer.get_width(); + height = pixel_buffer.get_height(); + if (lock_pixelbuffer) + lock(); + } + + ~PixelBufferLock() + { + if (lock_count > 0 && !(pixel_buffer.is_null())) + pixel_buffer.unlock(); + lock_count = 0; + } + + /// \brief Returns the amounts of recursive pixel_buffer locks performed by this section. + int get_lock_count() const + { + return lock_count; + } + + Type *get_data() { return reinterpret_cast(data); } + Type *get_row(int y) { return reinterpret_cast(data + pitch * y); } + Type &get_pixel(int x, int y) { return *(reinterpret_cast(data + pitch * y) + x); } + int get_width() const { return width; } + int get_height() const { return height; } + int get_pitch() const { return pitch; } + + /// \brief Lock the gpu pixel_buffer. + void lock(GraphicContext &gc, BufferAccess access) + { + if (!pixel_buffer.is_null()) + { + pixel_buffer.lock(gc, access); + data = static_cast(pixel_buffer.get_data()); + pitch = pixel_buffer.get_pitch(); + } + lock_count++; + } + + /// \brief Lock the system pixel_buffer. + void lock() + { + if (!pixel_buffer.is_null()) + { + if (pixel_buffer.is_gpu()) + throw Exception("Incorrect PixelBufferLock constructor called with a GPU pixelbuffer"); + + // lock() does not do anything on system pixel buffers, so we do not call it + + data = static_cast(pixel_buffer.get_data()); + pitch = pixel_buffer.get_pitch(); + } + lock_count++; + } + + /// \brief Unlock pixel_buffer. + void unlock() + { + if (lock_count <= 0) + return; + + if (!pixel_buffer.is_null()) + { + pixel_buffer.unlock(); + pitch = 0; + data = 0; + } + lock_count--; + } + + private: + PixelBuffer pixel_buffer; + int lock_count; + int width; + int height; + int pitch; + unsigned char *data; + }; + + typedef PixelBufferLock PixelBufferLock1ub; + typedef PixelBufferLock PixelBufferLock2ub; + typedef PixelBufferLock PixelBufferLock3ub; + typedef PixelBufferLock PixelBufferLock4ub; + typedef PixelBufferLock PixelBufferLock1us; + typedef PixelBufferLock PixelBufferLock2us; + typedef PixelBufferLock PixelBufferLock3us; + typedef PixelBufferLock PixelBufferLock4us; + typedef PixelBufferLock PixelBufferLock1ui; + typedef PixelBufferLock PixelBufferLock2ui; + typedef PixelBufferLock PixelBufferLock3ui; + typedef PixelBufferLock PixelBufferLock4ui; + + typedef PixelBufferLock PixelBufferLock1b; + typedef PixelBufferLock PixelBufferLock2b; + typedef PixelBufferLock PixelBufferLock3b; + typedef PixelBufferLock PixelBufferLock4b; + typedef PixelBufferLock PixelBufferLock1s; + typedef PixelBufferLock PixelBufferLock2s; + typedef PixelBufferLock PixelBufferLock3s; + typedef PixelBufferLock PixelBufferLock4s; + typedef PixelBufferLock PixelBufferLock1i; + typedef PixelBufferLock PixelBufferLock2i; + typedef PixelBufferLock PixelBufferLock3i; + typedef PixelBufferLock PixelBufferLock4i; + + typedef PixelBufferLock PixelBufferLock1hf; + typedef PixelBufferLock PixelBufferLock2hf; + typedef PixelBufferLock PixelBufferLock3hf; + typedef PixelBufferLock PixelBufferLock4hf; + + typedef PixelBufferLock PixelBufferLock1f; + typedef PixelBufferLock PixelBufferLock2f; + typedef PixelBufferLock PixelBufferLock3f; + typedef PixelBufferLock PixelBufferLock4f; + typedef PixelBufferLock PixelBufferLock1d; + typedef PixelBufferLock PixelBufferLock2d; + typedef PixelBufferLock PixelBufferLock3d; + typedef PixelBufferLock PixelBufferLock4d; + + typedef PixelBufferLock PixelBufferLockAny; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer_set.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer_set.h new file mode 100644 index 0000000..8df29e1 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_buffer_set.h @@ -0,0 +1,96 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../../Core/Math/rect.h" +#include "../Render/texture.h" +#include "texture_format.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class PixelBuffer; + class PixelBufferSet_Impl; + + /// \brief Set of images that combined form a complete texture + class PixelBufferSet + { + public: + /// \brief Constructs a null instance + PixelBufferSet(); + + /// \brief Constructs an image set of the specified dimensions type and internal format + PixelBufferSet(TextureDimensions dimensions, TextureFormat format, int width, int height = 1, int slices = 1); + + /// \brief Constructs an image set with a single image using the dimensions and internal format of the pixel buffer + PixelBufferSet(const PixelBuffer &image); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns the texture dimensions used by the image set + TextureDimensions get_dimensions() const; + + /// \brief Returns the internal texture format used by the image + TextureFormat get_format() const; + + /// \brief Returns the width of the image + int get_width() const; + + /// \brief Returns the height of the image + int get_height() const; + + /// \brief Returns the number of depth/array/cube slices in the set + int get_slice_count() const; + + /// \brief Returns the lowest mip level specified in the set + int get_base_level() const; + + /// \brief Returns the highest mip level specified in the set + int get_max_level() const; + + /// \brief Returns the pixel buffer for a specific slice and level + PixelBuffer get_image(int slice, int level); + + /// \brief Set the pixel buffer to be used for the specified slice and level + void set_image(int slice, int level, const PixelBuffer &image); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_converter.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_converter.h new file mode 100644 index 0000000..c7cd8f4 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/pixel_converter.h @@ -0,0 +1,104 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include +#include "../../Core/Math/vec4.h" +#include "texture_format.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class PixelConverter_Impl; + + /// \brief Low level pixel format converter class. + class PixelConverter + { + public: + /// \brief Constructs a pixel format converter + PixelConverter(); + ~PixelConverter(); + + /// \brief Returns the premultiply alpha setting + bool get_premultiply_alpha() const; + + /// \brief Returns the flip vertical setting + bool flip_vertical() const; + + /// \brief Returns the gamma setting + float get_gamma() const; + + /// \brief Returns the input channel used for each output channel + Vec4i get_swizzle() const; + + /// \brief Returns the JPEG JFIF YCrCb input setting + bool get_input_is_ycrcb() const; + + /// \brief Returns the JPEG JFIF YCrCb output setting + bool get_output_is_ycrcb() const; + + /// \brief Set the premultiply alpha setting + /// + /// This defaults to off. + void set_premultiply_alpha(bool enable); + + /// \brief Set the flip vertical setting + /// + /// This defaults to off. + void set_flip_vertical(bool enable); + + /// \brief Set the gamma applied when converting + /// + /// This defaults to 1.0 (off). + void set_gamma(float gamma); + + /// \brief Set the input channel used for each output channel + /// + /// Values 0-3 accepted. 0 = red, 1 = green, 2 = blue, 3 = alpha. + void set_swizzle(int red_source, int green_source, int blue_source, int alpha_source); + void set_swizzle(const Vec4i &swizzle); + + /// \brief Converts from JPEG JFIF YCrCb + void set_input_is_ycrcb(bool enable); + + /// \brief Converts to JPEG JFIF YCrCb + void set_output_is_ycrcb(bool enable); + + /// \brief Convert some pixel data + void convert(void *output, int output_pitch, TextureFormat output_format, const void *input, int input_pitch, TextureFormat input_format, int width, int height); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/texture_format.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/texture_format.h new file mode 100644 index 0000000..3061fb5 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Image/texture_format.h @@ -0,0 +1,141 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Texture format. + enum TextureFormat + { + // Standard ClanLib sized formats (most common listed first) + tf_rgba8, + tf_rgb8, + tf_bgra8, + tf_bgr8, + + // sized internal format + tf_stencil_index1, // For RenderBuffer ? + tf_stencil_index4, // For RenderBuffer ? + tf_stencil_index8, // For RenderBuffer ? + tf_stencil_index16, // For RenderBuffer ? + + tf_r8, + tf_r8_snorm, + tf_r16, + tf_r16_snorm, + tf_rg8, + tf_rg8_snorm, + tf_rg16, + tf_rg16_snorm, + tf_r3_g3_b2, + tf_rgb4, + tf_rgb5, + //tf_rgb8, (listed earlier) + tf_rgb8_snorm, + tf_rgb10, + tf_rgb12, + tf_rgb16, + tf_rgb16_snorm, + tf_rgba2, + tf_rgba4, + tf_rgb5_a1, + //tf_rgba8, (listed earlier) + tf_rgba8_snorm, + tf_rgb10_a2, + tf_rgba12, + tf_rgba16, + tf_rgba16_snorm, + tf_srgb8, + tf_srgb8_alpha8, + tf_r16f, + tf_rg16f, + tf_rgb16f, + tf_rgba16f, + tf_r32f, + tf_rg32f, + tf_rgb32f, + tf_rgba32f, + tf_r11f_g11f_b10f, + tf_rgb9_e5, + tf_r8i, + tf_r8ui, + tf_r16i, + tf_r16ui, + tf_r32i, + tf_r32ui, + tf_rg8i, + tf_rg8ui, + tf_rg16i, + tf_rg16ui, + tf_rg32i, + tf_rg32ui, + tf_rgb8i, + tf_rgb8ui, + tf_rgb16i, + tf_rgb16ui, + tf_rgb32i, + tf_rgb32ui, + tf_rgba8i, + tf_rgba8ui, + tf_rgba16i, + tf_rgba16ui, + tf_rgba32i, + tf_rgba32ui, + tf_depth_component16, + tf_depth_component24, + tf_depth_component32, + tf_depth_component32f, + tf_depth24_stencil8, + tf_depth32f_stencil8, + tf_compressed_red, + tf_compressed_rg, + tf_compressed_rgb, + tf_compressed_rgba, + tf_compressed_srgb, + tf_compressed_srgb_alpha, + tf_compressed_red_rgtc1, + tf_compressed_signed_red_rgtc1, + tf_compressed_rg_rgtc2, + tf_compressed_signed_rg_rgtc2, + tf_compressed_rgb_s3tc_dxt1, + tf_compressed_rgba_s3tc_dxt1, + tf_compressed_rgba_s3tc_dxt3, + tf_compressed_rgba_s3tc_dxt5, + tf_compressed_srgb_s3tc_dxt1, + tf_compressed_srgb_alpha_s3tc_dxt1, + tf_compressed_srgb_alpha_s3tc_dxt3, + tf_compressed_srgb_alpha_s3tc_dxt5 + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/dds_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/dds_provider.h new file mode 100644 index 0000000..e604d00 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/dds_provider.h @@ -0,0 +1,55 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../Image/pixel_buffer_set.h" +#include "../../Core/IOData/file_system.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Image_Providers clanDisplay Image Providers + /// \{ + + class FileSystem; + + /// \brief Image provider that can load Direct3D texture (.dds) files. + class DDSProvider + { + public: + /// \brief Called to load an image with this provider type. + /// + /// \param filename Name of the file to load. + /// \param directory Directory that file name is relative to. + static PixelBufferSet load(const std::string &filename, const FileSystem &file_system); + static PixelBufferSet load(const std::string &fullname); + static PixelBufferSet load(IODevice &file); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/jpeg_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/jpeg_provider.h new file mode 100644 index 0000000..8f3f4eb --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/jpeg_provider.h @@ -0,0 +1,86 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../Image/pixel_buffer.h" +#include "../../Core/IOData/file_system.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Image_Providers clanDisplay Image Providers + /// \{ + + class FileSystem; + + /// \brief Image provider that can load JPEG (.jpg) files. + class JPEGProvider + { + public: + /// \brief Called to load an image with this provider type. + /// + /// \param filename Name of the file to load. + /// \param directory Directory that file name is relative to. + static PixelBuffer load( + const std::string &filename, + const FileSystem &fs, + bool srgb = false); + + static PixelBuffer load( + const std::string &fullname, + bool srgb = false); + + static PixelBuffer load( + IODevice &file, + bool srgb = false); + + /// \brief Save the given PixelBuffer into a JPEG + /// + /// \param buffer The PixelBuffer to save, format doesn't matter its converted if needed + /// \param filename File name of JPEG. + /// \param directory Directory that the file name is relative to. + /// \param quality The quality level of the JPEG (0-100), 100 being best quality. + static void save( + PixelBuffer buffer, + const std::string &filename, + FileSystem &fs, + int quality = 85); + + static void save( + PixelBuffer buffer, + const std::string &fullname, + int quality = 85); + + static void save( + PixelBuffer buffer, + IODevice &file, + int quality = 85); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/png_output_description.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/png_output_description.h new file mode 100644 index 0000000..50ae147 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/png_output_description.h @@ -0,0 +1,151 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ + +#pragma once + +#include "../Image/pixel_buffer.h" +#include "../../Core/IOData/file_system.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Image_Providers clanDisplay Image Providers + /// \{ + + class FileSystem; + class PNGOutputDescription_Impl; + class DateTime; + + enum PNGColorType + { + png_color_type_gray, + png_color_type_gray_alpha, + png_color_type_palette, + png_color_type_rgb, + png_color_type_rgb_alpha, + png_color_mask_palette, + png_color_mask_color, + png_color_mask_alpha + }; + + enum PNGInterlaceType + { + png_interlace_none, + png_interlace_adam7 + }; + + enum PNGFilterMethod + { + png_filter_type_default, + png_intrapixel_differencing + }; + + enum PNGsRGBIntent + { + png_srgb_intent_saturation, + png_srgb_intent_perceptual, + png_srgb_intent_absolute, + png_srgb_intent_relative + }; + + enum PNGUnknownChunkLocation + { + png_before_plte, + png_before_idat, + png_after_idat + }; + + enum PNGOffsetUnitType + { + png_offset_pixel, + png_offset_micrometer + }; + + enum PNGResolutionUnitType + { + png_resolution_unknown, + png_resolution_meter + }; + + + class PNGOutputDescriptionPalette + { + public: + PNGOutputDescriptionPalette(); + + public: + void set_colors(const std::vector &palette_colors); + void set_key_color(const Color &color); + void set_tranparent_color_indexes(const std::vector &alpha_indexes); + + private: + std::vector colors; + bool use_keycolor; + }; + + + /// \brief Set PNG output options. Used with PNGProvider::save(). + class PNGOutputDescription + { + public: + /// \brief Create output description. + /// + /// \param bit_depth Number of bits per pixel. valid values are 1, 2, 4, 8, 16 - depending on color_type. + /// \param color_type Color mode of output image. + PNGOutputDescription(int bit_depth = 8, PNGColorType color_type = png_color_type_rgb_alpha); + + void add_palette(const PNGOutputDescriptionPalette &palette); + + void add_comment( + const std::string &comment, + std::string &keyword, // max 79 characters. + const std::string &lang, + const std::string &translated_keyword); + + void add_unknown_chunk(const std::string &name, const DataBuffer &chunk_data, PNGUnknownChunkLocation location); + + void set_background_color(const Color &background_color); + void set_chromacities(const Vec2f &white, const Vec2f &red, const Vec2f &green, const Vec2f &blue); + void set_chromacities_XYZ(const Vec3f &red, const Vec3f &green, const Vec3f &blue); + void set_key_color(const Color &color); + void set_filter_method(PNGFilterMethod filter); + void set_gamma(float gamma); + void set_icc_profile(const std::string &profile_name, const DataBuffer &profile_data); + void set_interlace_type(PNGInterlaceType type); + void set_modification_time(const DateTime &datetime); + void set_offset_from_screen_topleft(const Vec2i &offset, PNGOffsetUnitType offset_unit_type); + void set_physical_resolution(const Vec2i &resolution, PNGResolutionUnitType resolution_type); + void set_physical_scale(int scale_units, const Sized &pixel_size_in_scale_units); + void set_srgb_intent(PNGsRGBIntent intent); + void set_significant_bits(int num_bits); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/png_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/png_provider.h new file mode 100644 index 0000000..240c3ad --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/png_provider.h @@ -0,0 +1,80 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../Image/pixel_buffer.h" +#include "../../Core/IOData/file_system.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Image_Providers clanDisplay Image Providers + /// \{ + + class FileSystem; + + /// \brief Surface provider that can load PNG (.png) files. + class PNGProvider + { + public: + /// \brief Called to load an image with this provider type. + /// + /// \param name Name of the file to load. + /// \param directory Directory that file name is relative to. + static PixelBuffer load( + const std::string &filename, + const FileSystem &fs, + bool srgb = false); + + static PixelBuffer load( + const std::string &fullname, + bool srgb = false); + + /// \brief Load + /// + /// \param dev = IODevice + /// + /// \return Pixel Buffer + static PixelBuffer load(IODevice &dev, bool srgb = false); + + /// \brief Called to save a given PixelBuffer to a file + static void save( + PixelBuffer buffer, + const std::string &filename, + FileSystem &fs); + + static void save( + PixelBuffer buffer, + const std::string &fullname); + + /// \brief Save the given PixelBuffer to an output device. + static void save(PixelBuffer buffer, IODevice &iodev); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/provider_factory.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/provider_factory.h new file mode 100644 index 0000000..3034b9a --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/provider_factory.h @@ -0,0 +1,102 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include +#include "../../Core/IOData/file_system.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Image_Providers clanDisplay Image Providers + /// \{ + + class PixelBuffer; + class ImageProviderType; + + /// \brief Image Provider factory + class ImageProviderFactory + { + public: + /// \brief Attempts to load an image file from 'filename', using the provider identified by 'type'. + /// \return If the function fails to load the image, a null pixel buffer object is returned. + /// + ///

If the type is an empty string, it uses the extension of + /// the filename to determine what type it is.

+ ///

The virtual directory will be used as a the source.

+ static PixelBuffer try_load( + const std::string &filename, + const std::string &type = std::string(), + const FileSystem &fs = FileSystem(), + std::string *out_failure_reason = nullptr, + bool srgb = false); + + /// \brief Loads an image file from 'filename', using the provider + /// \brief identified by 'type'. + /**

If the type is an empty string, it uses the extension of + the filename to determine what type it is.

+

The virtual directory will be used as a the source.

*/ + static PixelBuffer load( + const std::string &filename, + const FileSystem &fs, + const std::string &type = std::string(), + bool srgb = false); + + static PixelBuffer load( + const std::string &fullname, + const std::string &type = std::string(), + bool srgb = false); + + static PixelBuffer load( + IODevice &file, + const std::string &type, + bool srgb = false); + + /// \brief Saves the given PixelBuffer to the file given by 'filename'. + /**

If the type is an empty string, it uses the extension of the + filename to determine what type it is

*/ + static void save( + PixelBuffer buffer, + const std::string &filename, + FileSystem &fs, + const std::string &type = std::string()); + + static void save( + PixelBuffer buffer, + const std::string &fullname, + const std::string &type = std::string()); + + static void save( + PixelBuffer buffer, + IODevice &file, + const std::string &type); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/provider_type.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/provider_type.h new file mode 100644 index 0000000..ae1d5b1 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/provider_type.h @@ -0,0 +1,73 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../Image/pixel_buffer.h" +#include "../../Core/IOData/file_system.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Image_Providers clanDisplay Image Providers + /// \{ + + class PixelBuffer; + + /// \brief Provider type + class ImageProviderType + { + public: + /// \brief Registers a provider type in the ImageProviderFactory. + ImageProviderType(const std::string &type); + + /// \brief Unregisters a provider type in the ImageProviderFactory. + virtual ~ImageProviderType(); + + /// \brief Called to load an image with this provider type. + virtual PixelBuffer load( + const std::string &filename, + const FileSystem &fs, + bool srgb) = 0; + + virtual PixelBuffer load( + IODevice &file, + bool srgb) = 0; + + /// \brief Called to save a given PixelBuffer to a file + virtual void save( + PixelBuffer buffer, + const std::string &filename, + FileSystem &fs) = 0; + + virtual void save( + PixelBuffer buffer, + IODevice &file) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/provider_type_register.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/provider_type_register.h new file mode 100644 index 0000000..7d4357e --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/provider_type_register.h @@ -0,0 +1,83 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../../Core/IOData/file_system.h" +#include "provider_type.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Image_Providers clanDisplay Image Providers + /// \{ + + /// \brief Class template to register a provider type. + /// + template + class ProviderType_Register : public ImageProviderType + { + public: + /// \brief Registers provider type in the ProviderFactory. + ProviderType_Register(const std::string &type) : ImageProviderType(type) + { + } + + /// \brief Called to load an image with this provider type. + virtual PixelBuffer load( + const std::string &filename, + const FileSystem &fs, + bool srgb) override + { + return ProviderClass::load(filename, fs, srgb); + } + + virtual PixelBuffer load( + IODevice &file, + bool srgb) override + { + return ProviderClass::load(file, srgb); + } + + virtual void save( + PixelBuffer buffer, + const std::string &filename, + FileSystem &fs) override + { + ProviderClass::save(buffer, filename, fs); + } + + virtual void save( + PixelBuffer buffer, + IODevice &file) override + { + ProviderClass::save(buffer, file); + } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/targa_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/targa_provider.h new file mode 100644 index 0000000..e3bf172 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ImageProviders/targa_provider.h @@ -0,0 +1,77 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../Image/pixel_buffer.h" +#include "../../Core/IOData/file_system.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Image_Providers clanDisplay Image Providers + /// \{ + + class FileSystem; + + /// \brief Surface provider that can load targa (.tga) files. + class TargaProvider + { + public: + /// \brief Called to load an image with this provider type. + /// + /// \param name Name of the file to load. + /// \param directory Directory that file name is relative to. + static PixelBuffer load( + const std::string &filename, + const FileSystem &fs, + bool srgb = false); + + static PixelBuffer load( + const std::string &fullname, + bool srgb = false); + + static PixelBuffer load( + IODevice &file, + bool srgb = false); + + static void save( + PixelBuffer buffer, + const std::string &filename, + FileSystem &fs); + + static void save( + PixelBuffer buffer, + const std::string &fullname); + + static void save( + PixelBuffer buffer, + IODevice &file); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/blend_state.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/blend_state.h new file mode 100644 index 0000000..409df81 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/blend_state.h @@ -0,0 +1,66 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class GraphicContext; + class BlendStateDescription; + class BlendStateProvider; + + /// \brief Blend state setup. + class BlendState + { + public: + /// \brief Constructs a null instance. + BlendState(); + + /// \brief Constructs a Texture + /// + /// \param context = Graphic context + /// \param desc = Blend state description + BlendState(GraphicContext &context, const BlendStateDescription &desc); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !provider; } + explicit operator bool() const { return bool(provider); } + + BlendStateProvider *get_provider() const; + + private: + std::shared_ptr provider; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/blend_state_description.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/blend_state_description.h new file mode 100644 index 0000000..045e675 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/blend_state_description.h @@ -0,0 +1,83 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "graphic_context.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class BlendStateDescription_Impl; + + /// \brief Blend state description. + class BlendStateDescription + { + public: + BlendStateDescription(); + BlendStateDescription clone() const; + + static BlendStateDescription blend(bool src_premultiplied, bool dest_premultiplied = true); + static BlendStateDescription opaque(); + + bool is_blending_enabled() const; + void get_blend_equation(BlendEquation &out_color, BlendEquation &out_alpha) const; + void get_blend_function(BlendFunc &out_src, BlendFunc &out_dest, BlendFunc &out_src_alpha, BlendFunc &out_dest_alpha) const; + void get_color_write(bool &out_red, bool &out_green, bool &out_blue, bool &out_alpha) const; + bool is_logic_op_enabled() const; + LogicOp get_logic_op() const; + + /// \brief Enable/Disable blending + void enable_blending(bool value); + + /// \brief Set the constant color used in the blend equations + void set_blend_equation(BlendEquation color, BlendEquation alpha); + + /// \brief Set the blend functions + void set_blend_function(BlendFunc src, BlendFunc dest, BlendFunc src_alpha, BlendFunc dest_alpha); + + /// \brief Enable/disable writing to the color buffer + void enable_color_write(bool red, bool green, bool blue, bool alpha); + + /// \brief Enable/disable logic op. (clanGL only) + void enable_logic_op(bool enabled); + + /// \brief Set logic operation. (clanGL only) + void set_logic_op(LogicOp op); + + bool operator==(const BlendStateDescription &other) const; + bool operator<(const BlendStateDescription &other) const; + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/depth_stencil_state.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/depth_stencil_state.h new file mode 100644 index 0000000..9ef59d1 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/depth_stencil_state.h @@ -0,0 +1,66 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class GraphicContext; + class DepthStencilStateDescription; + class DepthStencilStateProvider; + + /// \brief DepthStencil state setup. + class DepthStencilState + { + public: + /// \brief Constructs a null instance. + DepthStencilState(); + + /// \brief Constructs a Texture + /// + /// \param context = Graphic context + /// \param desc = DepthStencil state description + DepthStencilState(GraphicContext &context, const DepthStencilStateDescription &desc); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !provider; } + explicit operator bool() const { return bool(provider); } + + DepthStencilStateProvider *get_provider() const; + + private: + std::shared_ptr provider; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/depth_stencil_state_description.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/depth_stencil_state_description.h new file mode 100644 index 0000000..ae1e092 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/depth_stencil_state_description.h @@ -0,0 +1,101 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "graphic_context.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class DepthStencilStateDescription_Impl; + + /// \brief DepthStencil state description. + class DepthStencilStateDescription + { + public: + DepthStencilStateDescription(); + DepthStencilStateDescription clone() const; + + bool is_stencil_test_enabled() const; + void get_stencil_compare_front(CompareFunction &out_front, int &out_front_ref, int &out_front_mask) const; + void get_stencil_compare_back(CompareFunction &out_back, int &out_back_ref, int &out_back_mask) const; + void get_stencil_write_mask(unsigned char &out_front_facing_mask, unsigned char &out_back_facing_mask) const; + void get_stencil_op_front(StencilOp &out_fail_front, StencilOp &out_pass_depth_fail_front, StencilOp &out_pass_depth_pass_front) const; + void get_stencil_op_back(StencilOp &out_fail_back, StencilOp &out_pass_depth_fail_back, StencilOp &out_pass_depth_pass_back) const; + + bool is_depth_test_enabled() const; + bool is_depth_write_enabled() const; + CompareFunction get_depth_compare_function() const; + + /// \brief Enables/disables stencil testing. + void enable_stencil_test(bool enabled); + + /// \brief Set stencil compare function. + void set_stencil_compare_front(CompareFunction front, int front_ref, int front_mask); + + /// \brief Set stencil compare function. + void set_stencil_compare_back(CompareFunction back, int back_ref, int back_mask); + + /// \brief Set stencil write masks. + void set_stencil_write_mask(unsigned char front_facing_mask, unsigned char back_facing_mask); + + /// \brief Set stencil operations. + /// + /// Set stencil failed test operations. + /// Set stencil passed test operations. + /// Set stencil passed depth test but failed stencil test operations. + void set_stencil_op_front(StencilOp fail_front, StencilOp pass_depth_fail_front, StencilOp pass_depth_pass_front); + + /// \brief Set stencil operations. + /// + /// Set stencil failed test operations. + /// Set stencil passed test operations. + /// Set stencil passed depth test but failed stencil test operations. + void set_stencil_op_back(StencilOp fail_back, StencilOp pass_depth_fail_back, StencilOp pass_depth_pass_back); + + /// \brief Enables/disables depth testing. + void enable_depth_test(bool enabled); + + /// \brief Enables/disables depth writing. + void enable_depth_write(bool enabled); + + /// \brief Set depth test function. + void set_depth_compare_function(CompareFunction func); + + bool operator==(const DepthStencilStateDescription &other) const; + bool operator<(const DepthStencilStateDescription &other) const; + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/element_array_buffer.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/element_array_buffer.h new file mode 100644 index 0000000..d396f97 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/element_array_buffer.h @@ -0,0 +1,99 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "vertex_array_buffer.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class GraphicContext; + class TransferBuffer; + class ElementArrayBufferProvider; + class ElementArrayBuffer_Impl; + + /// \brief Element Array Buffer + class ElementArrayBuffer + { + public: + /// \brief Constructs a null instance. + ElementArrayBuffer(); + + /// \brief Constructs a ElementArrayBuffer + /// + /// \param gc = Graphic Context + /// \param size = value + /// \param usage = Buffer Usage + ElementArrayBuffer(GraphicContext &gc, int size, BufferUsage usage = usage_static_draw); + + /// \brief Constructs a ElementArrayBuffer + /// + /// \param gc = Graphic Context + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + ElementArrayBuffer(GraphicContext &gc, const void *data, int size, BufferUsage usage = usage_static_draw); + + virtual ~ElementArrayBuffer(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Get Provider + /// + /// \return provider + ElementArrayBufferProvider *get_provider() const; + + /// \brief Handle comparison operator. + bool operator==(const ElementArrayBuffer &other) const; + + /// \brief Uploads data to element array buffer. + /// + /// The size specified must match the size of the buffer and is only included to help guard against buffer overruns. + void upload_data(GraphicContext &gc, const void *data, int size); + + /// \brief Copies data from transfer buffer + void copy_from(GraphicContext &gc, TransferBuffer &buffer, int dest_pos = 0, int src_pos = 0, int size = -1); + + /// \brief Copies data to transfer buffer + void copy_to(GraphicContext &gc, TransferBuffer &buffer, int dest_pos = 0, int src_pos = 0, int size = -1); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/element_array_vector.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/element_array_vector.h new file mode 100644 index 0000000..0ff6b62 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/element_array_vector.h @@ -0,0 +1,109 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "element_array_buffer.h" +#include "transfer_vector.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Element Array Vector + /// + template + class ElementArrayVector : public ElementArrayBuffer + { + public: + /// \brief Constructs a null instance. + ElementArrayVector() + { + } + + /// \brief Constructs a ElementArrayBuffer + /// + /// \param gc = Graphic Context + /// \param size = value + /// \param usage = Buffer Usage + ElementArrayVector(GraphicContext &gc, int size, BufferUsage usage = usage_static_draw) + : ElementArrayBuffer(gc, size * sizeof(Type), usage) + { + } + + /// \brief Constructs a ElementArrayBuffer + /// + /// \param gc = Graphic Context + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + ElementArrayVector(GraphicContext &gc, Type *data, int size, BufferUsage usage = usage_static_draw) + : ElementArrayBuffer(gc, data, size * sizeof(Type), usage) + { + } + + ElementArrayVector(GraphicContext &gc, const std::vector &data, BufferUsage usage = usage_static_draw) + : ElementArrayBuffer(gc, data.empty() ? (Type*)0 : &data[0], data.size() * sizeof(Type), usage) + { + } + + /// \brief Uploads data to element array buffer. + /// + /// The size specified must match the size of the buffer and is only included to help guard against buffer overruns. + void upload_data(GraphicContext &gc, const Type *data, int size) + { + ElementArrayBuffer::upload_data(gc, data, size * sizeof(Type)); + } + + /// \brief Uploads data to element array buffer. + void upload_data(GraphicContext &gc, const std::vector &data) + { + if (!data.empty()) + ElementArrayBuffer::upload_data(gc, &data[0], data.size() * sizeof(Type)); + } + + /// \brief Copies data from transfer buffer + void copy_from(GraphicContext &gc, TransferVector &buffer, int dest_pos = 0, int src_pos = 0, int size = -1) + { + if (size != -1) + size = size * sizeof(Type); + ElementArrayBuffer::copy_from(gc, buffer, dest_pos * sizeof(Type), src_pos * sizeof(Type), size); + } + + /// \brief Copies data to transfer buffer + void copy_to(GraphicContext &gc, TransferVector &buffer, int dest_pos = 0, int src_pos = 0, int size = -1) + { + if (size != -1) + size = size * sizeof(Type); + ElementArrayBuffer::copy_to(gc, buffer, dest_pos * sizeof(Type), src_pos * sizeof(Type), size); + } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/frame_buffer.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/frame_buffer.h new file mode 100644 index 0000000..4d9a145 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/frame_buffer.h @@ -0,0 +1,203 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class Size; + class Rect; + class Texture1D; + class Texture1DArray; + class Texture2D; + class Texture2DArray; + class Texture3D; + class TextureCube; + class RenderBuffer; + class GraphicContext; + class FrameBufferProvider; + class FrameBuffer_Impl; + + /// \brief Texture Subtype + enum TextureSubtype + { + subtype_cube_map_positive_x, + subtype_cube_map_negative_x, + subtype_cube_map_positive_y, + subtype_cube_map_negative_y, + subtype_cube_map_positive_z, + subtype_cube_map_negative_z + }; + + /// \brief Framebuffer bind target. + enum FrameBufferBindTarget + { + framebuffer_draw, + framebuffer_read + }; + + /// \brief Frame-buffer object class. + class FrameBuffer + { + public: + /// \brief Constructs a null instance. + FrameBuffer(); + + /// \brief Constructs a FrameBuffer + /// + /// By default, the bind target is set to framebuffer_draw. See set_bind_target() + /// + /// \param context = Graphic Context + FrameBuffer(GraphicContext &context); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Get Provider + /// + /// \return provider + FrameBufferProvider *get_provider() const; + + /// \brief Get the minumum size of all the frame buffer attachments + /// + /// \return size + Size get_size() const; + + /// \brief Get the bind target of the framebuffer + /// + /// \return The bind target + FrameBufferBindTarget get_bind_target() const; + + /// \brief Equality operator + bool operator==(const FrameBuffer &other) const; + + /// \brief Attach color buffer + /// + /// \param attachment_index = value + /// \param render_buffer = Render Buffer + void attach_color(int attachment_index, const RenderBuffer &render_buffer); + + /// \brief Attach color buffer + /// + /// \param attachment_index = value + /// \param texture = Texture + /// \param level = value + void attach_color(int attachment_index, const Texture1D &texture, int level = 0); + + /// \brief Attach color buffer + /// + /// \param attachment_index = value + /// \param texture = Texture + /// \param array_index = value + /// \param level = value + void attach_color(int attachment_index, const Texture1DArray &texture, int array_index = -1, int level = 0); + + /// \brief Attach color buffer + /// + /// \param attachment_index = value + /// \param texture = Texture + /// \param level = value + void attach_color(int attachment_index, const Texture2D &texture, int level = 0); + + /// \brief Attach color buffer + /// + /// \param attachment_index = value + /// \param texture = Texture + /// \param array_index = value + /// \param level = value + void attach_color(int attachment_index, const Texture2DArray &texture, int array_index = -1, int level = 0); + + /// \brief Attach color buffer + /// + /// \param attachment_index = value + /// \param texture = Texture + /// \param depth = value + /// \param level = value + void attach_color(int attachment_index, const Texture3D &texture, int depth, int level = 0); + + /// \brief Attach color buffer + /// + /// \param attachment_index = value + /// \param texture = Texture + /// \param subtype = Texture Subtype + /// \param level = value + /// \param zoffset = value + void attach_color(int attachment_index, const TextureCube &texture, TextureSubtype subtype, int level = 0); + + /// \brief Detach color buffer + /// + /// \param attachment_index = value + /// \param texture = Texture + /// \param level = value + /// \param zoffset = value + void detach_color(int attachment_index); + + void attach_stencil(const RenderBuffer &render_buffer); + void attach_stencil(const Texture2D &texture, int level = 0); + void attach_stencil(const TextureCube &texture, TextureSubtype subtype, int level = 0); + void detach_stencil(); + + void attach_depth(const RenderBuffer &render_buffer); + void attach_depth(const Texture2D &texture, int level = 0); + void attach_depth(const TextureCube &texture, TextureSubtype subtype, int level = 0); + void detach_depth(); + + void attach_depth_stencil(const RenderBuffer &render_buffer); + void attach_depth_stencil(const Texture2D &texture, int level = 0); + void attach_depth_stencil(const TextureCube &texture, TextureSubtype subtype, int level = 0); + void detach_depth_stencil(); + + /// \brief Set the bind target of the framebuffer to either drawn to or read from. + /// + /// Detach existing textures and renderbuffers before setting a new bind target + /// + /// \param target = Target + void set_bind_target(FrameBufferBindTarget target); + + /** Retrieves the pixel ratio of this texture. + * \return The display pixel ratio set for this texture. + * A zero value implies that no pixel ratio has been set + */ + float get_pixel_ratio() const; + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/graphic_context.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/graphic_context.h new file mode 100644 index 0000000..b7c60fb --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/graphic_context.h @@ -0,0 +1,694 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +** Kenneth Gangstoe +*/ + +#pragma once + +#include "../2D/color.h" +#include "../Image/texture_format.h" +#include +#include "../../Core/Math/mat4.h" +#include "../../Core/Math/rect.h" +#include "../../Core/Signals/signal.h" +#include "primitives_array.h" +#include "frame_buffer.h" +#include "element_array_vector.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class Size; + class Texture; + class FrameBuffer; + class PixelBuffer; + class PrimitivesArray; + class Font; + class FontMetrics; + class GraphicContextProvider; + class GraphicContext_Impl; + class ProgramObject; + class Angle; + class RenderBatcher; + class FontProvider_Freetype; + class UniformBuffer; + class StorageBuffer; + class RasterizerState; + class BlendState; + class DepthStencilState; + + /// Polygon culling modes. + enum CullMode + { + cull_front, + cull_back, + cull_front_and_back + }; + + /// Polygon filling modes. + enum FillMode + { + fill_point, + fill_line, + fill_polygon + }; + + /// Front face modes. + enum FaceSide + { + face_clockwise, + face_counter_clockwise + }; + + /// Compare functions. + enum CompareFunction + { + compare_lequal, + compare_gequal, + compare_less, + compare_greater, + compare_equal, + compare_notequal, + compare_always, + compare_never + }; + + /// Stencil operations + enum StencilOp + { + stencil_keep, + stencil_zero, + stencil_replace, + stencil_incr, + stencil_decr, + stencil_invert, + stencil_incr_wrap, + stencil_decr_wrap + }; + + /// Drawing buffers. + enum DrawBuffer + { + buffer_none, + buffer_front_left, + buffer_front_right, + buffer_back_left, + buffer_back_right, + buffer_front, + buffer_back, + buffer_left, + buffer_right, + buffer_front_and_back + }; + + /// Logic Op + enum LogicOp + { + logic_clear, + logic_and, + logic_and_reverse, + logic_copy, + logic_and_inverted, + logic_noop, + logic_xor, + logic_or, + logic_nor, + logic_equiv, + logic_invert, + logic_or_reverse, + logic_copy_inverted, + logic_or_inverted, + logic_nand, + logic_set + }; + + /// Blending functions. + enum BlendFunc + { + /// source or destination (0, 0, 0, 0) + blend_zero, + + /// source or destination (1, 1, 1, 1) + blend_one, + + /// source (Rd, Gd, Bd, Ad) + blend_dest_color, + + /// destination (Rs, Gs, Bs, As) + blend_src_color, + + /// source (1, 1, 1, 1) - (Rd, Gd, Bd, Ad) + blend_one_minus_dest_color, + + /// destination (1, 1, 1, 1) - (Rs, Gs, Bs, As) + blend_one_minus_src_color, + + /// source or destination (As, As, As, As) + blend_src_alpha, + + /// source or destination (1, 1, 1, 1) - (As, As, As, As) + blend_one_minus_src_alpha, + + /// source or destination (Ad, Ad, Ad, Ad) + blend_dest_alpha, + + /// source or destination (1, 1, 1, 1) - (Ad, Ad, Ad, Ad) + blend_one_minus_dest_alpha, + + /// source (f, f, f, 1) - f = min(As, 1 - Ad) + blend_src_alpha_saturate, + + /// source or destination (Rc, Gc, Bc, Ac) + blend_constant_color, + + /// source or destination (1, 1, 1, 1) - (Rc, Gc, Bc, Ac) + blend_one_minus_constant_color, + + /// source or destination (Ac, Ac, Ac, Ac) + blend_constant_alpha, + + /// source or destination (1, 1, 1, 1) - (Ac, Ac, Ac, Ac) + blend_one_minus_constant_alpha + }; + + /// Blending equations. + enum BlendEquation + { + equation_add, + equation_subtract, + equation_reverse_subtract, + equation_min, + equation_max + }; + + /// Point Sprite Origin + enum PointSpriteOrigin + { + origin_upper_left, + origin_lower_left + }; + + /// Primitive types. + enum PrimitivesType + { + type_points, + type_line_strip, + type_line_loop, + type_lines, + type_triangle_strip, + type_triangle_fan, + type_triangles + }; + + /// Y axis direction for viewports, clipping rects, textures and render targets + enum TextureImageYAxis + { + y_axis_bottom_up, //!< OpenGL, origin is lower left with Y going upwards + y_axis_top_down //!< Direct3D, origin is upper left with Y going downwards + }; + + /// Standard Program + enum StandardProgram + { + program_color_only, + program_single_texture, + program_sprite, + program_path + }; + + /// Shader language used + enum ShaderLanguage + { + shader_glsl, + shader_hlsl, + shader_fixed_function, + num_shader_languages + }; + + /// Interface to drawing graphics. + class GraphicContext + { + public: + /// Constructs a null instance. + GraphicContext(); + + /** Constructs a new graphic context from a provider. + * \param provider = Graphic Context Provider + */ + GraphicContext(GraphicContextProvider *provider); + + ~GraphicContext(); + + /// Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// Throw an exception if this object is invalid. + void throw_if_null() const; + + /// Returns in what range clip space z values are clipped. + ClipZRange get_clip_z_range() const; + + /// Returns the Y axis direction for viewports, clipping rects, textures and render targets + TextureImageYAxis get_texture_image_y_axis() const; + + /// Returns the shader language used + ShaderLanguage get_shader_language() const; + + /** Returns the major version / feature level supported by the hardware. + * For an OpenGL target, this returns the major OpenGL version the driver supports. + * For a Direct3D target, this returns the major feature level. + */ + int get_major_version() const; + + /** Returns the minor version / feature level supported by the hardware. + * For an OpenGL target, this returns the minor OpenGL version the driver supports. + * For a Direct3D target, this returns the minor feature level. + */ + int get_minor_version() const; + + /** Returns `true` if the hardware supports compute shaders. + * This function will always returns true for OpenGL 4.3 or newer, or + * Direct3D 11.0 or newer. For Direct3D 10.0 and 10.1, the support for + * compute shaders is optional. + */ + bool has_compute_shader_support() const; + + /** Retrieves the texture selected in this context with an index number. + * \param index The texture index number to retrieve. [0 to n] + * \return The texture on the specified index. Use Texture::is_null() to + * determine whether the texture has been selected by the context. + */ + Texture get_texture(int index) const; + + /** Returns the textures currently selected in this context. + * \return A vector containing the selected textures. The vector may + * contain null (unselected) texture elements within it.. + */ + std::vector get_textures() const; + + /** Returns the currently selected write frame buffer. + * \return The frame buffer. Use frame_buffer.is_null() to determine if the frame buffer was not selected + */ + FrameBuffer get_write_frame_buffer() const; + + /// Returns the currently selected read frame buffer. + /// + /// \return The frame buffer. Use frame_buffer.is_null() to determine if the frame buffer was not selected + FrameBuffer get_read_frame_buffer() const; + + /// Returns the currently selected program object + ProgramObject get_program_object() const; + + /// Returns the current actual width of the context. + int get_width() const; + + /// Returns the current actual height of the context. + int get_height() const; + + /// Returns the current actual size of the context. + Size get_size() const; + + /// Retrieves the display pixel ratio of the context. + /// \seealso Resolution Independence + float get_pixel_ratio() const; + + /// Calculates the device independent width of the context. + /// \seealso Resolution Independence + float get_dip_width() const { return get_width() / get_pixel_ratio(); } + + /// Calculates the device independent height of the context. + /// \seealso Resolution Independence + float get_dip_height() const { return get_height() / get_pixel_ratio(); } + + /// Calculates the device independent dimensions of the context. + /// \seealso Resolution Independence + Sizef get_dip_size() const { return Sizef{ get_dip_width(), get_dip_height() }; } + + /** Retrieves the maximum size for a texture that this graphic context will + * allow. Size(0, 0) will be returned if there is no known limitation to + * the maximum texture size allowed for the context. + */ + Size get_max_texture_size() const; + + /// Returns the provider for this graphic context. + GraphicContextProvider *get_provider(); + + const GraphicContextProvider * get_provider() const; + + /// Create a new default graphic context compatible with this one + GraphicContext create() const; + + /// Create a new default graphic context with a frame buffer selected + GraphicContext create(FrameBuffer &buffer) const; + + /// Create a new default graphic context cloned with this one + GraphicContext clone() const; + + /// Return the content of the read buffer into a pixel buffer. + PixelBuffer get_pixeldata(const Rect& rect, TextureFormat texture_format = tf_rgba8, bool clamp = true); + + /// Return the content of the read buffer into a pixel buffer. + PixelBuffer get_pixeldata(TextureFormat texture_format = tf_rgba8, bool clamp = true); + + /** Returns `true` if this frame buffer object is owned by this graphic + * context. + * + * Frame buffer objects cannot be shared between graphic contexts. This + * function will verify if the frame buffer object belongs to this graphic + * context. + */ + bool is_frame_buffer_owner(const FrameBuffer &fb); + + /// Sets the current frame buffer. + void set_frame_buffer(const FrameBuffer &write_buffer); + void set_frame_buffer(const FrameBuffer &write_buffer, const FrameBuffer &read_buffer); + + /// Resets the current frame buffer to be the initial frame buffer. + void reset_frame_buffer(); + + /// Select uniform buffer into index + void set_uniform_buffer(int index, const UniformBuffer &buffer); + + /// Remove uniform buffer from index + void reset_uniform_buffer(int index); + + /// Select storage buffer into index + void set_storage_buffer(int index, const StorageBuffer &buffer); + + /// Remove storage buffer from index + void reset_storage_buffer(int index); + + /// Select texture into index. + /// + /// \param unit_index = 0 to x, the index of this texture + /// \param texture = The texture to select. This can be an empty texture Texture() + void set_texture(int unit_index, const Texture &texture); + + /// Select textures + /// + /// Only textures units from 0 to textures.size()-1 are set. + /// + /// \param textures = The texture to select (placed at unit_index 0 to texture.size()-1). These may contain null textures + void set_textures(std::vector &textures); + + /// Remove texture from index. + /// + /// \param unit_index = 0 to x, the index of the texture + void reset_texture(int unit_index); + + /// Remove all selected textures + void reset_textures(); + + /// Select texture image into index. + /// + /// \param unit_index = 0 to x, the index of this texture + /// \param texture = The texture to select. This can be an empty texture Texture() + void set_image_texture(int unit_index, const Texture &texture); + + /// Select texture images + /// + /// Only textures units from 0 to textures.size()-1 are set. + /// + /// \param textures = The texture to select (placed at unit_index 0 to texture.size()-1). These may contain null textures + void set_image_texture(std::vector &textures); + + /// Remove texture from index. + /// + /// \param unit_index = 0 to x, the index of the texture + void reset_image_texture(int unit_index); + + /// Remove all selected textures + void reset_image_textures(); + + /// Set active rasterizer state + void set_rasterizer_state(const RasterizerState &state); + + /// Set active blend state + void set_blend_state(const BlendState &state, const Colorf &blend_color = StandardColorf::white(), unsigned int sample_mask = 0xffffffff); + + /// Set active depth stencil state + void set_depth_stencil_state(const DepthStencilState &state, int stencil_ref = 0); + + /// Set active rasterizer state + void reset_rasterizer_state(); + + /// Set active blend state + void reset_blend_state(); + + /// Set active depth stencil state + void reset_depth_stencil_state(); + + /// Set active program object to the standard program specified. + void set_program_object(StandardProgram standard_program); + + /// Set active program object. + /// + /// \param program = Program to set + void set_program_object(const ProgramObject &program); + + /// Remove active program object. + void reset_program_object(); + + /// Returns true if this primitives array is owned by this graphic context. + /// + /// Primitive array objects cannot be shared between graphic contexts. This function verifies that the primitives array + /// belongs to this graphic context. + bool is_primitives_array_owner(const PrimitivesArray &primitives_array); + + /// Draw primitives on gc. + void draw_primitives(PrimitivesType type, int num_vertices, const PrimitivesArray &array); + + /// Set the primitives array on the gc. + void set_primitives_array(const PrimitivesArray &array); + + /// Draws primitives from the current assigned primitives array. + void draw_primitives_array(PrimitivesType type, int num_vertices); + + /// Draw primitives array + /// + /// \param type = Primitives Type + /// \param offset = value + /// \param num_vertices = value + void draw_primitives_array(PrimitivesType type, int offset, int num_vertices); + + /// Draw primitives array instanced + /// + /// \param type = Primitives Type + /// \param offset = value + /// \param num_vertices = value + /// \param instance_count = number of instances drawn + void draw_primitives_array_instanced(PrimitivesType type, int offset, int num_vertices, int instance_count); + + /// Sets current elements array buffer + void set_primitives_elements(ElementArrayBuffer &element_array); + + /// Sets current elements array buffer + template + void set_primitives_elements(ElementArrayVector &element_array) + { + set_primitives_elements((ElementArrayBuffer&)element_array); + } + + /// Draw primitives elements + /// + /// \param type = Primitives Type + /// \param count = value + /// \param indices_type = Vertex Attribute Data Type + /// \param offset = void + void draw_primitives_elements(PrimitivesType type, int count, VertexAttributeDataType indices_type, size_t offset = 0); + + /// Draw primitives elements instanced + /// + /// \param type = Primitives Type + /// \param count = value + /// \param indices_type = Vertex Attribute Data Type + /// \param offset = void + /// \param instance_count = number of instances drawn + void draw_primitives_elements_instanced(PrimitivesType type, int count, VertexAttributeDataType indices_type, size_t offset, int instance_count); + + /// Resets current elements array buffer + void reset_primitives_elements(); + + /// Draw primitives elements + /// + /// \param type = Primitives Type + /// \param count = value + /// \param element_array = Element Array Buffer + /// \param indices_type = Vertex Attribute Data Type + /// \param offset = void + void draw_primitives_elements(PrimitivesType type, int count, ElementArrayBuffer &element_array, VertexAttributeDataType indices_type, size_t offset = 0); + + /// Draw primitives elements + /// + /// \param type = Primitives Type + /// \param count = value + /// \param element_array = Element Array Buffer + /// \param indices_type = Vertex Attribute Data Type + /// \param offset = void + void draw_primitives_elements(PrimitivesType type, int count, ElementArrayVector &element_array, size_t offset = 0) + { + draw_primitives_elements(type, count, (ElementArrayBuffer&)element_array, type_unsigned_int, offset * sizeof(unsigned int)); + } + + /// Draw primitives elements + /// + /// \param type = Primitives Type + /// \param count = value + /// \param element_array = Element Array Buffer + /// \param indices_type = Vertex Attribute Data Type + /// \param offset = void + void draw_primitives_elements(PrimitivesType type, int count, ElementArrayVector &element_array, size_t offset = 0) + { + draw_primitives_elements(type, count, (ElementArrayBuffer&)element_array, type_unsigned_short, offset * sizeof(unsigned short)); + } + + /// Draw primitives elements + /// + /// \param type = Primitives Type + /// \param count = value + /// \param element_array = Element Array Buffer + /// \param indices_type = Vertex Attribute Data Type + /// \param offset = void + void draw_primitives_elements(PrimitivesType type, int count, ElementArrayVector &element_array, size_t offset = 0) + { + draw_primitives_elements(type, count, (ElementArrayBuffer&)element_array, type_unsigned_byte, offset * sizeof(unsigned char)); + } + + /// Draw primitives elements instanced + /// + /// \param type = Primitives Type + /// \param count = value + /// \param element_array = Element Array Buffer + /// \param indices_type = Vertex Attribute Data Type + /// \param offset = void + /// \param instance_count = number of instances drawn + void draw_primitives_elements_instanced(PrimitivesType type, int count, ElementArrayBuffer &element_array, VertexAttributeDataType indices_type, size_t offset, int instance_count); + + /// Draw primitives elements instanced + /// + /// \param type = Primitives Type + /// \param count = value + /// \param element_array = Element Array Buffer + /// \param indices_type = Vertex Attribute Data Type + /// \param offset = void + /// \param instance_count = number of instances drawn + void draw_primitives_elements_instanced(PrimitivesType type, int count, ElementArrayVector &element_array, size_t offset, int instance_count) + { + draw_primitives_elements_instanced(type, count, (ElementArrayBuffer&)element_array, type_unsigned_int, offset * sizeof(unsigned int), instance_count); + } + + /// Draw primitives elements instanced + /// + /// \param type = Primitives Type + /// \param count = value + /// \param element_array = Element Array Buffer + /// \param indices_type = Vertex Attribute Data Type + /// \param offset = void + /// \param instance_count = number of instances drawn + void draw_primitives_elements_instanced(PrimitivesType type, int count, ElementArrayVector &element_array, size_t offset, int instance_count) + { + draw_primitives_elements_instanced(type, count, (ElementArrayBuffer&)element_array, type_unsigned_short, offset * sizeof(unsigned short), instance_count); + } + + /// Draw primitives elements instanced + /// + /// \param type = Primitives Type + /// \param count = value + /// \param element_array = Element Array Buffer + /// \param indices_type = Vertex Attribute Data Type + /// \param offset = void + /// \param instance_count = number of instances drawn + void draw_primitives_elements_instanced(PrimitivesType type, int count, ElementArrayVector &element_array, size_t offset, int instance_count) + { + draw_primitives_elements_instanced(type, count, (ElementArrayBuffer&)element_array, type_unsigned_byte, offset * sizeof(unsigned char), instance_count); + } + + /// Reset the primitives arrays. + void reset_primitives_array(); + + /// Execute a compute shader. + void dispatch(int x = 1, int y = 1, int z = 1); + + /// Clears the whole context using the specified color. + void clear(const Colorf &color = StandardColorf::black()); + + /// Clear the stencil buffer + /// + /// \param value value to clear to. + void clear_stencil(int value = 0); + + /// Clear the depth buffer + /// + /// \param value: value to clear to. Range 0.0 - 1.0. + void clear_depth(float value = 0); + + /// Set the current clipping rectangle. + void set_scissor(const Rect &rect, TextureImageYAxis y_axis); + + /// Removes the set clipping rectangle + void reset_scissor(); + + /// Set the viewport to be used in user projection map mode. + /// + /// \param viewport = The viewport to set + void set_viewport(const Rectf &viewport); + + /// Set the specified viewport to be used in user projection map mode. + /// + /// \param index = The viewport index (0 to x) + /// \param viewport = The viewport to set + void set_viewport(int index, const Rectf &viewport); + + /// Specifies the depth range for all viewports + void set_depth_range(float n, float f); + + /// Specifies the depth range for the specified viewport + void set_depth_range(int viewport, float n, float f); + + /// Set used draw buffer. + void set_draw_buffer(DrawBuffer buffer); + + /// Flush the command buffer + void flush(); + + bool operator ==(const GraphicContext &other) const { return impl == other.impl; } + bool operator !=(const GraphicContext &other) const { return impl != other.impl; } + + private: + std::shared_ptr impl; + + friend class OpenGL; + }; + + const float pixelcenter_constant = 0.375f; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/occlusion_query.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/occlusion_query.h new file mode 100644 index 0000000..21d6e57 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/occlusion_query.h @@ -0,0 +1,84 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ + +#pragma once + +#include +#include "graphic_context.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class OcclusionQuery_Impl; + class GraphicContext; + class OcclusionQueryProvider; + + /// \brief Graphics occlusion query class. + class OcclusionQuery + { + public: + /// \brief Constructs a null instance. + OcclusionQuery(); + + /// \brief Constructs an occlusion query object. + OcclusionQuery(GraphicContext &context); + + virtual ~OcclusionQuery(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns the result of the occlusion query. + int get_result(); + + /// \brief Returns true if the GPU is ready to return the result. + bool is_result_ready(); + + /// \brief Get Provider + /// + /// \return provider + OcclusionQueryProvider *get_provider() const; + + /// \brief Start occlusion query. + void begin(); + + /// \brief Finish occlusion query. + void end(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/primitives_array.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/primitives_array.h new file mode 100644 index 0000000..b6db476 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/primitives_array.h @@ -0,0 +1,460 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +** Mark Page +** Kenneth Gangstoe +** +*/ + +#pragma once + +#include +#include "../../Core/Math/vec3.h" +#include "../2D/color.h" +#include "vertex_array_vector.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class GraphicContext; + class Colorf; + class Colorf; + class GraphicContext; + class PrimitivesArray_Impl; + class PrimitivesArrayProvider; + + #define cl_offsetof(s,m) (&(((s *)0)->m)) + + /// \brief Primitives array description. + enum VertexAttributeDataType + { + type_unsigned_byte, + type_unsigned_short, + type_unsigned_int, + type_byte, + type_short, + type_int, + type_float + }; + + /// \brief Primitives array description. + class PrimitivesArray + { + public: + /// \brief Construct a null instance + PrimitivesArray(); + + /// \brief Constructs a PrimitivesArray + /// + /// \param gc = Graphic Context + PrimitivesArray(GraphicContext &gc); + + ~PrimitivesArray(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns the target provider for the primitives array. + PrimitivesArrayProvider *get_provider() const; + + /// \brief Set attributes + /// + /// \param index = value + /// \param buffer = Vertex Array Buffer + /// \param size = value + /// \param type = Vertex Attribute Data Type + /// \param offset = void + /// \param stride = value + /// \param normalize = bool + void set_attributes(int index, VertexArrayBuffer &buffer, int size, VertexAttributeDataType type, size_t offset = 0, int stride = 0, bool normalize = false); + + void set_attributes(int index, VertexArrayVector &buffer, int size, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, size, type_unsigned_byte, 0, 0, normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, int size, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, size, type_byte, 0, 0, normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, int size, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, size, type_unsigned_short, 0, 0, normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, int size, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, size, type_short, 0, 0, normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, int size, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, size, type_unsigned_int, 0, 0, normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, int size, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, size, type_int, 0, 0, normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, int size, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, size, type_float, 0, 0, normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 1, type_unsigned_byte, 0, sizeof(unsigned char), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 1, type_byte, 0, sizeof(signed char), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 1, type_unsigned_short, 0, sizeof(unsigned short), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 1, type_short, 0, sizeof(signed short), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 1, type_unsigned_int, 0, sizeof(unsigned int), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 1, type_int, 0, sizeof(signed int), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 1, type_float, 0, sizeof(float), false); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 2, type_unsigned_byte, 0, sizeof(Vec2ub), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 2, type_byte, 0, sizeof(Vec2b), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 2, type_unsigned_short, 0, sizeof(Vec2us), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 2, type_short, 0, sizeof(Vec2s), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 2, type_unsigned_int, 0, sizeof(Vec2ui), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 2, type_int, 0, sizeof(Vec2i), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 2, type_float, 0, sizeof(Vec2f), false); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 3, type_unsigned_byte, 0, sizeof(Vec3ub), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 3, type_byte, 0, sizeof(Vec3b), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 3, type_unsigned_short, 0, sizeof(Vec3us), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 3, type_short, 0, sizeof(Vec3s), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 3, type_unsigned_int, 0, sizeof(Vec3ui), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 3, type_int, 0, sizeof(Vec3i), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 3, type_float, 0, sizeof(Vec3f), false); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_unsigned_byte, 0, sizeof(Vec4ub), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_byte, 0, sizeof(Vec4b), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_unsigned_short, 0, sizeof(Vec4us), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_short, 0, sizeof(Vec4s), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_unsigned_int, 0, sizeof(Vec4ui), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_int, 0, sizeof(Vec4i), normalize); + } + + void set_attributes(int index, VertexArrayVector &buffer) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_float, 0, sizeof(Vec4f), false); + } + + void set_attributes(int index, VertexArrayVector &buffer) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_float, 0, sizeof(Colorf), false); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, unsigned char *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 1, type_unsigned_byte, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, signed char *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 1, type_byte, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, unsigned short *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 1, type_unsigned_short, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, signed short *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 1, type_short, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, unsigned int *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 1, type_unsigned_int, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, signed int *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 1, type_int, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, float *member_offset) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 1, type_float, (size_t)member_offset, sizeof(Type), false); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec2ub *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 2, type_unsigned_byte, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec2b *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 2, type_byte, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec2us *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 2, type_unsigned_short, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec2s *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 2, type_short, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec2ui *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 2, type_unsigned_int, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec2i *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 2, type_int, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec2f *member_offset) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 2, type_float, (size_t)member_offset, sizeof(Type), false); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec3ub *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 3, type_unsigned_byte, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec3b *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 3, type_byte, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec3us *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 3, type_unsigned_short, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec3s *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 3, type_short, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec3ui *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 3, type_unsigned_int, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec3i *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 3, type_int, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec3f *member_offset) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 3, type_float, (size_t)member_offset, sizeof(Type), false); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec4ub *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_unsigned_byte, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec4b *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_byte, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec4us *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_unsigned_short, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec4s *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_short, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec4ui *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_unsigned_int, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec4i *member_offset, bool normalize = false) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_int, (size_t)member_offset, sizeof(Type), normalize); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Vec4f *member_offset) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_float, (size_t)member_offset, sizeof(Type), false); + } + + template + void set_attributes(int index, VertexArrayVector &buffer, Colorf *member_offset) + { + set_attributes(index, (VertexArrayBuffer&)buffer, 4, type_float, (size_t)member_offset, sizeof(Type), false); + } + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/program_object.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/program_object.h new file mode 100644 index 0000000..b9c7587 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/program_object.h @@ -0,0 +1,381 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +** Kenneth Gangstoe +*/ + +#pragma once + +#include +#include "../../Core/IOData/file_system.h" +#include "graphic_context.h" +#include "uniform_vector.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class ShaderObject; + class ProgramObject_Impl; + class GraphicContext; + class GraphicContextProvider; + class XMLResourceDocument; + class ProgramObjectProvider; + + /// \brief Program Object + /// + ///

The shader objects that are to be used by programmable stages of + /// OpenGL are collected together to form a program object. ProgramObject + /// is ClanLib's C++ interface to OpenGL program objects.

+ ///

To construct a program object programatically, the procedure is + /// as follows:

+ ///
+	///    ShaderObject vertex_shader(shadertype_vertex, vertex_glsl_sourcecode);
+	///    ShaderObject fragment_shader(shadertype_fragment, fragment_glsl_sourcecode);
+	///    ProgramObject program;
+	///    program.attach(vertex_shader);
+	///    program.attach(fragment_shader);
+	///    program.link();
+	///    
+ ///

For more information about program objects, see the OpenGL 2.0 + /// specification at www.opengl.org. Documentation + /// about the OpenGL Shader Language (GLSL) is also available from www.opengl.org.

+ class ProgramObject + { + public: + /// \brief Construct a null instance + ProgramObject(); + + /// \brief Constructs a ProgramObject + /// + /// \param gc = Graphic Context + ProgramObject(GraphicContext &gc); + + /// \brief Constructs a ProgramObject + /// + /// \param gc_provider = Graphic Context Provider + ProgramObject(GraphicContextProvider *gc_provider); + + /// \brief Constructs a ProgramObject + /// + /// \param provider = Font Provider + ProgramObject(ProgramObjectProvider *provider); + + /// \brief Load + /// + /// \param gc = Graphic Context + /// \param resource_id = String Ref + /// \param resman = Resource Manager + /// + /// \return Program Object + static ProgramObject load(GraphicContext &gc, const std::string &resource_id, const XMLResourceDocument &resman); + + /// \brief Load + /// + /// \param gc = Graphic Context + /// \param vertex_fullname = String Ref + /// \param fragment_fullname = String Ref + /// + /// \return Program Object + static ProgramObject load(GraphicContext &gc, const std::string &vertex_fullname, const std::string &fragment_fullname); + + /// \brief Load + /// + /// \param gc = Graphic Context + /// \param vertex_fullname = String Ref + /// \param geometry_fullname = String Ref + /// \param fragment_fullname = String Ref + /// + /// \return Program Object + static ProgramObject load(GraphicContext &gc, const std::string &vertex_fullname, const std::string &geometry_fullname, const std::string &fragment_fullname); + + /// \brief Load + /// + /// \param gc = Graphic Context + /// \param vertex_filename = String Ref + /// \param fragment_filename = String Ref + /// \param directory = Virtual Directory + /// + /// \return Program Object + static ProgramObject load(GraphicContext &gc, const std::string &vertex_filename, const std::string &fragment_filename, const FileSystem &fs); + + /// \brief Load + /// + /// \param gc = Graphic Context + /// \param vertex_filename = String Ref + /// \param geometry_filename = String Ref + /// \param fragment_filename = String Ref + /// \param directory = Virtual Directory + /// + /// \return Program Object + static ProgramObject load(GraphicContext &gc, const std::string &vertex_filename, const std::string &geometry_filename, const std::string &fragment_filename, const FileSystem &fs); + + /// \brief Load + /// + /// \param gc = Graphic Context + /// \param vertex_file = IODevice + /// \param fragment_file = IODevice + /// + /// \return Program Object + static ProgramObject load(GraphicContext &gc, IODevice &vertex_file, IODevice &fragment_file); + + /// \brief Load + /// + /// \param gc = Graphic Context + /// \param vertex_file = IODevice + /// \param geometry_file = IODevice + /// \param fragment_file = IODevice + /// + /// \return Program Object + static ProgramObject load(GraphicContext &gc, IODevice &vertex_file, IODevice &geometry_file, IODevice &fragment_file); + + /// \brief Load and link + /// + /// \param gc = Graphic Context + /// \param vertex_fullname = String Ref + /// \param fragment_fullname = String Ref + /// + /// \return Program Object + static ProgramObject load_and_link(GraphicContext &gc, const std::string &vertex_fullname, const std::string &fragment_fullname); + + /// \brief Load and link + /// + /// \param gc = Graphic Context + /// \param vertex_fullname = String Ref + /// \param geometry_fullname = String Ref + /// \param fragment_fullname = String Ref + /// + /// \return Program Object + static ProgramObject load_and_link(GraphicContext &gc, const std::string &vertex_fullname, const std::string &geometry_fullname, const std::string &fragment_fullname); + + /// \brief Load and link + /// + /// \param gc = Graphic Context + /// \param vertex_filename = String Ref + /// \param fragment_filename = String Ref + /// \param directory = Virtual Directory + /// + /// \return Program Object + static ProgramObject load_and_link(GraphicContext &gc, const std::string &vertex_filename, const std::string &fragment_filename, const FileSystem &fs); + + /// \brief Load and link + /// + /// \param gc = Graphic Context + /// \param vertex_filename = String Ref + /// \param geometry_filename = String Ref + /// \param fragment_filename = String Ref + /// \param directory = Virtual Directory + /// + /// \return Program Object + static ProgramObject load_and_link(GraphicContext &gc, const std::string &vertex_filename, const std::string &geometry_filename, const std::string &fragment_filename, const FileSystem &fs); + + /// \brief Load and link + /// + /// \param gc = Graphic Context + /// \param vertex_file = IODevice + /// \param fragment_file = IODevice + /// + /// \return Program Object + static ProgramObject load_and_link(GraphicContext &gc, IODevice &vertex_file, IODevice &fragment_file); + + /// \brief Load and link + /// + /// \param gc = Graphic Context + /// \param vertex_file = IODevice + /// \param geometry_file = IODevice + /// \param fragment_file = IODevice + /// + /// \return Program Object + static ProgramObject load_and_link(GraphicContext &gc, IODevice &vertex_file, IODevice &geometry_file, IODevice &fragment_file); + + virtual ~ProgramObject(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Retrieves the provider. + ProgramObjectProvider *get_provider() const; + + /// \brief Returns the OpenGL program object handle. + unsigned int get_handle() const; + + /// \brief Returns the shaders attached to the program object. + std::vector get_shaders() const; + + /// \brief Returns the current info log for the program object. + std::string get_info_log() const; + + /// \brief Returns the location of a named active attribute. + /// + /// Returns -1 when unknown + int get_attribute_location(const std::string &name) const; + + /// \brief Returns the location of a named uniform variable. + /// + /// Returns -1 when unknown + int get_uniform_location(const std::string &name) const; + + /// \brief Get the uniform block size + /// + /// An exception is thrown of block_name was not found + /// + /// Returns -1 when unknown + int get_uniform_buffer_size(const std::string &block_name) const; + + /// \brief Get the uniform block size + int get_uniform_buffer_size(int block_index) const; + + /// \brief Get the uniform block index + /// + /// Returns -1 when the block index was not found + int get_uniform_buffer_index(const std::string &block_name) const; + + /// \brief Get the storage buffer index + /// + /// Returns -1 when the block index was not found + int get_storage_buffer_index(const std::string &name) const; + + /// \brief Equality operator + bool operator==(const ProgramObject &other) const; + + /// \brief Add shader to program object. + void attach(const ShaderObject &obj); + + /// \brief Remove shader from program object. + void detach(const ShaderObject &obj); + + /// \brief Bind attribute to specific location. + /**

This function must be called before linking.

*/ + void bind_attribute_location(int index, const std::string &name); + + /// \brief Bind shader out variable a specific color buffer location. + /**

This function must be called before linking.

*/ + void bind_frag_data_location(int color_number, const std::string &name); + + /// \brief Link program. + /**

If the linking fails, get_info_log() will return the link log.

*/ + bool link(); + + /// \brief Validate program. + /**

If the validation fails, get_info_log() will return the validation log.

*/ + bool validate(); + + void set_uniform1i(int location, int value_a); + void set_uniform2i(int location, int value_a, int value_b); + void set_uniform3i(int location, int value_a, int value_b, int value_c); + void set_uniform4i(int location, int value_a, int value_b, int value_c, int value_d); + void set_uniformiv(int location, int size, int count, const int *data); + void set_uniform2i(int location, const Vec2i &vec) { set_uniform2i(location, vec.x, vec.y); } + void set_uniform3i(int location, const Vec3i &vec) { set_uniform3i(location, vec.x, vec.y, vec.z); } + void set_uniform4i(int location, const Vec4i &vec) { set_uniform4i(location, vec.x, vec.y, vec.z, vec.w); } + void set_uniform2s(int location, const Vec2s &vec) { set_uniform2i(location, vec.x, vec.y); } + void set_uniform3s(int location, const Vec3s &vec) { set_uniform3i(location, vec.x, vec.y, vec.z); } + void set_uniform4s(int location, const Vec4s &vec) { set_uniform4i(location, vec.x, vec.y, vec.z, vec.w); } + void set_uniform2b(int location, const Vec2b &vec) { set_uniform2i(location, vec.x, vec.y); } + void set_uniform3b(int location, const Vec3b &vec) { set_uniform3i(location, vec.x, vec.y, vec.z); } + void set_uniform4b(int location, const Vec4b &vec) { set_uniform4i(location, vec.x, vec.y, vec.z, vec.w); } + void set_uniformiv(int location, int count, const Vec2i *data) { set_uniformiv(location, 2, count, &data->x); } + void set_uniformiv(int location, int count, const Vec3i *data) { set_uniformiv(location, 3, count, &data->x); } + void set_uniformiv(int location, int count, const Vec4i *data) { set_uniformiv(location, 4, count, &data->x); } + void set_uniform1f(int location, float value_a); + void set_uniform2f(int location, float value_a, float value_b); + void set_uniform3f(int location, float value_a, float value_b, float value_c); + void set_uniform4f(int location, float value_a, float value_b, float value_c, float value_d); + void set_uniformfv(int location, int size, int count, const float *data); + void set_uniform2f(int location, const Vec2f &vec) { set_uniform2f(location, vec.x, vec.y); } + void set_uniform3f(int location, const Vec3f &vec) { set_uniform3f(location, vec.x, vec.y, vec.z); } + void set_uniform4f(int location, const Vec4f &vec) { set_uniform4f(location, vec.x, vec.y, vec.z, vec.w); } + void set_uniformfv(int location, int count, const Vec2f *data) { set_uniformfv(location, 2, count, &data->x); } + void set_uniformfv(int location, int count, const Vec3f *data) { set_uniformfv(location, 3, count, &data->x); } + void set_uniformfv(int location, int count, const Vec4f *data) { set_uniformfv(location, 4, count, &data->x); } + void set_uniform_matrix(int location, int size, int count, bool transpose, const float *data); + void set_uniform_matrix(int location, const Mat2f &matrix) { set_uniform_matrix(location, 2, 1, false, matrix.matrix); } + void set_uniform_matrix(int location, const Mat3f &matrix) { set_uniform_matrix(location, 3, 1, false, matrix.matrix); } + void set_uniform_matrix(int location, const Mat4f &matrix) { set_uniform_matrix(location, 4, 1, false, matrix.matrix); } + void set_uniform_matrix(int location, int count, const Mat2f *matrix) { set_uniform_matrix(location, 2, count, false, matrix->matrix); } + void set_uniform_matrix(int location, int count, const Mat3f *matrix) { set_uniform_matrix(location, 3, count, false, matrix->matrix); } + void set_uniform_matrix(int location, int count, const Mat4f *matrix) { set_uniform_matrix(location, 4, count, false, matrix->matrix); } + + void set_uniform1i(const std::string &name, int value_a) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform1i(loc, value_a); } + void set_uniform2i(const std::string &name, int value_a, int value_b) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform2i(loc, value_a, value_b); } + void set_uniform3i(const std::string &name, int value_a, int value_b, int value_c) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform3i(loc, value_a, value_b, value_c); } + void set_uniform4i(const std::string &name, int value_a, int value_b, int value_c, int value_d) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform4i(loc, value_a, value_b, value_c, value_d); } + void set_uniformiv(const std::string &name, int size, int count, const int *data) { int loc = get_uniform_location(name); if (loc >= 0) set_uniformiv(loc, size, count, data); } + void set_uniform2i(const std::string &name, const Vec2i &vec) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform2i(loc, vec); } + void set_uniform3i(const std::string &name, const Vec3i &vec) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform3i(loc, vec); } + void set_uniform4i(const std::string &name, const Vec4i &vec) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform4i(loc, vec); } + void set_uniform2s(const std::string &name, const Vec2s &vec) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform2s(loc, vec); } + void set_uniform3s(const std::string &name, const Vec3s &vec) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform3s(loc, vec); } + void set_uniform4s(const std::string &name, const Vec4s &vec) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform4s(loc, vec); } + void set_uniform2b(const std::string &name, const Vec2b &vec) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform2b(loc, vec); } + void set_uniform3b(const std::string &name, const Vec3b &vec) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform3b(loc, vec); } + void set_uniform4b(const std::string &name, const Vec4b &vec) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform4b(loc, vec); } + void set_uniformiv(const std::string &name, int count, const Vec2i *data) { int loc = get_uniform_location(name); if (loc >= 0) set_uniformiv(loc, count, data); } + void set_uniformiv(const std::string &name, int count, const Vec3i *data) { int loc = get_uniform_location(name); if (loc >= 0) set_uniformiv(loc, count, data); } + void set_uniformiv(const std::string &name, int count, const Vec4i *data) { int loc = get_uniform_location(name); if (loc >= 0) set_uniformiv(loc, count, data); } + void set_uniform1f(const std::string &name, float value_a) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform1f(loc, value_a); } + void set_uniform2f(const std::string &name, float value_a, float value_b) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform2f(loc, value_a, value_b); } + void set_uniform3f(const std::string &name, float value_a, float value_b, float value_c) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform3f(loc, value_a, value_b, value_c); } + void set_uniform4f(const std::string &name, float value_a, float value_b, float value_c, float value_d) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform4f(loc, value_a, value_b, value_c, value_d); } + void set_uniformfv(const std::string &name, int size, int count, const float *data) { int loc = get_uniform_location(name); if (loc >= 0) set_uniformfv(loc, size, count, data); } + void set_uniform2f(const std::string &name, const Vec2f &vec) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform2f(loc, vec); } + void set_uniform3f(const std::string &name, const Vec3f &vec) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform3f(loc, vec); } + void set_uniform4f(const std::string &name, const Vec4f &vec) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform4f(loc, vec); } + void set_uniformfv(const std::string &name, int count, const Vec2f *data) { int loc = get_uniform_location(name); if (loc >= 0) set_uniformfv(loc, count, data); } + void set_uniformfv(const std::string &name, int count, const Vec3f *data) { int loc = get_uniform_location(name); if (loc >= 0) set_uniformfv(loc, count, data); } + void set_uniformfv(const std::string &name, int count, const Vec4f *data) { int loc = get_uniform_location(name); if (loc >= 0) set_uniformfv(loc, count, data); } + void set_uniform_matrix(const std::string &name, int size, int count, bool transpose, const float *data) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform_matrix(loc, size, count, transpose, data); } + void set_uniform_matrix(const std::string &name, const Mat2f &matrix) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform_matrix(loc, matrix); } + void set_uniform_matrix(const std::string &name, const Mat3f &matrix) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform_matrix(loc, matrix); } + void set_uniform_matrix(const std::string &name, const Mat4f &matrix) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform_matrix(loc, matrix); } + void set_uniform_matrix(const std::string &name, int count, const Mat2f *matrix) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform_matrix(loc, count, matrix); } + void set_uniform_matrix(const std::string &name, int count, const Mat3f *matrix) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform_matrix(loc, count, matrix); } + void set_uniform_matrix(const std::string &name, int count, const Mat4f *matrix) { int loc = get_uniform_location(name); if (loc >= 0) set_uniform_matrix(loc, count, matrix); } + + /// \brief Sets the UniformBuffer + void set_uniform_buffer_index(const std::string &block_name, int bind_index); + + /// \brief Sets the UniformBuffer + void set_uniform_buffer_index(int block_index, int bind_index); + + /// \brief Sets the UniformBuffer + void set_storage_buffer_index(const std::string &block_name, int bind_index); + + /// \brief Sets the UniformBuffer + void set_storage_buffer_index(int block_index, int bind_index); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/rasterizer_state.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/rasterizer_state.h new file mode 100644 index 0000000..9ed5e06 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/rasterizer_state.h @@ -0,0 +1,66 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class GraphicContext; + class RasterizerStateDescription; + class RasterizerStateProvider; + + /// \brief Rasterizer state setup. + class RasterizerState + { + public: + /// \brief Constructs a null instance. + RasterizerState(); + + /// \brief Constructs a Texture + /// + /// \param context = Graphic context + /// \param desc = Rasterizer state description + RasterizerState(GraphicContext &context, const RasterizerStateDescription &desc); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !provider; } + explicit operator bool() const { return bool(provider); } + + RasterizerStateProvider *get_provider() const; + + private: + std::shared_ptr provider; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/rasterizer_state_description.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/rasterizer_state_description.h new file mode 100644 index 0000000..7a59162 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/rasterizer_state_description.h @@ -0,0 +1,118 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "graphic_context.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class RasterizerStateDescription_Impl; + + /// \brief Rasterizer state description. + class RasterizerStateDescription + { + public: + RasterizerStateDescription(); + RasterizerStateDescription clone() const; + + bool get_culled() const; + bool get_enable_line_antialiasing() const; + CullMode get_face_cull_mode() const; + FillMode get_face_fill_mode() const; + FaceSide get_front_face() const; + bool get_enable_scissor() const; + + bool get_antialiased() const; + bool get_offset_point() const; + bool get_offset_line() const; + bool get_offset_fill() const; + void get_polygon_offset(float &out_factor, float &out_units) const; + float get_point_size() const; + float get_point_fade_treshold_size() const; + bool is_point_size() const; + PointSpriteOrigin get_point_sprite_origin() const; + + /// \brief Enables/disables polygon cull clipping. + void set_culled(bool value); + + /// \brief Setting to true enables line antialiasing. + /**

Initially antialiasing of lines is disabled.

*/ + void enable_line_antialiasing(bool enabled); + + /// \brief Sets the polygon cull clipping mode. + void set_face_cull_mode(CullMode value); + + /// \brief Sets the filling mode for polygons. + void set_face_fill_mode(FillMode value); + + /// \brief Sets which side is the front side of a face. + void set_front_face(FaceSide value); + + /// \brief Enables/disables if clipping rects are used + void enable_scissor(bool enabled); + + /// \brief Enables/disables anti-aliasing. (clanGL only) + void enable_antialiased(bool value); + + /// \brief Enables/disables point offsetting. + void enable_offset_point(bool value); + + /// \brief Enables/disables line offsetting. + void enable_offset_line(bool value); + + /// \brief Enables/disables polygon offsetting. + void enable_offset_fill(bool value); + + /// \brief Sets the offset factor. + void set_polygon_offset(float factor, float units); + + /// \brief The default value is 1.0 (clanGL only) + void set_point_size(float); + + /// \brief Alpha fade point once minimum size treshold reached. Requires multisampling to be enabled. (clanGL only) + void set_point_fade_treshold_size(float); + + /// \brief Enables if points sizes is set by the vertex shader. (clanGL only) + void enable_point_size(bool enable); + + /// \brief Sets the origin of texture point sprites. (clanGL only) + void set_point_sprite_origin(PointSpriteOrigin origin); + + bool operator==(const RasterizerStateDescription &other) const; + bool operator<(const RasterizerStateDescription &other) const; + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/render_batcher.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/render_batcher.h new file mode 100644 index 0000000..78b6d89 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/render_batcher.h @@ -0,0 +1,65 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../../Core/Math/mat4.h" +#include "graphic_context.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class GraphicContext; + class Canvas; + enum TextureImageYAxis; + + /// \brief Render batching abstraction + class RenderBatcher + { + public: + virtual ~RenderBatcher() { } + + /** Flush render batcher contents. + * \param gc Graphic context to flush contents to. + */ + virtual void flush(GraphicContext &gc) = 0; + + /** Function to call when matrices are changed. + * \param modelview New wodel view matrix. + * \param projection New projection matrix. + * \param image_yaxis The image Y axis to use where `projection` is not + * used. + * \param pixel_ratio The display pixel ratio to use when rendering. + */ + virtual void matrix_changed(const Mat4f &modelview, const Mat4f &projection, TextureImageYAxis image_yaxis, float pixel_ratio) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/render_buffer.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/render_buffer.h new file mode 100644 index 0000000..0df9e40 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/render_buffer.h @@ -0,0 +1,83 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include +#include "texture.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class RenderBuffer; + class GraphicContext; + class RenderBufferProvider; + class RenderBuffer_Impl; + + /// \brief Render-buffer object class. + class RenderBuffer + { + public: + /// \brief Constructs a null instance. + RenderBuffer(); + + /// \brief Constructs a RenderBuffer + /// + /// \param context = Graphic Context + /// \param width = value + /// \param height = value + /// \param internal_format = Texture Format + RenderBuffer(GraphicContext &context, int width, int height, TextureFormat texture_format = tf_rgba8, int multisample_samples = 0); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns the render buffer size. + const Size &get_size() const; + + /// \brief Get Provider + /// + /// \return provider + RenderBufferProvider *get_provider() const; + + /// \brief Equality operator + bool operator==(const RenderBuffer &other) const; + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/shader_object.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/shader_object.h new file mode 100644 index 0000000..6c24e06 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/shader_object.h @@ -0,0 +1,207 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +** Kenneth Gangstoe +*/ + +#pragma once + +#include +#include "../../Core/IOData/file_system.h" +#include "graphic_context.h" +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class GraphicContextProvider; + class XMLResourceDocument; + class ShaderObject_Impl; + class ShaderObjectProvider; + + /// \brief Shader Type + enum ShaderType + { + shadertype_vertex, + shadertype_geometry, + shadertype_fragment, + shadertype_tess_evaluation, + shadertype_tess_control, + shadertype_compute, + shadertype_num_types + }; + + /// \brief Shader Object + /// + ///

The source code that makes up a program that gets executed by one of + /// the programmable stages is encapsulated in one or more shader + /// objects. Shader objects are attached to a program objects to form a + /// programmable setup. ShaderObject is ClanLib's C++ interface to OpenGL + /// shader objects.

+ class ShaderObject + { + public: + /// \brief Constructs a null instance + ShaderObject(); + + /// \brief Constructs an OpenGL shader. + /// + /// \param type Shader type. Can be shadertype_vertex or shadertype_fragment. + /// \param source Shader source code, in OpenGL Shader Language (GLSL). + /// \param gc Graphics context in which to create the shader object + ShaderObject(GraphicContext &gc, ShaderType type, const std::string &source); + + /// \brief Constructs a ShaderObject + ShaderObject(GraphicContext &gc, ShaderType type, const void *source, int source_size); + + /// \brief Constructs a ShaderObject + /// + /// \param gc = Graphic Context + /// \param type = Shader Type + /// \param sources = sources + ShaderObject(GraphicContext &gc, ShaderType type, const std::vector &sources); + + /// \brief Constructs a ShaderObject + /// + /// \param gc_provider = Graphic Context Provider + /// \param type = Shader Type + /// \param source = String Ref + ShaderObject(GraphicContextProvider *gc_provider, ShaderType type, const std::string &source); + + /// \brief Constructs a ShaderObject + /// + /// \param gc_provider = Graphic Context Provider + /// \param type = Shader Type + /// \param sources = sources + ShaderObject(GraphicContextProvider *gc_provider, ShaderType type, const std::vector &sources); + + /// \brief Load + /// + /// \param gc = Graphic Context + /// \param resource_id = String Ref + /// \param resources = Resource Manager + /// + /// \return Shader Object + static ShaderObject load(GraphicContext &gc, const std::string &resource_id, const XMLResourceDocument &resources); + + /// \brief Load + /// + /// \param gc = Graphic Context + /// \param type = Shader Type + /// \param filename = String Ref + /// \param directory = Virtual Directory + /// + /// \return Shader Object + static ShaderObject load(GraphicContext &gc, ShaderType type, const std::string &filename, const FileSystem &fs); + + /// \brief Load + /// + /// \param gc = Graphic Context + /// \param type = Shader Type + /// \param fullname = String Ref + /// + /// \return Shader Object + static ShaderObject load(GraphicContext &gc, ShaderType type, const std::string &fullname); + + /// \brief Load + /// + /// \param gc = Graphic Context + /// \param type = Shader Type + /// \param file = IODevice + /// + /// \return Shader Object + static ShaderObject load(GraphicContext &gc, ShaderType type, IODevice &file); + + /// \brief Load and compile + /// + /// \param gc = Graphic Context + /// \param type = Shader Type + /// \param filename = String Ref + /// \param directory = Virtual Directory + /// + /// \return Shader Object + static ShaderObject load_and_compile(GraphicContext &gc, ShaderType type, const std::string &filename, const FileSystem &fs); + + /// \brief Load and compile + /// + /// \param gc = Graphic Context + /// \param type = Shader Type + /// \param filename = String Ref + /// + /// \return Shader Object + static ShaderObject load_and_compile(GraphicContext &gc, ShaderType type, const std::string &filename); + + /// \brief Load and compile + /// + /// \param gc = Graphic Context + /// \param type = Shader Type + /// \param file = IODevice + /// + /// \return Shader Object + static ShaderObject load_and_compile(GraphicContext &gc, ShaderType type, IODevice &file); + + virtual ~ShaderObject(); + + /// \brief Returns the OpenGL shader handle. + unsigned int get_handle() const; + + /// \brief Gets the shader type. + ShaderType get_shader_type() const; + + /// \brief Get shader object's info log. + std::string get_info_log() const; + + /// \brief Get shader source code. + std::string get_shader_source() const; + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Get Provider + /// + /// \return provider + ShaderObjectProvider *get_provider() const; + + /// \brief Handle comparison operator. + bool operator==(const ShaderObject &other) const; + + /// \brief Compile program. + /**

If the compiling fails, get_info_log() will return the compile log.

*/ + bool compile(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/shared_gc_data.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/shared_gc_data.h new file mode 100644 index 0000000..3b9b4f7 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/shared_gc_data.h @@ -0,0 +1,95 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +** Mark Page +*/ + +#pragma once + +#include +#include +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class GraphicContext; + class GraphicContextProvider; + class DisposableObject; + class SharedGCData_Impl; + + /// \brief Shared Graphic Context Data + class SharedGCData + { + public: + /// \brief Add ref + static void add_ref(); + + /// \brief Release ref + static void release_ref(); + + /// \brief Add a provider + static void add_provider(GraphicContextProvider *provider); + + /// \brief Remove a provider + static void remove_provider(GraphicContextProvider *provider); + + /// \brief Get a provider + /// + /// \param mutex_section : Returns the mutex section for the provider lock + /// + /// \return NULL = None available + static GraphicContextProvider *get_provider(std::unique_ptr> &mutex_section); + + /// \brief Get the providers + /// + /// \param mutex_section : Returns the mutex section for the provider lock + /// + /// \return NULL = None available + static std::vector &get_gc_providers(std::unique_ptr> &mutex_section); + + /// \brief Add disposable + /// + /// \param disposable = Disposable Object + static void add_disposable(DisposableObject *disposable); + + /// \brief Remove disposable + /// + /// \param disposable = Disposable Object + static void remove_disposable(DisposableObject *disposable); + + private: + SharedGCData(); + ~SharedGCData(); + + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/storage_buffer.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/storage_buffer.h new file mode 100644 index 0000000..6e8bb66 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/storage_buffer.h @@ -0,0 +1,98 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../Image/buffer_usage.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class GraphicContext; + class TransferBuffer; + class StorageBufferProvider; + class StorageBuffer_Impl; + class ProgramObject; + + /// \brief Storage Buffer + class StorageBuffer + { + public: + /// \brief Constructs a null instance. + StorageBuffer(); + + /// \brief Constructs a buffer + /// + /// \param gc = Graphic Context + /// \param size = size - use ProgramObject::get_storage_buffer_size() to calcuate this + /// \param usage = Buffer Usage + StorageBuffer(GraphicContext &gc, int size, int stride, BufferUsage usage = usage_dynamic_draw); + + /// \brief Constructs a buffer + /// + /// \param gc = Graphic Context + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + StorageBuffer(GraphicContext &gc, const void *data, int size, int stride, BufferUsage usage = usage_dynamic_draw); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Get Provider + /// + /// \return provider + StorageBufferProvider *get_provider() const; + + /// \brief Handle comparison operator. + bool operator==(const StorageBuffer &other) const; + + /// \brief Uploads data to storage buffer. + /// + /// The size specified must match the size of the buffer and is only included to help guard against buffer overruns. + void upload_data(GraphicContext &gc, const void *data, int size); + + /// \brief Copies data from transfer buffer + void copy_from(GraphicContext &gc, TransferBuffer &buffer, int dest_pos = 0, int src_pos = 0, int size = -1); + + /// \brief Copies data to transfer buffer + void copy_to(GraphicContext &gc, TransferBuffer &buffer, int dest_pos = 0, int src_pos = 0, int size = -1); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/storage_vector.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/storage_vector.h new file mode 100644 index 0000000..6498086 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/storage_vector.h @@ -0,0 +1,109 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "storage_buffer.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Storage Buffer Vector + /// + template + class StorageVector : public StorageBuffer + { + public: + /// \brief Constructs a null instance. + StorageVector() + { + } + + /// \brief Constructs a ElementArrayBuffer + /// + /// \param gc = Graphic Context + /// \param size = value + /// \param usage = Buffer Usage + StorageVector(GraphicContext &gc, int size, BufferUsage usage = usage_static_draw) + : StorageBuffer(gc, size * sizeof(Type), sizeof(Type), usage) + { + } + + /// \brief Constructs a ElementArrayBuffer + /// + /// \param gc = Graphic Context + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + StorageVector(GraphicContext &gc, Type *data, int size, BufferUsage usage = usage_static_draw) + : StorageBuffer(gc, data, size * sizeof(Type), sizeof(Type), usage) + { + } + + StorageVector(GraphicContext &gc, const std::vector &data, BufferUsage usage = usage_static_draw) + : StorageBuffer(gc, data.empty() ? (Type*)0 : &data[0], data.size() * sizeof(Type), sizeof(Type), usage) + { + } + + /// \brief Uploads data to storage buffer. + /// + /// The size specified must match the size of the buffer and is only included to help guard against buffer overruns. + void upload_data(GraphicContext &gc, const Type *data, int size) + { + StorageBuffer::upload_data(gc, data, size * sizeof(Type)); + } + + /// \brief Uploads data to storage buffer. + void upload_data(GraphicContext &gc, const std::vector &data) + { + if (!data.empty()) + StorageBuffer::upload_data(gc, &data[0], data.size() * sizeof(Type)); + } + + /// \brief Copies data from transfer buffer + void copy_from(GraphicContext &gc, TransferVector &buffer, int dest_pos = 0, int src_pos = 0, int size = -1) + { + if (size != -1) + size = size * sizeof(Type); + StorageBuffer::copy_from(gc, buffer, dest_pos * sizeof(Type), src_pos * sizeof(Type), size); + } + + /// \brief Copies data to transfer buffer + void copy_to(GraphicContext &gc, TransferVector &buffer, int dest_pos = 0, int src_pos = 0, int size = -1) + { + if (size != -1) + size = size * sizeof(Type); + StorageBuffer::copy_to(gc, buffer, dest_pos * sizeof(Type), src_pos * sizeof(Type), size); + } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture.h new file mode 100644 index 0000000..cd45cf0 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture.h @@ -0,0 +1,256 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include +#include "../../Core/IOData/file_system.h" +#include "../../Core/Resources/resource.h" +#include "graphic_context.h" +#include "../Image/image_import_description.h" +#include "../Image/texture_format.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class Color; + class Point; + class PixelBuffer; + class PixelBufferSet; + class PixelFormat; + class TextureProvider; + class DataBuffer; + class Texture1D; + class Texture1DArray; + class Texture2D; + class Texture2DArray; + class Texture3D; + class TextureCube; + class TextureCubeArray; + class Texture_Impl; + class SharedGCData_Impl; + class ResourceManager; + class XMLResourceDocument; + + /// \brief Texture coordinate wrapping modes. + enum TextureWrapMode + { + wrap_clamp_to_edge, + wrap_repeat, + wrap_mirrored_repeat + }; + + /// \brief Texture filters. + enum TextureFilter + { + filter_nearest, + filter_linear, + filter_nearest_mipmap_nearest, + filter_nearest_mipmap_linear, + filter_linear_mipmap_nearest, + filter_linear_mipmap_linear + }; + + /// \brief Texture compare modes. + enum TextureCompareMode + { + comparemode_none, + comparemode_compare_r_to_texture + }; + + /// \brief Texture dimensions. + enum TextureDimensions + { + texture_1d, + texture_1d_array, + texture_2d, + texture_2d_array, + texture_3d, + texture_cube, + texture_cube_array + }; + + /// \brief Texture object class. + class Texture + { + public: + /// \brief Constructs a null instance. + Texture(); + + /// \brief Constructs a texture as described in a pixelbuffer set + Texture(GraphicContext &gc, PixelBufferSet pixelbuffer_set); + + /// \brief Constructs a texture from an implementation + /// + /// \param impl = The implementation + Texture(const std::shared_ptr &impl); + + /// \brief Constructs a texture from a texture provider + /// + /// \param provider = The provider + Texture(TextureProvider *provider); + + virtual ~Texture(); + + /// \brief Retrieves a Texture resource from the resource manager + /// + /// \param gc = Graphic Context + /// \param resources = Resource manager + /// \param id = id + static Resource resource(GraphicContext &gc, const std::string &id, const ResourceManager &resources); + + /// \brief Loads a Texture from a XML resource definition + static Texture load(GraphicContext &gc, const std::string &id, const XMLResourceDocument &doc, const ImageImportDescription &import_desc = ImageImportDescription()); + + /// \brief Equality operator + bool operator==(const Texture &other) const + { + return impl == other.impl; + } + + /// \brief Inequality operator + bool operator!=(const Texture &other) const + { + return impl != other.impl; + } + + /// \brief Less than operator + bool operator<(const Texture &other) const + { + return impl < other.impl; + } + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Get the minimum level of detail. + float get_min_lod() const; + + /// \brief Get the maximum level of detail. + float get_max_lod() const; + + /// \brief Get the level of detail bias constant. + float get_lod_bias() const; + + /// \brief Get the texture base level. + int get_base_level() const; + + /// \brief Get the texture max level. + int get_max_level() const; + + /// \brief Get the texture minification filter. + TextureFilter get_min_filter() const; + + /// \brief Get the texture magnification filter. + TextureFilter get_mag_filter() const; + + /// \brief Returns true if texture is resident in texture memory. + bool is_resident() const; + + /// \brief Get the texture compare mode. + TextureCompareMode get_compare_mode() const; + + /// \brief Get the texture compare function. + CompareFunction get_compare_function() const; + + /// \brief Get Provider + /// + /// \return provider + TextureProvider *get_provider() const; + + /// \brief Get the implementation weakptr + /// + /// This is used to assist is creating Texture caches internally within clanlib + std::weak_ptr get_impl() const; + + /// \brief Generate the mipmap + void generate_mipmap(); + + /// \brief Set the minimum level of detail texture parameter. + void set_min_lod(float min_lod); + + /// \brief Set the maximum level of detail texture parameter. + void set_max_lod(float max_lod); + + /// \brief Sets the level of detail bias constant. + void set_lod_bias(float lod_bias); + + /// \brief Sets the texture base level texture parameter. + void set_base_level(int base_level); + + /// \brief Sets the texture max level texture parameter. + void set_max_level(int max_level); + + /// \brief Set the minification filter. + void set_min_filter(TextureFilter filter); + + /// \brief Set the magnification filter. + void set_mag_filter(TextureFilter filter); + + /// \brief Set the maximum degree of anisotropy. + void set_max_anisotropy(float max_anisotropy); + + /// \brief Sets the texture compare mode and compare function texture parameters. + void set_texture_compare(TextureCompareMode mode, CompareFunction func); + + /// \brief Dynamic cast to Texture1D + Texture1D to_texture_1d() const; + + /// \brief Dynamic cast to Texture1DArray + Texture1DArray to_texture_1d_array() const; + + /// \brief Dynamic cast to Texture2D + Texture2D to_texture_2d() const; + + /// \brief Dynamic cast to Texture2DArray + Texture2DArray to_texture_2d_array() const; + + /// \brief Dynamic cast to Texture3D + Texture3D to_texture_3d() const; + + /// \brief Dynamic cast to TextureCube + TextureCube to_texture_cube() const; + + /// \brief Dynamic cast to TextureCubeArray + TextureCubeArray to_texture_cube_array() const; + + protected: + std::shared_ptr impl; + + friend class Texture2DArray; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_1d.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_1d.h new file mode 100644 index 0000000..fe9d643 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_1d.h @@ -0,0 +1,93 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include "texture.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief 1D texture object class. + class Texture1D : public Texture + { + public: + /// \brief Constructs a null instance. + Texture1D(); + + /// \brief Constructs a texture from an implementation + /// + /// \param impl = The implementation + Texture1D(const std::shared_ptr &impl) : Texture(impl) { } + + /// \brief Constructs a Texture + /// + /// \param context = Graphic Context + /// \param size = value + /// \param height = value + /// \param internal_format = Texture Format + /// \param levels = Mipmap levels for the texture. 0 = all levels + Texture1D(GraphicContext &context, int size, TextureFormat texture_format = tf_rgba8, int levels = 1); + + Texture1D(GraphicContext &context, const PixelBuffer &image, bool is_srgb = false); + Texture1D(GraphicContext &context, const PixelBuffer &image, int src_x, int width, bool is_srgb = false); + + /// \brief Get the texture width. + int get_size() const; + + /// \brief Get the texture wrap mode for the s coordinate. + TextureWrapMode get_wrap_mode_s() const; + + /// \brief Upload image to texture. + /// + /// \param context Graphic context to use for the request + /// \param image Image to upload. + /// \param level Mipmap level-of-detail number. + void set_image(GraphicContext &context, PixelBuffer &image, int level = 0); + + /// \brief Upload image to sub texture. + /// + /// \param context Graphic context to use for the request + /// \param image Image to upload. + /// \param level Mipmap level-of-detail number. + void set_subimage( + GraphicContext &context, + int x, + const PixelBuffer &image, + const int src_x, + const int src_width, + int level = 0); + + void set_wrap_mode(TextureWrapMode wrap_s); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_1d_array.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_1d_array.h new file mode 100644 index 0000000..55ed45f --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_1d_array.h @@ -0,0 +1,96 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include "texture.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief 1D texture array object class. + class Texture1DArray : public Texture + { + public: + /// \brief Constructs a null instance. + Texture1DArray(); + + /// \brief Constructs a texture from an implementation + /// + /// \param impl = The implementation + Texture1DArray(const std::shared_ptr &impl) : Texture(impl) { } + + /// \brief Constructs a Texture + /// + /// \param context = Graphic Context + /// \param size = value + /// \param height = value + /// \param internal_format = Texture Format + /// \param levels = Mipmap levels for the texture. 0 = all levels + Texture1DArray(GraphicContext &context, int size, int array_size, TextureFormat texture_format = tf_rgba8, int levels = 1); + + /// \brief Get the texture width. + int get_size() const; + + /// \brief Get the texture array size + int get_array_size() const; + + /// \brief Get the texture wrap mode for the s coordinate. + TextureWrapMode get_wrap_mode_s() const; + + /// \brief Upload image to texture. + /// + /// \param context Graphic context to use for the request + /// \param array_index Index in the array + /// \param image Image to upload. + /// \param level Mipmap level-of-detail number. + void set_image(GraphicContext &context, int array_index, PixelBuffer &image, int level = 0); + + /// \brief Upload image to sub texture. + /// + /// \param context Graphic context to use for the request + /// \param array_index Index in the array + /// \param image Image to upload. + /// \param level Mipmap level-of-detail number. + void set_subimage( + GraphicContext &context, + int array_index, + int x, + const PixelBuffer &image, + const int src_x, + const int src_width, + int level = 0); + + void set_wrap_mode(TextureWrapMode wrap_s); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_2d.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_2d.h new file mode 100644 index 0000000..d520f7d --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_2d.h @@ -0,0 +1,204 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include "texture.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// 2D texture object class. + class Texture2D : public Texture + { + public: + /// Constructs a null instance. + Texture2D(); + + /** Constructs a texture from an implementation. + * \param impl The Texture object implementation. + */ + Texture2D(const std::shared_ptr &impl) : Texture(impl) { } + + /** Constructs a new Texture object. + * \param context Graphic context to construct the texture on. + * \param width Width of the new texture. + * \param height Height of the new texture. + * \param format Data format of the new texture. + * \param levels Number of mipmap levels for the new texture. Setting + * this to `0` enables all levels. + */ + Texture2D(GraphicContext &context, int width, int height, TextureFormat format = tf_rgba8, int levels = 1); + + /** Constructs a new Texture object. + * \param context Graphic context to construct the texture on. + * \param size Size of the new texture. + * \param format Data format of the new texture. + * \param levels Number of mipmap levels for the new texture. Setting + * this to `0` enables all levels. + */ + Texture2D(GraphicContext &context, const Size &size, TextureFormat texture_format = tf_rgba8, int levels = 1); + + Texture2D(GraphicContext &context, const std::string &fullname, const ImageImportDescription &import_desc = {}); + Texture2D(GraphicContext &context, const std::string &filename, const FileSystem &fs, const ImageImportDescription &import_desc = {}); + Texture2D(GraphicContext &context, IODevice &file, const std::string &image_type, const ImageImportDescription &import_desc = {}); + + Texture2D(GraphicContext &context, const PixelBuffer &image, bool is_srgb = false); + Texture2D(GraphicContext &context, const PixelBuffer &image, const Rect &src_rect, bool is_srgb = false); + + /// Retrieves the actual width of the texture in the display. + int get_width() const; + + /// Retrieves the actual height of the texture in the display. + int get_height() const; + + /// Retrieves the actual size of the texture. + Size get_size() const { return Size{ get_width(), get_height() }; } + + /** Retrieves the pixel ratio of this texture. + * \return The display pixel ratio set for this texture. + * A zero value implies that no pixel ratio has been set + */ + float get_pixel_ratio() const; + + /// Returns the device independent width of this texture. + float get_dip_width() const { return get_width() / get_pixel_ratio(); } + + /// Returns the device independent height of this texture. + float get_dip_height() const { return get_height() / get_pixel_ratio(); } + + /// Returns the device independent size of this texture. + Sizef get_dip_size() const { return Sizef{ get_dip_width(), get_dip_height() }; } + + /// Retrieve image data from texture. + PixelBuffer get_pixeldata(GraphicContext &gc, int level = 0) const; + + /** Retrieve image data from this texture. + * \param format Output data format. + * \param level Mipmap level of the texture to retrieve data from. + */ + PixelBuffer get_pixeldata(GraphicContext &gc, TextureFormat texture_format, int level = 0) const; + + /// Get the texture wrap mode for the s coordinate. + TextureWrapMode get_wrap_mode_s() const; + + /// Get the texture wrap mode for the t coordinate. + TextureWrapMode get_wrap_mode_t() const; + + /** Upload image to this texture. + * \param context Graphic context to use for the request. + * \param image Image to upload. + * \param level Mipmap level-of-detail number. + */ + void set_image( + GraphicContext &context, + const PixelBuffer &image, + int level = 0); + + /** Upload image to sub-texture. + * \param context Graphic context to use for the request. + * \param x The horizontal point in the texture to write the new + * sub-texture image onto. + * \param y The vertical point in the texture to write the new + * sub-texture image onto. + * \param image Image to upload. + * \param level Mipmap level-of-detail number. + */ + void set_subimage( + GraphicContext &context, + int x, + int y, + const PixelBuffer &image, + const Rect &src_rect, + int level = 0); + + /** Upload image to sub-texture. + * \param context Graphic context to use for the request. + * \param point Point in the texture to write the new sub-texture image. + * onto. + * \param image Image to upload. + * \param level Mipmap level-of-detail number. + */ + void set_subimage( + GraphicContext &context, + const Point &point, + const PixelBuffer &image, + const Rect &src_rect, + int level = 0); + + /// Copy image data from a graphic context. + void copy_image_from( + GraphicContext &context, + int level, + TextureFormat texture_format = tf_rgba8); + + void copy_image_from( + GraphicContext &context, + int x, + int y, + int width, + int height, + int level = 0, + TextureFormat texture_format = tf_rgba8); + + void copy_image_from( + GraphicContext &context, + const Rect &pos, + int level = 0, + TextureFormat texture_format = tf_rgba8); + + /// Copy sub image data from a graphic context. + void copy_subimage_from( + GraphicContext &context, + int offset_x, + int offset_y, + int x, + int y, + int width, + int height, + int level = 0); + + void copy_subimage_from( + GraphicContext &context, + const Point &offset, + const Rect &pos, + int level = 0); + + void set_wrap_mode( + TextureWrapMode wrap_s, + TextureWrapMode wrap_t); + + /// Sets the display pixel ratio for this texture. + void set_pixel_ratio(float ratio); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_2d_array.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_2d_array.h new file mode 100644 index 0000000..c912c08 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_2d_array.h @@ -0,0 +1,167 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include "texture.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class Texture2D; + + /// 2D texture array object class. + class Texture2DArray : public Texture + { + public: + /// Constructs a null instance. + Texture2DArray(); + + /** Constructs a texture from an implementation. + * \param impl The Texture object implementation. + */ + Texture2DArray(const std::shared_ptr &impl) : Texture(impl) { } + + /** Constructs a new Texture object. + * \param context Graphic context to construct the texture on. + * \param width Width of the new texture. + * \param height Height of the new texture. + * \param array_size Number of textures to allocate in this array. + * \param format Data format of the new texture. + * \param levels Number of mipmap levels for the new texture. Setting + * this to `0` enables all levels. + */ + Texture2DArray(GraphicContext &context, int width, int height, int array_size, TextureFormat texture_format = tf_rgba8, int levels = 1); + + /** Constructs a new Texture object. + * \param context Graphic context to construct the texture on. + * \param size Size of the new texture. + * \param array_size Number of textures to allocate in this array. + * \param format Data format of the new texture. + * \param levels Number of mipmap levels for the new texture. Setting + * this to `0` enables all levels. + */ + Texture2DArray(GraphicContext &context, const Size &size, int array_size, TextureFormat texture_format = tf_rgba8, int levels = 1); + + /// Retrieves the actual width of the texture in the display. + int get_width() const; + + /// Retrieves the actual height of the texture in the display. + int get_height() const; + + /// Retrieves the actual size of the texture. + Size get_size() const { return Size{ get_width(), get_height() }; } + + /** Retrieves the pixel ratio of this texture. + * \return The display pixel ratio set for this texture. + * A zero value implies that no pixel ratio has been set + */ + float get_pixel_ratio() const; + + /// Returns the device independent width of this texture. + float get_dip_width() const { return get_width() / get_pixel_ratio(); } + + /// Returns the device independent height of this texture. + float get_dip_height() const { return get_height() / get_pixel_ratio(); } + + /// Returns the device independent size of this texture. + Sizef get_dip_size() const { return Sizef{ get_dip_width(), get_dip_height() }; } + + /// Returns the number of textures in the array. + int get_array_size() const; + + /// Get the texture wrap mode for the s coordinate. + TextureWrapMode get_wrap_mode_s() const; + + /// Get the texture wrap mode for the t coordinate. + TextureWrapMode get_wrap_mode_t() const; + + /** Upload image to this texture array. + * \param context Graphic context to use for the request. + * \param array_index Index in the array to upload the image into. + * \param image Image to upload. + * \param level Mipmap level-of-detail number. + */ + void set_image( + GraphicContext &context, + int array_index, + const PixelBuffer &image, + int level = 0); + + /** Upload image to sub-texture. + * \param context Graphic context to use for the request. + * \param array_index Index in the array to upload the image into. + * \param x The horizontal point in the selected texture to + * write the new sub-texture image onto. + * \param y The vertical point in the selected texture to write + * the sub-texture image onto. + * \param image Image to upload. + * \param level Mipmap level-of-detail number. + */ + void set_subimage( + GraphicContext &context, + int array_index, + int x, + int y, + const PixelBuffer &image, + const Rect &src_rect, + int level = 0); + + /** Upload image to sub-texture. + * \param context Graphic context to use for the request. + * \param array_index Index in the array to upload the image into. + * \param point Point in the selected texture to write the new + * sub-texture image onto. + * \param image Image to upload. + * \param level Mipmap level-of-detail number. + */ + + void set_subimage( + GraphicContext &context, + int array_index, + const Point &point, + const PixelBuffer &image, + const Rect &src_rect, + int level = 0); + + void set_wrap_mode( + TextureWrapMode wrap_s, + TextureWrapMode wrap_t); + + /// Creates a 2D texture view + Texture2D create_2d_view(int array_index, TextureFormat texture_format, int min_level, int num_levels); + + /// Sets the display pixel ratio for this texture. + void set_pixel_ratio(float ratio); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_3d.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_3d.h new file mode 100644 index 0000000..2a504ac --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_3d.h @@ -0,0 +1,123 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include "texture.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief 3D texture object class. + class Texture3D : public Texture + { + public: + /// \brief Constructs a null instance. + Texture3D(); + + /// \brief Constructs a texture from an implementation + /// + /// \param impl = The implementation + Texture3D(const std::shared_ptr &impl) : Texture(impl) { } + + /// \brief Constructs a 3D Texture + /// + /// \param context = Graphic Context + /// \param width = value + /// \param height = value + /// \param depth = value + /// \param internal_format = Texture Format + /// \param levels = Mipmap levels for the texture. 0 = all levels + Texture3D(GraphicContext &context, int width, int height, int depth, TextureFormat texture_format = tf_rgba8, int levels = 1); + + /// \brief Constructs a Texture + /// + /// \param context = Graphic Context + /// \param size = Size + /// \param internal_format = Texture Format + /// \param levels = Mipmap levels for the texture. 0 = all levels + Texture3D(GraphicContext &context, const Vec3i &size, TextureFormat texture_format = tf_rgba8, int levels = 1); + + /// \brief Get the texture width. + int get_width() const; + + /// \brief Get the texture height. + int get_height() const; + + /// \brief Get the texture depth. + int get_depth() const; + + /// \brief Get the texture size. + Vec3i get_size() const; + + /// \brief Get the texture wrap mode for the s coordinate. + TextureWrapMode get_wrap_mode_s() const; + + /// \brief Get the texture wrap mode for the t coordinate. + TextureWrapMode get_wrap_mode_t() const; + + /// \brief Get the texture wrap mode for the r coordinate. + TextureWrapMode get_wrap_mode_r() const; + + /// \brief Upload image to texture. + /// + /// \param context Graphic context to use for the request + /// \param image Image to upload. + /// \param level Mipmap level-of-detail number. + void set_image( + GraphicContext &context, + PixelBuffer &image, + int depth, + int level = 0); + + /// \brief Upload image to sub texture. + /// + /// \param context Graphic context to use for the request + /// \param image Image to upload. + /// \param level Mipmap level-of-detail number. + void set_subimage( + GraphicContext &context, + int x, + int y, + int z, + const PixelBuffer &image, + const Rect &src_rect, + int level = 0); + + /// \brief Set the texture wrapping mode. + void set_wrap_mode( + TextureWrapMode wrap_s, + TextureWrapMode wrap_t, + TextureWrapMode wrap_r); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_cube.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_cube.h new file mode 100644 index 0000000..7309e64 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_cube.h @@ -0,0 +1,123 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include "texture.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Texture cube directions + enum TextureCubeDirection + { + cl_cube_positive_x, + cl_cube_negative_x, + cl_cube_positive_y, + cl_cube_negative_y, + cl_cube_positive_z, + cl_cube_negative_z + }; + + /// \brief 2D texture cube object class. + class TextureCube : public Texture + { + public: + /// \brief Constructs a null instance. + TextureCube(); + + /// \brief Constructs a texture from an implementation + /// + /// \param impl = The implementation + TextureCube(const std::shared_ptr &impl) : Texture(impl) { } + + /// \brief Constructs a Texture + /// + /// \param context = Graphic Context + /// \param width = value + /// \param height = value + /// \param internal_format = Texture Format + /// \param levels = Mipmap levels for the texture. 0 = all levels + TextureCube(GraphicContext &context, int width, int height, TextureFormat texture_format = tf_rgba8, int levels = 1); + + /// \brief Constructs a Texture + /// + /// \param context = Graphic Context + /// \param size = Size + /// \param internal_format = Texture Format + /// \param levels = Mipmap levels for the texture. 0 = all levels + TextureCube(GraphicContext &context, const Size &size, TextureFormat texture_format = tf_rgba8, int levels = 1); + + /// \brief Get the texture width. + int get_width() const; + + /// \brief Get the texture height. + int get_height() const; + + /// \brief Get the texture size. + Size get_size() const; + + /// \brief Upload image to texture. + /// + /// \param context Graphic context to use for the request + /// \param image Image to upload. + /// \param level Mipmap level-of-detail number. + void set_image( + GraphicContext &context, + TextureCubeDirection cube_direction, + PixelBuffer &image, + int level = 0); + + /// \brief Upload image to sub texture. + /// + /// \param context Graphic context to use for the request + /// \param image Image to upload. + /// \param level Mipmap level-of-detail number. + void set_subimage( + GraphicContext &context, + TextureCubeDirection cube_direction, + int x, + int y, + const PixelBuffer &image, + const Rect &src_rect, + int level = 0); + + void set_subimage( + GraphicContext &context, + TextureCubeDirection cube_direction, + const Point &point, + const PixelBuffer &image, + const Rect &src_rect, + int level = 0); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_cube_array.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_cube_array.h new file mode 100644 index 0000000..4756148 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/texture_cube_array.h @@ -0,0 +1,120 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include "texture_cube.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief 2D texture cube array object class. + class TextureCubeArray : public Texture + { + public: + /// \brief Constructs a null instance. + TextureCubeArray(); + + /// \brief Constructs a texture from an implementation + /// + /// \param impl = The implementation + TextureCubeArray(const std::shared_ptr &impl) : Texture(impl) { } + + /// \brief Constructs a Texture + /// + /// \param context = Graphic Context + /// \param width = value + /// \param height = value + /// \param internal_format = Texture Format + /// \param levels = Mipmap levels for the texture. 0 = all levels + TextureCubeArray(GraphicContext &context, int width, int height, int array_size, TextureFormat texture_format = tf_rgba8, int levels = 1); + + /// \brief Constructs a Texture + /// + /// \param context = Graphic Context + /// \param size = Size + /// \param internal_format = Texture Format + /// \param levels = Mipmap levels for the texture. 0 = all levels + TextureCubeArray(GraphicContext &context, const Size &size, int array_size, TextureFormat texture_format = tf_rgba8, int levels = 1); + + /// \brief Get the texture width. + int get_width() const; + + /// \brief Get the texture height. + int get_height() const; + + /// \brief Get the texture size. + Size get_size() const; + + /// \brief Get the texture array size + int get_array_size() const; + + /// \brief Upload image to texture. + /// + /// \param context Graphic context to use for the request + /// \param array_index Index in the array + /// \param image Image to upload. + /// \param level Mipmap level-of-detail number. + void set_image( + GraphicContext &context, + int array_index, + TextureCubeDirection cube_direction, + PixelBuffer &image, + int level = 0); + + /// \brief Upload image to sub texture. + /// + /// \param context Graphic context to use for the request + /// \param array_index Index in the array + /// \param image Image to upload. + /// \param level Mipmap level-of-detail number. + void set_subimage( + GraphicContext &context, + int array_index, + TextureCubeDirection cube_direction, + int x, + int y, + const PixelBuffer &image, + const Rect &src_rect, + int level = 0); + + void set_subimage( + GraphicContext &context, + int array_index, + TextureCubeDirection cube_direction, + const Point &point, + const PixelBuffer &image, + const Rect &src_rect, + int level = 0); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/transfer_buffer.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/transfer_buffer.h new file mode 100644 index 0000000..c8491d5 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/transfer_buffer.h @@ -0,0 +1,99 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../Image/buffer_usage.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class GraphicContext; + class TransferBufferProvider; + class TransferBuffer_Impl; + + /// \brief Transfer Buffer + class TransferBuffer + { + public: + /// \brief Constructs a null instance. + TransferBuffer(); + + /// \brief Constructs a transfer buffer + /// + /// \param gc = Graphic Context + /// \param size = value + /// \param usage = Buffer Usage + TransferBuffer(GraphicContext &gc, int size, BufferUsage usage = usage_dynamic_copy); + + /// \brief Constructs a transfer buffer + /// + /// \param gc = Graphic Context + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + TransferBuffer(GraphicContext &gc, const void *data, int size, BufferUsage usage = usage_dynamic_copy); + + virtual ~TransferBuffer(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Retrieves a pointer to the mapped buffer. + void *get_data(); + + /// \brief Get Provider + /// + /// \return provider + TransferBufferProvider *get_provider() const; + + /// \brief Handle comparison operator. + bool operator==(const TransferBuffer &other) const; + + /// \brief Maps buffer into system memory. + void lock(GraphicContext &gc, BufferAccess access); + + /// \brief Unmaps buffer. + void unlock(); + + /// \brief Uploads data to transfer buffer. + void upload_data(GraphicContext &gc, int offset, const void *data, int size); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/transfer_texture.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/transfer_texture.h new file mode 100644 index 0000000..bf01485 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/transfer_texture.h @@ -0,0 +1,87 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include +#include "graphic_context.h" +#include "../Image/image_import_description.h" +#include "../Image/texture_format.h" +#include "../Image/pixel_buffer.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class Color; + class Point; + class PixelBuffer; + class PixelFormat; + class DataBuffer; + class PixelBufferProvider; + class TransferTexture_Impl; + class SharedGCData_Impl; + + /// \brief Texture Transfer class. + class TransferTexture : public PixelBuffer + { + public: + /// \brief Constructs a null instance. + TransferTexture(); + + /// \brief Constructs a GPU Transfer Buffer + /// + /// \param provider = Font Provider + TransferTexture(PixelBufferProvider *provider); + + /// \brief Constructs a GPU Transfer Buffer + /// + /// \param gc = Graphic Context + /// \param width = value + /// \param height = value + /// \param direction = prefered direction that you will use tranferring the pixel buffer data + /// \param sized_format = Texture Format + /// \param data = data to copy from (May be NULL) + /// \param usage = Buffer Usage + TransferTexture(GraphicContext &gc, int width, int height, PixelBufferDirection direction = data_to_gpu, TextureFormat texture_format = tf_rgba8, const void *data = nullptr, BufferUsage usage = usage_stream_draw); + + /// \brief Constructs a GPU Transfer Buffer from an existing pixelbuffer + /// + /// \param gc = Graphic Context + /// \param pbuff = The pixelbuffer to copy from + /// \param direction = prefered direction that you will use tranferring the pixel buffer data + /// \param usage = Buffer Usage + TransferTexture(GraphicContext &gc, const PixelBuffer &pbuff, PixelBufferDirection direction = data_to_gpu, BufferUsage usage = usage_stream_draw); + + ~TransferTexture(); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/transfer_vector.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/transfer_vector.h new file mode 100644 index 0000000..5f06f85 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/transfer_vector.h @@ -0,0 +1,102 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "transfer_buffer.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Transfer Vector + /// + template + class TransferVector : public TransferBuffer + { + public: + /// \brief Constructs a null instance. + TransferVector() + { + } + + /// \brief Constructs a TransferVector + /// + /// \param gc = Graphic Context + /// \param size = value + /// \param usage = Buffer Usage + TransferVector(GraphicContext &gc, int size, BufferUsage usage = usage_dynamic_copy) + : TransferBuffer(gc, size * sizeof(Type), usage) + { + } + + /// \brief Constructs a TransferVector + /// + /// \param gc = Graphic Context + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + TransferVector(GraphicContext &gc, Type *data, int size, BufferUsage usage = usage_dynamic_copy) + : TransferBuffer(gc, data, size * sizeof(Type), usage) + { + } + + TransferVector(GraphicContext &gc, const std::vector &data, BufferUsage usage = usage_dynamic_copy) + : TransferBuffer(gc, data.empty() ? (Type*)0 : &data[0], data.size() * sizeof(Type), usage) + { + } + + /// \brief Constructs a TransferVector from an existing buffer + explicit TransferVector(const TransferBuffer &transfer_buffer) + : TransferBuffer(transfer_buffer) + { + } + + /// \brief Retrieves a pointer to the mapped buffer. + Type *get_data() { return reinterpret_cast(TransferBuffer::get_data()); } + + Type &operator[](int index) { return get_data()[index]; } + Type &operator[](unsigned int index) { return get_data()[index]; } + + /// \brief Uploads data to transfer buffer. + void upload_data(GraphicContext &gc, int offset, const Type *data, int size) + { + TransferBuffer::upload_data(gc, offset * sizeof(Type), data, size * sizeof(Type)); + } + + /// \brief Uploads data to transfer buffer. + void upload_data(GraphicContext &gc, int offset, const std::vector &data) + { + if (!data.empty()) + TransferBuffer::upload_data(gc, offset * sizeof(Type), &data[0], data.size() * sizeof(Type)); + } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/uniform_buffer.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/uniform_buffer.h new file mode 100644 index 0000000..46734b1 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/uniform_buffer.h @@ -0,0 +1,105 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../Image/buffer_usage.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class GraphicContext; + class TransferBuffer; + class UniformBufferProvider; + class UniformBuffer_Impl; + class ProgramObject; + + /// \brief Uniform Buffer + class UniformBuffer + { + public: + /// \brief Constructs a null instance. + UniformBuffer(); + + /// \brief Constructs a ProgramUniformBlock + /// + /// \param gc = Graphic Context + /// \param size = size - use ProgramObject::get_uniform_buffer_size() to calcuate this + /// \param usage = Buffer Usage + UniformBuffer(GraphicContext &gc, int block_size, BufferUsage usage = usage_dynamic_draw); + + /// \brief Constructs a VertexArrayBuffer + /// + /// \param gc = Graphic Context + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + UniformBuffer(GraphicContext &gc, const void *data, int size, BufferUsage usage = usage_dynamic_draw); + + /// \brief Constructs a ProgramUniformBlock - convenience function + /// + /// \param gc = Graphic Context + /// \param num_blocks = Number of blocks to allocate + /// \param usage = Buffer Usage + UniformBuffer(GraphicContext &gc, ProgramObject &program, const std::string &name, int num_blocks = 1, BufferUsage usage = usage_dynamic_draw); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Get Provider + /// + /// \return provider + UniformBufferProvider *get_provider() const; + + /// \brief Handle comparison operator. + bool operator==(const UniformBuffer &other) const; + + /// \brief Uploads data to uniforms buffer. + /// + /// The size specified must match the size of the buffer and is only included to help guard against buffer overruns. + void upload_data(GraphicContext &gc, const void *data, int size); + + /// \brief Copies data from transfer buffer + void copy_from(GraphicContext &gc, TransferBuffer &buffer, int dest_pos = 0, int src_pos = 0, int size = -1); + + /// \brief Copies data to transfer buffer + void copy_to(GraphicContext &gc, TransferBuffer &buffer, int dest_pos = 0, int src_pos = 0, int size = -1); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/uniform_vector.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/uniform_vector.h new file mode 100644 index 0000000..ed31ff0 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/uniform_vector.h @@ -0,0 +1,109 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "uniform_buffer.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Uniform Buffer Vector + /// + template + class UniformVector : public UniformBuffer + { + public: + /// \brief Constructs a null instance. + UniformVector() + { + } + + /// \brief Constructs a ElementArrayBuffer + /// + /// \param gc = Graphic Context + /// \param size = value + /// \param usage = Buffer Usage + UniformVector(GraphicContext &gc, int size, BufferUsage usage = usage_static_draw) + : UniformBuffer(gc, size * sizeof(Type), usage) + { + } + + /// \brief Constructs a ElementArrayBuffer + /// + /// \param gc = Graphic Context + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + UniformVector(GraphicContext &gc, Type *data, int size, BufferUsage usage = usage_static_draw) + : UniformBuffer(gc, data, size * sizeof(Type), usage) + { + } + + UniformVector(GraphicContext &gc, const std::vector &data, BufferUsage usage = usage_static_draw) + : UniformBuffer(gc, data.empty() ? (Type*)0 : &data[0], data.size() * sizeof(Type), usage) + { + } + + /// \brief Uploads data to uniforms buffer. + /// + /// The size specified must match the size of the buffer and is only included to help guard against buffer overruns. + void upload_data(GraphicContext &gc, const Type *data, int size) + { + UniformBuffer::upload_data(gc, data, size * sizeof(Type)); + } + + /// \brief Uploads data to uniforms buffer. + void upload_data(GraphicContext &gc, const std::vector &data) + { + if (!data.empty()) + UniformBuffer::upload_data(gc, &data[0], data.size() * sizeof(Type)); + } + + /// \brief Copies data from transfer buffer + void copy_from(GraphicContext &gc, TransferVector &buffer, int dest_pos = 0, int src_pos = 0, int size = -1) + { + if (size != -1) + size = size * sizeof(Type); + UniformBuffer::copy_from(gc, buffer, dest_pos * sizeof(Type), src_pos * sizeof(Type), size); + } + + /// \brief Copies data to transfer buffer + void copy_to(GraphicContext &gc, TransferVector &buffer, int dest_pos = 0, int src_pos = 0, int size = -1) + { + if (size != -1) + size = size * sizeof(Type); + UniformBuffer::copy_to(gc, buffer, dest_pos * sizeof(Type), src_pos * sizeof(Type), size); + } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/vertex_array_buffer.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/vertex_array_buffer.h new file mode 100644 index 0000000..31fe52a --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/vertex_array_buffer.h @@ -0,0 +1,97 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../Image/buffer_usage.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class GraphicContext; + class TransferBuffer; + class VertexArrayBufferProvider; + class VertexArrayBuffer_Impl; + + /// \brief Vertex Array Buffer + class VertexArrayBuffer + { + public: + /// \brief Constructs a null instance. + VertexArrayBuffer(); + + /// \brief Constructs a VertexArrayBuffer + /// + /// \param gc = Graphic Context + /// \param size = value + /// \param usage = Buffer Usage + VertexArrayBuffer(GraphicContext &gc, int size, BufferUsage usage = usage_static_draw); + + /// \brief Constructs a VertexArrayBuffer + /// + /// \param gc = Graphic Context + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + VertexArrayBuffer(GraphicContext &gc, const void *data, int size, BufferUsage usage = usage_static_draw); + + virtual ~VertexArrayBuffer(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Get Provider + /// + /// \return provider + VertexArrayBufferProvider *get_provider() const; + + /// \brief Handle comparison operator. + bool operator==(const VertexArrayBuffer &other) const; + + /// \brief Uploads data to vertex array buffer. + void upload_data(GraphicContext &gc, int offset, const void *data, int size); + + /// \brief Copies data from transfer buffer + void copy_from(GraphicContext &gc, TransferBuffer &buffer, int dest_pos = 0, int src_pos = 0, int size = -1); + + /// \brief Copies data to transfer buffer + void copy_to(GraphicContext &gc, TransferBuffer &buffer, int dest_pos = 0, int src_pos = 0, int size = -1); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/vertex_array_vector.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/vertex_array_vector.h new file mode 100644 index 0000000..ca2475f --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Render/vertex_array_vector.h @@ -0,0 +1,112 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "vertex_array_buffer.h" +#include "transfer_vector.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Vertex Array Vector + /// + template + class VertexArrayVector : public VertexArrayBuffer + { + public: + /// \brief Constructs a null instance. + VertexArrayVector() + { + } + + /// \brief Constructs a VertexArrayBuffer using an existing VertexArrayBuffer + explicit VertexArrayVector(const VertexArrayBuffer &buffer) : VertexArrayBuffer(buffer) + { + } + + /// \brief Constructs a VertexArrayBuffer + /// + /// \param gc = Graphic Context + /// \param size = value + /// \param usage = Buffer Usage + VertexArrayVector(GraphicContext &gc, int size, BufferUsage usage = usage_static_draw) + : VertexArrayBuffer(gc, size * sizeof(Type), usage) + { + } + + /// \brief Constructs a VertexArrayBuffer + /// + /// \param gc = Graphic Context + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + VertexArrayVector(GraphicContext &gc, Type *data, int size, BufferUsage usage = usage_static_draw) + : VertexArrayBuffer(gc, data, size * sizeof(Type), usage) + { + } + + VertexArrayVector(GraphicContext &gc, const std::vector &data, BufferUsage usage = usage_static_draw) + : VertexArrayBuffer(gc, data.empty() ? (Type*)0 : &data[0], data.size() * sizeof(Type), usage) + { + } + + /// \brief Uploads data to vertex array buffer. + void upload_data(GraphicContext &gc, int offset, const Type *data, int size) + { + VertexArrayBuffer::upload_data(gc, offset * sizeof(Type), data, size * sizeof(Type)); + } + + /// \brief Uploads data to vertex array buffer. + void upload_data(GraphicContext &gc, int offset, const std::vector &data) + { + if (!data.empty()) + VertexArrayBuffer::upload_data(gc, offset, &data[0], data.size() * sizeof(Type)); + } + + /// \brief Copies data from transfer buffer + void copy_from(GraphicContext &gc, TransferVector &buffer, int dest_pos = 0, int src_pos = 0, int size = -1) + { + if (size != -1) + size = size * sizeof(Type); + VertexArrayBuffer::copy_from(gc, buffer, dest_pos * sizeof(Type), src_pos * sizeof(Type), size); + } + + /// \brief Copies data to transfer buffer + void copy_to(GraphicContext &gc, TransferVector &buffer, int dest_pos = 0, int src_pos = 0, int size = -1) + { + if (size != -1) + size = size * sizeof(Type); + VertexArrayBuffer::copy_to(gc, buffer, dest_pos * sizeof(Type), src_pos * sizeof(Type), size); + } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Resources/display_cache.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Resources/display_cache.h new file mode 100644 index 0000000..41b0361 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Resources/display_cache.h @@ -0,0 +1,62 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../../Core/Resources/resource.h" +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Resources clanDisplay Resources + /// \{ + + class ResourceManager; + class GraphicContext; + class Canvas; + class Sprite; + class Image; + class Texture; + class Font; + class FontDescription; + + class DisplayCache + { + public: + virtual ~DisplayCache() { } + virtual Resource get_sprite(Canvas &canvas, const std::string &id) = 0; + virtual Resource get_image(Canvas &canvas, const std::string &id) = 0; + virtual Resource get_texture(GraphicContext &gc, const std::string &id) = 0; + virtual Resource get_font(Canvas &canvas, const std::string &family_name, const FontDescription &desc) = 0; + + static DisplayCache &get(const ResourceManager &resources); + static void set(ResourceManager &resources, const std::shared_ptr &cache); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ShaderEffect/shader_effect.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ShaderEffect/shader_effect.h new file mode 100644 index 0000000..8dd9a99 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ShaderEffect/shader_effect.h @@ -0,0 +1,67 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Kenneth Gangstoe +*/ + +#pragma once + +#include +#include "../Render/graphic_context.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class ShaderEffect_Impl; + class ShaderEffectDescription; + + /// \brief Shader Feffect + class ShaderEffect + { + public: + /// \brief Constructs a null instance + ShaderEffect(); + + /// \brief Constructs a shader effect. + /// + /// \param description Shader effect description. + /// \param gc Graphics context in which to create the shader effect. + ShaderEffect(GraphicContext &gc, const ShaderEffectDescription &description); + + bool is_null() const; + explicit operator bool() const { return bool(impl); } + + void dispatch(GraphicContext &gc, int x, int y = 1, int z = 1); + void draw(GraphicContext &gc); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ShaderEffect/shader_effect_description.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ShaderEffect/shader_effect_description.h new file mode 100644 index 0000000..b21b974 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/ShaderEffect/shader_effect_description.h @@ -0,0 +1,298 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Kenneth Gangstoe +*/ + +#pragma once + +#include +#include "../Render/graphic_context.h" +#include "../Render/rasterizer_state_description.h" +#include "../Render/blend_state_description.h" +#include "../Render/depth_stencil_state_description.h" +#include "../Render/storage_buffer.h" +#include "../Render/uniform_buffer.h" +#include "../Render/texture.h" +#include "../Render/render_buffer.h" +#include "../../Core/Resources/resource.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class ShaderEffectDescription_Impl; + + /// \brief Shader Effect Description + /// + ///

...

+ class ShaderEffectDescription + { + public: + ShaderEffectDescription(); + + void set_glsl_version(int version = 330); + + void set_define(std::string name, std::string value = "1"); + + void set_vertex_shader(std::string code, ShaderLanguage language = shader_glsl); + void set_fragment_shader(std::string code, ShaderLanguage language = shader_glsl); + void set_compute_shader(std::string code, ShaderLanguage language = shader_glsl); + + RasterizerStateDescription &rasterizer(); + BlendStateDescription &blend(); + DepthStencilStateDescription &depth_stencil(); + + void set_frag_data(std::string name, RenderBuffer buffer); + void set_frag_data(std::string name, Texture texture); + void set_frag_data_to_back_buffer(std::string name); + + void set_depth_data(RenderBuffer buffer); + void set_depth_data(Texture texture); + + void set_stencil_data(RenderBuffer buffer); + void set_stencil_data(Texture texture); + + void set_texture(std::string name, Resource texture); + void set_image(std::string name, Resource texture); + + void set_storage(std::string name, Resource values); + + void set_uniform_block(std::string name, Resource values); + + void set_attribute(std::string name, VertexArrayBuffer &buffer, int size, VertexAttributeDataType type, size_t offset = 0, int stride = 0, bool normalize = false); + + void set_attribute(std::string name, VertexArrayVector &buffer, int size, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, size, type_unsigned_byte, 0, 0, normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, int size, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, size, type_byte, 0, 0, normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, int size, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, size, type_unsigned_short, 0, 0, normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, int size, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, size, type_short, 0, 0, normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, int size, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, size, type_unsigned_int, 0, 0, normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, int size, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, size, type_int, 0, 0, normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, int size, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, size, type_float, 0, 0, normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 1, type_unsigned_byte, 0, sizeof(unsigned char), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 1, type_byte, 0, sizeof(signed char), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 1, type_unsigned_short, 0, sizeof(unsigned short), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 1, type_short, 0, sizeof(signed short), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 1, type_unsigned_int, 0, sizeof(unsigned int), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 1, type_int, 0, sizeof(signed int), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 1, type_float, 0, sizeof(float), false); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 2, type_unsigned_byte, 0, sizeof(Vec2ub), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 2, type_byte, 0, sizeof(Vec2b), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 2, type_unsigned_short, 0, sizeof(Vec2us), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 2, type_short, 0, sizeof(Vec2s), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 2, type_unsigned_int, 0, sizeof(Vec2ui), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 2, type_int, 0, sizeof(Vec2i), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 2, type_float, 0, sizeof(Vec2f), false); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 3, type_unsigned_byte, 0, sizeof(Vec3ub), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 3, type_byte, 0, sizeof(Vec3b), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 3, type_unsigned_short, 0, sizeof(Vec3us), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 3, type_short, 0, sizeof(Vec3s), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 3, type_unsigned_int, 0, sizeof(Vec3ui), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 3, type_int, 0, sizeof(Vec3i), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 3, type_float, 0, sizeof(Vec3f), false); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 4, type_unsigned_byte, 0, sizeof(Vec4ub), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 4, type_byte, 0, sizeof(Vec4b), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 4, type_unsigned_short, 0, sizeof(Vec4us), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 4, type_short, 0, sizeof(Vec4s), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 4, type_unsigned_int, 0, sizeof(Vec4ui), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer, bool normalize = false) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 4, type_int, 0, sizeof(Vec4i), normalize); + } + + void set_attribute(std::string name, VertexArrayVector &buffer) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 4, type_float, 0, sizeof(Vec4f), false); + } + + void set_attribute(std::string name, VertexArrayVector &buffer) + { + set_attribute(name, (VertexArrayBuffer&)buffer, 4, type_float, 0, sizeof(Colorf), false); + } + + void set_attribute_screen_quad(std::string name); + void set_attribute_uv_quad(std::string name); + + void set_elements(ElementArrayBuffer &element_array, VertexAttributeDataType indices_type); + + void set_elements(ElementArrayVector &element_array) + { + set_elements(element_array, type_unsigned_int); + } + + void set_elements(ElementArrayVector &element_array) + { + set_elements(element_array, type_unsigned_short); + } + + void set_elements(ElementArrayVector &element_array) + { + set_elements(element_array, type_unsigned_byte); + } + + void set_draw_count(int count); + + private: + std::shared_ptr impl; + + friend class ShaderEffect; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/System/detect_hang.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/System/detect_hang.h new file mode 100644 index 0000000..38f3a06 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/System/detect_hang.h @@ -0,0 +1,53 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include + +namespace clan +{ + /// \addtogroup clanCore_ErrorReporting clanCore ErrorReporting + /// \{ + + class DetectHang_Impl; + + /// \brief Calls CrashReporter::invoke if the constructing thread does not call RunLoop::process for more than 30 seconds. + class DetectHang + { + public: + /// \brief Constructs a hang detector. + DetectHang(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/System/run_loop.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/System/run_loop.h new file mode 100644 index 0000000..55cdfaf --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/System/run_loop.h @@ -0,0 +1,97 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include + +namespace clan +{ + /// \brief Main thread message pump processing + class RunLoop + { + public: + /// \brief Continously process messages until RunLoop::exit() is called + static void run(); + + /// \brief Signal that message processing should end immediately + static void exit(); + + /// \brief Process messages for specified amount of time + /// \retval Returns false if RunLoop::exit() has been called or the OS signalled the app needs to shut down + static bool process(int timeout_ms = 0); + + /// \brief Executes a function on the main thread during message processing + /// + /// This provides a thread-safe way to execute some code on the main thread + /// as part of the message processing step. + static void main_thread_async(std::function func); + + /// \brief Executes a task on the main thread with a future result + /// + /// This provides a thread-safe way to execute some code on the main thread + /// as part of the message processing step. The caller can then wait and access + /// the result of the operation through the returned future. + template + static std::future main_thread_task(std::function func) + { + auto promise = std::make_shared>(); + main_thread_async([=]() + { + try + { + promise->set_value(func()); + } + catch (...) + { + promise->set_exception(std::current_exception()); + } + }); + return promise->get_future(); + } + + static std::future main_thread_task(std::function func) + { + auto promise = std::make_shared>(); + main_thread_async([=]() + { + try + { + func(); + promise->set_value(); + } + catch (...) + { + promise->set_exception(std::current_exception()); + } + }); + return promise->get_future(); + } + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/System/timer.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/System/timer.h new file mode 100644 index 0000000..27f21c2 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/System/timer.h @@ -0,0 +1,63 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include + +namespace clan +{ + class TimerImpl; + + /// \brief Timer class that invokes a callback on a specified interval + class Timer + { + public: + /// \brief Creates a timer object + Timer(); + + /// \brief Returns true if the timer repeats until it is stopped + bool is_repeating() const; + + /// \brief Returns the current timeout. In milliseconds. + unsigned int get_timeout() const; + + /// \brief Callback invoked every time the timer interval occurs + std::function &func_expired(); + + /// \brief Starts the timer. Timeout in milliseconds. + void start(unsigned int timeout, bool repeat = true); + + /// \brief Stop the timer. + void stop(); + + private: + std::shared_ptr impl; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/cursor_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/cursor_provider.h new file mode 100644 index 0000000..74492e9 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/cursor_provider.h @@ -0,0 +1,44 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Interface for implementing a Cursor target. + class CursorProvider + { + public: + virtual ~CursorProvider() { } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/display_target_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/display_target_provider.h new file mode 100644 index 0000000..191744f --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/display_target_provider.h @@ -0,0 +1,52 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class DisplayWindowProvider; + + /// \brief Interface for implementing a DisplayTarget target. + class DisplayTargetProvider + { + public: + virtual ~DisplayTargetProvider() { return; } + + /// \brief Allocates a display window provider. + virtual DisplayWindowProvider *alloc_display_window() = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/display_window_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/display_window_provider.h new file mode 100644 index 0000000..3952fb7 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/display_window_provider.h @@ -0,0 +1,291 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +** Kenneth Gangstoe +*/ + +#pragma once + +#include "../../Core/Signals/signal.h" +#include "../Window/display_window.h" +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class Rect; + class Size; + class Point; + class DisplayWindowDescription; + class GraphicContext; + class InputDevice; + class CursorProvider; + class CursorDescription; + + /// Display Window site. + class DisplayWindowSite + { + public: + /// Lost focus signal. + Signal sig_lost_focus; + + /// Obtained focus signal. + Signal sig_got_focus; + + /// Resize signal. + Signal sig_resize; + + /// Paint signal. + Signal sig_paint; + + /// Window close signal. + Signal sig_window_close; + + /// Window destroy signal. + Signal sig_window_destroy; + + /// Window minimized signal. + Signal sig_window_minimized; + + /// Window maximized signal. + Signal sig_window_maximized; + + /// Window restored signal. + Signal sig_window_restored; + + /// Window resize callback function. + std::function func_window_resize; + + /// Minimize button is clicked callback function. + std::function func_minimize_clicked; + + /// Window moved signal. + Signal sig_window_moved; + +#ifdef WIN32 + std::function func_window_message; + Signal sig_window_message; +#endif + }; + + /// Interface for implementing a DisplayWindow target. + class DisplayWindowProvider + { + public: + virtual ~DisplayWindowProvider() { return; } + + /// Returns the position and size of the window frame. + virtual Rect get_geometry() const = 0; + + /// Returns the drawable area of the window. + virtual Rect get_viewport() const = 0; + + /** Returns the display pixel ratio of the window. + * \seealso Resolution Independence + */ + virtual float get_pixel_ratio() const = 0; + + /// Returns true if window has focus. + virtual bool has_focus() const = 0; + + /// Returns true if the window is minimized. + virtual bool is_minimized() const = 0; + + /// Returns true if the window is maximized. + virtual bool is_maximized() const = 0; + + /// Returns true if the window is visible. + virtual bool is_visible() const = 0; + + /// Returns true if the window is fullscreen. + virtual bool is_fullscreen() const = 0; + + /// Returns the minimum size of the window. + virtual Size get_minimum_size(bool client_area) const = 0; + + /// Returns the maximum size of the window. + virtual Size get_maximum_size(bool client_area) const = 0; + + /// Returns the maximum size of the window. + virtual std::string get_title() const = 0; + + /// Returns the graphic context for the window. + virtual GraphicContext& get_gc() = 0; + + /// \brief Returns the keyboard input device. + virtual InputDevice &get_keyboard() = 0; + + /// \brief Returns the mouse input device. + virtual InputDevice &get_mouse() = 0; + + /// \brief Returns the game controller input device. + virtual std::vector &get_game_controllers() = 0; + + /** Returns an platform-specific internal display window handle object. + */ + virtual DisplayWindowHandle get_handle() const = 0; + + /// Returns true if text is available in the clipboard. + virtual bool is_clipboard_text_available() const = 0; + + /// Returns true if an image is available in the clipboard. + virtual bool is_clipboard_image_available() const = 0; + + /// Returns the text stored in the clipboard. + virtual std::string get_clipboard_text() const = 0; + + /// Returns the image stored in the clipboard. + virtual PixelBuffer get_clipboard_image() const = 0; + + /// Convert from window client coordinates to screen coordinates. + virtual Point client_to_screen(const Point &client) = 0; + + /// Convert from screen coordinates to client coordinates. + virtual Point screen_to_client(const Point &screen) = 0; + + /// Capture/Release the mouse. + virtual void capture_mouse(bool capture) = 0; + + /// Invalidates the screen, causing a repaint. + virtual void request_repaint() = 0; + + /// Creates window, assigning site and description to provider. + virtual void create(DisplayWindowSite *site, const DisplayWindowDescription &description) = 0; + + /// Shows the mouse cursor. + virtual void show_system_cursor() = 0; + + /// Hides the mouse cursor. + virtual void hide_system_cursor() = 0; + + /// Creates a new custom cursor. + virtual CursorProvider *create_cursor(const CursorDescription &cursor_description) = 0; + + /// Sets the current cursor icon. + virtual void set_cursor(CursorProvider *cursor) = 0; + + /// Sets the current cursor icon. + virtual void set_cursor(StandardCursor type) = 0; + +#ifdef WIN32 + /// Sets the current cursor handle (win32 only) + virtual void set_cursor_handle(HCURSOR cursor) = 0; +#endif + + /// Change window title. + virtual void set_title(const std::string &new_title) = 0; + + /// Sets the position and size of this window on the screen. + virtual void set_position(const Rect &pos, bool client_area) = 0; + + /** Sets the size of this window. + * \param width Minimum width of the window. + * \param height Minimum height of the window. + * \param client_area Size includes the entire window frame? + */ + virtual void set_size(int width, int height, bool client_area) = 0; + + /** Sets the minimum size allowed for this window when resizing. + * \param width Minimum width of the window. + * \param height Minimum height of the window. + * \param client_area Size includes the entire window frame? + */ + virtual void set_minimum_size(int width, int height, bool client_area) = 0; + + /** Sets the maximum size allowed for this window when resizing. + * \param width Maximum width of the window. + * \param height Maximum height of the window. + * \param client_area Size includes the entire window frame? + */ + virtual void set_maximum_size(int width, int height, bool client_area) = 0; + + /** Sets the display pixel ratio of this window. + * \param ratio The new display pixel ratio to use on this window. + */ + virtual void set_pixel_ratio(float ratio) = 0; + + /// Enables or disables input into this window. + virtual void set_enabled(bool enable) = 0; + + /// Minimizes the window. + virtual void minimize() = 0; + + /// Restores the window. + virtual void restore() = 0; + + /// Maximizes the window. + virtual void maximize() = 0; + + /// Toggle fullscreen + /// Only Win32 implementation for now + virtual void toggle_fullscreen() = 0; + + /// Displays the window in its current size and position. + virtual void show(bool activate) = 0; + + /// Hides the window. + virtual void hide() = 0; + + /// Raise window on top of other windows. + virtual void bring_to_front() = 0; + + /// Flip the window display buffers. + virtual void flip(int interval) = 0; + + /// Stores text in the clipboard. + virtual void set_clipboard_text(const std::string &text) = 0; + + /// Stores an image in the clipboard. + virtual void set_clipboard_image(const PixelBuffer &buf) = 0; + + /// Sets the large icon used for this window. + virtual void set_large_icon(const PixelBuffer &image) = 0; + + /// Sets the small icon used for this window. + virtual void set_small_icon(const PixelBuffer &image) = 0; + + /** Enable alpha channel blending for this window. + * + * \note This is only supported on Windows Vista and above. You can use + * layered windows to achieve the same effect on systems that do + * not support this. + * + * \param blur_rect Window blur area. If its size is `0`, the area of + * the entire window will be used. + */ + virtual void enable_alpha_channel(const Rect &blur_rect) = 0; + + /** Extend the window frame into the client area. + * \note This is only applicable in Windows. + */ + virtual void extend_frame_into_client_area(int left, int top, int right, int bottom) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/element_array_buffer_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/element_array_buffer_provider.h new file mode 100644 index 0000000..14d0431 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/element_array_buffer_provider.h @@ -0,0 +1,67 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../Render/element_array_buffer.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Element Array Buffer provider. + class ElementArrayBufferProvider + { + public: + virtual ~ElementArrayBufferProvider() { } + + /// \brief Constructs a element array buffer. + virtual void create(int size, BufferUsage usage) = 0; + + /// \brief Create + /// + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + virtual void create(void *data, int size, BufferUsage usage) = 0; + + /// \brief Uploads data to element array buffer. + /// + /// The size specified must match the size of the buffer and is only included to help guard against buffer overruns. + virtual void upload_data(GraphicContext &gc, const void *data, int size) = 0; + + /// \brief Copies data from transfer buffer + virtual void copy_from(GraphicContext &gc, TransferBuffer &buffer, int dest_pos, int src_pos, int size) = 0; + + /// \brief Copies data to transfer buffer + virtual void copy_to(GraphicContext &gc, TransferBuffer &buffer, int dest_pos, int src_pos, int size) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/frame_buffer_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/frame_buffer_provider.h new file mode 100644 index 0000000..502170a --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/frame_buffer_provider.h @@ -0,0 +1,133 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + + +#pragma once + +#include "../Render/frame_buffer.h" +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class RenderBuffer; + class Texture2D; + + /// \brief Interface for implementing a FrameBuffer target. + class FrameBufferProvider + { + public: + virtual ~FrameBufferProvider() { return; } + + virtual Size get_size() const = 0; + virtual FrameBufferBindTarget get_bind_target() const = 0; + + /// \brief Attach color buffer + /// + /// \param attachment_index = value + /// \param render_buffer = Render Buffer + virtual void attach_color(int attachment_index, const RenderBuffer &render_buffer) = 0; + + /// \brief Attach color buffer + /// + /// \param attachment_index = value + /// \param texture = Texture + /// \param level = value + virtual void attach_color(int attachment_index, const Texture1D &texture, int level) = 0; + + /// \brief Attach color buffer + /// + /// \param attachment_index = value + /// \param texture = Texture + /// \param array_index = value + /// \param level = value + virtual void attach_color(int attachment_index, const Texture1DArray &texture, int array_index, int level) = 0; + + /// \brief Attach color buffer + /// + /// \param attachment_index = value + /// \param texture = Texture + /// \param level = value + virtual void attach_color(int attachment_index, const Texture2D &texture, int level) = 0; + + /// \brief Attach color buffer + /// + /// \param attachment_index = value + /// \param texture = Texture + /// \param array_index = value + /// \param level = value + virtual void attach_color(int attachment_index, const Texture2DArray &texture, int array_index, int level) = 0; + + /// \brief Attach color buffer + /// + /// \param attachment_index = value + /// \param texture = Texture + /// \param depth = value + /// \param level = value + virtual void attach_color(int attachment_index, const Texture3D &texture, int depth, int level) = 0; + + /// \brief Attach color buffer + /// + /// \param attachment_index = value + /// \param texture = Texture + /// \param subtype = Texture Subtype + /// \param level = value + /// \param zoffset = value + virtual void attach_color(int attachment_index, const TextureCube &texture, TextureSubtype subtype, int level) = 0; + + /// \brief Detach color buffer + /// + /// \param color_buffer = value + /// \param texture = Texture + /// \param level = value + /// \param zoffset = value + virtual void detach_color(int attachment_index) = 0; + + virtual void attach_stencil(const RenderBuffer &render_buffer) = 0; + virtual void attach_stencil(const Texture2D &texture, int level) = 0; + virtual void attach_stencil(const TextureCube &texture, TextureSubtype subtype, int level) = 0; + virtual void detach_stencil() = 0; + + virtual void attach_depth(const RenderBuffer &render_buffer) = 0; + virtual void attach_depth(const Texture2D &texture, int level) = 0; + virtual void attach_depth(const TextureCube &texture, TextureSubtype subtype, int level) = 0; + virtual void detach_depth() = 0; + + virtual void attach_depth_stencil(const RenderBuffer &render_buffer) = 0; + virtual void attach_depth_stencil(const Texture2D &texture, int level) = 0; + virtual void attach_depth_stencil(const TextureCube &texture, TextureSubtype subtype, int level) = 0; + virtual void detach_depth_stencil() = 0; + + virtual void set_bind_target(FrameBufferBindTarget target) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/graphic_context_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/graphic_context_provider.h new file mode 100644 index 0000000..be9ee00 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/graphic_context_provider.h @@ -0,0 +1,340 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include +#include "../Render/graphic_context.h" +#include "../Render/primitives_array.h" +#include "../Render/texture.h" +#include "../../Core/Math/mat4.h" +#include "../../Core/Signals/signal.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class Texture; + class Stencil; + class TextureProvider; + class FontProvider; + class Font; + class OcclusionQueryProvider; + class ProgramObjectProvider; + class ShaderObjectProvider; + class FrameBufferProvider; + class RenderBufferProvider; + class VertexArrayBufferProvider; + class ElementArrayBufferProvider; + class TransferBufferProvider; + class FontDescription; + class PixelBufferProvider; + class UniformBufferProvider; + class StorageBufferProvider; + class PrimitivesArrayProvider; + class RasterizerStateDescription; + class BlendStateDescription; + class DepthStencilStateDescription; + + class RasterizerStateProvider + { + public: + virtual ~RasterizerStateProvider() { } + }; + + class BlendStateProvider + { + public: + virtual ~BlendStateProvider() { } + }; + + class DepthStencilStateProvider + { + public: + virtual ~DepthStencilStateProvider() { } + }; + + /// \brief Interface for implementing a GraphicContext target. + class GraphicContextProvider + { + public: + virtual ~GraphicContextProvider() { return; } + + /// \brief Returns the maximum amount of attributes available. + virtual int get_max_attributes() = 0; + + /// \brief Returns the maximum size of a texture this graphic context supports. + /**

It returns Size(0,0) if there is no known limitation to the max + texture size.

*/ + virtual Size get_max_texture_size() const = 0; + + /// \brief Returns the current size of the display window + virtual Size get_display_window_size() const = 0; + + /// \brief Physical pixels/dots per inch + virtual float get_pixel_ratio() const = 0; + + /// \brief Get the window resized signal + virtual Signal &sig_window_resized() = 0; + + /// \brief Get a program object from the standard program specified + virtual ProgramObject get_program_object(StandardProgram standard_program) const = 0; + + /// \brief Returns in what range clip space z values are clipped. + virtual ClipZRange get_clip_z_range() const = 0; + + /// \brief Returns the Y axis direction for viewports, clipping rects, textures and render targets + virtual TextureImageYAxis get_texture_image_y_axis() const = 0; + + /// \brief Returns the shader language used + virtual ShaderLanguage get_shader_language() const = 0; + + /// \brief Returns the major version / feature level supported by the hardware + /// + /// For the OpenGL target, this returns the major OpenGL version the driver supports. + /// For the Direct3D target, this returns the major feature level. + virtual int get_major_version() const = 0; + + /// \brief Returns the major version / feature level supported by the hardware + /// + /// For the OpenGL target, this returns the minor OpenGL version the driver supports. + /// For the Direct3D target, this returns the minor feature level. + virtual int get_minor_version() const = 0; + + /// \brief Returns true if the hardware supports compute shaders + /// + /// This always returns true for OpenGL 4.3 or newer, or Direct3D 11.0 or newer. + /// For Direct3D 10.0 and 10.1 the support for compute shaders is optional. + virtual bool has_compute_shader_support() const = 0; + + /// \brief Return the content of the draw buffer into a pixel buffer. + virtual PixelBuffer get_pixeldata(const Rect& rect, TextureFormat texture_format, bool clamp) const = 0; + + /// \brief Allocate texture provider for this gc. + virtual TextureProvider *alloc_texture(TextureDimensions texture_dimensions) = 0; + + /// \brief Allocate occlusion query provider of this gc. + virtual OcclusionQueryProvider *alloc_occlusion_query() = 0; + + /// \brief Allocate program object provider of this gc. + virtual ProgramObjectProvider *alloc_program_object() = 0; + + /// \brief Allocate shader object provider of this gc. + virtual ShaderObjectProvider *alloc_shader_object() = 0; + + /// \brief Allocate frame buffer provider for this gc. + virtual FrameBufferProvider *alloc_frame_buffer() = 0; + + /// \brief Allocate render buffer provider for this gc. + virtual RenderBufferProvider *alloc_render_buffer() = 0; + + /// \brief Allocate vertex array buffer provider for this gc. + virtual VertexArrayBufferProvider *alloc_vertex_array_buffer() = 0; + + /// \brief Allocate uniform buffer provider for this gc. + virtual UniformBufferProvider *alloc_uniform_buffer() = 0; + + /// \brief Allocate storage buffer provider for this gc. + virtual StorageBufferProvider *alloc_storage_buffer() = 0; + + /// \brief Allocate element array buffer provider for this gc. + virtual ElementArrayBufferProvider *alloc_element_array_buffer() = 0; + + /// \brief Allocate transfer buffer provider for this gc. + virtual TransferBufferProvider *alloc_transfer_buffer() = 0; + + /// \brief Allocate pixel buffer provider for this gc. + virtual PixelBufferProvider *alloc_pixel_buffer() = 0; + + /// \brief Allocate primitives array provider for this gc. + virtual PrimitivesArrayProvider *alloc_primitives_array() = 0; + + /// \brief Retrieve rasterizer state object. + virtual std::shared_ptr create_rasterizer_state(const RasterizerStateDescription &desc) = 0; + + /// \brief Retrieve blend state object. + virtual std::shared_ptr create_blend_state(const BlendStateDescription &desc) = 0; + + /// \brief Retrieve depth-stencil state object. + virtual std::shared_ptr create_depth_stencil_state(const DepthStencilStateDescription &desc) = 0; + + /// \brief Set active rasterizer state + virtual void set_rasterizer_state(RasterizerStateProvider *state) = 0; + + /// \brief Set active blend state + virtual void set_blend_state(BlendStateProvider *state, const Colorf &blend_color, unsigned int sample_mask) = 0; + + /// \brief Set active depth stencil state + virtual void set_depth_stencil_state(DepthStencilStateProvider *state, int stencil_ref) = 0; + + /// \brief Set active program object to the standard program specified. + virtual void set_program_object(StandardProgram standard_program) = 0; + + /// \brief Set active program object. + /// + /// \param program = Program to set + virtual void set_program_object(const ProgramObject &program) = 0; + + /// \brief Remove active program object. + virtual void reset_program_object() = 0; + + /// \brief Select uniform buffer into index + virtual void set_uniform_buffer(int index, const UniformBuffer &buffer) = 0; + + /// \brief Remove uniform buffer from index + virtual void reset_uniform_buffer(int index) = 0; + + /// \brief Select storage buffer into index + virtual void set_storage_buffer(int index, const StorageBuffer &buffer) = 0; + + /// \brief Remove storage buffer from index + virtual void reset_storage_buffer(int index) = 0; + + /// \brief Select texture into unit. + virtual void set_texture(int unit_index, const Texture &texture) = 0; + + /// \brief Remove texture from unit. + virtual void reset_texture(int unit_index) = 0; + + /// \brief Select texture into image unit. + virtual void set_image_texture(int unit_index, const Texture &texture) = 0; + + /// \brief Remove texture from image unit. + virtual void reset_image_texture(int unit_index) = 0; + + /// \brief Returns true if this frame buffer object is owned by this graphic context. + virtual bool is_frame_buffer_owner(const FrameBuffer &fb) = 0; + + /// \brief Set a frame buffer for off-screen rendering. + virtual void set_frame_buffer(const FrameBuffer &write_buffer, const FrameBuffer &read_buffer) = 0; + + /// \brief Set the rendering buffer back to the screen. + virtual void reset_frame_buffer() = 0; + + virtual void set_draw_buffer(DrawBuffer buffer) = 0; + + /// \brief Returns true if this primitives_array is owned by this graphic context. + virtual bool is_primitives_array_owner(const PrimitivesArray &primitives_array) = 0; + + /// \brief Draw primitives on gc. + virtual void draw_primitives(PrimitivesType type, int num_vertices, const PrimitivesArray &primitives_array) = 0; + + /// \brief Set the primitives array on the gc. + virtual void set_primitives_array(const PrimitivesArray &primitives_array) = 0; + + /// \brief Draws primitives from the current assigned primitives array. + virtual void draw_primitives_array(PrimitivesType type, int offset, int num_vertices) = 0; + + /// \brief Draws instanced primitives from the current assigned primitives array. + virtual void draw_primitives_array_instanced(PrimitivesType type, int offset, int num_vertices, int instance_count) = 0; + + /// \brief Sets current elements array buffer + virtual void set_primitives_elements(ElementArrayBufferProvider *array_provider) = 0; + + /// \brief Draw primitives elements + /// + /// \param type = Primitives Type + /// \param count = value + /// \param indices_type = Vertex Attribute Data Type + /// \param offset = void + virtual void draw_primitives_elements(PrimitivesType type, int count, VertexAttributeDataType indices_type, size_t offset = 0) = 0; + + /// \brief Draw primitives elements instanced + /// + /// \param type = Primitives Type + /// \param count = value + /// \param indices_type = Vertex Attribute Data Type + /// \param offset = void + /// \param instance_count = number of instances drawn + virtual void draw_primitives_elements_instanced(PrimitivesType type, int count, VertexAttributeDataType indices_type, size_t offset, int instance_count) = 0; + + /// \brief Resets current elements array buffer + virtual void reset_primitives_elements() = 0; + + /// \brief Draw primitives elements + /// + /// \param type = Primitives Type + /// \param count = value + /// \param array_provider = Element Array Buffer Provider + /// \param indices_type = Vertex Attribute Data Type + /// \param offset = void + virtual void draw_primitives_elements(PrimitivesType type, int count, ElementArrayBufferProvider *array_provider, VertexAttributeDataType indices_type, void *offset) = 0; + + /// \brief Draw primitives elements instanced + /// + /// \param type = Primitives Type + /// \param count = value + /// \param array_provider = Element Array Buffer Provider + /// \param indices_type = Vertex Attribute Data Type + /// \param offset = void + virtual void draw_primitives_elements_instanced(PrimitivesType type, int count, ElementArrayBufferProvider *array_provider, VertexAttributeDataType indices_type, void *offset, int instance_count) = 0; + + /// \brief Reset the primitives arrays. + virtual void reset_primitives_array() = 0; + + /// \brief Set scissor. + virtual void set_scissor(const Rect &rect) = 0; + + /// \brief Reset scissor. + virtual void reset_scissor() = 0; + + /// \brief Execute a compute shader. + virtual void dispatch(int x, int y, int z) = 0; + + /// \brief Clears the whole context using the specified color. + virtual void clear(const Colorf &color) = 0; + + /// \brief Clear the depth buffer + /// + /// \param value: value to clear to. Range 0.0 - 1.0. + virtual void clear_depth(float value) = 0; + + /// \brief Clear the stencil buffer + /// + /// \param value value to clear to. + virtual void clear_stencil(int value) = 0; + + /// \brief Set the viewport to be used in user projection map mode. + virtual void set_viewport(const Rectf &viewport) = 0; + + /// \brief Set the specified viewport to be used in user projection map mode. + virtual void set_viewport(int index, const Rectf &viewport) = 0; + + /// \brief Specifies the depth range for all viewports + virtual void set_depth_range(float n, float f) = 0; + + /// \brief Specifies the depth range for the specified viewport + virtual void set_depth_range(int viewport, float n, float f) = 0; + + virtual void flush() = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/input_device_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/input_device_provider.h new file mode 100644 index 0000000..016909d --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/input_device_provider.h @@ -0,0 +1,107 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include "../Window/input_device.h" +#include "../../Core/System/disposable_object.h" +#include +#include "../../Core/Signals/signal.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Input clanDisplay Input + /// \{ + + /// \brief Interface for implementing a InputDevice source. + class InputDeviceProvider : public DisposableObject + { + public: + virtual ~InputDeviceProvider() { return; } + + /// \brief Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D'). + virtual std::string get_name() const = 0; + + /// \brief Return the hardware id/device for this device (i.e. /dev/input/js0) + virtual std::string get_device_name() const = 0; + + /// \brief Returns the input device type. + virtual InputDevice::Type get_type() const = 0; + + /// \brief Retrieves the localized friendly key name for specified identifier (i.e. A, B, Leertaste, Backspace, Mouse Left, ...). + /// \note The returned name for the key may be localized by the system; it + // should only be used to display the name of the key to the user + // and not as a key identifier inside key binding configuration + // files and such. + virtual std::string get_key_name(int id) const = 0; + + /// \brief Returns true if this provider implements keyid to/from string mapping. + virtual bool supports_keyid_mapping() const { return false; } + + /// \brief Returns a generic string name for the specified key code. + virtual std::string keyid_to_string(int /* keycode */) const { return std::string(); } + + /// \brief Returns the key code for the specified generic string key name. + virtual int string_to_keyid(const std::string &/* str */) const { return 0; } + + /// \brief Returns true if the passed key code is down for this device. + /// See `keys.h` for list of key codes. + virtual bool get_keycode(int keycode) const = 0; + + /// \brief Returns the current device-independent x and y position (DIP) of the device. (Pointing devices only) + /// The returned positional value is scaled to the pixel ratio of the display. + virtual Pointf get_position() const { return Pointf(0.f, 0.f); } + + /// \brief Returns the current device-supplied x and y position of the device. (Pointing devices only) + /// The returned positional value is in the scale of the physical pixel on the screen. + virtual Point get_device_position() const { return Point(0, 0); } + + /// \brief Returns the the current position of a joystick axis. (Joysticks only) + virtual float get_axis(int index) const { return 0.f; } + + /// \brief Returns the number of axes available on this device. (Joysticks only) + virtual std::vector get_axis_ids() const { return std::vector(); } + + /// \brief Returns the current position of a joystick hat. (Joysticks only) + /// \return Hat direction in degrees (0-360), or -1 if the hat is centered. + virtual int get_hat(int /* index */) const { return -1; } + + /// \brief Returns the number of buttons available on this device. + /// \warn If used on a keyboard or mouse, this function returns -1. + virtual int get_button_count() const = 0; + + /// \brief Sets the display-independent position of the device. (Pointing devices only) + virtual void set_position(float x, float y) { } + + /// \brief Sets the actual position of the device. (Pointing devices only) + virtual void set_device_position(int x, int y) { } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/occlusion_query_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/occlusion_query_provider.h new file mode 100644 index 0000000..5d80f75 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/occlusion_query_provider.h @@ -0,0 +1,61 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Input clanDisplay Input + /// \{ + + /// \brief Occlusion query provider. + class OcclusionQueryProvider + { + public: + virtual ~OcclusionQueryProvider() { return; } + + /// \brief Returns true if the GPU is ready to return the result. + virtual bool is_result_ready() const = 0; + + /// \brief Returns the result of the occlusion query. + virtual int get_result() const = 0; + + /// \brief Start occlusion query. + virtual void begin() = 0; + + /// \brief Finish occlusion query. + virtual void end() = 0; + + /// \brief Create occlusion query object. + virtual void create() = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/pixel_buffer_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/pixel_buffer_provider.h new file mode 100644 index 0000000..e756291 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/pixel_buffer_provider.h @@ -0,0 +1,81 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include "../Render/element_array_buffer.h" +#include "../Image/pixel_buffer.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Element Array Buffer provider. + class PixelBufferProvider + { + public: + virtual ~PixelBufferProvider() { } + + /// \brief Create + /// + /// \param data = void + /// \param new_width = New width + /// \param new_height = New height + /// \param direction = Direction + /// \param new_format = New format + /// \param usage = Buffer Usage + virtual void create(const void *data, const Size &new_size, PixelBufferDirection direction, TextureFormat new_format, BufferUsage usage) = 0; + + /// \brief Retrieves a pointer to the mapped buffer. + virtual void *get_data() = 0; + + /// \brief Retrieves the pitch of the mapped buffer. Use this after get_data() + virtual int get_pitch() const = 0; + + virtual Size get_size() const = 0; + + /// \brief Returns true if this pixel buffer is a GPU based one + virtual bool is_gpu() const = 0; + + /// \brief Returns the pixel format + virtual TextureFormat get_format() const = 0; + + /// \brief Maps buffer into system memory. + virtual void lock(GraphicContext &gc, BufferAccess access) = 0; + + /// \brief Unmaps element buffer. + virtual void unlock() = 0; + + /// \brief Uploads data to buffer. + virtual void upload_data(GraphicContext &gc, const Rect &dest_rect, const void *data) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/primitives_array_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/primitives_array_provider.h new file mode 100644 index 0000000..21eea7d --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/primitives_array_provider.h @@ -0,0 +1,64 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../Render/primitives_array.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Interface for implementing a PrimitivesArray target. + class PrimitivesArrayProvider + { + public: + virtual ~PrimitivesArrayProvider() { return; } + + class VertexData + { + public: + VertexData(VertexArrayBufferProvider *array_provider, VertexAttributeDataType type, size_t offset, int size, int stride) : + array_provider(array_provider), type(type), offset(offset), size(size), stride(stride) {} + + VertexData() : array_provider(), type(), offset(), size(), stride() {} + + VertexArrayBufferProvider *array_provider; + VertexAttributeDataType type; + size_t offset; + int size; + int stride; + }; + + /// \brief Sets a vertex attribute. + virtual void set_attribute(int index, const VertexData &data, bool normalize = false) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/program_object_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/program_object_provider.h new file mode 100644 index 0000000..45b7974 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/program_object_provider.h @@ -0,0 +1,124 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class ShaderObject; + class UniformBuffer; + + /// \brief Program Object provider. + class ProgramObjectProvider + { + public: + virtual ~ProgramObjectProvider() { } + + /// \brief Returns the OpenGL program object handle. + virtual unsigned int get_handle() const = 0; + + /// \brief Returns true if the link succeeded. + virtual bool get_link_status() const = 0; + + /// \brief Returns true if validation succeeded. + virtual bool get_validate_status() const = 0; + + /// \brief Returns the current info log for the program object. + virtual std::string get_info_log() const = 0; + + /// \brief Returns the shaders used in this program. + virtual std::vector get_shaders() const = 0; + + /// \brief Returns the location of a named active attribute. + virtual int get_attribute_location(const std::string &name) const = 0; + + /// \brief Returns the location of a named uniform variable. + virtual int get_uniform_location(const std::string &name) const = 0; + + /// \brief Get the uniform block size + virtual int get_uniform_buffer_size(int block_index) const = 0; + + /// \brief Get the uniform block index + /// + /// Returns -1 when the block index was not found + virtual int get_uniform_buffer_index(const std::string &block_name) const = 0; + + /// \brief Get the storage block index + /// + /// Returns -1 when the block index was not found + virtual int get_storage_buffer_index(const std::string &name) const = 0; + + /// \brief Add shader to program object. + virtual void attach(const ShaderObject &obj) = 0; + + /// \brief Remove shader from program object. + virtual void detach(const ShaderObject &obj) = 0; + + /// \brief Bind attribute to specific location. + /**

This function must be called before linking.

*/ + virtual void bind_attribute_location(int index, const std::string &name) = 0; + + /// \brief Bind shader out variable a specific color buffer location. + /**

This function must be called before linking.

*/ + virtual void bind_frag_data_location(int color_number, const std::string &name) = 0; + + /// \brief Link program. + /**

If the linking fails, get_link_status() will return false and + get_info_log() will return the link log.

*/ + virtual void link() = 0; + + /// \brief Validate program. + /**

If the validation fails, get_validate_status() will return + false and get_info_log() will return the validation log.

*/ + virtual void validate() = 0; + + /// \brief Set uniform variable(s). + virtual void set_uniform1i(int location, int value_a) = 0; + virtual void set_uniform2i(int location, int value_a, int value_b) = 0; + virtual void set_uniform3i(int location, int value_a, int value_b, int value_c) = 0; + virtual void set_uniform4i(int location, int value_a, int value_b, int value_c, int value_d) = 0; + virtual void set_uniformiv(int location, int size, int count, const int *data) = 0; + virtual void set_uniform1f(int location, float value_a) = 0; + virtual void set_uniform2f(int location, float value_a, float value_b) = 0; + virtual void set_uniform3f(int location, float value_a, float value_b, float value_c) = 0; + virtual void set_uniform4f(int location, float value_a, float value_b, float value_c, float value_d) = 0; + virtual void set_uniformfv(int location, int size, int count, const float *data) = 0; + virtual void set_uniform_matrix(int location, int size, int count, bool transpose, const float *data) = 0; + + virtual void set_uniform_buffer_index(int block_index, int bind_index) = 0; + + virtual void set_storage_buffer_index(int buffer_index, int bind_unit_index) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/render_buffer_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/render_buffer_provider.h new file mode 100644 index 0000000..c3b886c --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/render_buffer_provider.h @@ -0,0 +1,52 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include "../Render/texture.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + enum TextureFormat; + + /// \brief Interface for implementing a RenderBuffer target. + class RenderBufferProvider + { + public: + virtual ~RenderBufferProvider() {} + + /// \brief Create a render buffer image with the specified dimensions. + virtual void create(int width, int height, TextureFormat texture_format, int multisample_samples) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/shader_object_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/shader_object_provider.h new file mode 100644 index 0000000..189fcda --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/shader_object_provider.h @@ -0,0 +1,78 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +** Kenneth Gangstoe +*/ + +#pragma once + +#include "shader_object_provider.h" +#include "../Render/shader_object.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Shader Object provider. + class ShaderObjectProvider + { + public: + virtual ~ShaderObjectProvider() { } + + /// \brief Creates a shader object. + virtual void create(ShaderType type, const std::string &source) = 0; + + /// \brief Creates a shader object. + virtual void create(ShaderType type, const void *source, int source_size) = 0; + + /// \brief Create + /// + /// \param type = Shader Type + /// \param vector = std + virtual void create(ShaderType type, const std::vector &sources) = 0; + + /// \brief Returns the OpenGL shader handle. + virtual unsigned int get_handle() const = 0; + + /// \brief Returns true if compile succeeded. + virtual bool get_compile_status() const = 0; + + /// \brief Gets the shader type. + virtual ShaderType get_shader_type() const = 0; + + /// \brief Get shader object's info log. + virtual std::string get_info_log() const = 0; + + /// \brief Get shader source code. + virtual std::string get_shader_source() const = 0; + + /// \brief Compile program. + virtual void compile() = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/storage_buffer_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/storage_buffer_provider.h new file mode 100644 index 0000000..65ccbfb --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/storage_buffer_provider.h @@ -0,0 +1,67 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../Render/storage_buffer.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Storage Buffer provider. + class StorageBufferProvider + { + public: + virtual ~StorageBufferProvider() { } + + /// \brief Constructs a vertex array buffer. + virtual void create(int size, int stride, BufferUsage usage) = 0; + + /// \brief Create + /// + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + virtual void create(const void *data, int size, int stride, BufferUsage usage) = 0; + + /// \brief Uploads data to storages buffer. + /// + /// The size specified must match the size of the buffer and is only included to help guard against buffer overruns. + virtual void upload_data(GraphicContext &gc, const void *data, int size) = 0; + + /// \brief Copies data from transfer buffer + virtual void copy_from(GraphicContext &gc, TransferBuffer &buffer, int dest_pos, int src_pos, int size) = 0; + + /// \brief Copies data to transfer buffer + virtual void copy_to(GraphicContext &gc, TransferBuffer &buffer, int dest_pos, int src_pos, int size) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/texture_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/texture_provider.h new file mode 100644 index 0000000..739bef2 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/texture_provider.h @@ -0,0 +1,132 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include "../Render/texture.h" +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + enum TextureWrapMode; + enum TextureFilter; + enum TextureCompareMode; + enum CompareFunction; + class PixelBuffer; + class PixelFormat; + class GraphicContextProvider; + + /// \brief Interface for implementing a Texture target. + class TextureProvider + { + public: + virtual ~TextureProvider() { return; } + + /// \brief Create texture. + virtual void create(int width, int height, int depth, int array_size, TextureFormat texture_format, int levels) = 0; + + /// \brief Retrieve image data from texture. + virtual PixelBuffer get_pixeldata(GraphicContext &gc, TextureFormat texture_format, int level) const = 0; + + /// \brief Generate the mipmap + virtual void generate_mipmap() = 0; + + /// \brief Copy image data to texture. + virtual void copy_from(GraphicContext &gc, int x, int y, int slice, int level, const PixelBuffer &src, const Rect &src_rect) = 0; + + /// \brief Copy image data from a graphic context. + virtual void copy_image_from( + int x, + int y, + int width, + int height, + int level, + TextureFormat texture_format, + GraphicContextProvider *gc) = 0; + + /// \brief Copy sub image data from a graphic context. + virtual void copy_subimage_from( + int offset_x, + int offset_y, + int x, + int y, + int width, + int height, + int level, + GraphicContextProvider *gc) = 0; + + /// \brief Set the minimum level of detail texture parameter. + virtual void set_min_lod(double min_lod) = 0; + + /// \brief Set the maximum level of detail texture parameter. + virtual void set_max_lod(double max_lod) = 0; + + /// \brief Sets the level of detail bias constant. + virtual void set_lod_bias(double lod_bias) = 0; + + /// \brief Sets the texture base level texture parameter. + virtual void set_base_level(int base_level) = 0; + + /// \brief Sets the texture max level texture parameter. + virtual void set_max_level(int max_level) = 0; + + /// \brief Set the texture wrapping mode. + virtual void set_wrap_mode( + TextureWrapMode wrap_s, + TextureWrapMode wrap_t, + TextureWrapMode wrap_r) = 0; + + virtual void set_wrap_mode( + TextureWrapMode wrap_s, + TextureWrapMode wrap_t) = 0; + + virtual void set_wrap_mode( + TextureWrapMode wrap_s) = 0; + + /// \brief Set the minification filter. + virtual void set_min_filter(TextureFilter filter) = 0; + + /// \brief Set the magnification filter. + virtual void set_mag_filter(TextureFilter filter) = 0; + + /// \brief Set the maximum degree of anisotropy. + virtual void set_max_anisotropy(float v) = 0; + + /// \brief Sets the texture compare mode and compare function texture parameters. + virtual void set_texture_compare(TextureCompareMode mode, CompareFunction func) = 0; + + /// \breif Creates a texture view for this texture + virtual TextureProvider *create_view(TextureDimensions texture_dimensions, TextureFormat texture_format, int min_level, int num_levels, int min_layer, int num_layers) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/transfer_buffer_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/transfer_buffer_provider.h new file mode 100644 index 0000000..d377948 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/transfer_buffer_provider.h @@ -0,0 +1,70 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../Render/transfer_buffer.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class GraphicContext; + + /// \brief Transfer Buffer provider. + class TransferBufferProvider + { + public: + virtual ~TransferBufferProvider() { } + + /// \brief Constructs a array buffer. + virtual void create(int size, BufferUsage usage) = 0; + + /// \brief Create + /// + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + virtual void create(void *data, int size, BufferUsage usage) = 0; + + /// \brief Retrieves a pointer to the mapped buffer. + virtual void *get_data() = 0; + + /// \brief Maps buffer into system memory. + virtual void lock(GraphicContext &gc, BufferAccess access) = 0; + + /// \brief Unmaps buffer. + virtual void unlock() = 0; + + /// \brief Uploads data to buffer. + virtual void upload_data(GraphicContext &gc, int offset, const void *data, int size) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/uniform_buffer_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/uniform_buffer_provider.h new file mode 100644 index 0000000..f75c9f9 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/uniform_buffer_provider.h @@ -0,0 +1,67 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../Render/uniform_buffer.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + /// \brief Uniform Buffer provider. + class UniformBufferProvider + { + public: + virtual ~UniformBufferProvider() { } + + /// \brief Constructs a vertex array buffer. + virtual void create(int size, BufferUsage usage) = 0; + + /// \brief Create + /// + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + virtual void create(const void *data, int size, BufferUsage usage) = 0; + + /// \brief Uploads data to uniforms buffer. + /// + /// The size specified must match the size of the buffer and is only included to help guard against buffer overruns. + virtual void upload_data(GraphicContext &gc, const void *data, int size) = 0; + + /// \brief Copies data from transfer buffer + virtual void copy_from(GraphicContext &gc, TransferBuffer &buffer, int dest_pos, int src_pos, int size) = 0; + + /// \brief Copies data to transfer buffer + virtual void copy_to(GraphicContext &gc, TransferBuffer &buffer, int dest_pos, int src_pos, int size) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/vertex_array_buffer_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/vertex_array_buffer_provider.h new file mode 100644 index 0000000..a9d7971 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/TargetProviders/vertex_array_buffer_provider.h @@ -0,0 +1,67 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../Render/vertex_array_buffer.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class GraphicContext; + + /// \brief Vertex Array Buffer provider. + class VertexArrayBufferProvider + { + public: + virtual ~VertexArrayBufferProvider() { } + + /// \brief Constructs a vertex array buffer. + virtual void create(int size, BufferUsage usage) = 0; + + /// \brief Create + /// + /// \param data = void + /// \param size = value + /// \param usage = Buffer Usage + virtual void create(void *data, int size, BufferUsage usage) = 0; + + /// \brief Uploads data to vertex array buffer. + virtual void upload_data(GraphicContext &gc, int offset, const void *data, int size) = 0; + + /// \brief Copies data from transfer buffer + virtual void copy_from(GraphicContext &gc, TransferBuffer &buffer, int dest_pos, int src_pos, int size) = 0; + + /// \brief Copies data to transfer buffer + virtual void copy_to(GraphicContext &gc, TransferBuffer &buffer, int dest_pos, int src_pos, int size) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/cursor.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/cursor.h new file mode 100644 index 0000000..96780bc --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/cursor.h @@ -0,0 +1,74 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../display_target.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Window clanDisplay Window + /// \{ + + class DisplayWindow; + class CursorProvider; + class CursorDescription; + class Point; + class Cursor_Impl; + + /// \brief Mouse cursor class. + class Cursor + { + public: + /// \brief Constructs a null instance. + Cursor(); + + /// \brief Constructs a Cursor + /// + /// \param window = Display Window + /// \param cursor_description = Sprite Description + /// \param hotspot = Point + Cursor(const DisplayWindow &window, const CursorDescription &cursor_description); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns the cursor provider + CursorProvider *get_provider() const; + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/cursor_description.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/cursor_description.h new file mode 100644 index 0000000..a6e9313 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/cursor_description.h @@ -0,0 +1,182 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Kenneth Gangstoe +*/ + +#pragma once + +#include "../Render/graphic_context.h" +#include "../Render/texture_2d.h" +#include "../Image/pixel_buffer.h" +#include + +namespace clan +{ + /// \addtogroup clanDisplay_2D clanDisplay 2D + /// \{ + + class CursorDescription_Impl; + class XMLResourceDocument; + + /// \brief This class describes a single frame in a cursor description. + class CursorDescriptionFrame + { + + public: + + /// \brief Constructs a CursorDescriptionFrame + /// + /// \param pixelbuffer = Pixel Buffer + /// \param rect = Rect + CursorDescriptionFrame(PixelBuffer pixelbuffer, Rect rect) : pixelbuffer(pixelbuffer), rect(rect), delay(1.0) { } + + PixelBuffer pixelbuffer; + Rect rect; + double delay; + + }; + + /// \brief This class contains everything to construct a cursor - its data, default settings etc. + /// + ///

CursorDescription is used by Cursor to construct itself based + /// on the description. The description class give a big flexibility + /// creating a cursor, individual frames can come from different image + /// sources, or be cut out from an image source using various different + /// techniques.

+ class CursorDescription + { + public: + /// \brief Constructs a cursor description. + CursorDescription(); + + /// \brief Constructs a CursorDescription + /// + /// \param copy = Cursor Description + CursorDescription(const CursorDescription ©); + + ~CursorDescription(); + + /// \brief Loads a CursorDescription from a XML resource definition + static CursorDescription load(GraphicContext &gc, const std::string &resource_id, const XMLResourceDocument &doc, const ImageImportDescription &import_desc = ImageImportDescription()); + + /// \brief Returns a list over all available frames. + const std::vector &get_frames() const; + + /// \brief the offset of where the cursor is drawn relative to cursor image + Point get_hotspot() const; + + bool operator==(const CursorDescription &that) const { return impl == that.impl; } + bool operator!=(const CursorDescription &that) const { return impl != that.impl; } + bool operator<(const CursorDescription &that) const { return impl < that.impl; } + bool operator>(const CursorDescription &that) const { return impl > that.impl; } + bool operator<=(const CursorDescription &that) const { return impl <= that.impl; } + bool operator>=(const CursorDescription &that) const { return impl >= that.impl; } + + /// \brief Copy assignment operator. + CursorDescription &operator =(const CursorDescription ©); + + /// \brief Adds a single image. + /// + /// \param pixelbuffer Image source. + /// \param filename Filename of image. + /// \param vfs Virtual File System to load image from. + void add_frame(const PixelBuffer &pixelbuffer); + + /// \brief Add frame + /// + /// \param fullname = String Ref + void add_frame(const std::string &fullname, const ImageImportDescription &import_desc = ImageImportDescription()); + + /// \brief Add frame + /// + /// \param file = IODevice + /// \param image_type = String + void add_frame(IODevice &file, const std::string &image_type, const ImageImportDescription &import_desc = ImageImportDescription()); + + /// \brief Add frame + /// + /// \param filename = String Ref + /// \param dir = Virtual Directory + void add_frame(const std::string &filename, FileSystem &fs, const ImageImportDescription &import_desc = ImageImportDescription()); + + /// \brief Adds images formed in a grid. + /**

This function will cut out a grid of frames from one image.

+ \param pixelbuffer Image source. + \param texture Image source. + \param xpos, ypos Position of where image grid starts. + \param width, height Size of a frame in the grid. + \param xarray, yarray Number of columns and rows in grid. + \param array_skipframes Number of frames to skip at last gridline. + \param xspacing, yspacing Pixel interspacing between grid frames.*/ + void add_gridclipped_frames( + const PixelBuffer &pixelbuffer, + int xpos, int ypos, + int width, int height, + int xarray = 1, int yarray = 1, + int array_skipframes = 0, + int xspacing = 0, int yspacing = 0); + + /// \brief Adds images separated with pure alpha (within trans_limit). + /**

The alpha clipper will cut out frames from an image based on + the transparency in the picture. It first determines the height + of a row by searching for the first line that it considers + completely transparent. Then it finds the width of each frame on + this line by looking for columns that are completely transparency.

+ \param pixelbuffer Image source. + \param texture Image source. + \param xpos, ypos Upper left position where alpha cutting should begin. + \param trans_limit Amount of non-transparent alpha allowed before a pixel is not considered transparent.*/ + void add_alphaclipped_frames( + const PixelBuffer &pixelbuffer, + int xpos = 0, int ypos = 0, + float trans_limit = 0.05f); + + /// \brief Adds images separated with pure alpha (within trans_limit). + /**

The alpha clipper will cut out frames from an image based on + the transparency in the picture. It scans the lines horizontally + from top to bottom. As soon as a non-transarent pixel is discovered, + the clipper finds the bounding box for that region and then moves on.

+ \param pixelbuffer Image source. + \param texture Image source. + \param xpos, ypos Upper left position where alpha cutting should begin. + \param trans_limit Amount of non-transparent alpha allowed before a pixel is not considered transparent.*/ + void add_alphaclipped_frames_free( + const PixelBuffer &pixelbuffer, + int xpos = 0, int ypos = 0, + float trans_limit = 0.05f); + + /// \brief Sets the duration this frame is displayed, in seconds. + void set_frame_delay(int frame, double delay); + + /// \brief Sets the offset of where the cursor is drawn relative to the cursor image + void set_hotspot(const Point &hotspot); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/display_window.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/display_window.h new file mode 100644 index 0000000..74d5482 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/display_window.h @@ -0,0 +1,389 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +** Kenneth Gangstoe +*/ + +#pragma once + +#include "../../Core/Signals/signal.h" +#include "../display_target.h" +#include + +#if !defined(WIN32) && !defined(__ANDROID__) && !defined(__APPLE__) +// We prefer not to include Xlib.h in clanlib (to prevent namespace issues when "using namespace clan") +struct _XDisplay; +typedef struct _XDisplay Display; +typedef unsigned long Window; +#endif + +#if defined(__ANDROID__) +struct ANativeWindow; +#endif + +namespace clan +{ + /// \addtogroup clanDisplay_Window clanDisplay Window + /// \{ + + class Sizef; + class Rectf; + class Display; + class GraphicContext; + class DisplayWindowMode; + class DisplayWindowDescription; + struct DisplayWindowHandle; + class InputDevice; + class Pointf; + class Cursor; + class DisplayWindowProvider; + class DisplayWindow_Impl; + class PixelBuffer; + + /// \brief Standard Cursor + enum class StandardCursor + { + arrow, + appstarting, + cross, + hand, + ibeam, + no, + size_all, + size_nesw, + size_ns, + size_nwse, + size_we, + uparrow, + wait + }; + + struct DisplayWindowHandle + { +#ifdef WIN32 + HWND hwnd = 0; +#elif defined(__ANDROID__) + ANativeWindow *window = 0; +#elif defined(__APPLE__) +#else + ::Display *display = 0; + ::Window window = 0; + int screen = -1; +#endif + }; + + /// \brief Top-level window class. + class DisplayWindow + { + public: + /// \brief Constructs a null instance. + DisplayWindow(); + + /// \brief Constructs a window. + /// + /// \param title = Titlebar text. + /// \param width = Width in pixels of window. + /// \param height = Height in pixels of window. + /// \param start_fullscreen = If true, window will go fullscreen. + /// \param allow_resize = If true, window will have resize grabbers and can be resized. + /// \param flipping_buffers = Number of flipping buffers in system. Default is that there is a front buffer and a back buffer. + /// \param target = Display target used to create the window. + DisplayWindow( + const std::string &title, + float width, + float height, + bool start_fullscreen = false, + bool allow_resize = false, + int flipping_buffers = 2); + + /// \brief Constructs a window. + /// + /// \param description = Structure that describes how to create the display window. + /// \param target = Display target used to create the window. + DisplayWindow( + const DisplayWindowDescription &description); + + /// \brief Constructs a window. + /// + /// \param provider = Display target implementation object. + DisplayWindow(DisplayWindowProvider *provider); + + ~DisplayWindow(); + + /// \brief Returns the position and size of the window frame. + Rectf get_geometry() const; + + /// \brief Returns the drawable area of the window (excluding window frame). + Rectf get_viewport() const; + + /// \brief Returns true if window is currently running fullscreen. + bool is_fullscreen() const; + + /// \brief Returns true if window has focus. + bool has_focus() const; + + /// \brief Return the graphic context for the window. + GraphicContext& get_gc() const; + + /// \brief Returns the keyboard input device. + InputDevice &get_keyboard(); + + /// \brief Returns the mouse input device. + InputDevice &get_mouse(); + + /// \brief Returns the game controller input device. + std::vector &get_game_controllers(); + + /// \brief Returns the input device with the given device name + InputDevice &get_input_device(const std::string &device_name); + + /// \brief Signal emitted when window lost focus. + Signal &sig_lost_focus(); + + /// \brief Signal emitted when window gain focus. + Signal &sig_got_focus(); + + /// \brief Signal emitted when window is resized. + Signal &sig_resize(); + + /// \brief Signal emitted when the window is invalidated. + Signal &sig_paint(); + + /// \brief Signal emitted when window is closed. + Signal &sig_window_close(); + + /// \brief Signal emitted when window is destroyed. + Signal &sig_window_destroy(); + + /// \brief Signal emitted when window is minimized. + Signal &sig_window_minimized(); + + /// \brief Signal emitted when window is maximized. + Signal &sig_window_maximized(); + + /// \brief Signal emitted when window is restored. + Signal &sig_window_restored(); + + /// \brief Signal emitted after a window has been moved. + Signal &sig_window_moved(); + + /// \brief Signal emitted when window flip() was called + Signal &sig_window_flip(); + + /// \brief Callback called when a window is being resized. + std::function &func_window_resize(); + + /// \brief Callback called when a window is asked to minimize itself. + std::function &func_minimize_clicked(); + +#ifdef WIN32 + /// \brief Callback called when a windows messages is received. + std::function &func_window_message(); + + /// \brief Signal called when a windows messages is received. + Signal &sig_window_message(); +#endif + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief returns true if this display window is visible + bool is_visible() const; + + /// \brief Returns true if the window is minimized. + bool is_minimized() const; + + /// \brief Returns true if the window is maximized. + bool is_maximized() const; + + /// \brief Returns the display window provider + DisplayWindowProvider *get_provider() const; + + /// \brief Returns true if text is available in the clipboard. + bool is_clipboard_text_available() const; + + /// \brief Returns true if an image is available in the clipboard. + bool is_clipboard_image_available() const; + + /// \brief Returns the text stored in the clipboard. + std::string get_clipboard_text() const; + + /// \brief Returns an image stored in the clipboard. + ///

Returns a null pixelbuffer if no image is available.

+ PixelBuffer get_clipboard_image() const; + + /// \brief Returns the minimum size the window can be resized to by the application user. + Sizef get_minimum_size(bool client_area = false); + + /// \brief Returns the maximum size the window can be resized to by the application user. + Sizef get_maximum_size(bool client_area = false); + + /// \brief Returns the window title. + std::string get_title() const; + + /** Returns an platform-specific internal display window handle object. + */ + DisplayWindowHandle get_handle() const; + + /// \brief Convert from window client coordinates to screen coordinates. + Pointf client_to_screen(const Pointf &client); + + /// \brief Convert from screen coordinates to client coordinates. + Pointf screen_to_client(const Pointf &screen); + + /// \brief Capture/Release the mouse. + void capture_mouse(bool capture); + + /// \brief Invalidates the screen, causing a repaint. + void request_repaint(); + + /// \brief Change window title. + void set_title(const std::string &title); + + /// \brief Set window position and size. + /// + /// \param pos = Window position and size. + /// \param client_area = true - Position relative to window client area + void set_position(const Rectf &pos, bool client_area); + + /// \brief Set window position. + /// + /// \param x Window x position on desktop. + /// \param y Window y position on desktop. + void set_position(float x, float y); + + /// \brief Set enabled + /// + /// \param enable = bool + void set_enabled(bool enable); + + /// \brief Set visible + /// + /// \param visible = bool + /// \param activate = bool + void set_visible(bool visible, bool activate); + + /// \brief Resize window. + /// + /// \param width = New width of window in pixels. + /// \param height = New height of window in pixels. + /// \param client_area = true - relative to the window client area + void set_size(float width, float height, bool client_area); + + /// \brief Minimum size a window can be resized to by the application user. + void set_minimum_size(float width, float height, bool client_area); + + /// \brief Maximum size a window can be resized to by the application user. + void set_maximum_size(float width, float height, bool client_area); + + /// \brief Minimizes the window. + void minimize(); + + /// \brief Restores the window. + void restore(); + + /// \brief Maximizes the window. + void maximize(); + + /// Toggle fullscreen + /// Only Win32 implementation for now + void toggle_fullscreen(); + + /// \brief Displays the window in its current size and position. + void show(bool activate = true); + + /// \brief Hides the window. + void hide(); + + /// \brief Raises the window on top of other windows. + void bring_to_front(); + + /// \brief Flip back buffer to front, making changes visible on screen. + /// + ///

The parameter interval specifies the minimum number of video frames + /// that are displayed before a buffer swap will occur.

+ ///

If interval is set to a value of 0, buffer swaps are not synchronized + /// to a video frame.

+ ///

If interval is set to a value of -1 (the default), then it will use + /// the buffer swap used for previous flip. If its the first flip, it will + /// use the system default.

+ /// + /// \param interval = See note + void flip(int interval = -1); + + /// \brief Shows the mouse cursor. + void show_cursor(); + + /// \brief Sets the current cursor icon. + void set_cursor(const Cursor &cursor); + + /// \brief Set cursor + /// + /// \param type = Standard Cursor + void set_cursor(StandardCursor type); + +#ifdef WIN32 + /// \brief Sets the current cursor handle (win32 only) + void set_cursor_handle(HCURSOR cursor); +#endif + + /// \brief Hides the mouse cursor. + void hide_cursor(); + + /// \brief Stores text in the clipboard. + void set_clipboard_text(const std::string &text); + + /// \brief Stores an image in the clipboard. + void set_clipboard_image(const PixelBuffer &buf); + + /// \brief Sets the large icon used for this window. + void set_large_icon(const PixelBuffer &image); + + /// \brief Sets the small icon used for this window. + void set_small_icon(const PixelBuffer &image); + + /// \brief Enable alpha channel for this window. + /// + /// This is only supported on Windows Vista and above (Else use Layered windows instead) + /// \param blur_rect = Blur rectangle. If size = 0, then the entire window is used + void enable_alpha_channel(const Rectf &blur_rect); + + /// \brief Exend the window frame into the client area + /// + /// Only implemented on win32 + void extend_frame_into_client_area(float left, float top, float right, float bottom); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/display_window_description.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/display_window_description.h new file mode 100644 index 0000000..1cad96d --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/display_window_description.h @@ -0,0 +1,298 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +** Kenneth Gangstoe +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Window clanDisplay Window + /// \{ + + class Sizef; + class Rectf; + class DisplayWindow; + class DisplayWindowDescription_Impl; + struct DisplayWindowHandle; + + /// \brief Display window description class. + /// + /// This class allows you to setup a more advanced description when creating a display window. + class DisplayWindowDescription + { + public: + /// \brief Constructs a window description with default values. + DisplayWindowDescription(); + + /// \brief Constructs a window description with default values and a title. + DisplayWindowDescription(const std::string &title); + + /// \brief Constructs a window description with default values, a title and a position. + DisplayWindowDescription(const std::string &title, const Rectf &position, bool client_area); + + /// \brief Constructs a window description with default values, a title and a size. + DisplayWindowDescription(const std::string &title, const Sizef &size, bool client_area); + + /// \brief Constructs a window description with default values and a position. + DisplayWindowDescription(const Rectf &position, bool client_area); + + /// \brief Constructs a DisplayWindowDescription + /// \param copy = Display Window Description + DisplayWindowDescription(const DisplayWindowDescription ©); + + ~DisplayWindowDescription(); + + /// \brief Returns the window title stored in the description. + const std::string &get_title() const; + + /// \brief Returns the size of the window stored in description. + Sizef get_size() const; + + /// \brief Returns the initial position of the window. + Rectf get_position() const; + + /// \brief Returns if the client area is used for the initial position of the window + bool get_position_client_area() const; + + /// \brief Returns if window should be initially fullscreen. + bool is_fullscreen() const; + + /// \brief Returns the amount of flipping buffers to be created. + int get_flipping_buffers() const; + + /// \brief Returns the swap interval to be used for the window + int get_swap_interval() const; + + /// \brief Returns true if window should be resizeable. + bool get_allow_resize() const; + + /// \brief Returns the numbers of bytes per pixel in the window. + int get_bpp() const; + + /** Returns the refresh rate of the DisplayMode in Hertz (cycles per + * second). This value is also known as the vertical refresh rate. + */ + int get_refresh_rate() const; + + /// \brief Returns true if window is layered (black is transparent) + bool is_layered() const; + + /** Returns an platform-specific internal display window handle object. + */ + DisplayWindowHandle get_handle() const; + + /// \brief Returns true if a title bar is shown. + bool has_caption() const; + + /// \brief Returns true if the window has a window menu on its title bar. + bool has_sysmenu() const; + + /// \brief Returns true if the window has a minimize button. + bool has_minimize_button() const; + + /// \brief Returns true if the window has a maximize button. + bool has_maximize_button() const; + + /// \brief Returns true if the window is initially visible. + bool is_visible() const; + + /// \brief Returns true if the window should be placed above all non-topmost windows. + bool is_topmost() const; + + /// \brief Indicates if window is automatically activated or not. + bool has_no_activate() const; + + /// \brief Returns true if the window is drawn with a drop shadow effect. + bool has_drop_shadow() const; + + /// \brief Returns the window owning this one. + DisplayWindow get_owner() const; + + /// \brief Returns the minimum required depth buffer. + int get_depth_size() const; + + /// \brief Returns the minimum required stencil buffer. + int get_stencil_size() const; + + /// \brief Returns the index of the monitor to go fullscreen on. See ScreenInfo. + int get_fullscreen_monitor() const; + + /// \brief Returns true if the screensaver is allowed + bool get_allow_screensaver() const; + + /// \brief Returns true if DisplayWindow::update should be supported + bool is_update_supported() const; + + /// \brief Returns the number of samples per pixel. + int get_multisampling() const; + + /// \brief Returns true if it is a main window + bool is_main() const; + + /// \brief Returns true if it is a dialog window + bool is_dialog() const; + + /// \brief Returns true if it is a popup window + bool is_popup() const; + + /// \brief Copy assignment operator. + DisplayWindowDescription &operator =(const DisplayWindowDescription ©); + + /// \brief Display this window as of the main windows of the application + /// + /// Window is shown on the taskbar + void set_main_window(); + + /// \brief Display the window as a modal dialog + /// + /// Window is shown on the taskbar + void set_dialog_window(); + + /// \brief Display the window as a popup + /// + /// This is treated as a transparent window (without clickthrough). + /// If clickthrough is also required, use set_layered_window() as well + void set_popup_window(); + + /// \brief Controls if a title bar (including frame) is shown or not. + /// + /// This is only used for the popup window types (Not Main and Dialog) + void show_caption(bool value = true); + + /// \brief Sets if the window has a window menu on its title bar. + /// + /// This is only used for the main window type (not Dialog and Popup) + void show_sysmenu(bool value = true); + + /// \brief Sets if the window has a minimize button. + /// + /// This is only used for the main and dialog window types (Not Popup) + void show_minimize_button(bool value = true); + + /// \brief Sets if the window has a maximize button. + /// + /// This is only used for the main and dialog window types (Not Popup) + void show_maximize_button(bool value = true); + + /// \brief Toggles whether the window is created as initially visible. + void set_visible(bool value = true); + + /// \brief Sets if the window should be placed above all non-topmost windows. + /// + /// This is used for all window types (Main, Dialog and Popup) + void set_topmost(bool value = true); + + /// \brief Prevents window from being automatically activated. + void set_no_activate(bool value = true); + + /// \brief Enables a drop shadow effect on the window. + void set_drop_shadow(bool value = true); + + /// \brief Specifies another window which owns this one. + void set_owner_window(const DisplayWindow &owner); + + /// \brief Sets the title of the window. + void set_title(const std::string &title); + + /// \brief Sets the size of the window (including window frame). + /// \param size = Window size + /// \param client_area = false = include the window frame. true = exclude the window frame + void set_size(const Sizef &size, bool client_area); + + /// \brief Sets the position of the window (including window frame). + /// + /// The default position, is centred on the screen. If this is wanted, use set_size() instead + /// + /// \param position = Window position + /// \param client_area = false = include the window frame. true = exclude the window frame + void set_position(const Rectf &position, bool client_area); + + /// \brief Makes the window initially fullscreen. + void set_fullscreen(bool fullscreen = true, int monitor = 0); + + /// \brief Sets the amount of flipping buffers to be used. + void set_flipping_buffers(int num_buffers = 2); + + /// \brief Sets the swap interval to be used for the window + void set_swap_interval(int interval = -1); + + /// \brief Sets if windows should be resizable. + /// + /// This is used for all window types (Main, Dialog and Popup) + void set_allow_resize(bool allow_resize = true); + + /// \brief Sets the number of bytes per pixel + void set_bpp(int bpp); + + /** Sets the refresh rate of the DisplayMode in Hertz (cycles per second). + * This value is also known as the vertical refresh rate. + */ + void set_refresh_rate(int refresh_rate); + + /// \brief Creates a layered window (complex shaped window) + /// + /// Use with set_popup_window() + void set_layered(bool layered); + + /// \brief Allow the screensaver to appear + /// + /// \param allow_screensaver = Allow the allow_screensaver (default is true) + void set_allow_screensaver(bool allow_screensaver = true); + + /** Sets the platform-specific internal display window handle object. + */ + void set_handle(DisplayWindowHandle handle); + + /// \brief Sets the minimum required depth buffer. + /**

If this value is zero, the smallest available depth buffer is preferred. Otherwise, + the largest available depth buffer of at least the minimum size is preferred.

*/ + void set_depth_size(int value); + + /// \brief Sets the minimum required stencil buffer. + /**

If this value is zero, the smallest available stencil buffer is preferred. Otherwise, + the largest available stencil buffer of at least the minimum size is preferred.

*/ + void set_stencil_size(int value); + + /// \brief Controls if DisplayWindow::update is supported + /// + /// The Direct3D target needs to know at window creation time if the application intends to update + /// the screen by calling DisplayWindow::update. + void set_update_supported(bool value) const; + + /// \brief Sets the number of samples per pixel. + void set_multisampling(int value); + + private: + std::unique_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/input_code.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/input_code.h new file mode 100644 index 0000000..e45147b --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/input_code.h @@ -0,0 +1,481 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +// Keyboard & mouse platform independence support. + +#if defined(WIN32) +#include +#elif defined(__APPLE__) || defined(__ANDROID__) +// No headers for Apple +#else +#include +#endif + +namespace clan +{ + /// \addtogroup clanDisplay_Input clanDisplay Input + /// \{ + + enum InputCode + { + mouse_left = 0, + mouse_right = 1, + mouse_middle = 2, + mouse_wheel_up = 3, + mouse_wheel_down = 4, + mouse_xbutton1 = 5, + mouse_xbutton2 = 6, + mouse_count = 7, + + joystick_x = 0, + joystick_y, + joystick_z, + joystick_rx, + joystick_ry, + joystick_rz, + joystick_slider, + joystick_dial, + joystick_wheel, + joystick_vx, + joystick_vy, + joystick_vz, + joystick_vrx, + joystick_vry, + joystick_vrz, + joystick_vslider0, + joystick_vslider1, + joystick_ax, + joystick_ay, + joystick_az, + joystick_arx, + joystick_ary, + joystick_arz, + joystick_aslider0, + joystick_aslider1, + joystick_fx, + joystick_fy, + joystick_fz, + joystick_frx, + joystick_fry, + joystick_frz, + joystick_fslider0, + joystick_fslider1, + + joystick_button = 0, // "id_offset" set + joystick_hat = 0, // "id_offset" set + +#if defined(WIN32) + + keycode_backspace = VK_BACK, + keycode_tab = VK_TAB, + keycode_clear = VK_CLEAR, + keycode_return = VK_RETURN, + keycode_shift = VK_SHIFT, + keycode_control = VK_CONTROL, + keycode_menu = VK_MENU, + keycode_pause = VK_PAUSE, + keycode_escape = VK_ESCAPE, + +#if !defined(__CYGWIN__) && !defined(__MINGW32__) + + keycode_kanji = VK_KANJI, + keycode_convert = VK_CONVERT, + keycode_nonconvert = VK_NONCONVERT, +#endif + + keycode_space = VK_SPACE, + keycode_prior = VK_PRIOR, + keycode_next = VK_NEXT, + keycode_end = VK_END, + keycode_home = VK_HOME, + keycode_left = VK_LEFT, + keycode_up = VK_UP, + keycode_right = VK_RIGHT, + keycode_down = VK_DOWN, + keycode_select = VK_SELECT, + keycode_print = VK_PRINT, + keycode_execute = VK_EXECUTE, + keycode_insert = VK_INSERT, + keycode_delete = VK_DELETE, + keycode_help = VK_HELP, + keycode_0 = '0', + keycode_1 = '1', + keycode_2 = '2', + keycode_3 = '3', + keycode_4 = '4', + keycode_5 = '5', + keycode_6 = '6', + keycode_7 = '7', + keycode_8 = '8', + keycode_9 = '9', + keycode_a = 'A', + keycode_b = 'B', + keycode_c = 'C', + keycode_d = 'D', + keycode_e = 'E', + keycode_f = 'F', + keycode_g = 'G', + keycode_h = 'H', + keycode_i = 'I', + keycode_j = 'J', + keycode_k = 'K', + keycode_l = 'L', + keycode_m = 'M', + keycode_n = 'N', + keycode_o = 'O', + keycode_p = 'P', + keycode_q = 'Q', + keycode_r = 'R', + keycode_s = 'S', + keycode_t = 'T', + keycode_u = 'U', + keycode_v = 'V', + keycode_w = 'W', + keycode_x = 'X', + keycode_y = 'Y', + keycode_z = 'Z', + keycode_lwin = VK_LWIN, + keycode_rwin = VK_RWIN, + keycode_apps = VK_APPS, + keycode_numpad0 = VK_NUMPAD0, + keycode_numpad1 = VK_NUMPAD1, + keycode_numpad2 = VK_NUMPAD2, + keycode_numpad3 = VK_NUMPAD3, + keycode_numpad4 = VK_NUMPAD4, + keycode_numpad5 = VK_NUMPAD5, + keycode_numpad6 = VK_NUMPAD6, + keycode_numpad7 = VK_NUMPAD7, + keycode_numpad8 = VK_NUMPAD8, + keycode_numpad9 = VK_NUMPAD9, + keycode_numpad_enter = keycode_return, + keycode_multiply = VK_MULTIPLY, + keycode_add = VK_ADD, + keycode_separator = VK_SEPARATOR, + keycode_subtract = VK_SUBTRACT, + keycode_decimal = VK_DECIMAL, + keycode_divide = VK_DIVIDE, + keycode_f1 = VK_F1, + keycode_f2 = VK_F2, + keycode_f3 = VK_F3, + keycode_f4 = VK_F4, + keycode_f5 = VK_F5, + keycode_f6 = VK_F6, + keycode_f7 = VK_F7, + keycode_f8 = VK_F8, + keycode_f9 = VK_F9, + keycode_f10 = VK_F10, + keycode_f11 = VK_F11, + keycode_f12 = VK_F12, + keycode_f13 = VK_F13, + keycode_f14 = VK_F14, + keycode_f15 = VK_F15, + keycode_f16 = VK_F16, + keycode_f17 = VK_F17, + keycode_f18 = VK_F18, + keycode_f19 = VK_F19, + keycode_f20 = VK_F20, + keycode_f21 = VK_F21, + keycode_f22 = VK_F22, + keycode_f23 = VK_F23, + keycode_f24 = VK_F24, + keycode_numlock = VK_NUMLOCK, + keycode_scroll = VK_SCROLL, + keycode_lshift = VK_LSHIFT, + keycode_rshift = VK_RSHIFT, + keycode_lcontrol = VK_LCONTROL, + keycode_rcontrol = VK_RCONTROL, + keycode_lmenu = VK_LMENU, + keycode_rmenu = VK_RMENU, + +#elif defined(__APPLE__) || defined(__ANDROID__) + + // Seems like this platform dont have keysyms, or their docs suck so much I + // can't find it. + // + // To solve this matter I've made my own virtual key numbering. If a key + // pressed does not match any of these, then it will return the actual + // MacOSX keycode in the high order word (keycode + 0x10000000). + // + // Naturally this require that they dont use keycode values above 0xffff, + // but if they do complain to Apple for their crappy keyboard support. + // Already kinda annoyed that the keys for typing { and } are alt+shift+8 and + // alt+shift+9, plus that backslash is alt+shift+7. How hostile is that!?!? + // Oh well what can you expect from a company that write "Designed by Apple + // in California" with big letters when you open your box that the powerbook + // came in. Yes it shows thats its designed in California!! + // + // (No offence to California though. Been there once and loved the place.) + + keycode_backspace=10, + keycode_tab=11, + keycode_clear=12, + keycode_return=13, + keycode_shift=14, + keycode_control=15, + keycode_menu=16, + keycode_pause=17, + keycode_kanji=18, + keycode_escape=19, + keycode_convert=20, + keycode_nonconvert=21, + keycode_space=22, + keycode_prior=23, + keycode_next=24, + keycode_end=25, + keycode_home=26, + keycode_left=27, + keycode_up=28, + keycode_right=29, + keycode_down=30, + keycode_select=31, + keycode_print=32, + keycode_execute=33, + keycode_insert=34, + keycode_delete=35, + keycode_help=36, + keycode_0=37, + keycode_1=38, + keycode_2=39, + keycode_3=40, + keycode_4=41, + keycode_5=42, + keycode_6=43, + keycode_7=44, + keycode_8=45, + keycode_9=46, + keycode_a=47, + keycode_b=48, + keycode_c=49, + keycode_d=50, + keycode_e=51, + keycode_f=52, + keycode_g=53, + keycode_h=54, + keycode_i=55, + keycode_j=56, + keycode_k=57, + keycode_l=58, + keycode_m=59, + keycode_n=60, + keycode_o=61, + keycode_p=62, + keycode_q=63, + keycode_r=64, + keycode_s=65, + keycode_t=66, + keycode_u=67, + keycode_v=68, + keycode_w=69, + keycode_x=70, + keycode_y=71, + keycode_z=72, + keycode_lwin=73, + keycode_rwin=74, + keycode_apps=75, + keycode_numpad0=76, + keycode_numpad1=77, + keycode_numpad2=78, + keycode_numpad3=79, + keycode_numpad4=80, + keycode_numpad5=81, + keycode_numpad6=82, + keycode_numpad7=83, + keycode_numpad8=84, + keycode_numpad9=85, + keycode_numpad_enter=keycode_return, + keycode_multiply=86, + keycode_add=87, + keycode_separator=88, + keycode_subtract=89, + keycode_decimal=90, + keycode_divide=91, + keycode_f1=92, + keycode_f2=93, + keycode_f3=94, + keycode_f4=95, + keycode_f5=96, + keycode_f6=97, + keycode_f7=98, + keycode_f8=99, + keycode_f9=100, + keycode_f10=101, + keycode_f11=102, + keycode_f12=103, + keycode_f13=104, + keycode_f14=105, + keycode_f15=106, + keycode_f16=107, + keycode_f17=108, + keycode_f18=109, + keycode_f19=110, + keycode_f20=111, + keycode_f21=112, + keycode_f22=113, + keycode_f23=114, + keycode_f24=115, + keycode_numlock=116, + keycode_scroll=117, + keycode_lshift=118, + keycode_rshift=119, + keycode_lcontrol=120, + keycode_rcontrol=121, + keycode_lmenu=122, + keycode_rmenu=123, + keycode_count=124, + +#else + + keycode_backspace=XK_BackSpace, + keycode_tab=XK_Tab, + keycode_clear=XK_Clear, + keycode_return=XK_Return, + keycode_shift=XK_Shift_L, + keycode_control=XK_Control_L, + keycode_menu=XK_Menu, // there is no XK_Alt, only XK_Alt_L and XK_Alt_R. Maybe remove this key? -- mbn 30 sep 2003 + keycode_pause=XK_Pause, + keycode_kanji=XK_Kanji, + keycode_escape=XK_Escape, + keycode_convert=XK_Henkan_Mode, + keycode_nonconvert=XK_Muhenkan, + keycode_space=XK_space, + keycode_prior=XK_Prior, + keycode_next=XK_Next, + keycode_end=XK_End, + keycode_home=XK_Home, + keycode_left=XK_Left, + keycode_up=XK_Up, + keycode_right=XK_Right, + keycode_down=XK_Down, + keycode_select=XK_Select, + keycode_print=XK_Print, + keycode_execute=XK_Execute, + keycode_insert=XK_Insert, + keycode_delete=XK_Delete, + keycode_help=XK_Help, + keycode_0=XK_0, + keycode_1=XK_1, + keycode_2=XK_2, + keycode_3=XK_3, + keycode_4=XK_4, + keycode_5=XK_5, + keycode_6=XK_6, + keycode_7=XK_7, + keycode_8=XK_8, + keycode_9=XK_9, + keycode_a=XK_a, + keycode_b=XK_b, + keycode_c=XK_c, + keycode_d=XK_d, + keycode_e=XK_e, + keycode_f=XK_f, + keycode_g=XK_g, + keycode_h=XK_h, + keycode_i=XK_i, + keycode_j=XK_j, + keycode_k=XK_k, + keycode_l=XK_l, + keycode_m=XK_m, + keycode_n=XK_n, + keycode_o=XK_o, + keycode_p=XK_p, + keycode_q=XK_q, + keycode_r=XK_r, + keycode_s=XK_s, + keycode_t=XK_t, + keycode_u=XK_u, + keycode_v=XK_v, + keycode_w=XK_w, + keycode_x=XK_x, + keycode_y=XK_y, + keycode_z=XK_z, + keycode_lwin=XK_Super_L, + keycode_rwin=XK_Multi_key, + keycode_apps=XK_Menu, + keycode_numpad0=XK_KP_0, + keycode_numpad1=XK_KP_1, + keycode_numpad2=XK_KP_2, + keycode_numpad3=XK_KP_3, + keycode_numpad4=XK_KP_4, + keycode_numpad5=XK_KP_5, + keycode_numpad6=XK_KP_6, + keycode_numpad7=XK_KP_7, + keycode_numpad8=XK_KP_8, + keycode_numpad9=XK_KP_9, + keycode_numpad_enter=XK_KP_Enter, + keycode_multiply=XK_KP_Multiply, + keycode_add=XK_KP_Add, + keycode_separator=XK_KP_Separator, + keycode_subtract=XK_KP_Subtract, + keycode_decimal=XK_KP_Decimal, + keycode_divide=XK_KP_Divide, + keycode_f1=XK_F1, + keycode_f2=XK_F2, + keycode_f3=XK_F3, + keycode_f4=XK_F4, + keycode_f5=XK_F5, + keycode_f6=XK_F6, + keycode_f7=XK_F7, + keycode_f8=XK_F8, + keycode_f9=XK_F9, + keycode_f10=XK_F10, + keycode_f11=XK_F11, + keycode_f12=XK_F12, + keycode_f13=XK_F13, + keycode_f14=XK_F14, + keycode_f15=XK_F15, + keycode_f16=XK_F16, + keycode_f17=XK_F17, + keycode_f18=XK_F18, + keycode_f19=XK_F19, + keycode_f20=XK_F20, + keycode_f21=XK_F21, + keycode_f22=XK_F22, + keycode_f23=XK_F23, + keycode_f24=XK_F24, + keycode_numlock=XK_Num_Lock, + keycode_scroll=XK_Scroll_Lock, + keycode_lshift=XK_Shift_L, + keycode_rshift=XK_Shift_R, + keycode_lcontrol=XK_Control_L, + keycode_rcontrol=XK_Control_R, + keycode_lmenu=XK_Meta_L, + keycode_rmenu=XK_Meta_R, + +#endif + + keycode_enter = keycode_return, + keycode_lapple = keycode_lwin, + keycode_rapple = keycode_rwin, + + keycode_unknown = -1 + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/input_device.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/input_device.h new file mode 100644 index 0000000..b5a46be --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/input_device.h @@ -0,0 +1,162 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include "../../Core/Signals/signal.h" +#include "../../Core/Math/point.h" +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Input clanDisplay Input + /// \{ + + class InputEvent; + class InputDeviceProvider; + class InputDevice_Impl; + + /// \brief InputDevice + class InputDevice + { + public: + /// \brief Input device types. + enum Type + { + keyboard, + pointer, + joystick, + unknown + }; + + /// \brief Constructs a null instance. + InputDevice(); + + /// \brief Constructs a InputDevice + /// + /// \param provider = Input Device Provider + InputDevice(InputDeviceProvider *provider); + + /// \brief Constructs a InputDevice + /// + /// \param impl = Weak Ptr + InputDevice(std::weak_ptr impl); + + ~InputDevice(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + explicit operator bool() const { return bool(impl); } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns the provider for this input device + InputDeviceProvider *get_provider() const; + + /// \brief Returns the human readable name of the device (i.e. 'Microsoft Sidewinder 3D'). + std::string get_name() const; + + /// \brief Return the hardware id/device for this device (i.e. /dev/input/js0) + std::string get_device_name() const; + + /// \brief Returns the input device type. + Type get_type() const; + + /// \brief Retrieves the localized friendly key name for specified identifier (i.e. A, B, Leertaste, Backspace, Mouse Left, ...). + /// \note The returned name for the key may be localized by the system; it + // should only be used to display the name of the key to the user + // and not as a key identifier inside key binding configuration + // files and such. + std::string get_key_name(int id) const; + + /// \brief Returns a generic string name for the specified key code. + std::string keyid_to_string(int keycode) const; + + /// \brief Returns the key code for the specified generic string key name. + int string_to_keyid(const std::string &str) const; + + /// \brief Returns true if the passed key code is down for this device. + /// See `keys.h` for list of key codes. + bool get_keycode(int keycode) const; + + /// \brief Returns the current device-independent x and y position (DIP) of the device. (Pointing devices only) + /// The returned positional value is scaled to the pixel ratio of the display. + Pointf get_position() const; + + /// \brief Returns the current devicesice-supplied x and y position of the device. (Pointing devices only) + /// The returned positional value is in the scale of the physical pixel on the screen. + Point get_device_position() const; + + /// \brief Returns the the current position of a joystick axis. (Joysticks only) + float get_axis(int axisid) const; + + /// \brief Returns the number of axes available on this device. (Joysticks only) + std::vector get_axis_ids() const; + + /// \brief Returns the current position of a joystick hat. (Joysticks only) + /// \return Hat direction in degrees (0-360), or -1 if the hat is centered. + int get_hat(int index) const; + + /// \brief Returns the number of buttons available on this device. + /// \warn If used on a keyboard or mouse, this function returns -1. + int get_button_count() const; + + InputDevice &operator =(const InputDevice ©); + + /// \brief Sets the display-independent position of the device. (Pointing devices only) + void set_position(float x, float y); + + /// \brief Sets the actual position of the device. (Pointing devices only) + void set_device_position(int x, int y); + + /// \brief Signal emitted when key is pressed. + Signal &sig_key_down(); + + /// \brief Signal emitted when key is released. + Signal &sig_key_up(); + + /// \brief Signal emitted when pointer is moved (absolute movement). + Signal &sig_pointer_move(); + + /// \brief Signal emitted when axis is moved. + Signal &sig_axis_move(); + + /// \brief Signal emitted when the mouse is double-clicked. + Signal &sig_key_dblclk(); + + /// \brief Signal emitted when proximity is entered or exited + Signal &sig_proximity_change(); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/input_event.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/input_event.h new file mode 100644 index 0000000..acc995f --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/input_event.h @@ -0,0 +1,102 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +*/ + +#pragma once + +#include "input_device.h" +#include "keys.h" +#include "../../Core/Math/point.h" + +namespace clan +{ + /// \addtogroup clanDisplay_Input clanDisplay Input + /// \{ + + /// \brief Input event class. + class InputEvent + { + public: + /// \brief Event types. + enum Type + { + no_key = 0, + pressed = 1, + released = 2, + doubleclick = 3, + pointer_moved = 4, + axis_moved = 5, + proximity_change = 6 + }; + + /// \brief Constructs a 'NoKey' key. + InputEvent(); + ~InputEvent(); + + /// \brief The exact input + InputCode id; + + /// \brief Contains the value (0 to x) for certains InputCode types that have a variable output identifier (for example, joystick button identifers, or joystick axis...) + int id_offset; + + /// \brief Character sequence generated by event. + /// A key press can generate one, none or multiple characters. The reason + /// for this are deadkeys, i.e. press ^ + a and get ^; the first press + /// would generate no key and the second one, in case that the second key + /// being pressed doesn't support the ^ it would generate two characters + /// (i.e. ^ + 5 => "", "^5") + std::string str; + + /// \brief Event type. + Type type; + + /// \brief Device that event originates from. + InputDevice device; + + /// \brief Mouse position at event time. + Pointf mouse_pos; + + /// \brief Mouse actual position at event time. + Point mouse_device_pos; + + /// \brief Axis position. + double axis_pos; + + /// \brief The repeat count for this event. + /// Contains the number of times the keystroke has auto-repeated as a + /// result of the user holding down the key. + int repeat_count; + + /// \brief State of modifier keys. + bool alt; + bool shift; + bool ctrl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/keys.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/keys.h new file mode 100644 index 0000000..bf3f4b2 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/Window/keys.h @@ -0,0 +1,174 @@ +/* + ** ClanLib SDK + ** Copyright (c) 1997-2016 The ClanLib Team + ** + ** This software is provided 'as-is', without any express or implied + ** warranty. In no event will the authors be held liable for any damages + ** arising from the use of this software. + ** + ** Permission is granted to anyone to use this software for any purpose, + ** including commercial applications, and to alter it and redistribute it + ** freely, subject to the following restrictions: + ** + ** 1. The origin of this software must not be misrepresented; you must not + ** claim that you wrote the original software. If you use this software + ** in a product, an acknowledgment in the product documentation would be + ** appreciated but is not required. + ** 2. Altered source versions must be plainly marked as such, and must not be + ** misrepresented as being the original software. + ** 3. This notice may not be removed or altered from any source distribution. + ** + ** Note: Some of the libraries ClanLib may link to may have additional + ** requirements or restrictions. + ** + ** File Author(s): + ** + ** Magnus Norddahl + ** Chu Chin Kuan + */ + +#pragma once + +#include "input_code.h" + +namespace clan +{ + //! Enumeration of keyboard keys recognized on ClanLib. + enum class Key + { + none = 0x00, + backspace = 0x08, + tab = 0x09, // ASCII HT, Horizontal tab + linefeed = 0x0a, // ASCII LF + clear = 0x0b, // ASCII VT + scroll = 0x0c, // ASCII FF, Clear screen + key_return = 0x0d, // ASCII CR, Enter key + select = 0x0e, + execute = 0x1a, + escape = 0x1b, + pause = 0x1c, + print = 0x1d, + + space = 0x20, + + prior = 0x21, + next = 0x22, + home = 0x23, + end = 0x24, + left = 0x25, + up = 0x26, + right = 0x27, + down = 0x28, + + kanji = 0x29, + convert = 0x2a, + nonconvert = 0x2b, + separator = 0x2c, // ASCII ',' + + help = 0x3f, // ASCII '?' + + key_0 = '0', // 0x30 + key_1 = '1', + key_2 = '2', + key_3 = '3', + key_4 = '4', + key_5 = '5', + key_6 = '6', + key_7 = '7', + key_8 = '8', + key_9 = '9', + + a = 'A', // 0x41 + b = 'B', + c = 'C', + d = 'D', + e = 'E', + f = 'F', + g = 'G', + h = 'H', + i = 'I', + j = 'J', + k = 'K', + l = 'L', + m = 'M', + n = 'N', + o = 'O', + p = 'P', + q = 'Q', + r = 'R', + s = 'S', + t = 'T', + u = 'U', + v = 'V', + w = 'W', + x = 'X', + y = 'Y', + z = 'Z', + + f1 = 0x61, // ASCII 'a' + f2 = 0x62, + f3 = 0x63, + f4 = 0x64, + f5 = 0x65, + f6 = 0x66, + f7 = 0x67, + f8 = 0x68, + f9 = 0x69, + f10 = 0x6a, + f11 = 0x6b, + f12 = 0x6c, + f13 = 0x6d, + f14 = 0x6e, + f15 = 0x6f, + f16 = 0x70, + f17 = 0x71, + f18 = 0x72, + f19 = 0x73, + f20 = 0x74, + f21 = 0x75, + f22 = 0x76, + f23 = 0x77, + f24 = 0x78, + + insert = 0x7e, + key_delete = 0x7f, // ASCII DEL + + // Numpad numbers + numpad_0 = 0x80, + numpad_1 = 0x81, + numpad_2 = 0x82, + numpad_3 = 0x83, + numpad_4 = 0x84, + numpad_5 = 0x85, + numpad_6 = 0x86, + numpad_7 = 0x87, + numpad_8 = 0x88, + numpad_9 = 0x89, + + // Numpad buttons + multiply = 0x8a, + add = 0x8b, + seperator = 0x8c, + subtract = 0x8d, + decimal = 0x8e, + divide = 0x8f, + + // Modifiers + lshift = 0xe0, + rshift = 0xe1, + lcontrol = 0xe2, + rcontrol = 0xe3, + lalt = 0xe4, loption = lalt, + ralt = 0xe5, roption = ralt, + lmenu = 0xe6, apps = lmenu, + rmenu = 0xe7, + lsuper = 0xe8, lcmd = lsuper, + rsuper = 0xe9, rcmd = rsuper, + + scrolllock = 0xea, + capslock = 0xeb, + numlock = 0xec + }; + + Key decode_ic(InputCode); +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/display_target.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/display_target.h new file mode 100644 index 0000000..7a2ca34 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/display_target.h @@ -0,0 +1,54 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class DisplayTargetProvider; + + /// \brief Display target for clanDisplay. + /// + /// Controls which target is used for window creation + class DisplayTarget + { + public: + /// \brief Returns the currently selected display target + static const std::shared_ptr &get_current_target(); + + /// \brief Sets the currently selected display target. + static void set_current_target(const std::shared_ptr &target); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/screen_info.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/screen_info.h new file mode 100644 index 0000000..8877e1f --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Display/screen_info.h @@ -0,0 +1,57 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Harry Storbacka +*/ + +#pragma once + +#include +#include + +namespace clan +{ + /// \addtogroup clanDisplay_Display clanDisplay Display + /// \{ + + class ScreenInfo_Impl; + class Rectf; + + /// \brief Screen Information class. + class ScreenInfo + { + public: + /// \brief Constructs a ScreenInfo object. + ScreenInfo(); + + /// \brief Returns the geometries of the attached screens and the index of the primary screen in the returned array. + std::vector get_screen_geometries(int &primary_screen_index) const; + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl.h new file mode 100644 index 0000000..9534b90 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl.h @@ -0,0 +1,148 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + + +#pragma once + +#include "opengl_defines.h" +#include +#include "../Display/Render/texture.h" +#include "../Core/System/thread_local_storage.h" + +namespace clan +{ + /// \addtogroup clanGL_System clanGL System + /// \{ + + class GLFunctions; + class GraphicContext; + class OpenGLGraphicContextProvider; + class GL1GraphicContextProvider; + class GL3GraphicContextProvider; + + enum TextureFormat; + + /// \brief Extension procedure address typedef for OpenGL. + typedef void (ProcAddress)(); + + typedef struct + { + TextureFormat texture_format; + bool valid; //!< True when this is a valid opengl format + GLint internal_format; + GLenum pixel_format; + GLenum pixel_datatype; + } TextureFormat_GL; + + typedef struct + { + GLenum source; + GLenum type; + GLenum severity; + GLuint id; + std::string message; + + } MessageLog_GL; + + /// \brief OpenGL utility class. + class OpenGL + { + public: + /// \brief Get OpenGL extension specific function address. + static ProcAddress *get_proc_address(const std::string &function_name); + + /// \brief Function table for OpenGL 2.0. + static cl_tls_variable GLFunctions *functions; + + /// \brief Returns the opengl texture format + static TextureFormat_GL get_textureformat(TextureFormat format); + + /// \brief Sets the thread's OpenGL context to the one used by the graphic context. + static void set_active(GraphicContext &gc); + + /// \brief Sets the thread's OpenGL context to the one used by the graphic context. + static void set_active(const OpenGLGraphicContextProvider * const gc_provider); + + /// \brief Sets the thread's OpenGL context to the first valid allocated one + /// + /// If a valid OpenGL context is not found, then "no render context" is set. + /// + /// \return true = Success. false = No OpenGL contexts could be found + static bool set_active(); + + /// \brief Throw an exception if an OpenGL error was detected ( Using glGetError() ) + /// + /// Remember to call glGetError() to clear any previous errors + static void check_error(); + + /// \brief Get the OpenGL message log + /// + /// This is required for this function to operate + /// OpenGLContextDescription gldesc; + /// gldesc.set_debug(true); + /// OpenGLTarget::set_description(gldesc); + static std::vector get_message_log(GLuint numMsgs); + + /// \brief Returns the OpenGL texture handle + static GLuint get_texture_handle(Texture &texture); + + /// \brief Creates a texture object from an OpenGL texture handle + /// + /// The returned object takes ownership of the texture handle (it calls glDeleteTextures when destroyed) + static Texture from_texture_handle(GLuint type, GLuint handle); + + static GLenum to_enum(DrawBuffer buf); + static GLenum to_enum(CompareFunction func); + static GLenum to_enum(StencilOp op); + static GLenum to_enum(CullMode mode); + static GLenum to_enum(FillMode mode); + static GLenum to_enum(BlendFunc func); + static GLenum to_enum(BlendEquation eq); + static GLenum to_enum(VertexAttributeDataType value); + static GLenum to_enum(PrimitivesType value); + static GLenum to_enum(LogicOp op); + static GLenum to_enum(TextureFilter filter); + static GLenum to_enum(TextureWrapMode mode); + static GLenum to_enum(TextureCompareMode mode); + static GLenum to_cube_target(int index); + static GLenum to_enum(BufferUsage usage); + static GLenum to_enum(BufferAccess access); + + private: + /// \brief Remove the opengl bindings from the thread's OpenGL context + /// + /// This should only be called by the OpenGLGraphicContextProvider destructor + static void remove_active(const OpenGLGraphicContextProvider * const gc_provider); + + friend class GL1GraphicContextProvider; + friend class GL3GraphicContextProvider; + friend class PBuffer_GL1_Impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_context_description.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_context_description.h new file mode 100644 index 0000000..8e66dfe --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_context_description.h @@ -0,0 +1,130 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanGL_Display clanGL Display + /// \{ + + class OpenGLContextDescription_Impl; + + /// \brief OpenGL context specific settings. + class OpenGLContextDescription + { + public: + /// \brief Constructs a window description with default values. + OpenGLContextDescription(); + + /// \brief Constructs a OpenGLContextDescription + /// + /// \param desc = Display Window Description + virtual ~OpenGLContextDescription(); + + /// \brief Returns selected major version number + int get_version_major() const; + + /// \brief Returns selected minor version number + int get_version_minor() const; + + /// \brief Returns true if allowed lower versions than the selected version + bool get_allow_lower_versions() const; + + /// \brief Returns true if the debug flag is set + bool get_debug() const; + + /// \brief Returns true if the forward compatible flag is set + bool get_forward_compatible() const; + + /// \brief Returns true if the core profile flag is set + bool get_core_profile() const; + + /// \brief Returns true if the compatibility profile flag is set + bool get_compatibility_profile() const; + + /// \brief Returns the layer plane value + int get_layer_plane() const; + + /// \brief Select the OpenGL version number + /// + /// Defaults to OpenGL 3.2 with lower versions (will drop to Legacy OpenGL without shader support if lower) + /// + /// \param major = OpenGL major number (e.g. 4) + /// \param minor = OpenGL minor number (e.g. 1) + /// \param allow_lower_versions = Allow lower versions of the specified opengl + void set_version(int major, int minor, bool allow_lower_versions); + + /// \brief Sets the debug flag + /// + /// Debug contexts are intended for use during application development, and + /// provide additional runtime checking, validation, and logging + /// functionality while possibly incurring performance penalties + /// + /// \param enable = true - Enable this option (Default is false) + void set_debug(bool enable); + + /// \brief Sets the forward compatible flag + /// + /// Forward-compatible contexts must not support functionality marked + /// as deprecated by that version of the API, while a + /// non-forward-compatible context must support all functionality in + /// that version, deprecated or not. + /// + /// \param enable = true - Enable this option (Default is false) + void set_forward_compatible(bool enable); + + /// \brief Sets the core profile flag + /// + /// If true, then a context implementing the core profile of OpenGL is returned + /// + /// \param enable = true - Enable this option (Default is true) + void set_core_profile(bool enable); + + /// \brief Sets the compatibility profile flag + /// + /// If than a context implementing the compatibility profile is returned. + /// + /// \param enable = true - Enable this option (Default is false) + void set_compatibility_profile(bool enable); + + /// \brief Sets the layer plane value + /// + /// Specifies the layer plane that the rendering context is bound to + /// + /// \param value = The layer plane. (Default is 0 - the main plane) + void set_layer_plane(int value); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_defines.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_defines.h new file mode 100644 index 0000000..3be9ac6 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_defines.h @@ -0,0 +1,1955 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + + +#pragma once + +#include "../Core/System/cl_platform.h" + +#if defined(__IOS__) +#include +#include +#elif defined(__APPLE__) +#include +#include +#elif defined(__ANDROID__) +#include +#else +#include +#endif + +#include + +namespace clan +{ +/// \addtogroup clanGL_Display clanGL Display +/// \{ + +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef signed char GLbyte; +typedef short GLshort; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned int GLuint; +typedef int64_t CLint64; +typedef uint64_t CLuint64; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void GLvoid; +typedef char GLchar; +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; +typedef struct __CLsync *CLsync; + +typedef void * CLDEBUGPROCARB; +typedef void * CLDEBUGPROC; + +/// \brief Display Defines +enum DisplayDefines +{ + // GL_VERSION_1_1 + // AttribMask +#ifndef GL_DEPTH_BUFFER_BIT + GL_DEPTH_BUFFER_BIT = 0x00000100, + GL_STENCIL_BUFFER_BIT = 0x00000400, + GL_COLOR_BUFFER_BIT = 0x00004000, +#endif + // Boolean +#ifndef GL_FALSE + GL_FALSE = 0, + GL_TRUE = 1, +#endif + // BeginMode +#ifndef GL_POINTS + GL_POINTS = 0x0000, + GL_LINES = 0x0001, + GL_LINE_LOOP = 0x0002, + GL_LINE_STRIP = 0x0003, + GL_TRIANGLES = 0x0004, + GL_TRIANGLE_STRIP = 0x0005, + GL_TRIANGLE_FAN = 0x0006, +#endif + // AlphaFunction +#ifndef GL_NEVER + GL_NEVER = 0x0200, + GL_LESS = 0x0201, + GL_EQUAL = 0x0202, + GL_LEQUAL = 0x0203, + GL_GREATER = 0x0204, + GL_NOTEQUAL = 0x0205, + GL_GEQUAL = 0x0206, + GL_ALWAYS = 0x0207, +#endif + // BlendingFactorDest +#ifndef GL_ZERO + GL_ZERO = 0, + GL_ONE = 1, + GL_SRC_COLOR = 0x0300, + GL_ONE_MINUS_SRC_COLOR = 0x0301, + GL_SRC_ALPHA = 0x0302, + GL_ONE_MINUS_SRC_ALPHA = 0x0303, + GL_DST_ALPHA = 0x0304, + GL_ONE_MINUS_DST_ALPHA = 0x0305, +#endif + // BlendingFactorSrc +#ifndef GL_DST_COLOR + GL_DST_COLOR = 0x0306, + GL_ONE_MINUS_DST_COLOR = 0x0307, + GL_SRC_ALPHA_SATURATE = 0x0308, +#endif + // DrawBufferMode +#ifndef GL_NONE + GL_NONE = 0, + GL_FRONT_LEFT = 0x0400, + GL_FRONT_RIGHT = 0x0401, + GL_BACK_LEFT = 0x0402, + GL_BACK_RIGHT = 0x0403, +#endif +#ifndef GL_FRONT + GL_FRONT = 0x0404, + GL_BACK = 0x0405, +#endif +#ifndef GL_LEFT + GL_LEFT = 0x0406, + GL_RIGHT = 0x0407, +#endif +#ifndef GL_FRONT_AND_BACK + GL_FRONT_AND_BACK = 0x0408, +#endif + // ErrorCode +#ifndef GL_NO_ERROR + GL_NO_ERROR = 0, + GL_INVALID_ENUM = 0x0500, + GL_INVALID_VALUE = 0x0501, + GL_INVALID_OPERATION = 0x0502, + GL_OUT_OF_MEMORY = 0x0505, +#endif + // FrontFaceDirection +#ifndef GL_CW + GL_CW = 0x0900, + GL_CCW = 0x0901, +#endif + // GetPName +#ifndef GL_POINT_SIZE + GL_POINT_SIZE = 0x0B11, + GL_POINT_SIZE_RANGE = 0x0B12, + GL_POINT_SIZE_GRANULARITY = 0x0B13, + GL_LINE_SMOOTH = 0x0B20, + GL_LINE_WIDTH = 0x0B21, + GL_LINE_WIDTH_RANGE = 0x0B22, + GL_LINE_WIDTH_GRANULARITY = 0x0B23, + GL_POLYGON_SMOOTH = 0x0B41, + GL_CULL_FACE = 0x0B44, + GL_CULL_FACE_MODE = 0x0B45, + GL_FRONT_FACE = 0x0B46, + GL_DEPTH_RANGE = 0x0B70, + GL_DEPTH_TEST = 0x0B71, + GL_DEPTH_WRITEMASK = 0x0B72, + GL_DEPTH_CLEAR_VALUE = 0x0B73, + GL_DEPTH_FUNC = 0x0B74, + GL_STENCIL_TEST = 0x0B90, + GL_STENCIL_CLEAR_VALUE = 0x0B91, + GL_STENCIL_FUNC = 0x0B92, + GL_STENCIL_VALUE_MASK = 0x0B93, + GL_STENCIL_FAIL = 0x0B94, + GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95, + GL_STENCIL_PASS_DEPTH_PASS = 0x0B96, + GL_STENCIL_REF = 0x0B97, + GL_STENCIL_WRITEMASK = 0x0B98, + GL_VIEWPORT = 0x0BA2, + GL_DITHER = 0x0BD0, + GL_BLEND_DST = 0x0BE0, + GL_BLEND_SRC = 0x0BE1, + GL_BLEND = 0x0BE2, + GL_LOGIC_OP_MODE = 0x0BF0, + GL_COLOR_LOGIC_OP = 0x0BF2, + GL_DRAW_BUFFER = 0x0C01, + GL_READ_BUFFER = 0x0C02, + GL_SCISSOR_BOX = 0x0C10, + GL_SCISSOR_TEST = 0x0C11, + GL_COLOR_CLEAR_VALUE = 0x0C22, + GL_COLOR_WRITEMASK = 0x0C23, + GL_DOUBLEBUFFER = 0x0C32, + GL_STEREO = 0x0C33, + GL_LINE_SMOOTH_HINT = 0x0C52, + GL_POLYGON_SMOOTH_HINT = 0x0C53, +#endif +#ifndef GL_UNPACK_SWAP_BYTES + GL_UNPACK_SWAP_BYTES = 0x0CF0, + GL_UNPACK_LSB_FIRST = 0x0CF1, + GL_UNPACK_ROW_LENGTH = 0x0CF2, + GL_UNPACK_SKIP_ROWS = 0x0CF3, + GL_UNPACK_SKIP_PIXELS = 0x0CF4, +#endif +#ifndef GL_UNPACK_ALIGNMENT + GL_UNPACK_ALIGNMENT = 0x0CF5, +#endif + +#ifndef GL_PACK_SWAP_BYTES + GL_PACK_SWAP_BYTES = 0x0D00, + GL_PACK_LSB_FIRST = 0x0D01, +#endif +#ifndef GL_PACK_ROW_LENGTH + GL_PACK_ROW_LENGTH = 0x0D02, + GL_PACK_SKIP_ROWS = 0x0D03, + GL_PACK_SKIP_PIXELS = 0x0D04, + +#endif +#ifndef GL_PACK_ALIGNMENT + GL_PACK_ALIGNMENT = 0x0D05, + GL_MAX_TEXTURE_SIZE = 0x0D33, + GL_MAX_VIEWPORT_DIMS = 0x0D3A, +#endif + +#ifndef GL_SUBCL_PIXEL_BITS + GL_SUBCL_PIXEL_BITS = 0x0D50, +#endif + +#ifndef GL_TEXTURE_1D + GL_TEXTURE_1D = 0x0DE0, +#endif +#ifndef GL_TEXTURE_2D + GL_TEXTURE_2D = 0x0DE1, + GL_POLYGON_OFFSET_UNITS = 0x2A00, + GL_POLYGON_OFFSET_POINT = 0x2A01, + GL_POLYGON_OFFSET_LINE = 0x2A02, + GL_POLYGON_OFFSET_FILL = 0x8037, + GL_POLYGON_OFFSET_FACTOR = 0x8038, +#endif +#ifndef GL_TEXTURE_BINDING_1D + GL_TEXTURE_BINDING_1D = 0x8068, +#endif +#ifndef GL_TEXTURE_BINDING_2D + GL_TEXTURE_BINDING_2D = 0x8069, +#endif + // GetTextureParameter +#ifndef GL_TEXTURE_WIDTH + GL_TEXTURE_WIDTH = 0x1000, + GL_TEXTURE_HEIGHT = 0x1001, + GL_TEXTURE_INTERNAL_FORMAT = 0x1003, + GL_TEXTURE_BORDER_COLOR = 0x1004, + GL_TEXTURE_RED_SIZE = 0x805C, + GL_TEXTURE_GREEN_SIZE = 0x805D, + GL_TEXTURE_BLUE_SIZE = 0x805E, + GL_TEXTURE_ALPHA_SIZE = 0x805F, +#endif + // HintMode +#ifndef GL_DONT_CARE + GL_DONT_CARE = 0x1100, + GL_FASTEST = 0x1101, + GL_NICEST = 0x1102, +#endif + // DataType +#ifndef GL_BYTE + GL_BYTE = 0x1400, + GL_UNSIGNED_BYTE = 0x1401, + GL_SHORT = 0x1402, + GL_UNSIGNED_SHORT = 0x1403, +#endif +#ifndef GL_INT + GL_INT = 0x1404, + GL_UNSIGNED_INT = 0x1405, +#endif +#ifndef GL_FLOAT + GL_FLOAT = 0x1406, +#endif +#ifndef GL_DOUBLE + GL_DOUBLE = 0x140A, +#endif + // ErrorCode +#ifndef GL_STACK_OVERFLOW + GL_STACK_OVERFLOW = 0x0503, + GL_STACK_UNDERFLOW = 0x0504, +#endif + // LogicOp +#ifndef GL_CLEAR + GL_CLEAR = 0x1500, + GL_AND = 0x1501, + GL_AND_REVERSE = 0x1502, + GL_COPY = 0x1503, + GL_AND_INVERTED = 0x1504, + GL_NOOP = 0x1505, + GL_XOR = 0x1506, + GL_OR = 0x1507, + GL_NOR = 0x1508, + GL_EQUIV = 0x1509, + GL_INVERT = 0x150A, + GL_OR_REVERSE = 0x150B, + GL_COPY_INVERTED = 0x150C, + GL_OR_INVERTED = 0x150D, + GL_NAND = 0x150E, + GL_SET = 0x150F, +#endif + // MatrixMode (for gl3.h, FBO attachment = type) +#ifndef GL_TEXTURE + GL_TEXTURE = 0x1702, +#endif + // PixelCopyType +#ifndef GL_COLOR + GL_COLOR = 0x1800, + GL_DEPTH = 0x1801, + GL_STENCIL = 0x1802, +#endif + // PixelFormat +#ifndef GL_STENCIL_INDEX + GL_STENCIL_INDEX = 0x1901, + GL_DEPTH_COMPONENT = 0x1902, + GL_RED = 0x1903, + GL_GREEN = 0x1904, + GL_BLUE = 0x1905, +#endif + +#ifndef GL_ALPHA + GL_ALPHA = 0x1906, + GL_RGB = 0x1907, + GL_RGBA = 0x1908, +#endif + // PolygonMode +#ifndef GL_POINT + GL_POINT = 0x1B00, + GL_LINE = 0x1B01, + GL_FILL = 0x1B02, +#endif + // StencilOp +#ifndef GL_KEEP + GL_KEEP = 0x1E00, + GL_REPLACE = 0x1E01, + GL_INCR = 0x1E02, + GL_DECR = 0x1E03, +#endif + // StringName +#ifndef GL_VENDOR + GL_VENDOR = 0x1F00, + GL_RENDERER = 0x1F01, + GL_VERSION = 0x1F02, + GL_EXTENSIONS = 0x1F03, +#endif + // TextureMagFilter +#ifndef GL_NEAREST + GL_NEAREST = 0x2600, + GL_LINEAR = 0x2601, +#endif + // TextureMinFilter +#ifndef GL_NEAREST_MIPMAP_NEAREST + GL_NEAREST_MIPMAP_NEAREST = 0x2700, + GL_LINEAR_MIPMAP_NEAREST = 0x2701, + GL_NEAREST_MIPMAP_LINEAR = 0x2702, + GL_LINEAR_MIPMAP_LINEAR = 0x2703, +#endif + // TextureParameterName +#ifndef GL_TEXTURE_MAG_FILTER + GL_TEXTURE_MAG_FILTER = 0x2800, + GL_TEXTURE_MIN_FILTER = 0x2801, + GL_TEXTURE_WRAP_S = 0x2802, + GL_TEXTURE_WRAP_T = 0x2803, +#endif + // TextureTarget +#ifndef GL_PROXY_TEXTURE_1D + GL_PROXY_TEXTURE_1D = 0x8063, + GL_PROXY_TEXTURE_2D = 0x8064, +#endif + // TextureWrapMode +#ifndef GL_REPEAT + GL_REPEAT = 0x2901, +#endif + // PixelInternalFormat +#ifndef GL_R3_G3_B2 + GL_R3_G3_B2 = 0x2A10, + GL_RGB4 = 0x804F, + GL_RGB5 = 0x8050, + GL_RGB8 = 0x8051, + GL_RGB10 = 0x8052, + GL_RGB12 = 0x8053, + GL_RGB16 = 0x8054, + GL_RGBA2 = 0x8055, + GL_RGBA4 = 0x8056, + GL_RGB5_A1 = 0x8057, + GL_RGBA8 = 0x8058, + GL_RGB10_A2 = 0x8059, + GL_RGBA12 = 0x805A, + GL_RGBA16 = 0x805B, +#endif + // GL_VERSION_1_2 +#ifndef GL_UNSIGNED_BYTE_3_3_2 + GL_UNSIGNED_BYTE_3_3_2 = 0x8032, +#endif +#ifndef GL_UNSIGNED_SHORT_4_4_4_4 + GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033, + GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034, +#endif +#ifndef GL_UNSIGNED_INT_8_8_8_8 + GL_UNSIGNED_INT_8_8_8_8 = 0x8035, + GL_UNSIGNED_INT_10_10_10_2 = 0x8036, + GL_TEXTURE_BINDING_3D = 0x806A, + GL_PACK_SKIP_IMAGES = 0x806B, + GL_PACK_IMAGE_HEIGHT = 0x806C, + GL_UNPACK_SKIP_IMAGES = 0x806D, + GL_UNPACK_IMAGE_HEIGHT = 0x806E, + GL_TEXTURE_3D = 0x806F, + GL_PROXY_TEXTURE_3D = 0x8070, + GL_TEXTURE_DEPTH = 0x8071, + GL_TEXTURE_WRAP_R = 0x8072, + GL_MAX_3D_TEXTURE_SIZE = 0x8073, + GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362, +#endif +#ifndef GL_UNSIGNED_SHORT_5_6_5 + GL_UNSIGNED_SHORT_5_6_5 = 0x8363, + GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364, + GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365, + GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366, + GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367, + GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368, +#endif +#ifndef GL_BGR + GL_BGR = 0x80E0, + GL_BGRA = 0x80E1, + GL_MAX_ELEMENTS_VERTICES = 0x80E8, + GL_MAX_ELEMENTS_INDICES = 0x80E9, + +#endif +#ifndef GL_CLAMP_TO_EDGE + GL_CLAMP_TO_EDGE = 0x812F, +#endif +#ifndef GL_TEXTURE_MIN_LOD + GL_TEXTURE_MIN_LOD = 0x813A, + GL_TEXTURE_MAX_LOD = 0x813B, + GL_TEXTURE_BASE_LEVEL = 0x813C, + GL_TEXTURE_MAX_LEVEL = 0x813D, +#endif +#ifndef GL_SMOOTH_POINT_SIZE_RANGE + GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12, + GL_SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13, + GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22, + GL_SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23, + GL_ALIASED_LINE_WIDTH_RANGE = 0x846E, +#endif + // GL_ARB_imaging +#ifndef GL_CONSTANT_COLOR + GL_CONSTANT_COLOR = 0x8001, + GL_ONE_MINUS_CONSTANT_COLOR = 0x8002, + GL_CONSTANT_ALPHA = 0x8003, + GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004, + GL_BLEND_COLOR = 0x8005, + GL_FUNC_ADD = 0x8006, + GL_MIN = 0x8007, + GL_MAX = 0x8008, + GL_BLEND_EQUATION = 0x8009, + GL_FUNC_SUBTRACT = 0x800A, + GL_FUNC_REVERSE_SUBTRACT = 0x800B, +#endif + // GL_VERSION_1_3 +#ifndef GL_TEXTURE0 + GL_TEXTURE0 = 0x84C0, + GL_TEXTURE1 = 0x84C1, + GL_TEXTURE2 = 0x84C2, + GL_TEXTURE3 = 0x84C3, + GL_TEXTURE4 = 0x84C4, + GL_TEXTURE5 = 0x84C5, + GL_TEXTURE6 = 0x84C6, + GL_TEXTURE7 = 0x84C7, + GL_TEXTURE8 = 0x84C8, + GL_TEXTURE9 = 0x84C9, + GL_TEXTURE10 = 0x84CA, + GL_TEXTURE11 = 0x84CB, + GL_TEXTURE12 = 0x84CC, + GL_TEXTURE13 = 0x84CD, + GL_TEXTURE14 = 0x84CE, + GL_TEXTURE15 = 0x84CF, + GL_TEXTURE16 = 0x84D0, + GL_TEXTURE17 = 0x84D1, + GL_TEXTURE18 = 0x84D2, + GL_TEXTURE19 = 0x84D3, + GL_TEXTURE20 = 0x84D4, + GL_TEXTURE21 = 0x84D5, + GL_TEXTURE22 = 0x84D6, + GL_TEXTURE23 = 0x84D7, + GL_TEXTURE24 = 0x84D8, + GL_TEXTURE25 = 0x84D9, + GL_TEXTURE26 = 0x84DA, + GL_TEXTURE27 = 0x84DB, + GL_TEXTURE28 = 0x84DC, + GL_TEXTURE29 = 0x84DD, + GL_TEXTURE30 = 0x84DE, + GL_TEXTURE31 = 0x84DF, + GL_ACTIVE_TEXTURE = 0x84E0, + GL_MULTISAMPLE = 0x809D, + GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E, + GL_SAMPLE_ALPHA_TO_ONE = 0x809F, + GL_SAMPLE_COVERAGE = 0x80A0, + GL_SAMPLE_BUFFERS = 0x80A8, + GL_SAMPLES = 0x80A9, + GL_SAMPLE_COVERAGE_VALUE = 0x80AA, + GL_SAMPLE_COVERAGE_INVERT = 0x80AB, +#endif +#ifndef GL_TEXTURE_CUBE_MAP + GL_TEXTURE_CUBE_MAP = 0x8513, + GL_TEXTURE_BINDING_CUBE_MAP = 0x8514, +#endif +#ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_X + GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515, + GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516, + GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518, + GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A, + GL_PROXY_TEXTURE_CUBE_MAP = 0x851B, + GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C, + GL_COMPRESSED_RGB = 0x84ED, + GL_COMPRESSED_RGBA = 0x84EE, + GL_TEXTURE_COMPRESSION_HINT = 0x84EF, + GL_TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0, + GL_TEXTURE_COMPRESSED = 0x86A1, + +#endif +#ifndef GL_NUM_COMPRESSED_TEXTURE_FORMATS + GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2, + GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3, +#endif +#ifndef GL_CLAMP_TO_BORDER + GL_CLAMP_TO_BORDER = 0x812D, +#endif + // GL_VERSION_1_4 +#ifndef GL_BLEND_DST_RGB + GL_BLEND_DST_RGB = 0x80C8, + GL_BLEND_SRC_RGB = 0x80C9, + GL_BLEND_DST_ALPHA = 0x80CA, + GL_BLEND_SRC_ALPHA = 0x80CB, + +#endif +#ifndef GL_POINT_FADE_THRESHOLD_SIZE + GL_POINT_FADE_THRESHOLD_SIZE = 0x8128, +#endif +#ifndef GL_DEPTH_COMPONENT16 + GL_DEPTH_COMPONENT16 = 0x81A5, + GL_DEPTH_COMPONENT24 = 0x81A6, + GL_DEPTH_COMPONENT32 = 0x81A7, + GL_MIRRORED_REPEAT = 0x8370, + GL_MAX_TEXTURE_LOD_BIAS = 0x84FD, + GL_TEXTURE_LOD_BIAS = 0x8501, + GL_INCR_WRAP = 0x8507, + GL_DECR_WRAP = 0x8508, + GL_TEXTURE_DEPTH_SIZE = 0x884A, + GL_TEXTURE_COMPARE_MODE = 0x884C, + GL_TEXTURE_COMPARE_FUNC = 0x884D, +#endif + // GL_VERSION_1_5 +#ifndef GL_BUFFER_SIZE + GL_BUFFER_SIZE = 0x8764, + GL_BUFFER_USAGE = 0x8765, + GL_QUERY_COUNTER_BITS = 0x8864, + GL_CURRENT_QUERY = 0x8865, +#endif +#ifndef GL_QUERY_RESULT + GL_QUERY_RESULT = 0x8866, + GL_QUERY_RESULT_AVAILABLE = 0x8867, +#endif + +#ifndef GL_ARRAY_BUFFER + GL_ARRAY_BUFFER = 0x8892, + GL_ELEMENT_ARRAY_BUFFER = 0x8893, + GL_ARRAY_BUFFER_BINDING = 0x8894, + GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895, + GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F, +#endif +#ifndef GL_READ_ONLY + GL_READ_ONLY = 0x88B8, + GL_WRITE_ONLY = 0x88B9, + GL_READ_WRITE = 0x88BA, + GL_BUFFER_ACCESS = 0x88BB, + GL_BUFFER_MAPPED = 0x88BC, + GL_BUFFER_MAP_POINTER = 0x88BD, +#endif +#ifndef GL_STREAM_DRAW + GL_STREAM_DRAW = 0x88E0, + GL_STREAM_READ = 0x88E1, + GL_STREAM_COPY = 0x88E2, +#endif +#ifndef GL_STATIC_DRAW + GL_STATIC_DRAW = 0x88E4, +#endif +#ifndef GL_STATIC_READ + GL_STATIC_READ = 0x88E5, + GL_STATIC_COPY = 0x88E6, +#endif +#ifndef GL_DYNAMIC_DRAW + GL_DYNAMIC_DRAW = 0x88E8, +#endif +#ifndef GL_DYNAMIC_READ + GL_DYNAMIC_READ = 0x88E9, + GL_DYNAMIC_COPY = 0x88EA, + GL_SAMPLES_PASSED = 0x8914, +#endif + // GL_VERSION_2_0 +#ifndef GL_BLEND_EQUATION_RGB + GL_BLEND_EQUATION_RGB = 0x8009, + GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622, + GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623, + GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624, + GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625, + GL_CURRENT_VERTEX_ATTRIB = 0x8626, + GL_VERTEX_PROGRAM_POINT_SIZE = 0x8642, + GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645, + GL_STENCIL_BACK_FUNC = 0x8800, + GL_STENCIL_BACK_FAIL = 0x8801, + GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802, + GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803, + GL_MAX_DRAW_BUFFERS = 0x8824, + GL_DRAW_BUFFER0 = 0x8825, + GL_DRAW_BUFFER1 = 0x8826, + GL_DRAW_BUFFER2 = 0x8827, + GL_DRAW_BUFFER3 = 0x8828, + GL_DRAW_BUFFER4 = 0x8829, + GL_DRAW_BUFFER5 = 0x882A, + GL_DRAW_BUFFER6 = 0x882B, + GL_DRAW_BUFFER7 = 0x882C, + GL_DRAW_BUFFER8 = 0x882D, + GL_DRAW_BUFFER9 = 0x882E, + GL_DRAW_BUFFER10 = 0x882F, + GL_DRAW_BUFFER11 = 0x8830, + GL_DRAW_BUFFER12 = 0x8831, + GL_DRAW_BUFFER13 = 0x8832, + GL_DRAW_BUFFER14 = 0x8833, + GL_DRAW_BUFFER15 = 0x8834, + GL_BLEND_EQUATION_ALPHA = 0x883D, + GL_MAX_VERTEX_ATTRIBS = 0x8869, + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A, + GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872, + GL_FRAGMENT_SHADER = 0x8B30, + GL_VERTEX_SHADER = 0x8B31, + GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49, + GL_MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A, + GL_MAX_VARYING_FLOATS = 0x8B4B, + GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C, + GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D, + GL_SHADER_TYPE = 0x8B4F, + GL_FLOAT_VEC2 = 0x8B50, + GL_FLOAT_VEC3 = 0x8B51, + GL_FLOAT_VEC4 = 0x8B52, + GL_INT_VEC2 = 0x8B53, + GL_INT_VEC3 = 0x8B54, + GL_INT_VEC4 = 0x8B55, + GL_BOOL = 0x8B56, + GL_BOOL_VEC2 = 0x8B57, + GL_BOOL_VEC3 = 0x8B58, + GL_BOOL_VEC4 = 0x8B59, + GL_FLOAT_MAT2 = 0x8B5A, + GL_FLOAT_MAT3 = 0x8B5B, + GL_FLOAT_MAT4 = 0x8B5C, + GL_SAMPLER_1D = 0x8B5D, + GL_SAMPLER_2D = 0x8B5E, + GL_SAMPLER_3D = 0x8B5F, + GL_SAMPLER_CUBE = 0x8B60, + GL_SAMPLER_1D_SHADOW = 0x8B61, + GL_SAMPLER_2D_SHADOW = 0x8B62, + GL_DELETE_STATUS = 0x8B80, + GL_COMPILE_STATUS = 0x8B81, + GL_LINK_STATUS = 0x8B82, + GL_VALIDATE_STATUS = 0x8B83, + GL_INFO_LOG_LENGTH = 0x8B84, + GL_ATTACHED_SHADERS = 0x8B85, + GL_ACTIVE_UNIFORMS = 0x8B86, + GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87, + GL_SHADER_SOURCE_LENGTH = 0x8B88, + GL_ACTIVE_ATTRIBUTES = 0x8B89, + GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A, + GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B, + GL_SHADING_LANGUAGE_VERSION = 0x8B8C, + GL_CURRENT_PROGRAM = 0x8B8D, + GL_POINT_SPRITE_COORD_ORIGIN = 0x8CA0, + GL_LOWER_LEFT = 0x8CA1, + GL_UPPER_LEFT = 0x8CA2, + GL_STENCIL_BACK_REF = 0x8CA3, + GL_STENCIL_BACK_VALUE_MASK = 0x8CA4, + GL_STENCIL_BACK_WRITEMASK = 0x8CA5, +#endif + // GL_VERSION_2_1 +#ifndef GL_PIXEL_PACK_BUFFER + GL_PIXEL_PACK_BUFFER = 0x88EB, + GL_PIXEL_UNPACK_BUFFER = 0x88EC, + GL_PIXEL_PACK_BUFFER_BINDING = 0x88ED, + GL_PIXEL_UNPACK_BUFFER_BINDING = 0x88EF, +#endif + +#ifndef GL_FLOAT_MAT2x3 + GL_FLOAT_MAT2x3 = 0x8B65, + GL_FLOAT_MAT2x4 = 0x8B66, + GL_FLOAT_MAT3x2 = 0x8B67, + GL_FLOAT_MAT3x4 = 0x8B68, + GL_FLOAT_MAT4x2 = 0x8B69, + GL_FLOAT_MAT4x3 = 0x8B6A, + + GL_SRGB = 0x8C40, + GL_SRGB8 = 0x8C41, + GL_SRGB_ALPHA = 0x8C42, + GL_SRGB8_ALPHA8 = 0x8C43, + GL_COMPRESSED_SRGB = 0x8C48, + GL_COMPRESSED_SRGB_ALPHA = 0x8C49, +#endif + + // GL_VERSION_3_0 +#ifndef GL_COMPARE_REF_TO_TEXTURE + GL_COMPARE_REF_TO_TEXTURE = 0x884E, + GL_CLIP_DISTANCE0 = 0x3000, + GL_CLIP_DISTANCE1 = 0x3001, + GL_CLIP_DISTANCE2 = 0x3002, + GL_CLIP_DISTANCE3 = 0x3003, + GL_CLIP_DISTANCE4 = 0x3004, + GL_CLIP_DISTANCE5 = 0x3005, + GL_CLIP_DISTANCE6 = 0x3006, + GL_CLIP_DISTANCE7 = 0x3007, + GL_MAX_CLIP_DISTANCES = 0x0D32, + GL_MAJOR_VERSION = 0x821B, + GL_MINOR_VERSION = 0x821C, + GL_NUM_EXTENSIONS = 0x821D, + GL_CONTEXT_FLAGS = 0x821E, +#if !defined(GL_ARB_texture_rg) + GL_COMPRESSED_RED = 0x8225, + GL_COMPRESSED_RG = 0x8226, +#endif + GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x0001, + GL_RGBA32F = 0x8814, + GL_RGB32F = 0x8815, + GL_RGBA16F = 0x881A, + GL_RGB16F = 0x881B, + GL_VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD, + GL_MAX_ARRAY_TEXTURE_LAYERS = 0x88FF, + GL_MIN_PROGRAM_TEXEL_OFFSET = 0x8904, + GL_MAX_PROGRAM_TEXEL_OFFSET = 0x8905, + GL_CLAMP_READ_COLOR = 0x891C, + GL_FIXED_ONLY = 0x891D, + GL_MAX_VARYING_COMPONENTS = 0x8B4B, + GL_TEXTURE_1D_ARRAY = 0x8C18, + GL_PROXY_TEXTURE_1D_ARRAY = 0x8C19, + GL_TEXTURE_2D_ARRAY = 0x8C1A, + GL_PROXY_TEXTURE_2D_ARRAY = 0x8C1B, + GL_TEXTURE_BINDING_1D_ARRAY = 0x8C1C, + GL_TEXTURE_BINDING_2D_ARRAY = 0x8C1D, + GL_R11F_G11F_B10F = 0x8C3A, + GL_UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B, + GL_RGB9_E5 = 0x8C3D, + GL_UNSIGNED_INT_5_9_9_9_REV = 0x8C3E, + GL_TEXTURE_SHARED_SIZE = 0x8C3F, + GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76, + GL_TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F, + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80, + GL_TRANSFORM_FEEDBACK_VARYINGS = 0x8C83, + GL_TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84, + GL_TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85, + GL_PRIMITIVES_GENERATED = 0x8C87, + GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88, + GL_RASTERIZER_DISCARD = 0x8C89, + GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A, + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B, + GL_INTERLEAVED_ATTRIBS = 0x8C8C, + GL_SEPARATE_ATTRIBS = 0x8C8D, + GL_TRANSFORM_FEEDBACK_BUFFER = 0x8C8E, + GL_TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F, + GL_RGBA32UI = 0x8D70, + GL_RGB32UI = 0x8D71, + GL_RGBA16UI = 0x8D76, + GL_RGB16UI = 0x8D77, + GL_RGBA8UI = 0x8D7C, + GL_RGB8UI = 0x8D7D, + GL_RGBA32I = 0x8D82, + GL_RGB32I = 0x8D83, + GL_RGBA16I = 0x8D88, + GL_RGB16I = 0x8D89, + GL_RGBA8I = 0x8D8E, + GL_RGB8I = 0x8D8F, + GL_RED_INTEGER = 0x8D94, + GL_GREEN_INTEGER = 0x8D95, + GL_BLUE_INTEGER = 0x8D96, + GL_RGB_INTEGER = 0x8D98, + GL_RGBA_INTEGER = 0x8D99, + GL_BGR_INTEGER = 0x8D9A, + GL_BGRA_INTEGER = 0x8D9B, + GL_SAMPLER_1D_ARRAY = 0x8DC0, + GL_SAMPLER_2D_ARRAY = 0x8DC1, + GL_SAMPLER_1D_ARRAY_SHADOW = 0x8DC3, + GL_SAMPLER_2D_ARRAY_SHADOW = 0x8DC4, + GL_SAMPLER_CUBE_SHADOW = 0x8DC5, + GL_UNSIGNED_INT_VEC2 = 0x8DC6, + GL_UNSIGNED_INT_VEC3 = 0x8DC7, + GL_UNSIGNED_INT_VEC4 = 0x8DC8, + GL_INT_SAMPLER_1D = 0x8DC9, + GL_INT_SAMPLER_2D = 0x8DCA, + GL_INT_SAMPLER_3D = 0x8DCB, + GL_INT_SAMPLER_CUBE = 0x8DCC, + GL_INT_SAMPLER_1D_ARRAY = 0x8DCE, + GL_INT_SAMPLER_2D_ARRAY = 0x8DCF, + GL_UNSIGNED_INT_SAMPLER_1D = 0x8DD1, + GL_UNSIGNED_INT_SAMPLER_2D = 0x8DD2, + GL_UNSIGNED_INT_SAMPLER_3D = 0x8DD3, + GL_UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4, + GL_UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6, + GL_UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7, + GL_QUERY_WAIT = 0x8E13, + GL_QUERY_NO_WAIT = 0x8E14, + GL_QUERY_BY_REGION_WAIT = 0x8E15, + GL_QUERY_BY_REGION_NO_WAIT = 0x8E16, + GL_BUFFER_ACCESS_FLAGS = 0x911F, + GL_BUFFER_MAP_LENGTH = 0x9120, + GL_BUFFER_MAP_OFFSET = 0x9121, +#endif + // GL_VERSION_3_1 +#ifndef GL_SAMPLER_2D_RECT + GL_SAMPLER_2D_RECT = 0x8B63, + GL_SAMPLER_2D_RECT_SHADOW = 0x8B64, + GL_SAMPLER_BUFFER = 0x8DC2, + GL_INT_SAMPLER_2D_RECT = 0x8DCD, + GL_INT_SAMPLER_BUFFER = 0x8DD0, + GL_UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5, + GL_UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8, + GL_TEXTURE_BUFFER = 0x8C2A, + GL_MAX_TEXTURE_BUFFER_SIZE = 0x8C2B, + GL_TEXTURE_BINDING_BUFFER = 0x8C2C, + GL_TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D, + GL_TEXTURE_BUFFER_FORMAT = 0x8C2E, + GL_TEXTURE_RECTANGLE = 0x84F5, + GL_TEXTURE_BINDING_RECTANGLE = 0x84F6, + GL_PROXY_TEXTURE_RECTANGLE = 0x84F7, + GL_MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8, + GL_RED_SNORM = 0x8F90, + GL_RG_SNORM = 0x8F91, + GL_RGB_SNORM = 0x8F92, + GL_RGBA_SNORM = 0x8F93, + GL_R8_SNORM = 0x8F94, + GL_RG8_SNORM = 0x8F95, + GL_RGB8_SNORM = 0x8F96, + GL_RGBA8_SNORM = 0x8F97, + GL_R16_SNORM = 0x8F98, + GL_RG16_SNORM = 0x8F99, + GL_RGB16_SNORM = 0x8F9A, + GL_RGBA16_SNORM = 0x8F9B, + GL_SIGNED_NORMALIZED = 0x8F9C, + GL_PRIMITIVE_RESTART = 0x8F9D, + GL_PRIMITIVE_RESTART_INDEX = 0x8F9E, +#endif + // GL_VERSION_3_2 +#ifndef GL_CONTEXT_CORE_PROFILE_BIT + GL_CONTEXT_CORE_PROFILE_BIT = 0x00000001, + GL_CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002, + GL_LINES_ADJACENCY = 0x000A, + GL_LINE_STRIP_ADJACENCY = 0x000B, + GL_TRIANGLES_ADJACENCY = 0x000C, + GL_TRIANGLE_STRIP_ADJACENCY = 0x000D, + GL_PROGRAM_POINT_SIZE = 0x8642, + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29, + GL_FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7, + GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8, + GL_GEOMETRY_SHADER = 0x8DD9, + GL_GEOMETRY_VERTICES_OUT = 0x8916, + GL_GEOMETRY_INPUT_TYPE = 0x8917, + GL_GEOMETRY_OUTPUT_TYPE = 0x8918, + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF, + GL_MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0, + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1, + GL_MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122, + GL_MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123, + GL_MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124, + GL_MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125, + GL_CONTEXT_PROFILE_MASK = 0x9126, +#endif + // GL_VERSION_3_3 +#ifndef GL_VERTEX_ATTRIB_ARRAY_DIVISOR + GL_VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE, +#endif + // GL_VERSION_4_0 +#ifndef GL_SAMPLE_SHADING + GL_SAMPLE_SHADING = 0x8C36, + GL_MIN_SAMPLE_SHADING_VALUE = 0x8C37, + GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5E, + GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5F, + GL_TEXTURE_CUBE_MAP_ARRAY = 0x9009, + GL_TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A, + GL_PROXY_TEXTURE_CUBE_MAP_ARRAY = 0x900B, + GL_SAMPLER_CUBE_MAP_ARRAY = 0x900C, + GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW = 0x900D, + GL_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900E, + GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900F, +#endif + // GL_VERSION_4_3 +#ifndef GL_NUM_SHADING_LANGUAGE_VERSIONS + GL_NUM_SHADING_LANGUAGE_VERSIONS = 0x82E9, + GL_VERTEX_ATTRIB_ARRAY_LONG = 0x874E, +#endif + // GL_ARB_depth_buffer_float +#ifndef GL_DEPTH_COMPONENT32F + GL_DEPTH_COMPONENT32F = 0x8CAC, + GL_DEPTH32F_STENCIL8 = 0x8CAD, + GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD, +#endif + // GL_ARB_framebuffer_object +#ifndef GL_INVALID_FRAMEBUFFER_OPERATION + GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506, + GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210, + GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211, + GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212, + GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213, + GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214, + GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215, + GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216, + GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217, + GL_FRAMEBUFFER_DEFAULT = 0x8218, + GL_FRAMEBUFFER_UNDEFINED = 0x8219, + GL_DEPTH_STENCIL_ATTACHMENT = 0x821A, + GL_MAX_RENDERBUFFER_SIZE = 0x84E8, + GL_DEPTH_STENCIL = 0x84F9, + GL_UNSIGNED_INT_24_8 = 0x84FA, + GL_DEPTH24_STENCIL8 = 0x88F0, + GL_TEXTURE_STENCIL_SIZE = 0x88F1, + GL_TEXTURE_RED_TYPE = 0x8C10, + GL_TEXTURE_GREEN_TYPE = 0x8C11, + GL_TEXTURE_BLUE_TYPE = 0x8C12, + GL_TEXTURE_ALPHA_TYPE = 0x8C13, + GL_TEXTURE_DEPTH_TYPE = 0x8C16, + GL_UNSIGNED_NORMALIZED = 0x8C17, + GL_FRAMEBUFFER_BINDING = 0x8CA6, + GL_DRAW_FRAMEBUFFER_BINDING = GL_FRAMEBUFFER_BINDING, + GL_RENDERBUFFER_BINDING = 0x8CA7, + GL_READ_FRAMEBUFFER = 0x8CA8, + GL_DRAW_FRAMEBUFFER = 0x8CA9, + GL_READ_FRAMEBUFFER_BINDING = 0x8CAA, + GL_RENDERBUFFER_SAMPLES = 0x8CAB, + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0, + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4, + GL_FRAMEBUFFER_COMPLETE = 0x8CD5, + GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6, + GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7, + GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB, + GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC, + GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD, + GL_MAX_COLOR_ATTACHMENTS = 0x8CDF, + GL_COLOR_ATTACHMENT0 = 0x8CE0, + GL_COLOR_ATTACHMENT1 = 0x8CE1, + GL_COLOR_ATTACHMENT2 = 0x8CE2, + GL_COLOR_ATTACHMENT3 = 0x8CE3, + GL_COLOR_ATTACHMENT4 = 0x8CE4, + GL_COLOR_ATTACHMENT5 = 0x8CE5, + GL_COLOR_ATTACHMENT6 = 0x8CE6, + GL_COLOR_ATTACHMENT7 = 0x8CE7, + GL_COLOR_ATTACHMENT8 = 0x8CE8, + GL_COLOR_ATTACHMENT9 = 0x8CE9, + GL_COLOR_ATTACHMENT10 = 0x8CEA, + GL_COLOR_ATTACHMENT11 = 0x8CEB, + GL_COLOR_ATTACHMENT12 = 0x8CEC, + GL_COLOR_ATTACHMENT13 = 0x8CED, + GL_COLOR_ATTACHMENT14 = 0x8CEE, + GL_COLOR_ATTACHMENT15 = 0x8CEF, + GL_DEPTH_ATTACHMENT = 0x8D00, + GL_STENCIL_ATTACHMENT = 0x8D20, + GL_FRAMEBUFFER = 0x8D40, + GL_RENDERBUFFER = 0x8D41, + GL_RENDERBUFFER_WIDTH = 0x8D42, + GL_RENDERBUFFER_HEIGHT = 0x8D43, + GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44, + GL_STENCIL_INDEX1 = 0x8D46, + GL_STENCIL_INDEX4 = 0x8D47, + GL_STENCIL_INDEX8 = 0x8D48, + GL_STENCIL_INDEX16 = 0x8D49, + GL_RENDERBUFFER_RED_SIZE = 0x8D50, + GL_RENDERBUFFER_GREEN_SIZE = 0x8D51, + GL_RENDERBUFFER_BLUE_SIZE = 0x8D52, + GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53, + GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54, + GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55, + GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56, + GL_MAX_SAMPLES = 0x8D57, +#endif + // GL_ARB_framebuffer_sRGB +#ifndef GL_FRAMEBUFFER_SRGB + GL_FRAMEBUFFER_SRGB = 0x8DB9, +#endif + // GL_ARB_half_float_vertex +#ifndef GL_HALF_FLOAT + GL_HALF_FLOAT = 0x140B, +#endif + // GL_ARB_map_buffer_range +#ifndef GL_MAP_READ_BIT + GL_MAP_READ_BIT = 0x0001, + GL_MAP_WRITE_BIT = 0x0002, + GL_MAP_INVALIDATE_RANGE_BIT = 0x0004, + GL_MAP_INVALIDATE_BUFFER_BIT = 0x0008, + GL_MAP_FLUSH_EXPLICIT_BIT = 0x0010, + GL_MAP_UNSYNCHRONIZED_BIT = 0x0020, +#endif + // GL_ARB_texture_compression_rgtc +#ifndef GL_COMPRESSED_RED_RGTC1 + GL_COMPRESSED_RED_RGTC1 = 0x8DBB, + GL_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC, + GL_COMPRESSED_RG_RGTC2 = 0x8DBD, + GL_COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE, +#endif + // GL_ARB_texture_rg +#ifndef GL_RG + GL_RG = 0x8227, + GL_RG_INTEGER = 0x8228, + GL_R8 = 0x8229, + GL_R16 = 0x822A, + GL_RG8 = 0x822B, + GL_RG16 = 0x822C, + GL_R16F = 0x822D, + GL_R32F = 0x822E, + GL_RG16F = 0x822F, + GL_RG32F = 0x8230, + GL_R8I = 0x8231, + GL_R8UI = 0x8232, + GL_R16I = 0x8233, + GL_R16UI = 0x8234, + GL_R32I = 0x8235, + GL_R32UI = 0x8236, + GL_RG8I = 0x8237, + GL_RG8UI = 0x8238, + GL_RG16I = 0x8239, + GL_RG16UI = 0x823A, + GL_RG32I = 0x823B, + GL_RG32UI = 0x823C, +#endif + // GL_ARB_vertex_array_object +#ifndef GL_VERTEX_ARRAY_BINDING + GL_VERTEX_ARRAY_BINDING = 0x85B5, +#endif + // GL_ARB_uniform_buffer_object +#ifndef GL_UNIFORM_BUFFER + GL_UNIFORM_BUFFER = 0x8A11, + GL_UNIFORM_BUFFER_BINDING = 0x8A28, + GL_UNIFORM_BUFFER_START = 0x8A29, + GL_UNIFORM_BUFFER_SIZE = 0x8A2A, + GL_MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B, + GL_MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C, + GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D, + GL_MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E, + GL_MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F, + GL_MAX_UNIFORM_BLOCK_SIZE = 0x8A30, + GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31, + GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32, + GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33, + GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34, + GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35, + GL_ACTIVE_UNIFORM_BLOCKS = 0x8A36, + GL_UNIFORM_TYPE = 0x8A37, + GL_UNIFORM_SIZE = 0x8A38, + GL_UNIFORM_NAME_LENGTH = 0x8A39, + GL_UNIFORM_BLOCK_INDEX = 0x8A3A, + GL_UNIFORM_OFFSET = 0x8A3B, + GL_UNIFORM_ARRAY_STRIDE = 0x8A3C, + GL_UNIFORM_MATRIX_STRIDE = 0x8A3D, + GL_UNIFORM_IS_ROW_MAJOR = 0x8A3E, + GL_UNIFORM_BLOCK_BINDING = 0x8A3F, + GL_UNIFORM_BLOCK_DATA_SIZE = 0x8A40, + GL_UNIFORM_BLOCK_NAME_LENGTH = 0x8A41, + GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42, + GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43, + GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44, + GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45, + GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46, + GL_INVALID_INDEX = 0xFFFFFFFFu, +#endif + // GL_ARB_copy_buffer +#ifndef GL_COPY_READ_BUFFER_BINDING + GL_COPY_READ_BUFFER_BINDING = 0x8F36, +#endif +#ifndef GL_COPY_READ_BUFFER + GL_COPY_READ_BUFFER = GL_COPY_READ_BUFFER_BINDING, +#endif +#ifndef GL_COPY_WRITE_BUFFER_BINDING + GL_COPY_WRITE_BUFFER_BINDING = 0x8F37, +#endif +#ifndef GL_COPY_WRITE_BUFFER + GL_COPY_WRITE_BUFFER = GL_COPY_WRITE_BUFFER_BINDING, +#endif + // GL_ARB_depth_clamp +#ifndef GL_DEPTH_CLAMP + GL_DEPTH_CLAMP = 0x864F, +#endif + // GL_ARB_provoking_vertex +#ifndef GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION + GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C, + GL_FIRST_VERTEX_CONVENTION = 0x8E4D, + GL_LAST_VERTEX_CONVENTION = 0x8E4E, + GL_PROVOKING_VERTEX = 0x8E4F, +#endif + // GL_ARB_seamless_cube_map +#ifndef GL_TEXTURE_CUBE_MAP_SEAMLESS + GL_TEXTURE_CUBE_MAP_SEAMLESS = 0x884F, +#endif + // GL_ARB_sync +#ifndef GL_MAX_SERVER_WAIT_TIMEOUT + GL_MAX_SERVER_WAIT_TIMEOUT = 0x9111, + GL_OBJECT_TYPE = 0x9112, + GL_SYNC_CONDITION = 0x9113, + GL_SYNC_STATUS = 0x9114, + GL_SYNC_FLAGS = 0x9115, + GL_SYNC_FENCE = 0x9116, + GL_SYNC_GPU_COMMANDS_COMPLETE = 0x9117, + GL_UNSIGNALED = 0x9118, + GL_SIGNALED = 0x9119, + GL_ALREADY_SIGNALED = 0x911A, + GL_TIMEOUT_EXCL_PIRED = 0x911B, + GL_CONDITION_SATISFIED = 0x911C, + GL_WAIT_FAILED = 0x911D, + GL_SYNC_FLUSH_COMMANDS_BIT = 0x00000001, + GL_TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFFull, +#endif + // GL_ARB_texture_multisample +#ifndef GL_SAMPLE_POSITION + GL_SAMPLE_POSITION = 0x8E50, + GL_SAMPLE_MASK = 0x8E51, + GL_SAMPLE_MASK_VALUE = 0x8E52, + GL_MAX_SAMPLE_MASK_WORDS = 0x8E59, + GL_TEXTURE_2D_MULTISAMPLE = 0x9100, + GL_PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101, + GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102, + GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103, + GL_TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104, + GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105, + GL_TEXTURE_SAMPLES = 0x9106, + GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107, + GL_SAMPLER_2D_MULTISAMPLE = 0x9108, + GL_INT_SAMPLER_2D_MULTISAMPLE = 0x9109, + GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A, + GL_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B, + GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C, + GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D, + GL_MAX_COLOR_TEXTURE_SAMPLES = 0x910E, + GL_MAX_DEPTH_TEXTURE_SAMPLES = 0x910F, + GL_MAX_INTEGER_SAMPLES = 0x9110, +#endif + // GL_ARB_sample_shading +#ifndef GL_SAMPLE_SHADING_ARB + GL_SAMPLE_SHADING_ARB = 0x8C36, + GL_MIN_SAMPLE_SHADING_VALUE_ARB = 0x8C37, +#endif + // GL_ARB_texture_cube_map_array +#ifndef GL_TEXTURE_CUBE_MAP_ARRAY_ARB + GL_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x9009, + GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB = 0x900A, + GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x900B, + GL_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900C, + GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB = 0x900D, + GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900E, + GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900F, +#endif + // GL_ARB_texture_gather +#ifndef GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB + GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E, + GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F, +#endif + // GL_ARB_shading_language_include +#ifndef GL_SHADER_INCLUDE_ARB + GL_SHADER_INCLUDE_ARB = 0x8DAE, + GL_NAMED_STRING_LENGTH_ARB = 0x8DE9, + GL_NAMED_STRING_TYPE_ARB = 0x8DEA, +#endif + // GL_ARB_texture_compression_bptc +#ifndef GL_COMPRESSED_RGBA_BPTC_UNORM_ARB + GL_COMPRESSED_RGBA_BPTC_UNORM_ARB = 0x8E8C, + GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB = 0x8E8D, + GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB = 0x8E8E, + GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB = 0x8E8F, +#endif + // GL_ARB_blend_func_extended +#ifndef GL_SRC1_COLOR + GL_SRC1_COLOR = 0x88F9, + GL_ONE_MINUS_SRC1_COLOR = 0x88FA, + GL_ONE_MINUS_SRC1_ALPHA = 0x88FB, + GL_MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC, +#endif + // GL_ARB_occlusion_query2 +#ifndef GL_ANY_SAMPLES_PASSED + GL_ANY_SAMPLES_PASSED = 0x8C2F, +#endif + // GL_ARB_sampler_objects +#ifndef GL_SAMPLER_BINDING + GL_SAMPLER_BINDING = 0x8919, +#endif + // GL_ARB_texture_rgb10_a2ui +#ifndef GL_RGB10_A2UI + GL_RGB10_A2UI = 0x906F, +#endif + // GL_ARB_texture_swizzle +#ifndef GL_TEXTURE_SWIZZLE_R + GL_TEXTURE_SWIZZLE_R = 0x8E42, + GL_TEXTURE_SWIZZLE_G = 0x8E43, + GL_TEXTURE_SWIZZLE_B = 0x8E44, + GL_TEXTURE_SWIZZLE_A = 0x8E45, + GL_TEXTURE_SWIZZLE_RGBA = 0x8E46, +#endif + // GL_ARB_timer_query +#ifndef GL_TIME_ELAPSED + GL_TIME_ELAPSED = 0x88BF, + GL_TIMESTAMP = 0x8E28, +#endif + // GL_ARB_vertex_type_2_10_10_10_rev +#ifndef GL_INT_2_10_10_10_REV + GL_INT_2_10_10_10_REV = 0x8D9F, +#endif + // GL_ARB_draw_indirect +#ifndef GL_DRAW_INDIRECT_BUFFER + GL_DRAW_INDIRECT_BUFFER = 0x8F3F, + GL_DRAW_INDIRECT_BUFFER_BINDING = 0x8F43, +#endif + // GL_ARB_gpu_shader5 +#ifndef GL_GEOMETRY_SHADER_INVOCATIONS + GL_GEOMETRY_SHADER_INVOCATIONS = 0x887F, + GL_MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A, + GL_MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B, + GL_MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C, + GL_FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D, +#endif + // GL_ARB_gpu_shader_fp64 +#ifndef GL_DOUBLE_VEC2 + GL_DOUBLE_VEC2 = 0x8FFC, + GL_DOUBLE_VEC3 = 0x8FFD, + GL_DOUBLE_VEC4 = 0x8FFE, + GL_DOUBLE_MAT2 = 0x8F46, + GL_DOUBLE_MAT3 = 0x8F47, + GL_DOUBLE_MAT4 = 0x8F48, + GL_DOUBLE_MAT2x3 = 0x8F49, + GL_DOUBLE_MAT2x4 = 0x8F4A, + GL_DOUBLE_MAT3x2 = 0x8F4B, + GL_DOUBLE_MAT3x4 = 0x8F4C, + GL_DOUBLE_MAT4x2 = 0x8F4D, + GL_DOUBLE_MAT4x3 = 0x8F4E, +#endif + // GL_ARB_shader_subroutine +#ifndef GL_ACTIVE_SUBROUTINES + GL_ACTIVE_SUBROUTINES = 0x8DE5, + GL_ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6, + GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47, + GL_ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48, + GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49, + GL_MAX_SUBROUTINES = 0x8DE7, + GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8, + GL_NUM_COMPATIBLE_SUBROUTINES = 0x8E4A, + GL_COMPATIBLE_SUBROUTINES = 0x8E4B, +#endif + // GL_ARB_tessellation_shader +#ifndef GL_PATCHES + GL_PATCHES = 0x000E, + GL_PATCH_VERTICES = 0x8E72, + GL_PATCH_DEFAULT_INNER_LEVEL = 0x8E73, + GL_PATCH_DEFAULT_OUTER_LEVEL = 0x8E74, + GL_TESS_CONTROL_OUTPUT_VERTICES = 0x8E75, + GL_TESS_GEN_MODE = 0x8E76, + GL_TESS_GEN_SPACING = 0x8E77, + GL_TESS_GEN_VERTEX_ORDER = 0x8E78, + GL_TESS_GEN_POINT_MODE = 0x8E79, + GL_ISOLINES = 0x8E7A, + GL_FRACTIONAL_ODD = 0x8E7B, + GL_FRACTIONAL_EVEN = 0x8E7C, + GL_MAX_PATCH_VERTICES = 0x8E7D, + GL_MAX_TESS_GEN_LEVEL = 0x8E7E, + GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F, + GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80, + GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81, + GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82, + GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83, + GL_MAX_TESS_PATCH_COMPONENTS = 0x8E84, + GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85, + GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86, + GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89, + GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A, + GL_MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C, + GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D, + GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E, + GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F, + GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0, + GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1, + GL_TESS_EVALUATION_SHADER = 0x8E87, + GL_TESS_CONTROL_SHADER = 0x8E88, +#endif + // GL_ARB_transform_feedback2 +#ifndef GL_TRANSFORM_FEEDBACK + GL_TRANSFORM_FEEDBACK = 0x8E22, + GL_TRANSFORM_FEEDBACK_PAUSED = 0x8E23, + GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED = GL_TRANSFORM_FEEDBACK_PAUSED, + GL_TRANSFORM_FEEDBACK_ACTIVE = 0x8E24, + GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE = GL_TRANSFORM_FEEDBACK_ACTIVE, + GL_TRANSFORM_FEEDBACK_BINDING = 0x8E25, +#endif + // GL_ARB_transform_feedback3 +#ifndef GL_MAX_TRANSFORM_FEEDBACK_BUFFERS + GL_MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70, + GL_MAX_VERTEX_STREAMS = 0x8E71, +#endif + // GL_ARB_ES2_compatibility +#ifndef GL_FIXED + GL_FIXED = 0x140C, + GL_IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A, + GL_IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B, + GL_LOW_FLOAT = 0x8DF0, + GL_MEDIUM_FLOAT = 0x8DF1, + GL_HIGH_FLOAT = 0x8DF2, + GL_LOW_INT = 0x8DF3, + GL_MEDIUM_INT = 0x8DF4, + GL_HIGH_INT = 0x8DF5, + GL_SHADER_COMPILER = 0x8DFA, + GL_NUM_SHADER_BINARY_FORMATS = 0x8DF9, + GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB, + GL_MAX_VARYING_VECTORS = 0x8DFC, + GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD, + GL_RGB565 = 0x8D62, +#endif + // GL_ARB_get_program_binary +#ifndef GL_PROGRAM_BINARY_RETRIEVABLE_HINT + GL_PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257, + GL_PROGRAM_BINARY_LENGTH = 0x8741, + GL_NUM_PROGRAM_BINARY_FORMATS = 0x87FE, + GL_PROGRAM_BINARY_FORMATS = 0x87FF, +#endif + // GL_ARB_separate_shader_objects +#ifndef GL_VERTEX_SHADER_BIT + GL_VERTEX_SHADER_BIT = 0x00000001, + GL_FRAGMENT_SHADER_BIT = 0x00000002, + GL_GEOMETRY_SHADER_BIT = 0x00000004, + GL_TESS_CONTROL_SHADER_BIT = 0x00000008, + GL_TESS_EVALUATION_SHADER_BIT = 0x00000010, + GL_ALL_SHADER_BITS = 0xFFFFFFFF, + GL_PROGRAM_SEPARABLE = 0x8258, + GL_ACTIVE_PROGRAM = 0x8259, + GL_PROGRAM_PIPELINE_BINDING = 0x825A, +#endif + // GL_ARB_viewport_array +#ifndef GL_MAX_VIEWPORTS + GL_MAX_VIEWPORTS = 0x825B, + GL_VIEWPORT_SUBCL_PIXEL_BITS = 0x825C, + GL_VIEWPORT_BOUNDS_RANGE = 0x825D, + GL_LAYER_PROVOKING_VERTEX = 0x825E, + GL_VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F, + GL_UNDEFINED_VERTEX = 0x8260, +#endif + // GL_ARB_cl_event +#ifndef GL_SYNC_EVENT_ARB + GL_SYNC_EVENT_ARB = 0x8240, + GL_SYNC_EVENT_COMPLETE_ARB = 0x8241, +#endif + // GL_ARB_debug_output +#ifndef GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB + GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB = 0x8242, + GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB = 0x8243, + GL_DEBUG_CALLBACK_FUNCTION_ARB = 0x8244, + GL_DEBUG_CALLBACK_USER_PARAM_ARB = 0x8245, + GL_DEBUG_SOURCE_CL_API_ARB = 0x8246, + GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB = 0x8247, + GL_DEBUG_SOURCE_SHADER_COMPILER_ARB = 0x8248, + GL_DEBUG_SOURCE_THIRD_PARTY_ARB = 0x8249, + GL_DEBUG_SOURCE_APPLICATION_ARB = 0x824A, + GL_DEBUG_SOURCE_OTHER_ARB = 0x824B, + GL_DEBUG_TYPE_ERROR_ARB = 0x824C, + GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB = 0x824D, + GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB = 0x824E, + GL_DEBUG_TYPE_PORTABILITY_ARB = 0x824F, + GL_DEBUG_TYPE_PERFORMANCE_ARB = 0x8250, + GL_DEBUG_TYPE_OTHER_ARB = 0x8251, + GL_MAX_DEBUG_MESSAGE_LENGTH_ARB = 0x9143, + GL_MAX_DEBUG_LOGGED_MESSAGES_ARB = 0x9144, + GL_DEBUG_LOGGED_MESSAGES_ARB = 0x9145, + GL_DEBUG_SEVERITY_HIGH_ARB = 0x9146, + GL_DEBUG_SEVERITY_MEDIUM_ARB = 0x9147, + GL_DEBUG_SEVERITY_LOW_ARB = 0x9148, +#endif + // GL_ARB_robustness +#ifndef GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB + GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB = 0x00000004, + GL_LOSE_CONTEXT_ON_RESET_ARB = 0x8252, + GL_GUILTY_CONTEXT_RESET_ARB = 0x8253, + GL_INNOCENT_CONTEXT_RESET_ARB = 0x8254, + GL_UNKNOWN_CONTEXT_RESET_ARB = 0x8255, + GL_RESET_NOTIFICATION_STRATEGY_ARB = 0x8256, + GL_NO_RESET_NOTIFICATION_ARB = 0x8261, +#endif + // GL_ARB_compressed_texture_pixel_storage +#ifndef GL_UNPACK_COMPRESSED_BLOCK_WIDTH + GL_UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127, + GL_UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128, + GL_UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129, + GL_UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A, + GL_PACK_COMPRESSED_BLOCK_WIDTH = 0x912B, + GL_PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C, + GL_PACK_COMPRESSED_BLOCK_DEPTH = 0x912D, + GL_PACK_COMPRESSED_BLOCK_SIZE = 0x912E, +#endif + // GL_ARB_internalformat_query +#ifndef GL_NUM_SAMPLE_COUNTS + GL_NUM_SAMPLE_COUNTS = 0x9380, +#endif + // GL_ARB_map_buffer_alignment +#ifndef GL_MIN_MAP_BUFFER_ALIGNMENT + GL_MIN_MAP_BUFFER_ALIGNMENT = 0x90BC, +#endif + // GL_ARB_shader_atomic_counters +#ifndef GL_ATOMIC_COUNTER_BUFFER + GL_ATOMIC_COUNTER_BUFFER = 0x92C0, + GL_ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1, + GL_ATOMIC_COUNTER_BUFFER_START = 0x92C2, + GL_ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3, + GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4, + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5, + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB, + GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC, + GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD, + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE, + GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF, + GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0, + GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1, + GL_MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2, + GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3, + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4, + GL_MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5, + GL_MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6, + GL_MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7, + GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8, + GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC, + GL_ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9, + GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA, + GL_UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB, +#endif + // GL_ARB_shader_image_load_store +#ifndef GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT + GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001, + GL_ELEMENT_ARRAY_BARRIER_BIT = 0x00000002, + GL_UNIFORM_BARRIER_BIT = 0x00000004, + GL_TEXTURE_FETCH_BARRIER_BIT = 0x00000008, + GL_SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020, + GL_COMMAND_BARRIER_BIT = 0x00000040, + GL_PIXEL_BUFFER_BARRIER_BIT = 0x00000080, + GL_TEXTURE_UPDATE_BARRIER_BIT = 0x00000100, + GL_BUFFER_UPDATE_BARRIER_BIT = 0x00000200, + GL_FRAMEBUFFER_BARRIER_BIT = 0x00000400, + GL_TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800, + GL_ATOMIC_COUNTER_BARRIER_BIT = 0x00001000, + GL_ALL_BARRIER_BITS = 0xFFFFFFFF, + GL_MAX_IMAGE_UNITS = 0x8F38, + GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39, + GL_IMAGE_BINDING_NAME = 0x8F3A, + GL_IMAGE_BINDING_LEVEL = 0x8F3B, + GL_IMAGE_BINDING_LAYERED = 0x8F3C, + GL_IMAGE_BINDING_LAYER = 0x8F3D, + GL_IMAGE_BINDING_ACCESS = 0x8F3E, + GL_IMAGE_1D = 0x904C, + GL_IMAGE_2D = 0x904D, + GL_IMAGE_3D = 0x904E, + GL_IMAGE_2D_RECT = 0x904F, + GL_IMAGE_CUBE = 0x9050, + GL_IMAGE_BUFFER = 0x9051, + GL_IMAGE_1D_ARRAY = 0x9052, + GL_IMAGE_2D_ARRAY = 0x9053, + GL_IMAGE_CUBE_MAP_ARRAY = 0x9054, + GL_IMAGE_2D_MULTISAMPLE = 0x9055, + GL_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056, + GL_INT_IMAGE_1D = 0x9057, + GL_INT_IMAGE_2D = 0x9058, + GL_INT_IMAGE_3D = 0x9059, + GL_INT_IMAGE_2D_RECT = 0x905A, + GL_INT_IMAGE_CUBE = 0x905B, + GL_INT_IMAGE_BUFFER = 0x905C, + GL_INT_IMAGE_1D_ARRAY = 0x905D, + GL_INT_IMAGE_2D_ARRAY = 0x905E, + GL_INT_IMAGE_CUBE_MAP_ARRAY = 0x905F, + GL_INT_IMAGE_2D_MULTISAMPLE = 0x9060, + GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061, + GL_UNSIGNED_INT_IMAGE_1D = 0x9062, + GL_UNSIGNED_INT_IMAGE_2D = 0x9063, + GL_UNSIGNED_INT_IMAGE_3D = 0x9064, + GL_UNSIGNED_INT_IMAGE_2D_RECT = 0x9065, + GL_UNSIGNED_INT_IMAGE_CUBE = 0x9066, + GL_UNSIGNED_INT_IMAGE_BUFFER = 0x9067, + GL_UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068, + GL_UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069, + GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A, + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B, + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C, + GL_MAX_IMAGE_SAMPLES = 0x906D, + GL_IMAGE_BINDING_FORMAT = 0x906E, + GL_IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7, + GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8, + GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9, + GL_MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA, + GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB, + GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC, + GL_MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD, + GL_MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE, + GL_MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF, +#endif + // GL_ARB_texture_storage +#ifndef GL_TEXTURE_IMMUTABLE_FORMAT + GL_TEXTURE_IMMUTABLE_FORMAT = 0x912F, +#endif + // GL_KHR_texture_compression_astc_ldr +#ifndef GL_COMPRESSED_RGBA_ASTC_4x4_KHR + GL_COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0, + GL_COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1, + GL_COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2, + GL_COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3, + GL_COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4, + GL_COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5, + GL_COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6, + GL_COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7, + GL_COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8, + GL_COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9, + GL_COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA, + GL_COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB, + GL_COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC, + GL_COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD, +#endif + // GL_KHR_debug +#ifndef GL_DEBUG_OUTPUT_SYNCHRONOUS + GL_DEBUG_OUTPUT_SYNCHRONOUS = 0x8242, + GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243, + GL_DEBUG_CALLBACK_FUNCTION = 0x8244, + GL_DEBUG_CALLBACK_USER_PARAM = 0x8245, + GL_DEBUG_SOURCE_API = 0x8246, + GL_DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247, + GL_DEBUG_SOURCE_SHADER_COMPILER = 0x8248, + GL_DEBUG_SOURCE_THIRD_PARTY = 0x8249, + GL_DEBUG_SOURCE_APPLICATION = 0x824A, + GL_DEBUG_SOURCE_OTHER = 0x824B, + GL_DEBUG_TYPE_ERROR = 0x824C, + GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D, + GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E, + GL_DEBUG_TYPE_PORTABILITY = 0x824F, + GL_DEBUG_TYPE_PERFORMANCE = 0x8250, + GL_DEBUG_TYPE_OTHER = 0x8251, + GL_DEBUG_TYPE_MARKER = 0x8268, + GL_DEBUG_TYPE_PUSH_GROUP = 0x8269, + GL_DEBUG_TYPE_POP_GROUP = 0x826A, + GL_DEBUG_SEVERITY_NOTIFICATION = 0x826B, + GL_MAX_DEBUG_GROUP_STACK_DEPTH = 0x826C, + GL_DEBUG_GROUP_STACK_DEPTH = 0x826D, + GL_BUFFER = 0x82E0, + GL_SHADER = 0x82E1, + GL_PROGRAM = 0x82E2, + GL_QUERY = 0x82E3, + GL_PROGRAM_PIPELINE = 0x82E4, +#ifndef GL_SAMPLER + GL_SAMPLER = 0x82E6, +#endif + GL_DISPLAY_LIST = 0x82E7, + GL_MAX_LABEL_LENGTH = 0x82E8, + GL_MAX_DEBUG_MESSAGE_LENGTH = 0x9143, + GL_MAX_DEBUG_LOGGED_MESSAGES = 0x9144, + GL_DEBUG_LOGGED_MESSAGES = 0x9145, + GL_DEBUG_SEVERITY_HIGH = 0x9146, + GL_DEBUG_SEVERITY_MEDIUM = 0x9147, + GL_DEBUG_SEVERITY_LOW = 0x9148, + GL_DEBUG_OUTPUT = 0x92E0, + GL_CONTEXT_FLAG_DEBUG_BIT = 0x00000002, +#endif + // GL_ARB_compute_shader +#ifndef GL_COMPUTE_SHADER + GL_COMPUTE_SHADER = 0x91B9, + GL_MAX_COMPUTE_UNIFORM_BLOCKS = 0x91BB, + GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC, + GL_MAX_COMPUTE_IMAGE_UNIFORMS = 0x91BD, + GL_MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262, + GL_MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263, + GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264, + GL_MAX_COMPUTE_ATOMIC_COUNTERS = 0x8265, + GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266, + GL_MAX_COMPUTE_LOCAL_INVOCATIONS = 0x90EB, + GL_MAX_COMPUTE_WORK_GROUP_COUNT = 0x91BE, + GL_MAX_COMPUTE_WORK_GROUP_SIZE = 0x91BF, + GL_COMPUTE_LOCAL_WORK_SIZE = 0x8267, + GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED, + GL_DISPATCH_INDIRECT_BUFFER = 0x90EE, + GL_DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF, + GL_COMPUTE_SHADER_BIT = 0x00000020, +#endif + // GL_ARB_ES3_compatibility +#ifndef GL_COMPRESSED_RGB8_ETC2 + GL_COMPRESSED_RGB8_ETC2 = 0x9274, + GL_COMPRESSED_SRGB8_ETC2 = 0x9275, + GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276, + GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277, + GL_COMPRESSED_RGBA8_ETC2_EAC = 0x9278, + GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279, + GL_COMPRESSED_R11_EAC = 0x9270, + GL_COMPRESSED_SIGNED_R11_EAC = 0x9271, + GL_COMPRESSED_RG11_EAC = 0x9272, + GL_COMPRESSED_SIGNED_RG11_EAC = 0x9273, + GL_PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69, + GL_ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A, + GL_MAX_ELEMENT_INDEX = 0x8D6B, +#endif + // GL_ARB_explicit_uniform_location +#ifndef GL_MAX_UNIFORM_LOCATIONS + GL_MAX_UNIFORM_LOCATIONS = 0x826E, +#endif + // GL_ARB_framebuffer_no_attachments +#ifndef GL_FRAMEBUFFER_DEFAULT_WIDTH + GL_FRAMEBUFFER_DEFAULT_WIDTH = 0x9310, + GL_FRAMEBUFFER_DEFAULT_HEIGHT = 0x9311, + GL_FRAMEBUFFER_DEFAULT_LAYERS = 0x9312, + GL_FRAMEBUFFER_DEFAULT_SAMPLES = 0x9313, + GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314, + GL_MAX_FRAMEBUFFER_WIDTH = 0x9315, + GL_MAX_FRAMEBUFFER_HEIGHT = 0x9316, + GL_MAX_FRAMEBUFFER_LAYERS = 0x9317, + GL_MAX_FRAMEBUFFER_SAMPLES = 0x9318, +#endif + // GL_ARB_internalformat_query2 +#ifndef GL_INTERNALFORMAT_SUPPORTED + GL_INTERNALFORMAT_SUPPORTED = 0x826F, + GL_INTERNALFORMAT_PREFERRED = 0x8270, + GL_INTERNALFORMAT_RED_SIZE = 0x8271, + GL_INTERNALFORMAT_GREEN_SIZE = 0x8272, + GL_INTERNALFORMAT_BLUE_SIZE = 0x8273, + GL_INTERNALFORMAT_ALPHA_SIZE = 0x8274, + GL_INTERNALFORMAT_DEPTH_SIZE = 0x8275, + GL_INTERNALFORMAT_STENCIL_SIZE = 0x8276, + GL_INTERNALFORMAT_SHARED_SIZE = 0x8277, + GL_INTERNALFORMAT_RED_TYPE = 0x8278, + GL_INTERNALFORMAT_GREEN_TYPE = 0x8279, + GL_INTERNALFORMAT_BLUE_TYPE = 0x827A, + GL_INTERNALFORMAT_ALPHA_TYPE = 0x827B, + GL_INTERNALFORMAT_DEPTH_TYPE = 0x827C, + GL_INTERNALFORMAT_STENCIL_TYPE = 0x827D, + GL_MAX_WIDTH = 0x827E, + GL_MAX_HEIGHT = 0x827F, + GL_MAX_DEPTH = 0x8280, + GL_MAX_LAYERS = 0x8281, + GL_MAX_COMBINED_DIMENSIONS = 0x8282, + GL_COLOR_COMPONENTS = 0x8283, + GL_DEPTH_COMPONENTS = 0x8284, + GL_STENCIL_COMPONENTS = 0x8285, + GL_COLOR_RENDERABLE = 0x8286, + GL_DEPTH_RENDERABLE = 0x8287, + GL_STENCIL_RENDERABLE = 0x8288, + GL_FRAMEBUFFER_RENDERABLE = 0x8289, + GL_FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A, + GL_FRAMEBUFFER_BLEND = 0x828B, + GL_READ_CL_PIXELS = 0x828C, + GL_READ_CL_PIXELS_FORMAT = 0x828D, + GL_READ_CL_PIXELS_TYPE = 0x828E, + GL_TEXTURE_IMAGE_FORMAT = 0x828F, + GL_TEXTURE_IMAGE_TYPE = 0x8290, + GL_GET_TEXTURE_IMAGE_FORMAT = 0x8291, + GL_GET_TEXTURE_IMAGE_TYPE = 0x8292, + GL_MIPMAP = 0x8293, + GL_MANUAL_GENERATE_MIPMAP = 0x8294, + GL_AUTO_GENERATE_MIPMAP = 0x8295, + GL_COLOR_ENCODING = 0x8296, + GL_SRGB_READ = 0x8297, + GL_SRGB_WRITE = 0x8298, + GL_SRGB_DECODE_ARB = 0x8299, + GL_FILTER = 0x829A, + GL_VERTEX_TEXTURE = 0x829B, + GL_TESS_CONTROL_TEXTURE = 0x829C, + GL_TESS_EVALUATION_TEXTURE = 0x829D, + GL_GEOMETRY_TEXTURE = 0x829E, + GL_FRAGMENT_TEXTURE = 0x829F, + GL_COMPUTE_TEXTURE = 0x82A0, + GL_TEXTURE_SHADOW = 0x82A1, + GL_TEXTURE_GATHER = 0x82A2, + GL_TEXTURE_GATHER_SHADOW = 0x82A3, + GL_SHADER_IMAGE_LOAD = 0x82A4, + GL_SHADER_IMAGE_STORE = 0x82A5, + GL_SHADER_IMAGE_ATOMIC = 0x82A6, + GL_IMAGE_TEXEL_SIZE = 0x82A7, + GL_IMAGE_COMPATIBILITY_CLASS = 0x82A8, + GL_IMAGE_CL_PIXEL_FORMAT = 0x82A9, + GL_IMAGE_CL_PIXEL_TYPE = 0x82AA, + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC, + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD, + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE, + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF, + GL_TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1, + GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2, + GL_TEXTURE_COMPRESSED_BLOCK_SIZE = 0x82B3, + GL_CLEAR_BUFFER = 0x82B4, + GL_TEXTURE_VIEW = 0x82B5, + GL_VIEW_COMPATIBILITY_CLASS = 0x82B6, + GL_FULL_SUPPORT = 0x82B7, + GL_CAVEAT_SUPPORT = 0x82B8, + GL_IMAGE_CLASS_4_X_32 = 0x82B9, + GL_IMAGE_CLASS_2_X_32 = 0x82BA, + GL_IMAGE_CLASS_1_X_32 = 0x82BB, + GL_IMAGE_CLASS_4_X_16 = 0x82BC, + GL_IMAGE_CLASS_2_X_16 = 0x82BD, + GL_IMAGE_CLASS_1_X_16 = 0x82BE, + GL_IMAGE_CLASS_4_X_8 = 0x82BF, + GL_IMAGE_CLASS_2_X_8 = 0x82C0, + GL_IMAGE_CLASS_1_X_8 = 0x82C1, + GL_IMAGE_CLASS_11_11_10 = 0x82C2, + GL_IMAGE_CLASS_10_10_10_2 = 0x82C3, + GL_VIEW_CLASS_128_BITS = 0x82C4, + GL_VIEW_CLASS_96_BITS = 0x82C5, + GL_VIEW_CLASS_64_BITS = 0x82C6, + GL_VIEW_CLASS_48_BITS = 0x82C7, + GL_VIEW_CLASS_32_BITS = 0x82C8, + GL_VIEW_CLASS_24_BITS = 0x82C9, + GL_VIEW_CLASS_16_BITS = 0x82CA, + GL_VIEW_CLASS_8_BITS = 0x82CB, + GL_VIEW_CLASS_S3TC_DXT1_RGB = 0x82CC, + GL_VIEW_CLASS_S3TC_DXT1_RGBA = 0x82CD, + GL_VIEW_CLASS_S3TC_DXT3_RGBA = 0x82CE, + GL_VIEW_CLASS_S3TC_DXT5_RGBA = 0x82CF, + GL_VIEW_CLASS_RGTC1_RED = 0x82D0, + GL_VIEW_CLASS_RGTC2_RG = 0x82D1, + GL_VIEW_CLASS_BPTC_UNORM = 0x82D2, + GL_VIEW_CLASS_BPTC_FLOAT = 0x82D3, +#endif + // GL_ARB_program_interface_query +#ifndef GL_UNIFORM + GL_UNIFORM = 0x92E1, + GL_UNIFORM_BLOCK = 0x92E2, + GL_PROGRAM_INPUT = 0x92E3, + GL_PROGRAM_OUTPUT = 0x92E4, + GL_BUFFER_VARIABLE = 0x92E5, + GL_SHADER_STORAGE_BLOCK = 0x92E6, + GL_VERTEX_SUBROUTINE = 0x92E8, + GL_TESS_CONTROL_SUBROUTINE = 0x92E9, + GL_TESS_EVALUATION_SUBROUTINE = 0x92EA, + GL_GEOMETRY_SUBROUTINE = 0x92EB, + GL_FRAGMENT_SUBROUTINE = 0x92EC, + GL_COMPUTE_SUBROUTINE = 0x92ED, + GL_VERTEX_SUBROUTINE_UNIFORM = 0x92EE, + GL_TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF, + GL_TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0, + GL_GEOMETRY_SUBROUTINE_UNIFORM = 0x92F1, + GL_FRAGMENT_SUBROUTINE_UNIFORM = 0x92F2, + GL_COMPUTE_SUBROUTINE_UNIFORM = 0x92F3, + GL_TRANSFORM_FEEDBACK_VARYING = 0x92F4, + GL_ACTIVE_RESOURCES = 0x92F5, + GL_MAX_NAME_LENGTH = 0x92F6, + GL_MAX_NUM_ACTIVE_VARIABLES = 0x92F7, + GL_MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8, + GL_NAME_LENGTH = 0x92F9, + GL_TYPE = 0x92FA, + GL_ARRAY_SIZE = 0x92FB, + GL_OFFSET = 0x92FC, + GL_BLOCK_INDEX = 0x92FD, + GL_ARRAY_STRIDE = 0x92FE, + GL_MATRIX_STRIDE = 0x92FF, + GL_IS_ROW_MAJOR = 0x9300, + GL_ATOMIC_COUNTER_BUFFER_INDEX = 0x9301, + GL_BUFFER_BINDING = 0x9302, + GL_BUFFER_DATA_SIZE = 0x9303, + GL_NUM_ACTIVE_VARIABLES = 0x9304, + GL_ACTIVE_VARIABLES = 0x9305, + GL_REFERENCED_BY_VERTEX_SHADER = 0x9306, + GL_REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307, + GL_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308, + GL_REFERENCED_BY_GEOMETRY_SHADER = 0x9309, + GL_REFERENCED_BY_FRAGMENT_SHADER = 0x930A, + GL_REFERENCED_BY_COMPUTE_SHADER = 0x930B, + GL_TOP_LEVEL_ARRAY_SIZE = 0x930C, + GL_TOP_LEVEL_ARRAY_STRIDE = 0x930D, + GL_LOCATION = 0x930E, + GL_LOCATION_INDEX = 0x930F, + GL_IS_PER_PATCH = 0x92E7, +#endif + // GL_ARB_shader_storage_buffer_object +#ifndef GL_SHADER_STORAGE_BUFFER + GL_SHADER_STORAGE_BUFFER = 0x90D2, + GL_SHADER_STORAGE_BUFFER_BINDING = 0x90D3, + GL_SHADER_STORAGE_BUFFER_START = 0x90D4, + GL_SHADER_STORAGE_BUFFER_SIZE = 0x90D5, + GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6, + GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7, + GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8, + GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9, + GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA, + GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB, + GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC, + GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD, + GL_MAX_SHADER_STORAGE_BLOCK_SIZE = 0x90DE, + GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF, + GL_SHADER_STORAGE_BARRIER_BIT = 0x2000, + GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES = GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS, +#endif + // GL_ARB_stencil_texturing +#ifndef GL_DEPTH_STENCIL_TEXTURE_MODE + GL_DEPTH_STENCIL_TEXTURE_MODE = 0x90EA, +#endif + // GL_ARB_texture_buffer_range +#ifndef GL_TEXTURE_BUFFER_OFFSET + GL_TEXTURE_BUFFER_OFFSET = 0x919D, + GL_TEXTURE_BUFFER_SIZE = 0x919E, + GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F, +#endif + // GL_ARB_texture_view +#ifndef GL_TEXTURE_VIEW_MIN_LEVEL + GL_TEXTURE_VIEW_MIN_LEVEL = 0x82DB, + GL_TEXTURE_VIEW_NUM_LEVELS = 0x82DC, + GL_TEXTURE_VIEW_MIN_LAYER = 0x82DD, + GL_TEXTURE_VIEW_NUM_LAYERS = 0x82DE, + GL_TEXTURE_IMMUTABLE_LEVELS = 0x82DF, +#endif + // GL_ARB_vertex_attrib_binding +#ifndef GL_VERTEX_ATTRIB_BINDING + GL_VERTEX_ATTRIB_BINDING = 0x82D4, + GL_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D5, + GL_VERTEX_BINDING_DIVISOR = 0x82D6, + GL_VERTEX_BINDING_OFFSET = 0x82D7, + GL_VERTEX_BINDING_STRIDE = 0x82D8, + GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9, + GL_MAX_VERTEX_ATTRIB_BINDINGS = 0x82DA, + +#endif + + // http://www.opengl.org/wiki/Ubiquitous_Extensions + // EXT_texture_filter_anisotropic +#ifndef GL_TEXTURE_MAX_ANISOTROPY_EXT + GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE, + GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF, +#endif + + + // NOTE - NOT PART OF THE OPENGL 4.3 STANDARD HEADER FILES +#ifndef GL_COMPRESSED_RGB_S3TC_DXT1_EXT + + GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0, + GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1, + GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2, + GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3, + +#endif + + // NOTE - NOT PART OF THE OPENGL 4.3 STANDARD HEADER FILES +#ifndef GL_SRGB_EXT + GL_SRGB_EXT = 0x8C40, + GL_SRGB8_EXT = 0x8C41, + GL_SRGB_ALPHA_EXT = 0x8C42, + GL_SRGB8_ALPHA8_EXT = 0x8C43, + GL_SLUMINANCE_ALPHA_EXT = 0x8C44, + GL_SLUMINANCE8_ALPHA8_EXT = 0x8C45, + GL_SLUMINANCE_EXT = 0x8C46, + GL_SLUMINANCE8_EXT = 0x8C47, + GL_COMPRESSED_SRGB_EXT = 0x8C48, + GL_COMPRESSED_SRGB_ALPHA_EXT = 0x8C49, + GL_COMPRESSED_SLUMINANCE_EXT = 0x8C4A, + GL_COMPRESSED_SLUMINANCE_ALPHA_EXT = 0x8C4B, + GL_COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C, + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D, + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E, + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F, +#endif + +// OpenGL 4.4 +#ifndef GL_MAX_VERTEX_ATTRIB_STRIDE + GL_MAX_VERTEX_ATTRIB_STRIDE = 0x82E5, + GL_MAP_PERSISTENT_BIT = 0x0040, + GL_MAP_COHERENT_BIT = 0x0080, + GL_DYNAMIC_STORAGE_BIT = 0x0100, + GL_CLIENT_STORAGE_BIT = 0x0200, + GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x00004000, + GL_BUFFER_IMMUTABLE_STORAGE = 0x821F, + GL_BUFFER_STORAGE_FLAGS = 0x8220, + GL_CLEAR_TEXTURE = 0x9365, + GL_LOCATION_COMPONENT = 0x934A, + GL_TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B, + GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C, + GL_QUERY_BUFFER = 0x9192, + GL_QUERY_BUFFER_BARRIER_BIT = 0x00008000, + GL_QUERY_BUFFER_BINDING = 0x9193, + GL_QUERY_RESULT_NO_WAIT = 0x9194, + GL_MIRROR_CLAMP_TO_EDGE = 0x8743, +#endif + +// OpenGL 4.5 +#ifndef GL_CONTEXT_LOST + GL_CONTEXT_LOST = 0x0507, + GL_NEGATIVE_ONE_TO_ONE = 0x935E, + GL_ZERO_TO_ONE = 0x935F, + GL_CLIP_ORIGIN = 0x935C, + GL_CLIP_DEPTH_MODE = 0x935D, + GL_QUERY_WAIT_INVERTED = 0x8E17, + GL_QUERY_NO_WAIT_INVERTED = 0x8E18, + GL_QUERY_BY_REGION_WAIT_INVERTED = 0x8E19, + GL_QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A, + GL_MAX_CULL_DISTANCES = 0x82F9, + GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA, + GL_TEXTURE_TARGET = 0x1006, + GL_QUERY_TARGET = 0x82EA, + GL_GUILTY_CONTEXT_RESET = 0x8253, + GL_INNOCENT_CONTEXT_RESET = 0x8254, + GL_UNKNOWN_CONTEXT_RESET = 0x8255, + GL_RESET_NOTIFICATION_STRATEGY = 0x8256, + GL_LOSE_CONTEXT_ON_RESET = 0x8252, + GL_NO_RESET_NOTIFICATION = 0x8261, + GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT = 0x00000004, + GL_CONTEXT_RELEASE_BEHAVIOR = 0x82FB, + GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC, +#endif + + // *********************************************************** + // *** Legacy defines for ClanLib OpenGL 1.3 (GL1) support *** +#ifndef GL_COMPARE_R_TO_TEXTURE + GL_COMPARE_R_TO_TEXTURE = 0x884e, +#endif +#ifndef GL_POINT_SPRITE + GL_POINT_SPRITE = 0x8861, +#endif +#ifndef GL_MAX_TEXTURE_COORDS + GL_MAX_TEXTURE_COORDS = 0x8871, +#endif +#ifndef GL_MAX_TEXTURE_UNITS + GL_MAX_TEXTURE_UNITS = 0x84E2, +#endif + + // *********************************************************** + +}; + +} + +/// \} + + diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_target.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_target.h new file mode 100644 index 0000000..8fd3244 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_target.h @@ -0,0 +1,96 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanGL_Display clanGL Display + /// \{ + + class GraphicContext; + class OpenGLTargetProvider; + class OpenGLTarget_Impl; + class OpenGLContextDescription; + + /// \brief Display target for clanDisplay. + class OpenGLTarget + { + public: + /// \brief Returns true if this display target is the current target + /// + /// This may change after a display window has been created + static bool is_current(); + + /// Target should be current (using set_current() ) before using this function + static OpenGLContextDescription get_description(); + + /// \brief Set this display target to be the current target + static void set_current(); + + /// Target should be current (using set_current() ) before using this function + static void set_description(OpenGLContextDescription &desc); + + /// \brief Get the opengl version + /// + /// \param version_major = On Return: Major + /// \param version_minor = On Return: Minor + static void get_opengl_version(const GraphicContext &gc, int &version_major, int &version_minor); + + /// \brief Get the opengl version + /// + /// \param version_major = On Return: Major + /// \param version_minor = On Return: Minor + /// \param version_release = On Return: Release + static void get_opengl_version(const GraphicContext &gc, int &version_major, int &version_minor, int &version_release); + + /// \brief Get the opengl shading language version + /// + /// \param version_major = On Return: Major + /// \param version_minor = On Return: Minor + static void get_opengl_shading_language_version(const GraphicContext &gc, int &version_major, int &version_minor); + + /// \brief Get the opengl renderer string + static std::string get_renderer_string(const GraphicContext &gc); + + /// \brief Get the opengl vendor string + static std::string get_vendor_string(const GraphicContext &gc); + + /// \brief Get the list of opengl extensions. + static std::vector get_extensions(const GraphicContext &gc); + + /// \brief Set OpenGL context used by this GraphicContext to be active + static void set_active_context(const GraphicContext &gc); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_wrap.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_wrap.h new file mode 100644 index 0000000..93ed61b --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/GL/opengl_wrap.h @@ -0,0 +1,2345 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + + +#pragma once + +#include "opengl.h" +#include "opengl_defines.h" + +namespace clan +{ + /// \addtogroup clanGL_System clanGL System + /// \{ + + #ifdef WIN32 + #define GLFUNC WINAPI + #else + #define GLFUNC + #endif + + /// \name OpenGL 2.0 binds + /// \{ + + /// \brief GLFunctions + class GLFunctions + { + public: + typedef void (GLFUNC *ptr_glCullFace)(GLenum mode); + typedef void (GLFUNC *ptr_glFrontFace)(GLenum mode); + typedef void (GLFUNC *ptr_glHint)(GLenum target, GLenum mode); + typedef void (GLFUNC *ptr_glLineWidth)(GLfloat width); + typedef void (GLFUNC *ptr_glPointSize)(GLfloat size); + typedef void (GLFUNC *ptr_glPolygonMode)(GLenum face, GLenum mode); + typedef void (GLFUNC *ptr_glScissor)(GLint x, GLint y, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glTexParameterf)(GLenum target, GLenum pname, GLfloat param); + typedef void (GLFUNC *ptr_glTexParameterfv)(GLenum target, GLenum pname, const GLfloat *params); + typedef void (GLFUNC *ptr_glTexParameteri)(GLenum target, GLenum pname, GLint param); + typedef void (GLFUNC *ptr_glTexParameteriv)(GLenum target, GLenum pname, const GLint *params); + typedef void (GLFUNC *ptr_glTexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + typedef void (GLFUNC *ptr_glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + typedef void (GLFUNC *ptr_glDrawBuffer)(GLenum mode); + typedef void (GLFUNC *ptr_glClear)(GLbitfield mask); + typedef void (GLFUNC *ptr_glClearColor)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); + typedef void (GLFUNC *ptr_glClearStencil)(GLint s); + typedef void (GLFUNC *ptr_glClearDepth)(GLdouble depth); + typedef void (GLFUNC *ptr_glStencilMask)(GLuint mask); + typedef void (GLFUNC *ptr_glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); + typedef void (GLFUNC *ptr_glDepthMask)(GLboolean flag); + typedef void (GLFUNC *ptr_glDisable)(GLenum cap); + typedef void (GLFUNC *ptr_glEnable)(GLenum cap); + typedef void (GLFUNC *ptr_glFinish)(void); + typedef void (GLFUNC *ptr_glFlush)(void); + typedef void (GLFUNC *ptr_glBlendFunc)(GLenum sfactor, GLenum dfactor); + typedef void (GLFUNC *ptr_glLogicOp)(GLenum opcode); + typedef void (GLFUNC *ptr_glStencilFunc)(GLenum func, GLint ref, GLuint mask); + typedef void (GLFUNC *ptr_glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass); + typedef void (GLFUNC *ptr_glDepthFunc)(GLenum func); + typedef void (GLFUNC *ptr_glPixelStoref)(GLenum pname, GLfloat param); + typedef void (GLFUNC *ptr_glPixelStorei)(GLenum pname, GLint param); + typedef void (GLFUNC *ptr_glReadBuffer)(GLenum mode); + typedef void (GLFUNC *ptr_glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); + typedef void (GLFUNC *ptr_glGetBooleanv)(GLenum pname, GLboolean *params); + typedef void (GLFUNC *ptr_glGetDoublev)(GLenum pname, GLdouble *params); + typedef GLenum (GLFUNC *ptr_glGetError)(void); + typedef void (GLFUNC *ptr_glGetFloatv)(GLenum pname, GLfloat *params); + typedef void (GLFUNC *ptr_glGetIntegerv)(GLenum pname, GLint *params); + typedef const GLubyte * (GLFUNC *ptr_glGetString)(GLenum name); + typedef void (GLFUNC *ptr_glGetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); + typedef void (GLFUNC *ptr_glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params); + typedef void (GLFUNC *ptr_glGetTexParameteriv)(GLenum target, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params); + typedef void (GLFUNC *ptr_glGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params); + typedef GLboolean (GLFUNC *ptr_glIsEnabled)(GLenum cap); + typedef void (GLFUNC *ptr_glDepthRange)(GLdouble near, GLdouble far); + typedef void (GLFUNC *ptr_glViewport)(GLint x, GLint y, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glDrawArrays)(GLenum mode, GLint first, GLsizei count); + typedef void (GLFUNC *ptr_glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); + typedef void (GLFUNC *ptr_glGetPointerv)(GLenum pname, GLvoid* *params); + typedef void (GLFUNC *ptr_glPolygonOffset)(GLfloat factor, GLfloat units); + typedef void (GLFUNC *ptr_glCopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); + typedef void (GLFUNC *ptr_glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); + typedef void (GLFUNC *ptr_glCopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); + typedef void (GLFUNC *ptr_glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); + typedef void (GLFUNC *ptr_glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); + typedef void (GLFUNC *ptr_glBindTexture)(GLenum target, GLuint texture); + typedef void (GLFUNC *ptr_glDeleteTextures)(GLsizei n, const GLuint *textures); + typedef void (GLFUNC *ptr_glGenTextures)(GLsizei n, GLuint *textures); + typedef GLboolean (GLFUNC *ptr_glIsTexture)(GLuint texture); + typedef void (GLFUNC *ptr_glBlendColor)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); + typedef void (GLFUNC *ptr_glBlendEquation)(GLenum mode); + typedef void (GLFUNC *ptr_glDrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); + typedef void (GLFUNC *ptr_glTexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + typedef void (GLFUNC *ptr_glTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + typedef void (GLFUNC *ptr_glCopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glActiveTexture)(GLenum texture); + typedef void (GLFUNC *ptr_glSampleCoverage)(GLfloat value, GLboolean invert); + typedef void (GLFUNC *ptr_glCompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); + typedef void (GLFUNC *ptr_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); + typedef void (GLFUNC *ptr_glCompressedTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); + typedef void (GLFUNC *ptr_glCompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); + typedef void (GLFUNC *ptr_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); + typedef void (GLFUNC *ptr_glCompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); + typedef void (GLFUNC *ptr_glGetCompressedTexImage)(GLenum target, GLint level, GLvoid *img); + typedef void (GLFUNC *ptr_glBlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + typedef void (GLFUNC *ptr_glMultiDrawArrays)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); + typedef void (GLFUNC *ptr_glMultiDrawElements)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount); + typedef void (GLFUNC *ptr_glPointParameterf)(GLenum pname, GLfloat param); + typedef void (GLFUNC *ptr_glPointParameterfv)(GLenum pname, const GLfloat *params); + typedef void (GLFUNC *ptr_glPointParameteri)(GLenum pname, GLint param); + typedef void (GLFUNC *ptr_glPointParameteriv)(GLenum pname, const GLint *params); + typedef void (GLFUNC *ptr_glGenQueries)(GLsizei n, GLuint *ids); + typedef void (GLFUNC *ptr_glDeleteQueries)(GLsizei n, const GLuint *ids); + typedef GLboolean (GLFUNC *ptr_glIsQuery)(GLuint id); + typedef void (GLFUNC *ptr_glBeginQuery)(GLenum target, GLuint id); + typedef void (GLFUNC *ptr_glEndQuery)(GLenum target); + typedef void (GLFUNC *ptr_glGetQueryiv)(GLenum target, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetQueryObjectiv)(GLuint id, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetQueryObjectuiv)(GLuint id, GLenum pname, GLuint *params); + typedef void (GLFUNC *ptr_glBindBuffer)(GLenum target, GLuint buffer); + typedef void (GLFUNC *ptr_glDeleteBuffers)(GLsizei n, const GLuint *buffers); + typedef void (GLFUNC *ptr_glGenBuffers)(GLsizei n, GLuint *buffers); + typedef GLboolean (GLFUNC *ptr_glIsBuffer)(GLuint buffer); + typedef void (GLFUNC *ptr_glBufferData)(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); + typedef void (GLFUNC *ptr_glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); + typedef void (GLFUNC *ptr_glGetBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); + typedef GLvoid* (GLFUNC *ptr_glMapBuffer)(GLenum target, GLenum access); + typedef GLboolean (GLFUNC *ptr_glUnmapBuffer)(GLenum target); + typedef void (GLFUNC *ptr_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetBufferPointerv)(GLenum target, GLenum pname, GLvoid* *params); + typedef void (GLFUNC *ptr_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha); + typedef void (GLFUNC *ptr_glDrawBuffers)(GLsizei n, const GLenum *bufs); + typedef void (GLFUNC *ptr_glStencilOpSeparate)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); + typedef void (GLFUNC *ptr_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); + typedef void (GLFUNC *ptr_glStencilMaskSeparate)(GLenum face, GLuint mask); + typedef void (GLFUNC *ptr_glAttachShader)(GLuint program, GLuint shader); + typedef void (GLFUNC *ptr_glBindAttribLocation)(GLuint program, GLuint index, const GLchar *name); + typedef void (GLFUNC *ptr_glCompileShader)(GLuint shader); + typedef GLuint (GLFUNC *ptr_glCreateProgram)(void); + typedef GLuint (GLFUNC *ptr_glCreateShader)(GLenum type); + typedef void (GLFUNC *ptr_glDeleteProgram)(GLuint program); + typedef void (GLFUNC *ptr_glDeleteShader)(GLuint shader); + typedef void (GLFUNC *ptr_glDetachShader)(GLuint program, GLuint shader); + typedef void (GLFUNC *ptr_glDisableVertexAttribArray)(GLuint index); + typedef void (GLFUNC *ptr_glEnableVertexAttribArray)(GLuint index); + typedef void (GLFUNC *ptr_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); + typedef void (GLFUNC *ptr_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); + typedef void (GLFUNC *ptr_glGetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); + typedef GLint (GLFUNC *ptr_glGetAttribLocation)(GLuint program, const GLchar *name); + typedef void (GLFUNC *ptr_glGetProgramiv)(GLuint program, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); + typedef void (GLFUNC *ptr_glGetShaderiv)(GLuint shader, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); + typedef void (GLFUNC *ptr_glGetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); + typedef GLint (GLFUNC *ptr_glGetUniformLocation)(GLuint program, const GLchar *name); + typedef void (GLFUNC *ptr_glGetUniformfv)(GLuint program, GLint location, GLfloat *params); + typedef void (GLFUNC *ptr_glGetUniformiv)(GLuint program, GLint location, GLint *params); + typedef void (GLFUNC *ptr_glGetVertexAttribdv)(GLuint index, GLenum pname, GLdouble *params); + typedef void (GLFUNC *ptr_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat *params); + typedef void (GLFUNC *ptr_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid* *pointer); + typedef GLboolean (GLFUNC *ptr_glIsProgram)(GLuint program); + typedef GLboolean (GLFUNC *ptr_glIsShader)(GLuint shader); + typedef void (GLFUNC *ptr_glLinkProgram)(GLuint program); + typedef void (GLFUNC *ptr_glShaderSource)(GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length); + typedef void (GLFUNC *ptr_glUseProgram)(GLuint program); + typedef void (GLFUNC *ptr_glUniform1f)(GLint location, GLfloat v0); + typedef void (GLFUNC *ptr_glUniform2f)(GLint location, GLfloat v0, GLfloat v1); + typedef void (GLFUNC *ptr_glUniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); + typedef void (GLFUNC *ptr_glUniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); + typedef void (GLFUNC *ptr_glUniform1i)(GLint location, GLint v0); + typedef void (GLFUNC *ptr_glUniform2i)(GLint location, GLint v0, GLint v1); + typedef void (GLFUNC *ptr_glUniform3i)(GLint location, GLint v0, GLint v1, GLint v2); + typedef void (GLFUNC *ptr_glUniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); + typedef void (GLFUNC *ptr_glUniform1fv)(GLint location, GLsizei count, const GLfloat *value); + typedef void (GLFUNC *ptr_glUniform2fv)(GLint location, GLsizei count, const GLfloat *value); + typedef void (GLFUNC *ptr_glUniform3fv)(GLint location, GLsizei count, const GLfloat *value); + typedef void (GLFUNC *ptr_glUniform4fv)(GLint location, GLsizei count, const GLfloat *value); + typedef void (GLFUNC *ptr_glUniform1iv)(GLint location, GLsizei count, const GLint *value); + typedef void (GLFUNC *ptr_glUniform2iv)(GLint location, GLsizei count, const GLint *value); + typedef void (GLFUNC *ptr_glUniform3iv)(GLint location, GLsizei count, const GLint *value); + typedef void (GLFUNC *ptr_glUniform4iv)(GLint location, GLsizei count, const GLint *value); + typedef void (GLFUNC *ptr_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glValidateProgram)(GLuint program); + typedef void (GLFUNC *ptr_glVertexAttrib1d)(GLuint index, GLdouble x); + typedef void (GLFUNC *ptr_glVertexAttrib1dv)(GLuint index, const GLdouble *v); + typedef void (GLFUNC *ptr_glVertexAttrib1f)(GLuint index, GLfloat x); + typedef void (GLFUNC *ptr_glVertexAttrib1fv)(GLuint index, const GLfloat *v); + typedef void (GLFUNC *ptr_glVertexAttrib1s)(GLuint index, GLshort x); + typedef void (GLFUNC *ptr_glVertexAttrib1sv)(GLuint index, const GLshort *v); + typedef void (GLFUNC *ptr_glVertexAttrib2d)(GLuint index, GLdouble x, GLdouble y); + typedef void (GLFUNC *ptr_glVertexAttrib2dv)(GLuint index, const GLdouble *v); + typedef void (GLFUNC *ptr_glVertexAttrib2f)(GLuint index, GLfloat x, GLfloat y); + typedef void (GLFUNC *ptr_glVertexAttrib2fv)(GLuint index, const GLfloat *v); + typedef void (GLFUNC *ptr_glVertexAttrib2s)(GLuint index, GLshort x, GLshort y); + typedef void (GLFUNC *ptr_glVertexAttrib2sv)(GLuint index, const GLshort *v); + typedef void (GLFUNC *ptr_glVertexAttrib3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z); + typedef void (GLFUNC *ptr_glVertexAttrib3dv)(GLuint index, const GLdouble *v); + typedef void (GLFUNC *ptr_glVertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z); + typedef void (GLFUNC *ptr_glVertexAttrib3fv)(GLuint index, const GLfloat *v); + typedef void (GLFUNC *ptr_glVertexAttrib3s)(GLuint index, GLshort x, GLshort y, GLshort z); + typedef void (GLFUNC *ptr_glVertexAttrib3sv)(GLuint index, const GLshort *v); + typedef void (GLFUNC *ptr_glVertexAttrib4Nbv)(GLuint index, const GLbyte *v); + typedef void (GLFUNC *ptr_glVertexAttrib4Niv)(GLuint index, const GLint *v); + typedef void (GLFUNC *ptr_glVertexAttrib4Nsv)(GLuint index, const GLshort *v); + typedef void (GLFUNC *ptr_glVertexAttrib4Nub)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); + typedef void (GLFUNC *ptr_glVertexAttrib4Nubv)(GLuint index, const GLubyte *v); + typedef void (GLFUNC *ptr_glVertexAttrib4Nuiv)(GLuint index, const GLuint *v); + typedef void (GLFUNC *ptr_glVertexAttrib4Nusv)(GLuint index, const GLushort *v); + typedef void (GLFUNC *ptr_glVertexAttrib4bv)(GLuint index, const GLbyte *v); + typedef void (GLFUNC *ptr_glVertexAttrib4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + typedef void (GLFUNC *ptr_glVertexAttrib4dv)(GLuint index, const GLdouble *v); + typedef void (GLFUNC *ptr_glVertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + typedef void (GLFUNC *ptr_glVertexAttrib4fv)(GLuint index, const GLfloat *v); + typedef void (GLFUNC *ptr_glVertexAttrib4iv)(GLuint index, const GLint *v); + typedef void (GLFUNC *ptr_glVertexAttrib4s)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); + typedef void (GLFUNC *ptr_glVertexAttrib4sv)(GLuint index, const GLshort *v); + typedef void (GLFUNC *ptr_glVertexAttrib4ubv)(GLuint index, const GLubyte *v); + typedef void (GLFUNC *ptr_glVertexAttrib4uiv)(GLuint index, const GLuint *v); + typedef void (GLFUNC *ptr_glVertexAttrib4usv)(GLuint index, const GLushort *v); + typedef void (GLFUNC *ptr_glVertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); + typedef void (GLFUNC *ptr_glUniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glUniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glUniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glUniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glUniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glUniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glColorMaski)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); + typedef void (GLFUNC *ptr_glGetBooleani_v)(GLenum target, GLuint index, GLboolean *data); + typedef void (GLFUNC *ptr_glGetIntegeri_v)(GLenum target, GLuint index, GLint *data); + typedef void (GLFUNC *ptr_glEnablei)(GLenum target, GLuint index); + typedef void (GLFUNC *ptr_glDisablei)(GLenum target, GLuint index); + typedef GLboolean (GLFUNC *ptr_glIsEnabledi)(GLenum target, GLuint index); + typedef void (GLFUNC *ptr_glBeginTransformFeedback)(GLenum primitiveMode); + typedef void (GLFUNC *ptr_glEndTransformFeedback)(void); + typedef void (GLFUNC *ptr_glBindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); + typedef void (GLFUNC *ptr_glBindBufferBase)(GLenum target, GLuint index, GLuint buffer); + typedef void (GLFUNC *ptr_glTransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar* const *varyings, GLenum bufferMode); + typedef void (GLFUNC *ptr_glGetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); + typedef void (GLFUNC *ptr_glClampColor)(GLenum target, GLenum clamp); + typedef void (GLFUNC *ptr_glBeginConditionalRender)(GLuint id, GLenum mode); + typedef void (GLFUNC *ptr_glEndConditionalRender)(void); + typedef void (GLFUNC *ptr_glVertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + typedef void (GLFUNC *ptr_glGetVertexAttribIiv)(GLuint index, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint *params); + typedef void (GLFUNC *ptr_glVertexAttribI1i)(GLuint index, GLint x); + typedef void (GLFUNC *ptr_glVertexAttribI2i)(GLuint index, GLint x, GLint y); + typedef void (GLFUNC *ptr_glVertexAttribI3i)(GLuint index, GLint x, GLint y, GLint z); + typedef void (GLFUNC *ptr_glVertexAttribI4i)(GLuint index, GLint x, GLint y, GLint z, GLint w); + typedef void (GLFUNC *ptr_glVertexAttribI1ui)(GLuint index, GLuint x); + typedef void (GLFUNC *ptr_glVertexAttribI2ui)(GLuint index, GLuint x, GLuint y); + typedef void (GLFUNC *ptr_glVertexAttribI3ui)(GLuint index, GLuint x, GLuint y, GLuint z); + typedef void (GLFUNC *ptr_glVertexAttribI4ui)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); + typedef void (GLFUNC *ptr_glVertexAttribI1iv)(GLuint index, const GLint *v); + typedef void (GLFUNC *ptr_glVertexAttribI2iv)(GLuint index, const GLint *v); + typedef void (GLFUNC *ptr_glVertexAttribI3iv)(GLuint index, const GLint *v); + typedef void (GLFUNC *ptr_glVertexAttribI4iv)(GLuint index, const GLint *v); + typedef void (GLFUNC *ptr_glVertexAttribI1uiv)(GLuint index, const GLuint *v); + typedef void (GLFUNC *ptr_glVertexAttribI2uiv)(GLuint index, const GLuint *v); + typedef void (GLFUNC *ptr_glVertexAttribI3uiv)(GLuint index, const GLuint *v); + typedef void (GLFUNC *ptr_glVertexAttribI4uiv)(GLuint index, const GLuint *v); + typedef void (GLFUNC *ptr_glVertexAttribI4bv)(GLuint index, const GLbyte *v); + typedef void (GLFUNC *ptr_glVertexAttribI4sv)(GLuint index, const GLshort *v); + typedef void (GLFUNC *ptr_glVertexAttribI4ubv)(GLuint index, const GLubyte *v); + typedef void (GLFUNC *ptr_glVertexAttribI4usv)(GLuint index, const GLushort *v); + typedef void (GLFUNC *ptr_glGetUniformuiv)(GLuint program, GLint location, GLuint *params); + typedef void (GLFUNC *ptr_glBindFragDataLocation)(GLuint program, GLuint color, const GLchar *name); + typedef GLint (GLFUNC *ptr_glGetFragDataLocation)(GLuint program, const GLchar *name); + typedef void (GLFUNC *ptr_glUniform1ui)(GLint location, GLuint v0); + typedef void (GLFUNC *ptr_glUniform2ui)(GLint location, GLuint v0, GLuint v1); + typedef void (GLFUNC *ptr_glUniform3ui)(GLint location, GLuint v0, GLuint v1, GLuint v2); + typedef void (GLFUNC *ptr_glUniform4ui)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); + typedef void (GLFUNC *ptr_glUniform1uiv)(GLint location, GLsizei count, const GLuint *value); + typedef void (GLFUNC *ptr_glUniform2uiv)(GLint location, GLsizei count, const GLuint *value); + typedef void (GLFUNC *ptr_glUniform3uiv)(GLint location, GLsizei count, const GLuint *value); + typedef void (GLFUNC *ptr_glUniform4uiv)(GLint location, GLsizei count, const GLuint *value); + typedef void (GLFUNC *ptr_glTexParameterIiv)(GLenum target, GLenum pname, const GLint *params); + typedef void (GLFUNC *ptr_glTexParameterIuiv)(GLenum target, GLenum pname, const GLuint *params); + typedef void (GLFUNC *ptr_glGetTexParameterIiv)(GLenum target, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetTexParameterIuiv)(GLenum target, GLenum pname, GLuint *params); + typedef void (GLFUNC *ptr_glClearBufferiv)(GLenum buffer, GLint drawbuffer, const GLint *value); + typedef void (GLFUNC *ptr_glClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint *value); + typedef void (GLFUNC *ptr_glClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat *value); + typedef void (GLFUNC *ptr_glClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); + typedef const GLubyte * (GLFUNC *ptr_glGetStringi)(GLenum name, GLuint index); + typedef void (GLFUNC *ptr_glDrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount); + typedef void (GLFUNC *ptr_glDrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount); + typedef void (GLFUNC *ptr_glTexBuffer)(GLenum target, GLenum internalformat, GLuint buffer); + typedef void (GLFUNC *ptr_glPrimitiveRestartIndex)(GLuint index); + typedef void (GLFUNC *ptr_glGetInteger64i_v)(GLenum target, GLuint index, CLint64 *data); + typedef void (GLFUNC *ptr_glGetBufferParameteri64v)(GLenum target, GLenum pname, CLint64 *params); + typedef void (GLFUNC *ptr_glFramebufferTexture)(GLenum target, GLenum attachment, GLuint texture, GLint level); + typedef void (GLFUNC *ptr_glVertexAttribDivisor)(GLuint index, GLuint divisor); + typedef void (GLFUNC *ptr_glMinSampleShading)(GLfloat value); + typedef void (GLFUNC *ptr_glBlendEquationi)(GLuint buf, GLenum mode); + typedef void (GLFUNC *ptr_glBlendEquationSeparatei)(GLuint buf, GLenum modeRGB, GLenum modeAlpha); + typedef void (GLFUNC *ptr_glBlendFunci)(GLuint buf, GLenum src, GLenum dst); + typedef void (GLFUNC *ptr_glBlendFuncSeparatei)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); + typedef GLboolean (GLFUNC *ptr_glIsRenderbuffer)(GLuint renderbuffer); + typedef void (GLFUNC *ptr_glBindRenderbuffer)(GLenum target, GLuint renderbuffer); + typedef void (GLFUNC *ptr_glDeleteRenderbuffers)(GLsizei n, const GLuint *renderbuffers); + typedef void (GLFUNC *ptr_glGenRenderbuffers)(GLsizei n, GLuint *renderbuffers); + typedef void (GLFUNC *ptr_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint *params); + typedef GLboolean (GLFUNC *ptr_glIsFramebuffer)(GLuint framebuffer); + typedef void (GLFUNC *ptr_glBindFramebuffer)(GLenum target, GLuint framebuffer); + typedef void (GLFUNC *ptr_glDeleteFramebuffers)(GLsizei n, const GLuint *framebuffers); + typedef void (GLFUNC *ptr_glGenFramebuffers)(GLsizei n, GLuint *framebuffers); + typedef GLenum (GLFUNC *ptr_glCheckFramebufferStatus)(GLenum target); + typedef void (GLFUNC *ptr_glFramebufferTexture1D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); + typedef void (GLFUNC *ptr_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); + typedef void (GLFUNC *ptr_glFramebufferTexture3D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); + typedef void (GLFUNC *ptr_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); + typedef void (GLFUNC *ptr_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGenerateMipmap)(GLenum target); + typedef void (GLFUNC *ptr_glBlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + typedef void (GLFUNC *ptr_glRenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glFramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); + typedef GLvoid* (GLFUNC *ptr_glMapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + typedef void (GLFUNC *ptr_glFlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length); + typedef void (GLFUNC *ptr_glBindVertexArray)(GLuint array); + typedef void (GLFUNC *ptr_glDeleteVertexArrays)(GLsizei n, const GLuint *arrays); + typedef void (GLFUNC *ptr_glGenVertexArrays)(GLsizei n, GLuint *arrays); + typedef GLboolean (GLFUNC *ptr_glIsVertexArray)(GLuint array); + typedef void (GLFUNC *ptr_glGetUniformIndices)(GLuint program, GLsizei uniformCount, const GLchar* const *uniformNames, GLuint *uniformIndices); + typedef void (GLFUNC *ptr_glGetActiveUniformsiv)(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetActiveUniformName)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); + typedef GLuint (GLFUNC *ptr_glGetUniformBlockIndex)(GLuint program, const GLchar *uniformBlockName); + typedef void (GLFUNC *ptr_glGetActiveUniformBlockiv)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetActiveUniformBlockName)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); + typedef void (GLFUNC *ptr_glUniformBlockBinding)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); + typedef void (GLFUNC *ptr_glCopyBufferSubData)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); + typedef void (GLFUNC *ptr_glDrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); + typedef void (GLFUNC *ptr_glDrawRangeElementsBaseVertex)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); + typedef void (GLFUNC *ptr_glDrawElementsInstancedBaseVertex)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex); + typedef void (GLFUNC *ptr_glMultiDrawElementsBaseVertex)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex); + typedef void (GLFUNC *ptr_glProvokingVertex)(GLenum mode); + typedef CLsync (GLFUNC *ptr_glFenceSync)(GLenum condition, GLbitfield flags); + typedef GLboolean (GLFUNC *ptr_glIsSync)(CLsync sync); + typedef void (GLFUNC *ptr_glDeleteSync)(CLsync sync); + typedef GLenum (GLFUNC *ptr_glClientWaitSync)(CLsync sync, GLbitfield flags, CLuint64 timeout); + typedef void (GLFUNC *ptr_glWaitSync)(CLsync sync, GLbitfield flags, CLuint64 timeout); + typedef void (GLFUNC *ptr_glGetInteger64v)(GLenum pname, CLint64 *params); + typedef void (GLFUNC *ptr_glGetSynciv)(CLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); + typedef void (GLFUNC *ptr_glTexImage2DMultisample)(GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); + typedef void (GLFUNC *ptr_glTexImage3DMultisample)(GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + typedef void (GLFUNC *ptr_glGetMultisamplefv)(GLenum pname, GLuint index, GLfloat *val); + typedef void (GLFUNC *ptr_glSampleMaski)(GLuint index, GLbitfield mask); + typedef void (GLFUNC *ptr_glBlendEquationiARB)(GLuint buf, GLenum mode); + typedef void (GLFUNC *ptr_glBlendEquationSeparateiARB)(GLuint buf, GLenum modeRGB, GLenum modeAlpha); + typedef void (GLFUNC *ptr_glBlendFunciARB)(GLuint buf, GLenum src, GLenum dst); + typedef void (GLFUNC *ptr_glBlendFuncSeparateiARB)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); + typedef void (GLFUNC *ptr_glMinSampleShadingARB)(GLfloat value); + typedef void (GLFUNC *ptr_glNamedStringARB)(GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); + typedef void (GLFUNC *ptr_glDeleteNamedStringARB)(GLint namelen, const GLchar *name); + typedef void (GLFUNC *ptr_glCompileShaderIncludeARB)(GLuint shader, GLsizei count, const GLchar* *path, const GLint *length); + typedef GLboolean (GLFUNC *ptr_glIsNamedStringARB)(GLint namelen, const GLchar *name); + typedef void (GLFUNC *ptr_glGetNamedStringARB)(GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); + typedef void (GLFUNC *ptr_glGetNamedStringivARB)(GLint namelen, const GLchar *name, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glBindFragDataLocationIndexed)(GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); + typedef GLint (GLFUNC *ptr_glGetFragDataIndex)(GLuint program, const GLchar *name); + typedef void (GLFUNC *ptr_glGenSamplers)(GLsizei count, GLuint *samplers); + typedef void (GLFUNC *ptr_glDeleteSamplers)(GLsizei count, const GLuint *samplers); + typedef GLboolean (GLFUNC *ptr_glIsSampler)(GLuint sampler); + typedef void (GLFUNC *ptr_glBindSampler)(GLuint unit, GLuint sampler); + typedef void (GLFUNC *ptr_glSamplerParameteri)(GLuint sampler, GLenum pname, GLint param); + typedef void (GLFUNC *ptr_glSamplerParameteriv)(GLuint sampler, GLenum pname, const GLint *param); + typedef void (GLFUNC *ptr_glSamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param); + typedef void (GLFUNC *ptr_glSamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat *param); + typedef void (GLFUNC *ptr_glSamplerParameterIiv)(GLuint sampler, GLenum pname, const GLint *param); + typedef void (GLFUNC *ptr_glSamplerParameterIuiv)(GLuint sampler, GLenum pname, const GLuint *param); + typedef void (GLFUNC *ptr_glGetSamplerParameteriv)(GLuint sampler, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetSamplerParameterIiv)(GLuint sampler, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetSamplerParameterfv)(GLuint sampler, GLenum pname, GLfloat *params); + typedef void (GLFUNC *ptr_glGetSamplerParameterIuiv)(GLuint sampler, GLenum pname, GLuint *params); + typedef void (GLFUNC *ptr_glQueryCounter)(GLuint id, GLenum target); + typedef void (GLFUNC *ptr_glGetQueryObjecti64v)(GLuint id, GLenum pname, CLint64 *params); + typedef void (GLFUNC *ptr_glGetQueryObjectui64v)(GLuint id, GLenum pname, CLuint64 *params); + typedef void (GLFUNC *ptr_glVertexP2ui)(GLenum type, GLuint value); + typedef void (GLFUNC *ptr_glVertexP2uiv)(GLenum type, const GLuint *value); + typedef void (GLFUNC *ptr_glVertexP3ui)(GLenum type, GLuint value); + typedef void (GLFUNC *ptr_glVertexP3uiv)(GLenum type, const GLuint *value); + typedef void (GLFUNC *ptr_glVertexP4ui)(GLenum type, GLuint value); + typedef void (GLFUNC *ptr_glVertexP4uiv)(GLenum type, const GLuint *value); + typedef void (GLFUNC *ptr_glTexCoordP1ui)(GLenum type, GLuint coords); + typedef void (GLFUNC *ptr_glTexCoordP1uiv)(GLenum type, const GLuint *coords); + typedef void (GLFUNC *ptr_glTexCoordP2ui)(GLenum type, GLuint coords); + typedef void (GLFUNC *ptr_glTexCoordP2uiv)(GLenum type, const GLuint *coords); + typedef void (GLFUNC *ptr_glTexCoordP3ui)(GLenum type, GLuint coords); + typedef void (GLFUNC *ptr_glTexCoordP3uiv)(GLenum type, const GLuint *coords); + typedef void (GLFUNC *ptr_glTexCoordP4ui)(GLenum type, GLuint coords); + typedef void (GLFUNC *ptr_glTexCoordP4uiv)(GLenum type, const GLuint *coords); + typedef void (GLFUNC *ptr_glMultiTexCoordP1ui)(GLenum texture, GLenum type, GLuint coords); + typedef void (GLFUNC *ptr_glMultiTexCoordP1uiv)(GLenum texture, GLenum type, const GLuint *coords); + typedef void (GLFUNC *ptr_glMultiTexCoordP2ui)(GLenum texture, GLenum type, GLuint coords); + typedef void (GLFUNC *ptr_glMultiTexCoordP2uiv)(GLenum texture, GLenum type, const GLuint *coords); + typedef void (GLFUNC *ptr_glMultiTexCoordP3ui)(GLenum texture, GLenum type, GLuint coords); + typedef void (GLFUNC *ptr_glMultiTexCoordP3uiv)(GLenum texture, GLenum type, const GLuint *coords); + typedef void (GLFUNC *ptr_glMultiTexCoordP4ui)(GLenum texture, GLenum type, GLuint coords); + typedef void (GLFUNC *ptr_glMultiTexCoordP4uiv)(GLenum texture, GLenum type, const GLuint *coords); + typedef void (GLFUNC *ptr_glNormalP3ui)(GLenum type, GLuint coords); + typedef void (GLFUNC *ptr_glNormalP3uiv)(GLenum type, const GLuint *coords); + typedef void (GLFUNC *ptr_glColorP3ui)(GLenum type, GLuint color); + typedef void (GLFUNC *ptr_glColorP3uiv)(GLenum type, const GLuint *color); + typedef void (GLFUNC *ptr_glColorP4ui)(GLenum type, GLuint color); + typedef void (GLFUNC *ptr_glColorP4uiv)(GLenum type, const GLuint *color); + typedef void (GLFUNC *ptr_glSecondaryColorP3ui)(GLenum type, GLuint color); + typedef void (GLFUNC *ptr_glSecondaryColorP3uiv)(GLenum type, const GLuint *color); + typedef void (GLFUNC *ptr_glVertexAttribP1ui)(GLuint index, GLenum type, GLboolean normalized, GLuint value); + typedef void (GLFUNC *ptr_glVertexAttribP1uiv)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value); + typedef void (GLFUNC *ptr_glVertexAttribP2ui)(GLuint index, GLenum type, GLboolean normalized, GLuint value); + typedef void (GLFUNC *ptr_glVertexAttribP2uiv)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value); + typedef void (GLFUNC *ptr_glVertexAttribP3ui)(GLuint index, GLenum type, GLboolean normalized, GLuint value); + typedef void (GLFUNC *ptr_glVertexAttribP3uiv)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value); + typedef void (GLFUNC *ptr_glVertexAttribP4ui)(GLuint index, GLenum type, GLboolean normalized, GLuint value); + typedef void (GLFUNC *ptr_glVertexAttribP4uiv)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value); + typedef void (GLFUNC *ptr_glDrawArraysIndirect)(GLenum mode, const GLvoid *indirect); + typedef void (GLFUNC *ptr_glDrawElementsIndirect)(GLenum mode, GLenum type, const GLvoid *indirect); + typedef void (GLFUNC *ptr_glUniform1d)(GLint location, GLdouble x); + typedef void (GLFUNC *ptr_glUniform2d)(GLint location, GLdouble x, GLdouble y); + typedef void (GLFUNC *ptr_glUniform3d)(GLint location, GLdouble x, GLdouble y, GLdouble z); + typedef void (GLFUNC *ptr_glUniform4d)(GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + typedef void (GLFUNC *ptr_glUniform1dv)(GLint location, GLsizei count, const GLdouble *value); + typedef void (GLFUNC *ptr_glUniform2dv)(GLint location, GLsizei count, const GLdouble *value); + typedef void (GLFUNC *ptr_glUniform3dv)(GLint location, GLsizei count, const GLdouble *value); + typedef void (GLFUNC *ptr_glUniform4dv)(GLint location, GLsizei count, const GLdouble *value); + typedef void (GLFUNC *ptr_glUniformMatrix2dv)(GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glUniformMatrix3dv)(GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glUniformMatrix4dv)(GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glUniformMatrix2x3dv)(GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glUniformMatrix2x4dv)(GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glUniformMatrix3x2dv)(GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glUniformMatrix3x4dv)(GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glUniformMatrix4x2dv)(GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glUniformMatrix4x3dv)(GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glGetUniformdv)(GLuint program, GLint location, GLdouble *params); + typedef GLint (GLFUNC *ptr_glGetSubroutineUniformLocation)(GLuint program, GLenum shadertype, const GLchar *name); + typedef GLuint (GLFUNC *ptr_glGetSubroutineIndex)(GLuint program, GLenum shadertype, const GLchar *name); + typedef void (GLFUNC *ptr_glGetActiveSubroutineUniformiv)(GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); + typedef void (GLFUNC *ptr_glGetActiveSubroutineUniformName)(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); + typedef void (GLFUNC *ptr_glGetActiveSubroutineName)(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); + typedef void (GLFUNC *ptr_glUniformSubroutinesuiv)(GLenum shadertype, GLsizei count, const GLuint *indices); + typedef void (GLFUNC *ptr_glGetUniformSubroutineuiv)(GLenum shadertype, GLint location, GLuint *params); + typedef void (GLFUNC *ptr_glGetProgramStageiv)(GLuint program, GLenum shadertype, GLenum pname, GLint *values); + typedef void (GLFUNC *ptr_glPatchParameteri)(GLenum pname, GLint value); + typedef void (GLFUNC *ptr_glPatchParameterfv)(GLenum pname, const GLfloat *values); + typedef void (GLFUNC *ptr_glBindTransformFeedback)(GLenum target, GLuint id); + typedef void (GLFUNC *ptr_glDeleteTransformFeedbacks)(GLsizei n, const GLuint *ids); + typedef void (GLFUNC *ptr_glGenTransformFeedbacks)(GLsizei n, GLuint *ids); + typedef GLboolean (GLFUNC *ptr_glIsTransformFeedback)(GLuint id); + typedef void (GLFUNC *ptr_glPauseTransformFeedback)(void); + typedef void (GLFUNC *ptr_glResumeTransformFeedback)(void); + typedef void (GLFUNC *ptr_glDrawTransformFeedback)(GLenum mode, GLuint id); + typedef void (GLFUNC *ptr_glDrawTransformFeedbackStream)(GLenum mode, GLuint id, GLuint stream); + typedef void (GLFUNC *ptr_glBeginQueryIndexed)(GLenum target, GLuint index, GLuint id); + typedef void (GLFUNC *ptr_glEndQueryIndexed)(GLenum target, GLuint index); + typedef void (GLFUNC *ptr_glGetQueryIndexediv)(GLenum target, GLuint index, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glReleaseShaderCompiler)(void); + typedef void (GLFUNC *ptr_glShaderBinary)(GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length); + typedef void (GLFUNC *ptr_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); + typedef void (GLFUNC *ptr_glDepthRangef)(GLfloat n, GLfloat f); + typedef void (GLFUNC *ptr_glClearDepthf)(GLfloat d); + typedef void (GLFUNC *ptr_glGetProgramBinary)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); + typedef void (GLFUNC *ptr_glProgramBinary)(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); + typedef void (GLFUNC *ptr_glProgramParameteri)(GLuint program, GLenum pname, GLint value); + typedef void (GLFUNC *ptr_glUseProgramStages)(GLuint pipeline, GLbitfield stages, GLuint program); + typedef void (GLFUNC *ptr_glActiveShaderProgram)(GLuint pipeline, GLuint program); + typedef GLuint (GLFUNC *ptr_glCreateShaderProgramv)(GLenum type, GLsizei count, const GLchar* const *strings); + typedef void (GLFUNC *ptr_glBindProgramPipeline)(GLuint pipeline); + typedef void (GLFUNC *ptr_glDeleteProgramPipelines)(GLsizei n, const GLuint *pipelines); + typedef void (GLFUNC *ptr_glGenProgramPipelines)(GLsizei n, GLuint *pipelines); + typedef GLboolean (GLFUNC *ptr_glIsProgramPipeline)(GLuint pipeline); + typedef void (GLFUNC *ptr_glGetProgramPipelineiv)(GLuint pipeline, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glProgramUniform1i)(GLuint program, GLint location, GLint v0); + typedef void (GLFUNC *ptr_glProgramUniform1iv)(GLuint program, GLint location, GLsizei count, const GLint *value); + typedef void (GLFUNC *ptr_glProgramUniform1f)(GLuint program, GLint location, GLfloat v0); + typedef void (GLFUNC *ptr_glProgramUniform1fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value); + typedef void (GLFUNC *ptr_glProgramUniform1d)(GLuint program, GLint location, GLdouble v0); + typedef void (GLFUNC *ptr_glProgramUniform1dv)(GLuint program, GLint location, GLsizei count, const GLdouble *value); + typedef void (GLFUNC *ptr_glProgramUniform1ui)(GLuint program, GLint location, GLuint v0); + typedef void (GLFUNC *ptr_glProgramUniform1uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value); + typedef void (GLFUNC *ptr_glProgramUniform2i)(GLuint program, GLint location, GLint v0, GLint v1); + typedef void (GLFUNC *ptr_glProgramUniform2iv)(GLuint program, GLint location, GLsizei count, const GLint *value); + typedef void (GLFUNC *ptr_glProgramUniform2f)(GLuint program, GLint location, GLfloat v0, GLfloat v1); + typedef void (GLFUNC *ptr_glProgramUniform2fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value); + typedef void (GLFUNC *ptr_glProgramUniform2d)(GLuint program, GLint location, GLdouble v0, GLdouble v1); + typedef void (GLFUNC *ptr_glProgramUniform2dv)(GLuint program, GLint location, GLsizei count, const GLdouble *value); + typedef void (GLFUNC *ptr_glProgramUniform2ui)(GLuint program, GLint location, GLuint v0, GLuint v1); + typedef void (GLFUNC *ptr_glProgramUniform2uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value); + typedef void (GLFUNC *ptr_glProgramUniform3i)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2); + typedef void (GLFUNC *ptr_glProgramUniform3iv)(GLuint program, GLint location, GLsizei count, const GLint *value); + typedef void (GLFUNC *ptr_glProgramUniform3f)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); + typedef void (GLFUNC *ptr_glProgramUniform3fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value); + typedef void (GLFUNC *ptr_glProgramUniform3d)(GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); + typedef void (GLFUNC *ptr_glProgramUniform3dv)(GLuint program, GLint location, GLsizei count, const GLdouble *value); + typedef void (GLFUNC *ptr_glProgramUniform3ui)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); + typedef void (GLFUNC *ptr_glProgramUniform3uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value); + typedef void (GLFUNC *ptr_glProgramUniform4i)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); + typedef void (GLFUNC *ptr_glProgramUniform4iv)(GLuint program, GLint location, GLsizei count, const GLint *value); + typedef void (GLFUNC *ptr_glProgramUniform4f)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); + typedef void (GLFUNC *ptr_glProgramUniform4fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value); + typedef void (GLFUNC *ptr_glProgramUniform4d)(GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); + typedef void (GLFUNC *ptr_glProgramUniform4dv)(GLuint program, GLint location, GLsizei count, const GLdouble *value); + typedef void (GLFUNC *ptr_glProgramUniform4ui)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); + typedef void (GLFUNC *ptr_glProgramUniform4uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix2dv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix3dv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix4dv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix2x3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix3x2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix2x4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix4x2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix3x4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix4x3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix2x3dv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix3x2dv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix2x4dv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix4x2dv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix3x4dv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glProgramUniformMatrix4x3dv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); + typedef void (GLFUNC *ptr_glValidateProgramPipeline)(GLuint pipeline); + typedef void (GLFUNC *ptr_glGetProgramPipelineInfoLog)(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); + typedef void (GLFUNC *ptr_glVertexAttribL1d)(GLuint index, GLdouble x); + typedef void (GLFUNC *ptr_glVertexAttribL2d)(GLuint index, GLdouble x, GLdouble y); + typedef void (GLFUNC *ptr_glVertexAttribL3d)(GLuint index, GLdouble x, GLdouble y, GLdouble z); + typedef void (GLFUNC *ptr_glVertexAttribL4d)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + typedef void (GLFUNC *ptr_glVertexAttribL1dv)(GLuint index, const GLdouble *v); + typedef void (GLFUNC *ptr_glVertexAttribL2dv)(GLuint index, const GLdouble *v); + typedef void (GLFUNC *ptr_glVertexAttribL3dv)(GLuint index, const GLdouble *v); + typedef void (GLFUNC *ptr_glVertexAttribL4dv)(GLuint index, const GLdouble *v); + typedef void (GLFUNC *ptr_glVertexAttribLPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + typedef void (GLFUNC *ptr_glGetVertexAttribLdv)(GLuint index, GLenum pname, GLdouble *params); + typedef void (GLFUNC *ptr_glViewportArrayv)(GLuint first, GLsizei count, const GLfloat *v); + typedef void (GLFUNC *ptr_glViewportIndexedf)(GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); + typedef void (GLFUNC *ptr_glViewportIndexedfv)(GLuint index, const GLfloat *v); + typedef void (GLFUNC *ptr_glScissorArrayv)(GLuint first, GLsizei count, const GLint *v); + typedef void (GLFUNC *ptr_glScissorIndexed)(GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glScissorIndexedv)(GLuint index, const GLint *v); + typedef void (GLFUNC *ptr_glDepthRangeArrayv)(GLuint first, GLsizei count, const GLdouble *v); + typedef void (GLFUNC *ptr_glDepthRangeIndexed)(GLuint index, GLdouble n, GLdouble f); + typedef void (GLFUNC *ptr_glGetFloati_v)(GLenum target, GLuint index, GLfloat *data); + typedef void (GLFUNC *ptr_glGetDoublei_v)(GLenum target, GLuint index, GLdouble *data); + typedef CLsync (GLFUNC *ptr_glCreateSyncFromCLeventARB)(struct _cl_context * context, struct _cl_event * event, GLbitfield flags); + typedef void (GLFUNC *ptr_glDebugMessageControlARB)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); + typedef void (GLFUNC *ptr_glDebugMessageInsertARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); + typedef void (GLFUNC *ptr_glDebugMessageCallbackARB)(CLDEBUGPROCARB callback, const GLvoid *userParam); + typedef GLuint (GLFUNC *ptr_glGetDebugMessageLogARB)(GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); + typedef GLenum (GLFUNC *ptr_glGetGraphicsResetStatusARB)(void); + typedef void (GLFUNC *ptr_glGetnMapdvARB)(GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); + typedef void (GLFUNC *ptr_glGetnMapfvARB)(GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); + typedef void (GLFUNC *ptr_glGetnMapivARB)(GLenum target, GLenum query, GLsizei bufSize, GLint *v); + typedef void (GLFUNC *ptr_glGetnPixelMapfvARB)(GLenum map, GLsizei bufSize, GLfloat *values); + typedef void (GLFUNC *ptr_glGetnPixelMapuivARB)(GLenum map, GLsizei bufSize, GLuint *values); + typedef void (GLFUNC *ptr_glGetnPixelMapusvARB)(GLenum map, GLsizei bufSize, GLushort *values); + typedef void (GLFUNC *ptr_glGetnPolygonStippleARB)(GLsizei bufSize, GLubyte *pattern); + typedef void (GLFUNC *ptr_glGetnColorTableARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table); + typedef void (GLFUNC *ptr_glGetnConvolutionFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image); + typedef void (GLFUNC *ptr_glGetnSeparableFilterARB)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span); + typedef void (GLFUNC *ptr_glGetnHistogramARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); + typedef void (GLFUNC *ptr_glGetnMinmaxARB)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); + typedef void (GLFUNC *ptr_glGetnTexImageARB)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img); + typedef void (GLFUNC *ptr_glReadnPixelsARB)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); + typedef void (GLFUNC *ptr_glGetnCompressedTexImageARB)(GLenum target, GLint lod, GLsizei bufSize, GLvoid *img); + typedef void (GLFUNC *ptr_glGetnUniformfvARB)(GLuint program, GLint location, GLsizei bufSize, GLfloat *params); + typedef void (GLFUNC *ptr_glGetnUniformivARB)(GLuint program, GLint location, GLsizei bufSize, GLint *params); + typedef void (GLFUNC *ptr_glGetnUniformuivARB)(GLuint program, GLint location, GLsizei bufSize, GLuint *params); + typedef void (GLFUNC *ptr_glGetnUniformdvARB)(GLuint program, GLint location, GLsizei bufSize, GLdouble *params); + typedef void (GLFUNC *ptr_glDrawArraysInstancedBaseInstance)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); + typedef void (GLFUNC *ptr_glDrawElementsInstancedBaseInstance)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); + typedef void (GLFUNC *ptr_glDrawElementsInstancedBaseVertexBaseInstance)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); + typedef void (GLFUNC *ptr_glDrawTransformFeedbackInstanced)(GLenum mode, GLuint id, GLsizei instancecount); + typedef void (GLFUNC *ptr_glDrawTransformFeedbackStreamInstanced)(GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); + typedef void (GLFUNC *ptr_glGetInternalformativ)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); + typedef void (GLFUNC *ptr_glGetActiveAtomicCounterBufferiv)(GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glBindImageTexture)(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); + typedef void (GLFUNC *ptr_glMemoryBarrier)(GLbitfield barriers); + typedef void (GLFUNC *ptr_glTexStorage1D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); + typedef void (GLFUNC *ptr_glTexStorage2D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glTexStorage3D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + typedef void (GLFUNC *ptr_glTextureStorage1DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); + typedef void (GLFUNC *ptr_glTextureStorage2DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glTextureStorage3DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + typedef void (GLFUNC *ptr_glDebugMessageControl)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); + typedef void (GLFUNC *ptr_glDebugMessageInsert)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); + typedef void (GLFUNC *ptr_glDebugMessageCallback)(CLDEBUGPROC callback, const void *userParam); + typedef GLuint (GLFUNC *ptr_glGetDebugMessageLog)(GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); + typedef void (GLFUNC *ptr_glPushDebugGroup)(GLenum source, GLuint id, GLsizei length, const GLchar *message); + typedef void (GLFUNC *ptr_glPopDebugGroup)(void); + typedef void (GLFUNC *ptr_glObjectLabel)(GLenum identifier, GLuint name, GLsizei length, const GLchar *label); + typedef void (GLFUNC *ptr_glGetObjectLabel)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); + typedef void (GLFUNC *ptr_glObjectPtrLabel)(const void *ptr, GLsizei length, const GLchar *label); + typedef void (GLFUNC *ptr_glGetObjectPtrLabel)(const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); + typedef void (GLFUNC *ptr_glClearBufferData)(GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); + typedef void (GLFUNC *ptr_glClearBufferSubData)(GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); + typedef void (GLFUNC *ptr_glClearNamedBufferDataEXT)(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); + typedef void (GLFUNC *ptr_glClearNamedBufferSubDataEXT)(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data); + typedef void (GLFUNC *ptr_glDispatchCompute)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); + typedef void (GLFUNC *ptr_glDispatchComputeIndirect)(GLintptr indirect); + typedef void (GLFUNC *ptr_glCopyImageSubData)(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); + typedef void (GLFUNC *ptr_glFramebufferParameteri)(GLenum target, GLenum pname, GLint param); + typedef void (GLFUNC *ptr_glGetFramebufferParameteriv)(GLenum target, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glNamedFramebufferParameteriEXT)(GLuint framebuffer, GLenum pname, GLint param); + typedef void (GLFUNC *ptr_glGetNamedFramebufferParameterivEXT)(GLuint framebuffer, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetInternalformati64v)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, CLint64 *params); + typedef void (GLFUNC *ptr_glInvalidateTexSubImage)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); + typedef void (GLFUNC *ptr_glInvalidateTexImage)(GLuint texture, GLint level); + typedef void (GLFUNC *ptr_glInvalidateBufferSubData)(GLuint buffer, GLintptr offset, GLsizeiptr length); + typedef void (GLFUNC *ptr_glInvalidateBufferData)(GLuint buffer); + typedef void (GLFUNC *ptr_glInvalidateFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum *attachments); + typedef void (GLFUNC *ptr_glInvalidateSubFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glMultiDrawArraysIndirect)(GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); + typedef void (GLFUNC *ptr_glMultiDrawElementsIndirect)(GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); + typedef void (GLFUNC *ptr_glGetProgramInterfaceiv)(GLuint program, GLenum programInterface, GLenum pname, GLint *params); + typedef GLuint (GLFUNC *ptr_glGetProgramResourceIndex)(GLuint program, GLenum programInterface, const GLchar *name); + typedef void (GLFUNC *ptr_glGetProgramResourceName)(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); + typedef void (GLFUNC *ptr_glGetProgramResourceiv)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); + typedef GLint (GLFUNC *ptr_glGetProgramResourceLocation)(GLuint program, GLenum programInterface, const GLchar *name); + typedef GLint (GLFUNC *ptr_glGetProgramResourceLocationIndex)(GLuint program, GLenum programInterface, const GLchar *name); + typedef void (GLFUNC *ptr_glShaderStorageBlockBinding)(GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); + typedef void (GLFUNC *ptr_glTexBufferRange)(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); + typedef void (GLFUNC *ptr_glTextureBufferRangeEXT)(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); + typedef void (GLFUNC *ptr_glTexStorage2DMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); + typedef void (GLFUNC *ptr_glTexStorage3DMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + typedef void (GLFUNC *ptr_glTextureStorage2DMultisampleEXT)(GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); + typedef void (GLFUNC *ptr_glTextureStorage3DMultisampleEXT)(GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + typedef void (GLFUNC *ptr_glTextureView)(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + typedef void (GLFUNC *ptr_glBindVertexBuffer)(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); + typedef void (GLFUNC *ptr_glVertexAttribFormat)(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); + typedef void (GLFUNC *ptr_glVertexAttribIFormat)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); + typedef void (GLFUNC *ptr_glVertexAttribLFormat)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); + typedef void (GLFUNC *ptr_glVertexAttribBinding)(GLuint attribindex, GLuint bindingindex); + typedef void (GLFUNC *ptr_glVertexBindingDivisor)(GLuint bindingindex, GLuint divisor); + typedef void (GLFUNC *ptr_glVertexArrayBindVertexBufferEXT)(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); + typedef void (GLFUNC *ptr_glVertexArrayVertexAttribFormatEXT)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); + typedef void (GLFUNC *ptr_glVertexArrayVertexAttribIFormatEXT)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); + typedef void (GLFUNC *ptr_glVertexArrayVertexAttribLFormatEXT)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); + typedef void (GLFUNC *ptr_glVertexArrayVertexAttribBindingEXT)(GLuint vaobj, GLuint attribindex, GLuint bindingindex); + typedef void (GLFUNC *ptr_glVertexArrayVertexBindingDivisorEXT)(GLuint vaobj, GLuint bindingindex, GLuint divisor); + + // OpenGL 4.4 + typedef void (GLFUNC *ptr_glBufferStorage)(GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); + typedef void (GLFUNC *ptr_glClearTexImage)(GLuint texture, GLint level, GLenum format, GLenum type, const void *data); + typedef void (GLFUNC *ptr_glClearTexSubImage)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); + typedef void (GLFUNC *ptr_glBindBuffersBase)(GLenum target, GLuint first, GLsizei count, const GLuint *buffers); + typedef void (GLFUNC *ptr_glBindBuffersRange)(GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes); + typedef void (GLFUNC *ptr_glBindTextures)(GLuint first, GLsizei count, const GLuint *textures); + typedef void (GLFUNC *ptr_glBindSamplers)(GLuint first, GLsizei count, const GLuint *samplers); + typedef void (GLFUNC *ptr_glBindImageTextures)(GLuint first, GLsizei count, const GLuint *textures); + typedef void (GLFUNC *ptr_glBindVertexBuffers)(GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); + + // OpenGL 4.5 + typedef void (GLFUNC *ptr_glClipControl)(GLenum origin, GLenum depth); + typedef void (GLFUNC *ptr_glCreateTransformFeedbacks)(GLsizei n, GLuint *ids); + typedef void (GLFUNC *ptr_glTransformFeedbackBufferBase)(GLuint xfb, GLuint index, GLuint buffer); + typedef void (GLFUNC *ptr_glTransformFeedbackBufferRange)(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); + typedef void (GLFUNC *ptr_glGetTransformFeedbackiv)(GLuint xfb, GLenum pname, GLint *param); + typedef void (GLFUNC *ptr_glGetTransformFeedbacki_v)(GLuint xfb, GLenum pname, GLuint index, GLint *param); + typedef void (GLFUNC *ptr_glGetTransformFeedbacki64_v)(GLuint xfb, GLenum pname, GLuint index, CLint64 *param); + typedef void (GLFUNC *ptr_glCreateBuffers)(GLsizei n, GLuint *buffers); + typedef void (GLFUNC *ptr_glNamedBufferStorage)(GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); + typedef void (GLFUNC *ptr_glNamedBufferData)(GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); + typedef void (GLFUNC *ptr_glNamedBufferSubData)(GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); + typedef void (GLFUNC *ptr_glCopyNamedBufferSubData)(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); + typedef void (GLFUNC *ptr_glClearNamedBufferData)(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); + typedef void (GLFUNC *ptr_glClearNamedBufferSubData)(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); + typedef void *(GLFUNC *ptr_glMapNamedBuffer)(GLuint buffer, GLenum access); + typedef void *(GLFUNC *ptr_glMapNamedBufferRange)(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); + typedef GLboolean (GLFUNC *ptr_glUnmapNamedBuffer)(GLuint buffer); + typedef void (GLFUNC *ptr_glFlushMappedNamedBufferRange)(GLuint buffer, GLintptr offset, GLsizeiptr length); + typedef void (GLFUNC *ptr_glGetNamedBufferParameteriv)(GLuint buffer, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetNamedBufferParameteri64v)(GLuint buffer, GLenum pname, CLint64 *params); + typedef void (GLFUNC *ptr_glGetNamedBufferPointerv)(GLuint buffer, GLenum pname, void **params); + typedef void (GLFUNC *ptr_glGetNamedBufferSubData)(GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); + typedef void (GLFUNC *ptr_glCreateFramebuffers)(GLsizei n, GLuint *framebuffers); + typedef void (GLFUNC *ptr_glNamedFramebufferRenderbuffer)(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); + typedef void (GLFUNC *ptr_glNamedFramebufferParameteri)(GLuint framebuffer, GLenum pname, GLint param); + typedef void (GLFUNC *ptr_glNamedFramebufferTexture)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); + typedef void (GLFUNC *ptr_glNamedFramebufferTextureLayer)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); + typedef void (GLFUNC *ptr_glNamedFramebufferDrawBuffer)(GLuint framebuffer, GLenum buf); + typedef void (GLFUNC *ptr_glNamedFramebufferDrawBuffers)(GLuint framebuffer, GLsizei n, const GLenum *bufs); + typedef void (GLFUNC *ptr_glNamedFramebufferReadBuffer)(GLuint framebuffer, GLenum src); + typedef void (GLFUNC *ptr_glInvalidateNamedFramebufferData)(GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments); + typedef void (GLFUNC *ptr_glInvalidateNamedFramebufferSubData)(GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glClearNamedFramebufferiv)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value); + typedef void (GLFUNC *ptr_glClearNamedFramebufferuiv)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value); + typedef void (GLFUNC *ptr_glClearNamedFramebufferfv)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value); + typedef void (GLFUNC *ptr_glClearNamedFramebufferfi)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); + typedef void (GLFUNC *ptr_glBlitNamedFramebuffer)(GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + typedef GLenum (GLFUNC *ptr_glCheckNamedFramebufferStatus)(GLuint framebuffer, GLenum target); + typedef void (GLFUNC *ptr_glGetNamedFramebufferParameteriv)(GLuint framebuffer, GLenum pname, GLint *param); + typedef void (GLFUNC *ptr_glGetNamedFramebufferAttachmentParameteriv)(GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glCreateRenderbuffers)(GLsizei n, GLuint *renderbuffers); + typedef void (GLFUNC *ptr_glNamedRenderbufferStorage)(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glNamedRenderbufferStorageMultisample)(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glGetNamedRenderbufferParameteriv)(GLuint renderbuffer, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glCreateTextures)(GLenum target, GLsizei n, GLuint *textures); + typedef void (GLFUNC *ptr_glTextureBuffer)(GLuint texture, GLenum internalformat, GLuint buffer); + typedef void (GLFUNC *ptr_glTextureBufferRange)(GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); + typedef void (GLFUNC *ptr_glTextureStorage1D)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); + typedef void (GLFUNC *ptr_glTextureStorage2D)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glTextureStorage3D)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + typedef void (GLFUNC *ptr_glTextureStorage2DMultisample)(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); + typedef void (GLFUNC *ptr_glTextureStorage3DMultisample)(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + typedef void (GLFUNC *ptr_glTextureSubImage1D)(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); + typedef void (GLFUNC *ptr_glTextureSubImage2D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); + typedef void (GLFUNC *ptr_glTextureSubImage3D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); + typedef void (GLFUNC *ptr_glCompressedTextureSubImage1D)(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); + typedef void (GLFUNC *ptr_glCompressedTextureSubImage2D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); + typedef void (GLFUNC *ptr_glCompressedTextureSubImage3D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); + typedef void (GLFUNC *ptr_glCopyTextureSubImage1D)(GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); + typedef void (GLFUNC *ptr_glCopyTextureSubImage2D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glCopyTextureSubImage3D)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + typedef void (GLFUNC *ptr_glTextureParameterf)(GLuint texture, GLenum pname, GLfloat param); + typedef void (GLFUNC *ptr_glTextureParameterfv)(GLuint texture, GLenum pname, const GLfloat *param); + typedef void (GLFUNC *ptr_glTextureParameteri)(GLuint texture, GLenum pname, GLint param); + typedef void (GLFUNC *ptr_glTextureParameterIiv)(GLuint texture, GLenum pname, const GLint *params); + typedef void (GLFUNC *ptr_glTextureParameterIuiv)(GLuint texture, GLenum pname, const GLuint *params); + typedef void (GLFUNC *ptr_glTextureParameteriv)(GLuint texture, GLenum pname, const GLint *param); + typedef void (GLFUNC *ptr_glGenerateTextureMipmap)(GLuint texture); + typedef void (GLFUNC *ptr_glBindTextureUnit)(GLuint unit, GLuint texture); + typedef void (GLFUNC *ptr_glGetTextureImage)(GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); + typedef void (GLFUNC *ptr_glGetCompressedTextureImage)(GLuint texture, GLint level, GLsizei bufSize, void *pixels); + typedef void (GLFUNC *ptr_glGetTextureLevelParameterfv)(GLuint texture, GLint level, GLenum pname, GLfloat *params); + typedef void (GLFUNC *ptr_glGetTextureLevelParameteriv)(GLuint texture, GLint level, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetTextureParameterfv)(GLuint texture, GLenum pname, GLfloat *params); + typedef void (GLFUNC *ptr_glGetTextureParameterIiv)(GLuint texture, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glGetTextureParameterIuiv)(GLuint texture, GLenum pname, GLuint *params); + typedef void (GLFUNC *ptr_glGetTextureParameteriv)(GLuint texture, GLenum pname, GLint *params); + typedef void (GLFUNC *ptr_glCreateVertexArrays)(GLsizei n, GLuint *arrays); + typedef void (GLFUNC *ptr_glDisableVertexArrayAttrib)(GLuint vaobj, GLuint index); + typedef void (GLFUNC *ptr_glEnableVertexArrayAttrib)(GLuint vaobj, GLuint index); + typedef void (GLFUNC *ptr_glVertexArrayElementBuffer)(GLuint vaobj, GLuint buffer); + typedef void (GLFUNC *ptr_glVertexArrayVertexBuffer)(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); + typedef void (GLFUNC *ptr_glVertexArrayVertexBuffers)(GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); + typedef void (GLFUNC *ptr_glVertexArrayAttribBinding)(GLuint vaobj, GLuint attribindex, GLuint bindingindex); + typedef void (GLFUNC *ptr_glVertexArrayAttribFormat)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); + typedef void (GLFUNC *ptr_glVertexArrayAttribIFormat)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); + typedef void (GLFUNC *ptr_glVertexArrayAttribLFormat)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); + typedef void (GLFUNC *ptr_glVertexArrayBindingDivisor)(GLuint vaobj, GLuint bindingindex, GLuint divisor); + typedef void (GLFUNC *ptr_glGetVertexArrayiv)(GLuint vaobj, GLenum pname, GLint *param); + typedef void (GLFUNC *ptr_glGetVertexArrayIndexediv)(GLuint vaobj, GLuint index, GLenum pname, GLint *param); + typedef void (GLFUNC *ptr_glGetVertexArrayIndexed64iv)(GLuint vaobj, GLuint index, GLenum pname, CLint64 *param); + typedef void (GLFUNC *ptr_glCreateSamplers)(GLsizei n, GLuint *samplers); + typedef void (GLFUNC *ptr_glCreateProgramPipelines)(GLsizei n, GLuint *pipelines); + typedef void (GLFUNC *ptr_glCreateQueries)(GLenum target, GLsizei n, GLuint *ids); + typedef void (GLFUNC *ptr_glGetQueryBufferObjecti64v)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); + typedef void (GLFUNC *ptr_glGetQueryBufferObjectiv)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); + typedef void (GLFUNC *ptr_glGetQueryBufferObjectui64v)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); + typedef void (GLFUNC *ptr_glGetQueryBufferObjectuiv)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); + typedef void (GLFUNC *ptr_glMemoryBarrierByRegion)(GLbitfield barriers); + typedef void (GLFUNC *ptr_glGetTextureSubImage)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); + typedef void (GLFUNC *ptr_glGetCompressedTextureSubImage)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); + typedef GLenum (GLFUNC *ptr_glGetGraphicsResetStatus)(void); + typedef void (GLFUNC *ptr_glGetnCompressedTexImage)(GLenum target, GLint lod, GLsizei bufSize, void *pixels); + typedef void (GLFUNC *ptr_glGetnTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); + typedef void (GLFUNC *ptr_glGetnUniformdv)(GLuint program, GLint location, GLsizei bufSize, GLdouble *params); + typedef void (GLFUNC *ptr_glGetnUniformfv)(GLuint program, GLint location, GLsizei bufSize, GLfloat *params); + typedef void (GLFUNC *ptr_glGetnUniformiv)(GLuint program, GLint location, GLsizei bufSize, GLint *params); + typedef void (GLFUNC *ptr_glGetnUniformuiv)(GLuint program, GLint location, GLsizei bufSize, GLuint *params); + typedef void (GLFUNC *ptr_glReadnPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); + typedef void (GLFUNC *ptr_glGetnMapdv)(GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); + typedef void (GLFUNC *ptr_glGetnMapfv)(GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); + typedef void (GLFUNC *ptr_glGetnMapiv)(GLenum target, GLenum query, GLsizei bufSize, GLint *v); + typedef void (GLFUNC *ptr_glGetnPixelMapfv)(GLenum map, GLsizei bufSize, GLfloat *values); + typedef void (GLFUNC *ptr_glGetnPixelMapuiv)(GLenum map, GLsizei bufSize, GLuint *values); + typedef void (GLFUNC *ptr_glGetnPixelMapusv)(GLenum map, GLsizei bufSize, GLushort *values); + typedef void (GLFUNC *ptr_glGetnPolygonStipple)(GLsizei bufSize, GLubyte *pattern); + typedef void (GLFUNC *ptr_glGetnColorTable)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); + typedef void (GLFUNC *ptr_glGetnConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); + typedef void (GLFUNC *ptr_glGetnSeparableFilter)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); + typedef void (GLFUNC *ptr_glGetnHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); + typedef void (GLFUNC *ptr_glGetnMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); + typedef void (GLFUNC *ptr_glTextureBarrier)(void); + + // For Legacy OpenGL (For GL1 target) + typedef GLvoid (GLFUNC *ptr_glClientActiveTextureARB)(GLenum); + #ifdef WIN32 + DECLARE_HANDLE(HPBUFFERARB); + typedef HPBUFFERARB (GLFUNC *ptr_wglCreatePbufferARB)(HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); + typedef HDC (GLFUNC *ptr_wglGetPbufferDCARB)(HPBUFFERARB hPbuffer); + typedef int (GLFUNC *ptr_wglReleasePbufferDCARB)(HPBUFFERARB hPbuffer, HDC hDC); + typedef BOOL (GLFUNC *ptr_wglDestroyPbufferARB)(HPBUFFERARB hPbuffer); + typedef BOOL (GLFUNC *ptr_wglQueryPbufferARB)(HPBUFFERARB hPbuffer, int iAttribute, int *piValue); + #endif + + ptr_glCullFace cullFace; + ptr_glFrontFace frontFace; + ptr_glHint hint; + ptr_glLineWidth lineWidth; + ptr_glPointSize pointSize; + ptr_glPolygonMode polygonMode; + ptr_glScissor scissor; + ptr_glTexParameterf texParameterf; + ptr_glTexParameterfv texParameterfv; + ptr_glTexParameteri texParameteri; + ptr_glTexParameteriv texParameteriv; + ptr_glTexImage1D texImage1D; + ptr_glTexImage2D texImage2D; + ptr_glDrawBuffer drawBuffer; + ptr_glClear clear; + ptr_glClearColor clearColor; + ptr_glClearStencil clearStencil; + ptr_glClearDepth clearDepth; + ptr_glStencilMask stencilMask; + ptr_glColorMask colorMask; + ptr_glDepthMask depthMask; + ptr_glDisable disable; + ptr_glEnable enable; + ptr_glFinish finish; + ptr_glFlush flush; + ptr_glBlendFunc blendFunc; + ptr_glLogicOp logicOp; + ptr_glStencilFunc stencilFunc; + ptr_glStencilOp stencilOp; + ptr_glDepthFunc depthFunc; + ptr_glPixelStoref pixelStoref; + ptr_glPixelStorei pixelStorei; + ptr_glReadBuffer readBuffer; + ptr_glReadPixels readPixels; + ptr_glGetBooleanv getBooleanv; + ptr_glGetDoublev getDoublev; + ptr_glGetError getError; + ptr_glGetFloatv getFloatv; + ptr_glGetIntegerv getIntegerv; + ptr_glGetString getString; + ptr_glGetTexImage getTexImage; + ptr_glGetTexParameterfv getTexParameterfv; + ptr_glGetTexParameteriv getTexParameteriv; + ptr_glGetTexLevelParameterfv getTexLevelParameterfv; + ptr_glGetTexLevelParameteriv getTexLevelParameteriv; + ptr_glIsEnabled isEnabled; + ptr_glDepthRange depthRange; + ptr_glViewport viewport; + ptr_glDrawArrays drawArrays; + ptr_glDrawElements drawElements; + ptr_glGetPointerv getPointerv; + ptr_glPolygonOffset polygonOffset; + ptr_glCopyTexImage1D copyTexImage1D; + ptr_glCopyTexImage2D copyTexImage2D; + ptr_glCopyTexSubImage1D copyTexSubImage1D; + ptr_glCopyTexSubImage2D copyTexSubImage2D; + ptr_glTexSubImage1D texSubImage1D; + ptr_glTexSubImage2D texSubImage2D; + ptr_glBindTexture bindTexture; + ptr_glDeleteTextures deleteTextures; + ptr_glGenTextures genTextures; + ptr_glIsTexture isTexture; + ptr_glBlendColor blendColor; + ptr_glBlendEquation blendEquation; + ptr_glDrawRangeElements drawRangeElements; + ptr_glTexImage3D texImage3D; + ptr_glTexSubImage3D texSubImage3D; + ptr_glCopyTexSubImage3D copyTexSubImage3D; + ptr_glActiveTexture activeTexture; + ptr_glSampleCoverage sampleCoverage; + ptr_glCompressedTexImage3D compressedTexImage3D; + ptr_glCompressedTexImage2D compressedTexImage2D; + ptr_glCompressedTexImage1D compressedTexImage1D; + ptr_glCompressedTexSubImage3D compressedTexSubImage3D; + ptr_glCompressedTexSubImage2D compressedTexSubImage2D; + ptr_glCompressedTexSubImage1D compressedTexSubImage1D; + ptr_glGetCompressedTexImage getCompressedTexImage; + ptr_glBlendFuncSeparate blendFuncSeparate; + ptr_glMultiDrawArrays multiDrawArrays; + ptr_glMultiDrawElements multiDrawElements; + ptr_glPointParameterf pointParameterf; + ptr_glPointParameterfv pointParameterfv; + ptr_glPointParameteri pointParameteri; + ptr_glPointParameteriv pointParameteriv; + ptr_glGenQueries genQueries; + ptr_glDeleteQueries deleteQueries; + ptr_glIsQuery isQuery; + ptr_glBeginQuery beginQuery; + ptr_glEndQuery endQuery; + ptr_glGetQueryiv getQueryiv; + ptr_glGetQueryObjectiv getQueryObjectiv; + ptr_glGetQueryObjectuiv getQueryObjectuiv; + ptr_glBindBuffer bindBuffer; + ptr_glDeleteBuffers deleteBuffers; + ptr_glGenBuffers genBuffers; + ptr_glIsBuffer isBuffer; + ptr_glBufferData bufferData; + ptr_glBufferSubData bufferSubData; + ptr_glGetBufferSubData getBufferSubData; + ptr_glMapBuffer mapBuffer; + ptr_glUnmapBuffer unmapBuffer; + ptr_glGetBufferParameteriv getBufferParameteriv; + ptr_glGetBufferPointerv getBufferPointerv; + ptr_glBlendEquationSeparate blendEquationSeparate; + ptr_glDrawBuffers drawBuffers; + ptr_glStencilOpSeparate stencilOpSeparate; + ptr_glStencilFuncSeparate stencilFuncSeparate; + ptr_glStencilMaskSeparate stencilMaskSeparate; + ptr_glAttachShader attachShader; + ptr_glBindAttribLocation bindAttribLocation; + ptr_glCompileShader compileShader; + ptr_glCreateProgram createProgram; + ptr_glCreateShader createShader; + ptr_glDeleteProgram deleteProgram; + ptr_glDeleteShader deleteShader; + ptr_glDetachShader detachShader; + ptr_glDisableVertexAttribArray disableVertexAttribArray; + ptr_glEnableVertexAttribArray enableVertexAttribArray; + ptr_glGetActiveAttrib getActiveAttrib; + ptr_glGetActiveUniform getActiveUniform; + ptr_glGetAttachedShaders getAttachedShaders; + ptr_glGetAttribLocation getAttribLocation; + ptr_glGetProgramiv getProgramiv; + ptr_glGetProgramInfoLog getProgramInfoLog; + ptr_glGetShaderiv getShaderiv; + ptr_glGetShaderInfoLog getShaderInfoLog; + ptr_glGetShaderSource getShaderSource; + ptr_glGetUniformLocation getUniformLocation; + ptr_glGetUniformfv getUniformfv; + ptr_glGetUniformiv getUniformiv; + ptr_glGetVertexAttribdv getVertexAttribdv; + ptr_glGetVertexAttribfv getVertexAttribfv; + ptr_glGetVertexAttribiv getVertexAttribiv; + ptr_glGetVertexAttribPointerv getVertexAttribPointerv; + ptr_glIsProgram isProgram; + ptr_glIsShader isShader; + ptr_glLinkProgram linkProgram; + ptr_glShaderSource shaderSource; + ptr_glUseProgram useProgram; + ptr_glUniform1f uniform1f; + ptr_glUniform2f uniform2f; + ptr_glUniform3f uniform3f; + ptr_glUniform4f uniform4f; + ptr_glUniform1i uniform1i; + ptr_glUniform2i uniform2i; + ptr_glUniform3i uniform3i; + ptr_glUniform4i uniform4i; + ptr_glUniform1fv uniform1fv; + ptr_glUniform2fv uniform2fv; + ptr_glUniform3fv uniform3fv; + ptr_glUniform4fv uniform4fv; + ptr_glUniform1iv uniform1iv; + ptr_glUniform2iv uniform2iv; + ptr_glUniform3iv uniform3iv; + ptr_glUniform4iv uniform4iv; + ptr_glUniformMatrix2fv uniformMatrix2fv; + ptr_glUniformMatrix3fv uniformMatrix3fv; + ptr_glUniformMatrix4fv uniformMatrix4fv; + ptr_glValidateProgram validateProgram; + ptr_glVertexAttrib1d vertexAttrib1d; + ptr_glVertexAttrib1dv vertexAttrib1dv; + ptr_glVertexAttrib1f vertexAttrib1f; + ptr_glVertexAttrib1fv vertexAttrib1fv; + ptr_glVertexAttrib1s vertexAttrib1s; + ptr_glVertexAttrib1sv vertexAttrib1sv; + ptr_glVertexAttrib2d vertexAttrib2d; + ptr_glVertexAttrib2dv vertexAttrib2dv; + ptr_glVertexAttrib2f vertexAttrib2f; + ptr_glVertexAttrib2fv vertexAttrib2fv; + ptr_glVertexAttrib2s vertexAttrib2s; + ptr_glVertexAttrib2sv vertexAttrib2sv; + ptr_glVertexAttrib3d vertexAttrib3d; + ptr_glVertexAttrib3dv vertexAttrib3dv; + ptr_glVertexAttrib3f vertexAttrib3f; + ptr_glVertexAttrib3fv vertexAttrib3fv; + ptr_glVertexAttrib3s vertexAttrib3s; + ptr_glVertexAttrib3sv vertexAttrib3sv; + ptr_glVertexAttrib4Nbv vertexAttrib4Nbv; + ptr_glVertexAttrib4Niv vertexAttrib4Niv; + ptr_glVertexAttrib4Nsv vertexAttrib4Nsv; + ptr_glVertexAttrib4Nub vertexAttrib4Nub; + ptr_glVertexAttrib4Nubv vertexAttrib4Nubv; + ptr_glVertexAttrib4Nuiv vertexAttrib4Nuiv; + ptr_glVertexAttrib4Nusv vertexAttrib4Nusv; + ptr_glVertexAttrib4bv vertexAttrib4bv; + ptr_glVertexAttrib4d vertexAttrib4d; + ptr_glVertexAttrib4dv vertexAttrib4dv; + ptr_glVertexAttrib4f vertexAttrib4f; + ptr_glVertexAttrib4fv vertexAttrib4fv; + ptr_glVertexAttrib4iv vertexAttrib4iv; + ptr_glVertexAttrib4s vertexAttrib4s; + ptr_glVertexAttrib4sv vertexAttrib4sv; + ptr_glVertexAttrib4ubv vertexAttrib4ubv; + ptr_glVertexAttrib4uiv vertexAttrib4uiv; + ptr_glVertexAttrib4usv vertexAttrib4usv; + ptr_glVertexAttribPointer vertexAttribPointer; + ptr_glUniformMatrix2x3fv uniformMatrix2x3fv; + ptr_glUniformMatrix3x2fv uniformMatrix3x2fv; + ptr_glUniformMatrix2x4fv uniformMatrix2x4fv; + ptr_glUniformMatrix4x2fv uniformMatrix4x2fv; + ptr_glUniformMatrix3x4fv uniformMatrix3x4fv; + ptr_glUniformMatrix4x3fv uniformMatrix4x3fv; + ptr_glColorMaski colorMaski; + ptr_glGetBooleani_v getBooleani_v; + ptr_glGetIntegeri_v getIntegeri_v; + ptr_glEnablei enablei; + ptr_glDisablei disablei; + ptr_glIsEnabledi isEnabledi; + ptr_glBeginTransformFeedback beginTransformFeedback; + ptr_glEndTransformFeedback endTransformFeedback; + ptr_glBindBufferRange bindBufferRange; + ptr_glBindBufferBase bindBufferBase; + ptr_glTransformFeedbackVaryings transformFeedbackVaryings; + ptr_glGetTransformFeedbackVarying getTransformFeedbackVarying; + ptr_glClampColor clampColor; + ptr_glBeginConditionalRender beginConditionalRender; + ptr_glEndConditionalRender endConditionalRender; + ptr_glVertexAttribIPointer vertexAttribIPointer; + ptr_glGetVertexAttribIiv getVertexAttribIiv; + ptr_glGetVertexAttribIuiv getVertexAttribIuiv; + ptr_glVertexAttribI1i vertexAttribI1i; + ptr_glVertexAttribI2i vertexAttribI2i; + ptr_glVertexAttribI3i vertexAttribI3i; + ptr_glVertexAttribI4i vertexAttribI4i; + ptr_glVertexAttribI1ui vertexAttribI1ui; + ptr_glVertexAttribI2ui vertexAttribI2ui; + ptr_glVertexAttribI3ui vertexAttribI3ui; + ptr_glVertexAttribI4ui vertexAttribI4ui; + ptr_glVertexAttribI1iv vertexAttribI1iv; + ptr_glVertexAttribI2iv vertexAttribI2iv; + ptr_glVertexAttribI3iv vertexAttribI3iv; + ptr_glVertexAttribI4iv vertexAttribI4iv; + ptr_glVertexAttribI1uiv vertexAttribI1uiv; + ptr_glVertexAttribI2uiv vertexAttribI2uiv; + ptr_glVertexAttribI3uiv vertexAttribI3uiv; + ptr_glVertexAttribI4uiv vertexAttribI4uiv; + ptr_glVertexAttribI4bv vertexAttribI4bv; + ptr_glVertexAttribI4sv vertexAttribI4sv; + ptr_glVertexAttribI4ubv vertexAttribI4ubv; + ptr_glVertexAttribI4usv vertexAttribI4usv; + ptr_glGetUniformuiv getUniformuiv; + ptr_glBindFragDataLocation bindFragDataLocation; + ptr_glGetFragDataLocation getFragDataLocation; + ptr_glUniform1ui uniform1ui; + ptr_glUniform2ui uniform2ui; + ptr_glUniform3ui uniform3ui; + ptr_glUniform4ui uniform4ui; + ptr_glUniform1uiv uniform1uiv; + ptr_glUniform2uiv uniform2uiv; + ptr_glUniform3uiv uniform3uiv; + ptr_glUniform4uiv uniform4uiv; + ptr_glTexParameterIiv texParameterIiv; + ptr_glTexParameterIuiv texParameterIuiv; + ptr_glGetTexParameterIiv getTexParameterIiv; + ptr_glGetTexParameterIuiv getTexParameterIuiv; + ptr_glClearBufferiv clearBufferiv; + ptr_glClearBufferuiv clearBufferuiv; + ptr_glClearBufferfv clearBufferfv; + ptr_glClearBufferfi clearBufferfi; + ptr_glGetStringi getStringi; + ptr_glDrawArraysInstanced drawArraysInstanced; + ptr_glDrawElementsInstanced drawElementsInstanced; + ptr_glTexBuffer texBuffer; + ptr_glPrimitiveRestartIndex primitiveRestartIndex; + ptr_glGetInteger64i_v getInteger64i_v; + ptr_glGetBufferParameteri64v getBufferParameteri64v; + ptr_glFramebufferTexture framebufferTexture; + ptr_glVertexAttribDivisor vertexAttribDivisor; + ptr_glMinSampleShading minSampleShading; + ptr_glBlendEquationi blendEquationi; + ptr_glBlendEquationSeparatei blendEquationSeparatei; + ptr_glBlendFunci blendFunci; + ptr_glBlendFuncSeparatei blendFuncSeparatei; + ptr_glIsRenderbuffer isRenderbuffer; + ptr_glBindRenderbuffer bindRenderbuffer; + ptr_glDeleteRenderbuffers deleteRenderbuffers; + ptr_glGenRenderbuffers genRenderbuffers; + ptr_glRenderbufferStorage renderbufferStorage; + ptr_glGetRenderbufferParameteriv getRenderbufferParameteriv; + ptr_glIsFramebuffer isFramebuffer; + ptr_glBindFramebuffer bindFramebuffer; + ptr_glDeleteFramebuffers deleteFramebuffers; + ptr_glGenFramebuffers genFramebuffers; + ptr_glCheckFramebufferStatus checkFramebufferStatus; + ptr_glFramebufferTexture1D framebufferTexture1D; + ptr_glFramebufferTexture2D framebufferTexture2D; + ptr_glFramebufferTexture3D framebufferTexture3D; + ptr_glFramebufferRenderbuffer framebufferRenderbuffer; + ptr_glGetFramebufferAttachmentParameteriv getFramebufferAttachmentParameteriv; + ptr_glGenerateMipmap generateMipmap; + ptr_glBlitFramebuffer blitFramebuffer; + ptr_glRenderbufferStorageMultisample renderbufferStorageMultisample; + ptr_glFramebufferTextureLayer framebufferTextureLayer; + ptr_glMapBufferRange mapBufferRange; + ptr_glFlushMappedBufferRange flushMappedBufferRange; + ptr_glBindVertexArray bindVertexArray; + ptr_glDeleteVertexArrays deleteVertexArrays; + ptr_glGenVertexArrays genVertexArrays; + ptr_glIsVertexArray isVertexArray; + ptr_glGetUniformIndices getUniformIndices; + ptr_glGetActiveUniformsiv getActiveUniformsiv; + ptr_glGetActiveUniformName getActiveUniformName; + ptr_glGetUniformBlockIndex getUniformBlockIndex; + ptr_glGetActiveUniformBlockiv getActiveUniformBlockiv; + ptr_glGetActiveUniformBlockName getActiveUniformBlockName; + ptr_glUniformBlockBinding uniformBlockBinding; + ptr_glCopyBufferSubData copyBufferSubData; + ptr_glDrawElementsBaseVertex drawElementsBaseVertex; + ptr_glDrawRangeElementsBaseVertex drawRangeElementsBaseVertex; + ptr_glDrawElementsInstancedBaseVertex drawElementsInstancedBaseVertex; + ptr_glMultiDrawElementsBaseVertex multiDrawElementsBaseVertex; + ptr_glProvokingVertex provokingVertex; + ptr_glFenceSync fenceSync; + ptr_glIsSync isSync; + ptr_glDeleteSync deleteSync; + ptr_glClientWaitSync clientWaitSync; + ptr_glWaitSync waitSync; + ptr_glGetInteger64v getInteger64v; + ptr_glGetSynciv getSynciv; + ptr_glTexImage2DMultisample texImage2DMultisample; + ptr_glTexImage3DMultisample texImage3DMultisample; + ptr_glGetMultisamplefv getMultisamplefv; + ptr_glSampleMaski sampleMaski; + ptr_glBlendEquationiARB blendEquationiARB; + ptr_glBlendEquationSeparateiARB blendEquationSeparateiARB; + ptr_glBlendFunciARB blendFunciARB; + ptr_glBlendFuncSeparateiARB blendFuncSeparateiARB; + ptr_glMinSampleShadingARB minSampleShadingARB; + ptr_glNamedStringARB namedStringARB; + ptr_glDeleteNamedStringARB deleteNamedStringARB; + ptr_glCompileShaderIncludeARB compileShaderIncludeARB; + ptr_glIsNamedStringARB isNamedStringARB; + ptr_glGetNamedStringARB getNamedStringARB; + ptr_glGetNamedStringivARB getNamedStringivARB; + ptr_glBindFragDataLocationIndexed bindFragDataLocationIndexed; + ptr_glGetFragDataIndex getFragDataIndex; + ptr_glGenSamplers genSamplers; + ptr_glDeleteSamplers deleteSamplers; + ptr_glIsSampler isSampler; + ptr_glBindSampler bindSampler; + ptr_glSamplerParameteri samplerParameteri; + ptr_glSamplerParameteriv samplerParameteriv; + ptr_glSamplerParameterf samplerParameterf; + ptr_glSamplerParameterfv samplerParameterfv; + ptr_glSamplerParameterIiv samplerParameterIiv; + ptr_glSamplerParameterIuiv samplerParameterIuiv; + ptr_glGetSamplerParameteriv getSamplerParameteriv; + ptr_glGetSamplerParameterIiv getSamplerParameterIiv; + ptr_glGetSamplerParameterfv getSamplerParameterfv; + ptr_glGetSamplerParameterIuiv getSamplerParameterIuiv; + ptr_glQueryCounter queryCounter; + ptr_glGetQueryObjecti64v getQueryObjecti64v; + ptr_glGetQueryObjectui64v getQueryObjectui64v; + ptr_glVertexP2ui vertexP2ui; + ptr_glVertexP2uiv vertexP2uiv; + ptr_glVertexP3ui vertexP3ui; + ptr_glVertexP3uiv vertexP3uiv; + ptr_glVertexP4ui vertexP4ui; + ptr_glVertexP4uiv vertexP4uiv; + ptr_glTexCoordP1ui texCoordP1ui; + ptr_glTexCoordP1uiv texCoordP1uiv; + ptr_glTexCoordP2ui texCoordP2ui; + ptr_glTexCoordP2uiv texCoordP2uiv; + ptr_glTexCoordP3ui texCoordP3ui; + ptr_glTexCoordP3uiv texCoordP3uiv; + ptr_glTexCoordP4ui texCoordP4ui; + ptr_glTexCoordP4uiv texCoordP4uiv; + ptr_glMultiTexCoordP1ui multiTexCoordP1ui; + ptr_glMultiTexCoordP1uiv multiTexCoordP1uiv; + ptr_glMultiTexCoordP2ui multiTexCoordP2ui; + ptr_glMultiTexCoordP2uiv multiTexCoordP2uiv; + ptr_glMultiTexCoordP3ui multiTexCoordP3ui; + ptr_glMultiTexCoordP3uiv multiTexCoordP3uiv; + ptr_glMultiTexCoordP4ui multiTexCoordP4ui; + ptr_glMultiTexCoordP4uiv multiTexCoordP4uiv; + ptr_glNormalP3ui normalP3ui; + ptr_glNormalP3uiv normalP3uiv; + ptr_glColorP3ui colorP3ui; + ptr_glColorP3uiv colorP3uiv; + ptr_glColorP4ui colorP4ui; + ptr_glColorP4uiv colorP4uiv; + ptr_glSecondaryColorP3ui secondaryColorP3ui; + ptr_glSecondaryColorP3uiv secondaryColorP3uiv; + ptr_glVertexAttribP1ui vertexAttribP1ui; + ptr_glVertexAttribP1uiv vertexAttribP1uiv; + ptr_glVertexAttribP2ui vertexAttribP2ui; + ptr_glVertexAttribP2uiv vertexAttribP2uiv; + ptr_glVertexAttribP3ui vertexAttribP3ui; + ptr_glVertexAttribP3uiv vertexAttribP3uiv; + ptr_glVertexAttribP4ui vertexAttribP4ui; + ptr_glVertexAttribP4uiv vertexAttribP4uiv; + ptr_glDrawArraysIndirect drawArraysIndirect; + ptr_glDrawElementsIndirect drawElementsIndirect; + ptr_glUniform1d uniform1d; + ptr_glUniform2d uniform2d; + ptr_glUniform3d uniform3d; + ptr_glUniform4d uniform4d; + ptr_glUniform1dv uniform1dv; + ptr_glUniform2dv uniform2dv; + ptr_glUniform3dv uniform3dv; + ptr_glUniform4dv uniform4dv; + ptr_glUniformMatrix2dv uniformMatrix2dv; + ptr_glUniformMatrix3dv uniformMatrix3dv; + ptr_glUniformMatrix4dv uniformMatrix4dv; + ptr_glUniformMatrix2x3dv uniformMatrix2x3dv; + ptr_glUniformMatrix2x4dv uniformMatrix2x4dv; + ptr_glUniformMatrix3x2dv uniformMatrix3x2dv; + ptr_glUniformMatrix3x4dv uniformMatrix3x4dv; + ptr_glUniformMatrix4x2dv uniformMatrix4x2dv; + ptr_glUniformMatrix4x3dv uniformMatrix4x3dv; + ptr_glGetUniformdv getUniformdv; + ptr_glGetSubroutineUniformLocation getSubroutineUniformLocation; + ptr_glGetSubroutineIndex getSubroutineIndex; + ptr_glGetActiveSubroutineUniformiv getActiveSubroutineUniformiv; + ptr_glGetActiveSubroutineUniformName getActiveSubroutineUniformName; + ptr_glGetActiveSubroutineName getActiveSubroutineName; + ptr_glUniformSubroutinesuiv uniformSubroutinesuiv; + ptr_glGetUniformSubroutineuiv getUniformSubroutineuiv; + ptr_glGetProgramStageiv getProgramStageiv; + ptr_glPatchParameteri patchParameteri; + ptr_glPatchParameterfv patchParameterfv; + ptr_glBindTransformFeedback bindTransformFeedback; + ptr_glDeleteTransformFeedbacks deleteTransformFeedbacks; + ptr_glGenTransformFeedbacks genTransformFeedbacks; + ptr_glIsTransformFeedback isTransformFeedback; + ptr_glPauseTransformFeedback pauseTransformFeedback; + ptr_glResumeTransformFeedback resumeTransformFeedback; + ptr_glDrawTransformFeedback drawTransformFeedback; + ptr_glDrawTransformFeedbackStream drawTransformFeedbackStream; + ptr_glBeginQueryIndexed beginQueryIndexed; + ptr_glEndQueryIndexed endQueryIndexed; + ptr_glGetQueryIndexediv getQueryIndexediv; + ptr_glReleaseShaderCompiler releaseShaderCompiler; + ptr_glShaderBinary shaderBinary; + ptr_glGetShaderPrecisionFormat getShaderPrecisionFormat; + ptr_glDepthRangef depthRangef; + ptr_glClearDepthf clearDepthf; + ptr_glGetProgramBinary getProgramBinary; + ptr_glProgramBinary programBinary; + ptr_glProgramParameteri programParameteri; + ptr_glUseProgramStages useProgramStages; + ptr_glActiveShaderProgram activeShaderProgram; + ptr_glCreateShaderProgramv createShaderProgramv; + ptr_glBindProgramPipeline bindProgramPipeline; + ptr_glDeleteProgramPipelines deleteProgramPipelines; + ptr_glGenProgramPipelines genProgramPipelines; + ptr_glIsProgramPipeline isProgramPipeline; + ptr_glGetProgramPipelineiv getProgramPipelineiv; + ptr_glProgramUniform1i programUniform1i; + ptr_glProgramUniform1iv programUniform1iv; + ptr_glProgramUniform1f programUniform1f; + ptr_glProgramUniform1fv programUniform1fv; + ptr_glProgramUniform1d programUniform1d; + ptr_glProgramUniform1dv programUniform1dv; + ptr_glProgramUniform1ui programUniform1ui; + ptr_glProgramUniform1uiv programUniform1uiv; + ptr_glProgramUniform2i programUniform2i; + ptr_glProgramUniform2iv programUniform2iv; + ptr_glProgramUniform2f programUniform2f; + ptr_glProgramUniform2fv programUniform2fv; + ptr_glProgramUniform2d programUniform2d; + ptr_glProgramUniform2dv programUniform2dv; + ptr_glProgramUniform2ui programUniform2ui; + ptr_glProgramUniform2uiv programUniform2uiv; + ptr_glProgramUniform3i programUniform3i; + ptr_glProgramUniform3iv programUniform3iv; + ptr_glProgramUniform3f programUniform3f; + ptr_glProgramUniform3fv programUniform3fv; + ptr_glProgramUniform3d programUniform3d; + ptr_glProgramUniform3dv programUniform3dv; + ptr_glProgramUniform3ui programUniform3ui; + ptr_glProgramUniform3uiv programUniform3uiv; + ptr_glProgramUniform4i programUniform4i; + ptr_glProgramUniform4iv programUniform4iv; + ptr_glProgramUniform4f programUniform4f; + ptr_glProgramUniform4fv programUniform4fv; + ptr_glProgramUniform4d programUniform4d; + ptr_glProgramUniform4dv programUniform4dv; + ptr_glProgramUniform4ui programUniform4ui; + ptr_glProgramUniform4uiv programUniform4uiv; + ptr_glProgramUniformMatrix2fv programUniformMatrix2fv; + ptr_glProgramUniformMatrix3fv programUniformMatrix3fv; + ptr_glProgramUniformMatrix4fv programUniformMatrix4fv; + ptr_glProgramUniformMatrix2dv programUniformMatrix2dv; + ptr_glProgramUniformMatrix3dv programUniformMatrix3dv; + ptr_glProgramUniformMatrix4dv programUniformMatrix4dv; + ptr_glProgramUniformMatrix2x3fv programUniformMatrix2x3fv; + ptr_glProgramUniformMatrix3x2fv programUniformMatrix3x2fv; + ptr_glProgramUniformMatrix2x4fv programUniformMatrix2x4fv; + ptr_glProgramUniformMatrix4x2fv programUniformMatrix4x2fv; + ptr_glProgramUniformMatrix3x4fv programUniformMatrix3x4fv; + ptr_glProgramUniformMatrix4x3fv programUniformMatrix4x3fv; + ptr_glProgramUniformMatrix2x3dv programUniformMatrix2x3dv; + ptr_glProgramUniformMatrix3x2dv programUniformMatrix3x2dv; + ptr_glProgramUniformMatrix2x4dv programUniformMatrix2x4dv; + ptr_glProgramUniformMatrix4x2dv programUniformMatrix4x2dv; + ptr_glProgramUniformMatrix3x4dv programUniformMatrix3x4dv; + ptr_glProgramUniformMatrix4x3dv programUniformMatrix4x3dv; + ptr_glValidateProgramPipeline validateProgramPipeline; + ptr_glGetProgramPipelineInfoLog getProgramPipelineInfoLog; + ptr_glVertexAttribL1d vertexAttribL1d; + ptr_glVertexAttribL2d vertexAttribL2d; + ptr_glVertexAttribL3d vertexAttribL3d; + ptr_glVertexAttribL4d vertexAttribL4d; + ptr_glVertexAttribL1dv vertexAttribL1dv; + ptr_glVertexAttribL2dv vertexAttribL2dv; + ptr_glVertexAttribL3dv vertexAttribL3dv; + ptr_glVertexAttribL4dv vertexAttribL4dv; + ptr_glVertexAttribLPointer vertexAttribLPointer; + ptr_glGetVertexAttribLdv getVertexAttribLdv; + ptr_glViewportArrayv viewportArrayv; + ptr_glViewportIndexedf viewportIndexedf; + ptr_glViewportIndexedfv viewportIndexedfv; + ptr_glScissorArrayv scissorArrayv; + ptr_glScissorIndexed scissorIndexed; + ptr_glScissorIndexedv scissorIndexedv; + ptr_glDepthRangeArrayv depthRangeArrayv; + ptr_glDepthRangeIndexed depthRangeIndexed; + ptr_glGetFloati_v getFloati_v; + ptr_glGetDoublei_v getDoublei_v; + ptr_glCreateSyncFromCLeventARB createSyncFromCLeventARB; + ptr_glDebugMessageControlARB debugMessageControlARB; + ptr_glDebugMessageInsertARB debugMessageInsertARB; + ptr_glDebugMessageCallbackARB debugMessageCallbackARB; + ptr_glGetDebugMessageLogARB getDebugMessageLogARB; + ptr_glGetGraphicsResetStatusARB getGraphicsResetStatusARB; + ptr_glGetnMapdvARB getnMapdvARB; + ptr_glGetnMapfvARB getnMapfvARB; + ptr_glGetnMapivARB getnMapivARB; + ptr_glGetnPixelMapfvARB getnPixelMapfvARB; + ptr_glGetnPixelMapuivARB getnPixelMapuivARB; + ptr_glGetnPixelMapusvARB getnPixelMapusvARB; + ptr_glGetnPolygonStippleARB getnPolygonStippleARB; + ptr_glGetnColorTableARB getnColorTableARB; + ptr_glGetnConvolutionFilterARB getnConvolutionFilterARB; + ptr_glGetnSeparableFilterARB getnSeparableFilterARB; + ptr_glGetnHistogramARB getnHistogramARB; + ptr_glGetnMinmaxARB getnMinmaxARB; + ptr_glGetnTexImageARB getnTexImageARB; + ptr_glReadnPixelsARB readnPixelsARB; + ptr_glGetnCompressedTexImageARB getnCompressedTexImageARB; + ptr_glGetnUniformfvARB getnUniformfvARB; + ptr_glGetnUniformivARB getnUniformivARB; + ptr_glGetnUniformuivARB getnUniformuivARB; + ptr_glGetnUniformdvARB getnUniformdvARB; + ptr_glDrawArraysInstancedBaseInstance drawArraysInstancedBaseInstance; + ptr_glDrawElementsInstancedBaseInstance drawElementsInstancedBaseInstance; + ptr_glDrawElementsInstancedBaseVertexBaseInstance drawElementsInstancedBaseVertexBaseInstance; + ptr_glDrawTransformFeedbackInstanced drawTransformFeedbackInstanced; + ptr_glDrawTransformFeedbackStreamInstanced drawTransformFeedbackStreamInstanced; + ptr_glGetInternalformativ getInternalformativ; + ptr_glGetActiveAtomicCounterBufferiv getActiveAtomicCounterBufferiv; + ptr_glBindImageTexture bindImageTexture; + ptr_glMemoryBarrier memoryBarrier; + ptr_glTexStorage1D texStorage1D; + ptr_glTexStorage2D texStorage2D; + ptr_glTexStorage3D texStorage3D; + ptr_glTextureStorage1DEXT textureStorage1DEXT; + ptr_glTextureStorage2DEXT textureStorage2DEXT; + ptr_glTextureStorage3DEXT textureStorage3DEXT; + ptr_glDebugMessageControl debugMessageControl; + ptr_glDebugMessageInsert debugMessageInsert; + ptr_glDebugMessageCallback debugMessageCallback; + ptr_glGetDebugMessageLog getDebugMessageLog; + ptr_glPushDebugGroup pushDebugGroup; + ptr_glPopDebugGroup popDebugGroup; + ptr_glObjectLabel objectLabel; + ptr_glGetObjectLabel getObjectLabel; + ptr_glObjectPtrLabel objectPtrLabel; + ptr_glGetObjectPtrLabel getObjectPtrLabel; + ptr_glClearBufferData clearBufferData; + ptr_glClearBufferSubData clearBufferSubData; + ptr_glClearNamedBufferDataEXT clearNamedBufferDataEXT; + ptr_glClearNamedBufferSubDataEXT clearNamedBufferSubDataEXT; + ptr_glDispatchCompute dispatchCompute; + ptr_glDispatchComputeIndirect dispatchComputeIndirect; + ptr_glCopyImageSubData copyImageSubData; + ptr_glFramebufferParameteri framebufferParameteri; + ptr_glGetFramebufferParameteriv getFramebufferParameteriv; + ptr_glNamedFramebufferParameteriEXT namedFramebufferParameteriEXT; + ptr_glGetNamedFramebufferParameterivEXT getNamedFramebufferParameterivEXT; + ptr_glGetInternalformati64v getInternalformati64v; + ptr_glInvalidateTexSubImage invalidateTexSubImage; + ptr_glInvalidateTexImage invalidateTexImage; + ptr_glInvalidateBufferSubData invalidateBufferSubData; + ptr_glInvalidateBufferData invalidateBufferData; + ptr_glInvalidateFramebuffer invalidateFramebuffer; + ptr_glInvalidateSubFramebuffer invalidateSubFramebuffer; + ptr_glMultiDrawArraysIndirect multiDrawArraysIndirect; + ptr_glMultiDrawElementsIndirect multiDrawElementsIndirect; + ptr_glGetProgramInterfaceiv getProgramInterfaceiv; + ptr_glGetProgramResourceIndex getProgramResourceIndex; + ptr_glGetProgramResourceName getProgramResourceName; + ptr_glGetProgramResourceiv getProgramResourceiv; + ptr_glGetProgramResourceLocation getProgramResourceLocation; + ptr_glGetProgramResourceLocationIndex getProgramResourceLocationIndex; + ptr_glShaderStorageBlockBinding shaderStorageBlockBinding; + ptr_glTexBufferRange texBufferRange; + ptr_glTextureBufferRangeEXT textureBufferRangeEXT; + ptr_glTexStorage2DMultisample texStorage2DMultisample; + ptr_glTexStorage3DMultisample texStorage3DMultisample; + ptr_glTextureStorage2DMultisampleEXT textureStorage2DMultisampleEXT; + ptr_glTextureStorage3DMultisampleEXT textureStorage3DMultisampleEXT; + ptr_glTextureView textureView; + ptr_glBindVertexBuffer bindVertexBuffer; + ptr_glVertexAttribFormat vertexAttribFormat; + ptr_glVertexAttribIFormat vertexAttribIFormat; + ptr_glVertexAttribLFormat vertexAttribLFormat; + ptr_glVertexAttribBinding vertexAttribBinding; + ptr_glVertexBindingDivisor vertexBindingDivisor; + ptr_glVertexArrayBindVertexBufferEXT vertexArrayBindVertexBufferEXT; + ptr_glVertexArrayVertexAttribFormatEXT vertexArrayVertexAttribFormatEXT; + ptr_glVertexArrayVertexAttribIFormatEXT vertexArrayVertexAttribIFormatEXT; + ptr_glVertexArrayVertexAttribLFormatEXT vertexArrayVertexAttribLFormatEXT; + ptr_glVertexArrayVertexAttribBindingEXT vertexArrayVertexAttribBindingEXT; + ptr_glVertexArrayVertexBindingDivisorEXT vertexArrayVertexBindingDivisorEXT; + + // OpenGL 4.4 + ptr_glBufferStorage BufferStorage; + ptr_glClearTexImage ClearTexImage; + ptr_glClearTexSubImage ClearTexSubImage; + ptr_glBindBuffersBase BindBuffersBase; + ptr_glBindBuffersRange BindBuffersRange; + ptr_glBindTextures BindTextures; + ptr_glBindSamplers BindSamplers; + ptr_glBindImageTextures BindImageTextures; + ptr_glBindVertexBuffers BindVertexBuffers; + + // OpenGL 4.5 + ptr_glClipControl ClipControl; + ptr_glCreateTransformFeedbacks CreateTransformFeedbacks; + ptr_glTransformFeedbackBufferBase TransformFeedbackBufferBase; + ptr_glTransformFeedbackBufferRange TransformFeedbackBufferRange; + ptr_glGetTransformFeedbackiv GetTransformFeedbackiv; + ptr_glGetTransformFeedbacki_v GetTransformFeedbacki_v; + ptr_glGetTransformFeedbacki64_v GetTransformFeedbacki64_v; + ptr_glCreateBuffers CreateBuffers; + ptr_glNamedBufferStorage NamedBufferStorage; + ptr_glNamedBufferData NamedBufferData; + ptr_glNamedBufferSubData NamedBufferSubData; + ptr_glCopyNamedBufferSubData CopyNamedBufferSubData; + ptr_glClearNamedBufferData ClearNamedBufferData; + ptr_glClearNamedBufferSubData ClearNamedBufferSubData; + ptr_glMapNamedBuffer MapNamedBuffer; + ptr_glMapNamedBufferRange MapNamedBufferRange; + ptr_glUnmapNamedBuffer UnmapNamedBuffer; + ptr_glFlushMappedNamedBufferRange FlushMappedNamedBufferRange; + ptr_glGetNamedBufferParameteriv GetNamedBufferParameteriv; + ptr_glGetNamedBufferParameteri64v GetNamedBufferParameteri64v; + ptr_glGetNamedBufferPointerv GetNamedBufferPointerv; + ptr_glGetNamedBufferSubData GetNamedBufferSubData; + ptr_glCreateFramebuffers CreateFramebuffers; + ptr_glNamedFramebufferRenderbuffer NamedFramebufferRenderbuffer; + ptr_glNamedFramebufferParameteri NamedFramebufferParameteri; + ptr_glNamedFramebufferTexture NamedFramebufferTexture; + ptr_glNamedFramebufferTextureLayer NamedFramebufferTextureLayer; + ptr_glNamedFramebufferDrawBuffer NamedFramebufferDrawBuffer; + ptr_glNamedFramebufferDrawBuffers NamedFramebufferDrawBuffers; + ptr_glNamedFramebufferReadBuffer NamedFramebufferReadBuffer; + ptr_glInvalidateNamedFramebufferData InvalidateNamedFramebufferData; + ptr_glInvalidateNamedFramebufferSubData InvalidateNamedFramebufferSubData; + ptr_glClearNamedFramebufferiv ClearNamedFramebufferiv; + ptr_glClearNamedFramebufferuiv ClearNamedFramebufferuiv; + ptr_glClearNamedFramebufferfv ClearNamedFramebufferfv; + ptr_glClearNamedFramebufferfi ClearNamedFramebufferfi; + ptr_glBlitNamedFramebuffer BlitNamedFramebuffer; + ptr_glCheckNamedFramebufferStatus CheckNamedFramebufferStatus; + ptr_glGetNamedFramebufferParameteriv GetNamedFramebufferParameteriv; + ptr_glGetNamedFramebufferAttachmentParameteriv GetNamedFramebufferAttachmentParameteriv; + ptr_glCreateRenderbuffers CreateRenderbuffers; + ptr_glNamedRenderbufferStorage NamedRenderbufferStorage; + ptr_glNamedRenderbufferStorageMultisample NamedRenderbufferStorageMultisample; + ptr_glGetNamedRenderbufferParameteriv GetNamedRenderbufferParameteriv; + ptr_glCreateTextures CreateTextures; + ptr_glTextureBuffer TextureBuffer; + ptr_glTextureBufferRange TextureBufferRange; + ptr_glTextureStorage1D TextureStorage1D; + ptr_glTextureStorage2D TextureStorage2D; + ptr_glTextureStorage3D TextureStorage3D; + ptr_glTextureStorage2DMultisample TextureStorage2DMultisample; + ptr_glTextureStorage3DMultisample TextureStorage3DMultisample; + ptr_glTextureSubImage1D TextureSubImage1D; + ptr_glTextureSubImage2D TextureSubImage2D; + ptr_glTextureSubImage3D TextureSubImage3D; + ptr_glCompressedTextureSubImage1D CompressedTextureSubImage1D; + ptr_glCompressedTextureSubImage2D CompressedTextureSubImage2D; + ptr_glCompressedTextureSubImage3D CompressedTextureSubImage3D; + ptr_glCopyTextureSubImage1D CopyTextureSubImage1D; + ptr_glCopyTextureSubImage2D CopyTextureSubImage2D; + ptr_glCopyTextureSubImage3D CopyTextureSubImage3D; + ptr_glTextureParameterf TextureParameterf; + ptr_glTextureParameterfv TextureParameterfv; + ptr_glTextureParameteri TextureParameteri; + ptr_glTextureParameterIiv TextureParameterIiv; + ptr_glTextureParameterIuiv TextureParameterIuiv; + ptr_glTextureParameteriv TextureParameteriv; + ptr_glGenerateTextureMipmap GenerateTextureMipmap; + ptr_glBindTextureUnit BindTextureUnit; + ptr_glGetTextureImage GetTextureImage; + ptr_glGetCompressedTextureImage GetCompressedTextureImage; + ptr_glGetTextureLevelParameterfv GetTextureLevelParameterfv; + ptr_glGetTextureLevelParameteriv GetTextureLevelParameteriv; + ptr_glGetTextureParameterfv GetTextureParameterfv; + ptr_glGetTextureParameterIiv GetTextureParameterIiv; + ptr_glGetTextureParameterIuiv GetTextureParameterIuiv; + ptr_glGetTextureParameteriv GetTextureParameteriv; + ptr_glCreateVertexArrays CreateVertexArrays; + ptr_glDisableVertexArrayAttrib DisableVertexArrayAttrib; + ptr_glEnableVertexArrayAttrib EnableVertexArrayAttrib; + ptr_glVertexArrayElementBuffer VertexArrayElementBuffer; + ptr_glVertexArrayVertexBuffer VertexArrayVertexBuffer; + ptr_glVertexArrayVertexBuffers VertexArrayVertexBuffers; + ptr_glVertexArrayAttribBinding VertexArrayAttribBinding; + ptr_glVertexArrayAttribFormat VertexArrayAttribFormat; + ptr_glVertexArrayAttribIFormat VertexArrayAttribIFormat; + ptr_glVertexArrayAttribLFormat VertexArrayAttribLFormat; + ptr_glVertexArrayBindingDivisor VertexArrayBindingDivisor; + ptr_glGetVertexArrayiv GetVertexArrayiv; + ptr_glGetVertexArrayIndexediv GetVertexArrayIndexediv; + ptr_glGetVertexArrayIndexed64iv GetVertexArrayIndexed64iv; + ptr_glCreateSamplers CreateSamplers; + ptr_glCreateProgramPipelines CreateProgramPipelines; + ptr_glCreateQueries CreateQueries; + ptr_glGetQueryBufferObjecti64v GetQueryBufferObjecti64v; + ptr_glGetQueryBufferObjectiv GetQueryBufferObjectiv; + ptr_glGetQueryBufferObjectui64v GetQueryBufferObjectui64v; + ptr_glGetQueryBufferObjectuiv GetQueryBufferObjectuiv; + ptr_glMemoryBarrierByRegion MemoryBarrierByRegion; + ptr_glGetTextureSubImage GetTextureSubImage; + ptr_glGetCompressedTextureSubImage GetCompressedTextureSubImage; + ptr_glGetGraphicsResetStatus GetGraphicsResetStatus; + ptr_glGetnCompressedTexImage GetnCompressedTexImage; + ptr_glGetnTexImage GetnTexImage; + ptr_glGetnUniformdv GetnUniformdv; + ptr_glGetnUniformfv GetnUniformfv; + ptr_glGetnUniformiv GetnUniformiv; + ptr_glGetnUniformuiv GetnUniformuiv; + ptr_glReadnPixels ReadnPixels; + ptr_glGetnMapdv GetnMapdv; + ptr_glGetnMapfv GetnMapfv; + ptr_glGetnMapiv GetnMapiv; + ptr_glGetnPixelMapfv GetnPixelMapfv; + ptr_glGetnPixelMapuiv GetnPixelMapuiv; + ptr_glGetnPixelMapusv GetnPixelMapusv; + ptr_glGetnPolygonStipple GetnPolygonStipple; + ptr_glGetnColorTable GetnColorTable; + ptr_glGetnConvolutionFilter GetnConvolutionFilter; + ptr_glGetnSeparableFilter GetnSeparableFilter; + ptr_glGetnHistogram GetnHistogram; + ptr_glGetnMinmax GetnMinmax; + ptr_glTextureBarrier TextureBarrier; + + // For Legacy OpenGL (For GL1 target) + ptr_glClientActiveTextureARB clientActiveTexture; + #ifdef WIN32 + ptr_wglCreatePbufferARB wglCreatePbufferARB; + ptr_wglGetPbufferDCARB wglGetPbufferDCARB; + ptr_wglReleasePbufferDCARB wglReleasePbufferDCARB; + ptr_wglDestroyPbufferARB wglDestroyPbufferARB; + ptr_wglQueryPbufferARB wglQueryPbufferARB; + #endif + + }; + + #define glCullFace clan::OpenGL::functions->cullFace + #define glFrontFace clan::OpenGL::functions->frontFace + #define glHint clan::OpenGL::functions->hint + #define glLineWidth clan::OpenGL::functions->lineWidth + #define glPointSize clan::OpenGL::functions->pointSize + #define glPolygonMode clan::OpenGL::functions->polygonMode + #define glScissor clan::OpenGL::functions->scissor + #define glTexParameterf clan::OpenGL::functions->texParameterf + #define glTexParameterfv clan::OpenGL::functions->texParameterfv + #define glTexParameteri clan::OpenGL::functions->texParameteri + #define glTexParameteriv clan::OpenGL::functions->texParameteriv + #define glTexImage1D clan::OpenGL::functions->texImage1D + #define glTexImage2D clan::OpenGL::functions->texImage2D + #define glDrawBuffer clan::OpenGL::functions->drawBuffer + #define glClear clan::OpenGL::functions->clear + #define glClearColor clan::OpenGL::functions->clearColor + #define glClearStencil clan::OpenGL::functions->clearStencil + #define glClearDepth clan::OpenGL::functions->clearDepth + #define glStencilMask clan::OpenGL::functions->stencilMask + #define glColorMask clan::OpenGL::functions->colorMask + #define glDepthMask clan::OpenGL::functions->depthMask + #define glDisable clan::OpenGL::functions->disable + #define glEnable clan::OpenGL::functions->enable + #define glFinish clan::OpenGL::functions->finish + #define glFlush clan::OpenGL::functions->flush + #define glBlendFunc clan::OpenGL::functions->blendFunc + #define glLogicOp clan::OpenGL::functions->logicOp + #define glStencilFunc clan::OpenGL::functions->stencilFunc + #define glStencilOp clan::OpenGL::functions->stencilOp + #define glDepthFunc clan::OpenGL::functions->depthFunc + #define glPixelStoref clan::OpenGL::functions->pixelStoref + #define glPixelStorei clan::OpenGL::functions->pixelStorei + #define glReadBuffer clan::OpenGL::functions->readBuffer + #define glReadPixels clan::OpenGL::functions->readPixels + #define glGetBooleanv clan::OpenGL::functions->getBooleanv + #define glGetDoublev clan::OpenGL::functions->getDoublev + #define glGetError clan::OpenGL::functions->getError + #define glGetFloatv clan::OpenGL::functions->getFloatv + #define glGetIntegerv clan::OpenGL::functions->getIntegerv + #define glGetString clan::OpenGL::functions->getString + #define glGetTexImage clan::OpenGL::functions->getTexImage + #define glGetTexParameterfv clan::OpenGL::functions->getTexParameterfv + #define glGetTexParameteriv clan::OpenGL::functions->getTexParameteriv + #define glGetTexLevelParameterfv clan::OpenGL::functions->getTexLevelParameterfv + #define glGetTexLevelParameteriv clan::OpenGL::functions->getTexLevelParameteriv + #define glIsEnabled clan::OpenGL::functions->isEnabled + #define glDepthRange clan::OpenGL::functions->depthRange + #define glViewport clan::OpenGL::functions->viewport + #define glDrawArrays clan::OpenGL::functions->drawArrays + #define glDrawElements clan::OpenGL::functions->drawElements + #define glGetPointerv clan::OpenGL::functions->getPointerv + #define glPolygonOffset clan::OpenGL::functions->polygonOffset + #define glCopyTexImage1D clan::OpenGL::functions->copyTexImage1D + #define glCopyTexImage2D clan::OpenGL::functions->copyTexImage2D + #define glCopyTexSubImage1D clan::OpenGL::functions->copyTexSubImage1D + #define glCopyTexSubImage2D clan::OpenGL::functions->copyTexSubImage2D + #define glTexSubImage1D clan::OpenGL::functions->texSubImage1D + #define glTexSubImage2D clan::OpenGL::functions->texSubImage2D + #define glBindTexture clan::OpenGL::functions->bindTexture + #define glDeleteTextures clan::OpenGL::functions->deleteTextures + #define glGenTextures clan::OpenGL::functions->genTextures + #define glIsTexture clan::OpenGL::functions->isTexture + #define glBlendColor clan::OpenGL::functions->blendColor + #define glBlendEquation clan::OpenGL::functions->blendEquation + #define glDrawRangeElements clan::OpenGL::functions->drawRangeElements + #define glTexImage3D clan::OpenGL::functions->texImage3D + #define glTexSubImage3D clan::OpenGL::functions->texSubImage3D + #define glCopyTexSubImage3D clan::OpenGL::functions->copyTexSubImage3D + #define glActiveTexture clan::OpenGL::functions->activeTexture + #define glSampleCoverage clan::OpenGL::functions->sampleCoverage + #define glCompressedTexImage3D clan::OpenGL::functions->compressedTexImage3D + #define glCompressedTexImage2D clan::OpenGL::functions->compressedTexImage2D + #define glCompressedTexImage1D clan::OpenGL::functions->compressedTexImage1D + #define glCompressedTexSubImage3D clan::OpenGL::functions->compressedTexSubImage3D + #define glCompressedTexSubImage2D clan::OpenGL::functions->compressedTexSubImage2D + #define glCompressedTexSubImage1D clan::OpenGL::functions->compressedTexSubImage1D + #define glGetCompressedTexImage clan::OpenGL::functions->getCompressedTexImage + #define glBlendFuncSeparate clan::OpenGL::functions->blendFuncSeparate + #define glMultiDrawArrays clan::OpenGL::functions->multiDrawArrays + #define glMultiDrawElements clan::OpenGL::functions->multiDrawElements + #define glPointParameterf clan::OpenGL::functions->pointParameterf + #define glPointParameterfv clan::OpenGL::functions->pointParameterfv + #define glPointParameteri clan::OpenGL::functions->pointParameteri + #define glPointParameteriv clan::OpenGL::functions->pointParameteriv + #define glGenQueries clan::OpenGL::functions->genQueries + #define glDeleteQueries clan::OpenGL::functions->deleteQueries + #define glIsQuery clan::OpenGL::functions->isQuery + #define glBeginQuery clan::OpenGL::functions->beginQuery + #define glEndQuery clan::OpenGL::functions->endQuery + #define glGetQueryiv clan::OpenGL::functions->getQueryiv + #define glGetQueryObjectiv clan::OpenGL::functions->getQueryObjectiv + #define glGetQueryObjectuiv clan::OpenGL::functions->getQueryObjectuiv + #define glBindBuffer clan::OpenGL::functions->bindBuffer + #define glDeleteBuffers clan::OpenGL::functions->deleteBuffers + #define glGenBuffers clan::OpenGL::functions->genBuffers + #define glIsBuffer clan::OpenGL::functions->isBuffer + #define glBufferData clan::OpenGL::functions->bufferData + #define glBufferSubData clan::OpenGL::functions->bufferSubData + #define glGetBufferSubData clan::OpenGL::functions->getBufferSubData + #define glMapBuffer clan::OpenGL::functions->mapBuffer + #define glUnmapBuffer clan::OpenGL::functions->unmapBuffer + #define glGetBufferParameteriv clan::OpenGL::functions->getBufferParameteriv + #define glGetBufferPointerv clan::OpenGL::functions->getBufferPointerv + #define glBlendEquationSeparate clan::OpenGL::functions->blendEquationSeparate + #define glDrawBuffers clan::OpenGL::functions->drawBuffers + #define glStencilOpSeparate clan::OpenGL::functions->stencilOpSeparate + #define glStencilFuncSeparate clan::OpenGL::functions->stencilFuncSeparate + #define glStencilMaskSeparate clan::OpenGL::functions->stencilMaskSeparate + #define glAttachShader clan::OpenGL::functions->attachShader + #define glBindAttribLocation clan::OpenGL::functions->bindAttribLocation + #define glCompileShader clan::OpenGL::functions->compileShader + #define glCreateProgram clan::OpenGL::functions->createProgram + #define glCreateShader clan::OpenGL::functions->createShader + #define glDeleteProgram clan::OpenGL::functions->deleteProgram + #define glDeleteShader clan::OpenGL::functions->deleteShader + #define glDetachShader clan::OpenGL::functions->detachShader + #define glDisableVertexAttribArray clan::OpenGL::functions->disableVertexAttribArray + #define glEnableVertexAttribArray clan::OpenGL::functions->enableVertexAttribArray + #define glGetActiveAttrib clan::OpenGL::functions->getActiveAttrib + #define glGetActiveUniform clan::OpenGL::functions->getActiveUniform + #define glGetAttachedShaders clan::OpenGL::functions->getAttachedShaders + #define glGetAttribLocation clan::OpenGL::functions->getAttribLocation + #define glGetProgramiv clan::OpenGL::functions->getProgramiv + #define glGetProgramInfoLog clan::OpenGL::functions->getProgramInfoLog + #define glGetShaderiv clan::OpenGL::functions->getShaderiv + #define glGetShaderInfoLog clan::OpenGL::functions->getShaderInfoLog + #define glGetShaderSource clan::OpenGL::functions->getShaderSource + #define glGetUniformLocation clan::OpenGL::functions->getUniformLocation + #define glGetUniformfv clan::OpenGL::functions->getUniformfv + #define glGetUniformiv clan::OpenGL::functions->getUniformiv + #define glGetVertexAttribdv clan::OpenGL::functions->getVertexAttribdv + #define glGetVertexAttribfv clan::OpenGL::functions->getVertexAttribfv + #define glGetVertexAttribiv clan::OpenGL::functions->getVertexAttribiv + #define glGetVertexAttribPointerv clan::OpenGL::functions->getVertexAttribPointerv + #define glIsProgram clan::OpenGL::functions->isProgram + #define glIsShader clan::OpenGL::functions->isShader + #define glLinkProgram clan::OpenGL::functions->linkProgram + #define glShaderSource clan::OpenGL::functions->shaderSource + #define glUseProgram clan::OpenGL::functions->useProgram + #define glUniform1f clan::OpenGL::functions->uniform1f + #define glUniform2f clan::OpenGL::functions->uniform2f + #define glUniform3f clan::OpenGL::functions->uniform3f + #define glUniform4f clan::OpenGL::functions->uniform4f + #define glUniform1i clan::OpenGL::functions->uniform1i + #define glUniform2i clan::OpenGL::functions->uniform2i + #define glUniform3i clan::OpenGL::functions->uniform3i + #define glUniform4i clan::OpenGL::functions->uniform4i + #define glUniform1fv clan::OpenGL::functions->uniform1fv + #define glUniform2fv clan::OpenGL::functions->uniform2fv + #define glUniform3fv clan::OpenGL::functions->uniform3fv + #define glUniform4fv clan::OpenGL::functions->uniform4fv + #define glUniform1iv clan::OpenGL::functions->uniform1iv + #define glUniform2iv clan::OpenGL::functions->uniform2iv + #define glUniform3iv clan::OpenGL::functions->uniform3iv + #define glUniform4iv clan::OpenGL::functions->uniform4iv + #define glUniformMatrix2fv clan::OpenGL::functions->uniformMatrix2fv + #define glUniformMatrix3fv clan::OpenGL::functions->uniformMatrix3fv + #define glUniformMatrix4fv clan::OpenGL::functions->uniformMatrix4fv + #define glValidateProgram clan::OpenGL::functions->validateProgram + #define glVertexAttrib1d clan::OpenGL::functions->vertexAttrib1d + #define glVertexAttrib1dv clan::OpenGL::functions->vertexAttrib1dv + #define glVertexAttrib1f clan::OpenGL::functions->vertexAttrib1f + #define glVertexAttrib1fv clan::OpenGL::functions->vertexAttrib1fv + #define glVertexAttrib1s clan::OpenGL::functions->vertexAttrib1s + #define glVertexAttrib1sv clan::OpenGL::functions->vertexAttrib1sv + #define glVertexAttrib2d clan::OpenGL::functions->vertexAttrib2d + #define glVertexAttrib2dv clan::OpenGL::functions->vertexAttrib2dv + #define glVertexAttrib2f clan::OpenGL::functions->vertexAttrib2f + #define glVertexAttrib2fv clan::OpenGL::functions->vertexAttrib2fv + #define glVertexAttrib2s clan::OpenGL::functions->vertexAttrib2s + #define glVertexAttrib2sv clan::OpenGL::functions->vertexAttrib2sv + #define glVertexAttrib3d clan::OpenGL::functions->vertexAttrib3d + #define glVertexAttrib3dv clan::OpenGL::functions->vertexAttrib3dv + #define glVertexAttrib3f clan::OpenGL::functions->vertexAttrib3f + #define glVertexAttrib3fv clan::OpenGL::functions->vertexAttrib3fv + #define glVertexAttrib3s clan::OpenGL::functions->vertexAttrib3s + #define glVertexAttrib3sv clan::OpenGL::functions->vertexAttrib3sv + #define glVertexAttrib4Nbv clan::OpenGL::functions->vertexAttrib4Nbv + #define glVertexAttrib4Niv clan::OpenGL::functions->vertexAttrib4Niv + #define glVertexAttrib4Nsv clan::OpenGL::functions->vertexAttrib4Nsv + #define glVertexAttrib4Nub clan::OpenGL::functions->vertexAttrib4Nub + #define glVertexAttrib4Nubv clan::OpenGL::functions->vertexAttrib4Nubv + #define glVertexAttrib4Nuiv clan::OpenGL::functions->vertexAttrib4Nuiv + #define glVertexAttrib4Nusv clan::OpenGL::functions->vertexAttrib4Nusv + #define glVertexAttrib4bv clan::OpenGL::functions->vertexAttrib4bv + #define glVertexAttrib4d clan::OpenGL::functions->vertexAttrib4d + #define glVertexAttrib4dv clan::OpenGL::functions->vertexAttrib4dv + #define glVertexAttrib4f clan::OpenGL::functions->vertexAttrib4f + #define glVertexAttrib4fv clan::OpenGL::functions->vertexAttrib4fv + #define glVertexAttrib4iv clan::OpenGL::functions->vertexAttrib4iv + #define glVertexAttrib4s clan::OpenGL::functions->vertexAttrib4s + #define glVertexAttrib4sv clan::OpenGL::functions->vertexAttrib4sv + #define glVertexAttrib4ubv clan::OpenGL::functions->vertexAttrib4ubv + #define glVertexAttrib4uiv clan::OpenGL::functions->vertexAttrib4uiv + #define glVertexAttrib4usv clan::OpenGL::functions->vertexAttrib4usv + #define glVertexAttribPointer clan::OpenGL::functions->vertexAttribPointer + #define glUniformMatrix2x3fv clan::OpenGL::functions->uniformMatrix2x3fv + #define glUniformMatrix3x2fv clan::OpenGL::functions->uniformMatrix3x2fv + #define glUniformMatrix2x4fv clan::OpenGL::functions->uniformMatrix2x4fv + #define glUniformMatrix4x2fv clan::OpenGL::functions->uniformMatrix4x2fv + #define glUniformMatrix3x4fv clan::OpenGL::functions->uniformMatrix3x4fv + #define glUniformMatrix4x3fv clan::OpenGL::functions->uniformMatrix4x3fv + #define glColorMaski clan::OpenGL::functions->colorMaski + #define glGetBooleani_v clan::OpenGL::functions->getBooleani_v + #define glGetIntegeri_v clan::OpenGL::functions->getIntegeri_v + #define glEnablei clan::OpenGL::functions->enablei + #define glDisablei clan::OpenGL::functions->disablei + #define glIsEnabledi clan::OpenGL::functions->isEnabledi + #define glBeginTransformFeedback clan::OpenGL::functions->beginTransformFeedback + #define glEndTransformFeedback clan::OpenGL::functions->endTransformFeedback + #define glBindBufferRange clan::OpenGL::functions->bindBufferRange + #define glBindBufferBase clan::OpenGL::functions->bindBufferBase + #define glTransformFeedbackVaryings clan::OpenGL::functions->transformFeedbackVaryings + #define glGetTransformFeedbackVarying clan::OpenGL::functions->getTransformFeedbackVarying + #define glClampColor clan::OpenGL::functions->clampColor + #define glBeginConditionalRender clan::OpenGL::functions->beginConditionalRender + #define glEndConditionalRender clan::OpenGL::functions->endConditionalRender + #define glVertexAttribIPointer clan::OpenGL::functions->vertexAttribIPointer + #define glGetVertexAttribIiv clan::OpenGL::functions->getVertexAttribIiv + #define glGetVertexAttribIuiv clan::OpenGL::functions->getVertexAttribIuiv + #define glVertexAttribI1i clan::OpenGL::functions->vertexAttribI1i + #define glVertexAttribI2i clan::OpenGL::functions->vertexAttribI2i + #define glVertexAttribI3i clan::OpenGL::functions->vertexAttribI3i + #define glVertexAttribI4i clan::OpenGL::functions->vertexAttribI4i + #define glVertexAttribI1ui clan::OpenGL::functions->vertexAttribI1ui + #define glVertexAttribI2ui clan::OpenGL::functions->vertexAttribI2ui + #define glVertexAttribI3ui clan::OpenGL::functions->vertexAttribI3ui + #define glVertexAttribI4ui clan::OpenGL::functions->vertexAttribI4ui + #define glVertexAttribI1iv clan::OpenGL::functions->vertexAttribI1iv + #define glVertexAttribI2iv clan::OpenGL::functions->vertexAttribI2iv + #define glVertexAttribI3iv clan::OpenGL::functions->vertexAttribI3iv + #define glVertexAttribI4iv clan::OpenGL::functions->vertexAttribI4iv + #define glVertexAttribI1uiv clan::OpenGL::functions->vertexAttribI1uiv + #define glVertexAttribI2uiv clan::OpenGL::functions->vertexAttribI2uiv + #define glVertexAttribI3uiv clan::OpenGL::functions->vertexAttribI3uiv + #define glVertexAttribI4uiv clan::OpenGL::functions->vertexAttribI4uiv + #define glVertexAttribI4bv clan::OpenGL::functions->vertexAttribI4bv + #define glVertexAttribI4sv clan::OpenGL::functions->vertexAttribI4sv + #define glVertexAttribI4ubv clan::OpenGL::functions->vertexAttribI4ubv + #define glVertexAttribI4usv clan::OpenGL::functions->vertexAttribI4usv + #define glGetUniformuiv clan::OpenGL::functions->getUniformuiv + #define glBindFragDataLocation clan::OpenGL::functions->bindFragDataLocation + #define glGetFragDataLocation clan::OpenGL::functions->getFragDataLocation + #define glUniform1ui clan::OpenGL::functions->uniform1ui + #define glUniform2ui clan::OpenGL::functions->uniform2ui + #define glUniform3ui clan::OpenGL::functions->uniform3ui + #define glUniform4ui clan::OpenGL::functions->uniform4ui + #define glUniform1uiv clan::OpenGL::functions->uniform1uiv + #define glUniform2uiv clan::OpenGL::functions->uniform2uiv + #define glUniform3uiv clan::OpenGL::functions->uniform3uiv + #define glUniform4uiv clan::OpenGL::functions->uniform4uiv + #define glTexParameterIiv clan::OpenGL::functions->texParameterIiv + #define glTexParameterIuiv clan::OpenGL::functions->texParameterIuiv + #define glGetTexParameterIiv clan::OpenGL::functions->getTexParameterIiv + #define glGetTexParameterIuiv clan::OpenGL::functions->getTexParameterIuiv + #define glClearBufferiv clan::OpenGL::functions->clearBufferiv + #define glClearBufferuiv clan::OpenGL::functions->clearBufferuiv + #define glClearBufferfv clan::OpenGL::functions->clearBufferfv + #define glClearBufferfi clan::OpenGL::functions->clearBufferfi + #define glGetStringi clan::OpenGL::functions->getStringi + #define glDrawArraysInstanced clan::OpenGL::functions->drawArraysInstanced + #define glDrawElementsInstanced clan::OpenGL::functions->drawElementsInstanced + #define glTexBuffer clan::OpenGL::functions->texBuffer + #define glPrimitiveRestartIndex clan::OpenGL::functions->primitiveRestartIndex + #define glGetInteger64i_v clan::OpenGL::functions->getInteger64i_v + #define glGetBufferParameteri64v clan::OpenGL::functions->getBufferParameteri64v + #define glFramebufferTexture clan::OpenGL::functions->framebufferTexture + #define glVertexAttribDivisor clan::OpenGL::functions->vertexAttribDivisor + #define glMinSampleShading clan::OpenGL::functions->minSampleShading + #define glBlendEquationi clan::OpenGL::functions->blendEquationi + #define glBlendEquationSeparatei clan::OpenGL::functions->blendEquationSeparatei + #define glBlendFunci clan::OpenGL::functions->blendFunci + #define glBlendFuncSeparatei clan::OpenGL::functions->blendFuncSeparatei + #define glIsRenderbuffer clan::OpenGL::functions->isRenderbuffer + #define glBindRenderbuffer clan::OpenGL::functions->bindRenderbuffer + #define glDeleteRenderbuffers clan::OpenGL::functions->deleteRenderbuffers + #define glGenRenderbuffers clan::OpenGL::functions->genRenderbuffers + #define glRenderbufferStorage clan::OpenGL::functions->renderbufferStorage + #define glGetRenderbufferParameteriv clan::OpenGL::functions->getRenderbufferParameteriv + #define glIsFramebuffer clan::OpenGL::functions->isFramebuffer + #define glBindFramebuffer clan::OpenGL::functions->bindFramebuffer + #define glDeleteFramebuffers clan::OpenGL::functions->deleteFramebuffers + #define glGenFramebuffers clan::OpenGL::functions->genFramebuffers + #define glCheckFramebufferStatus clan::OpenGL::functions->checkFramebufferStatus + #define glFramebufferTexture1D clan::OpenGL::functions->framebufferTexture1D + #define glFramebufferTexture2D clan::OpenGL::functions->framebufferTexture2D + #define glFramebufferTexture3D clan::OpenGL::functions->framebufferTexture3D + #define glFramebufferRenderbuffer clan::OpenGL::functions->framebufferRenderbuffer + #define glGetFramebufferAttachmentParameteriv clan::OpenGL::functions->getFramebufferAttachmentParameteriv + #define glGenerateMipmap clan::OpenGL::functions->generateMipmap + #define glBlitFramebuffer clan::OpenGL::functions->blitFramebuffer + #define glRenderbufferStorageMultisample clan::OpenGL::functions->renderbufferStorageMultisample + #define glFramebufferTextureLayer clan::OpenGL::functions->framebufferTextureLayer + #define glMapBufferRange clan::OpenGL::functions->mapBufferRange + #define glFlushMappedBufferRange clan::OpenGL::functions->flushMappedBufferRange + #define glBindVertexArray clan::OpenGL::functions->bindVertexArray + #define glDeleteVertexArrays clan::OpenGL::functions->deleteVertexArrays + #define glGenVertexArrays clan::OpenGL::functions->genVertexArrays + #define glIsVertexArray clan::OpenGL::functions->isVertexArray + #define glGetUniformIndices clan::OpenGL::functions->getUniformIndices + #define glGetActiveUniformsiv clan::OpenGL::functions->getActiveUniformsiv + #define glGetActiveUniformName clan::OpenGL::functions->getActiveUniformName + #define glGetUniformBlockIndex clan::OpenGL::functions->getUniformBlockIndex + #define glGetActiveUniformBlockiv clan::OpenGL::functions->getActiveUniformBlockiv + #define glGetActiveUniformBlockName clan::OpenGL::functions->getActiveUniformBlockName + #define glUniformBlockBinding clan::OpenGL::functions->uniformBlockBinding + #define glCopyBufferSubData clan::OpenGL::functions->copyBufferSubData + #define glDrawElementsBaseVertex clan::OpenGL::functions->drawElementsBaseVertex + #define glDrawRangeElementsBaseVertex clan::OpenGL::functions->drawRangeElementsBaseVertex + #define glDrawElementsInstancedBaseVertex clan::OpenGL::functions->drawElementsInstancedBaseVertex + #define glMultiDrawElementsBaseVertex clan::OpenGL::functions->multiDrawElementsBaseVertex + #define glProvokingVertex clan::OpenGL::functions->provokingVertex + #define glFenceSync clan::OpenGL::functions->fenceSync + #define glIsSync clan::OpenGL::functions->isSync + #define glDeleteSync clan::OpenGL::functions->deleteSync + #define glClientWaitSync clan::OpenGL::functions->clientWaitSync + #define glWaitSync clan::OpenGL::functions->waitSync + #define glGetInteger64v clan::OpenGL::functions->getInteger64v + #define glGetSynciv clan::OpenGL::functions->getSynciv + #define glTexImage2DMultisample clan::OpenGL::functions->texImage2DMultisample + #define glTexImage3DMultisample clan::OpenGL::functions->texImage3DMultisample + #define glGetMultisamplefv clan::OpenGL::functions->getMultisamplefv + #define glSampleMaski clan::OpenGL::functions->sampleMaski + #define glBlendEquationiARB clan::OpenGL::functions->blendEquationiARB + #define glBlendEquationSeparateiARB clan::OpenGL::functions->blendEquationSeparateiARB + #define glBlendFunciARB clan::OpenGL::functions->blendFunciARB + #define glBlendFuncSeparateiARB clan::OpenGL::functions->blendFuncSeparateiARB + #define glMinSampleShadingARB clan::OpenGL::functions->minSampleShadingARB + #define glNamedStringARB clan::OpenGL::functions->namedStringARB + #define glDeleteNamedStringARB clan::OpenGL::functions->deleteNamedStringARB + #define glCompileShaderIncludeARB clan::OpenGL::functions->compileShaderIncludeARB + #define glIsNamedStringARB clan::OpenGL::functions->isNamedStringARB + #define glGetNamedStringARB clan::OpenGL::functions->getNamedStringARB + #define glGetNamedStringivARB clan::OpenGL::functions->getNamedStringivARB + #define glBindFragDataLocationIndexed clan::OpenGL::functions->bindFragDataLocationIndexed + #define glGetFragDataIndex clan::OpenGL::functions->getFragDataIndex + #define glGenSamplers clan::OpenGL::functions->genSamplers + #define glDeleteSamplers clan::OpenGL::functions->deleteSamplers + #define glIsSampler clan::OpenGL::functions->isSampler + #define glBindSampler clan::OpenGL::functions->bindSampler + #define glSamplerParameteri clan::OpenGL::functions->samplerParameteri + #define glSamplerParameteriv clan::OpenGL::functions->samplerParameteriv + #define glSamplerParameterf clan::OpenGL::functions->samplerParameterf + #define glSamplerParameterfv clan::OpenGL::functions->samplerParameterfv + #define glSamplerParameterIiv clan::OpenGL::functions->samplerParameterIiv + #define glSamplerParameterIuiv clan::OpenGL::functions->samplerParameterIuiv + #define glGetSamplerParameteriv clan::OpenGL::functions->getSamplerParameteriv + #define glGetSamplerParameterIiv clan::OpenGL::functions->getSamplerParameterIiv + #define glGetSamplerParameterfv clan::OpenGL::functions->getSamplerParameterfv + #define glGetSamplerParameterIuiv clan::OpenGL::functions->getSamplerParameterIuiv + #define glQueryCounter clan::OpenGL::functions->queryCounter + #define glGetQueryObjecti64v clan::OpenGL::functions->getQueryObjecti64v + #define glGetQueryObjectui64v clan::OpenGL::functions->getQueryObjectui64v + #define glVertexP2ui clan::OpenGL::functions->vertexP2ui + #define glVertexP2uiv clan::OpenGL::functions->vertexP2uiv + #define glVertexP3ui clan::OpenGL::functions->vertexP3ui + #define glVertexP3uiv clan::OpenGL::functions->vertexP3uiv + #define glVertexP4ui clan::OpenGL::functions->vertexP4ui + #define glVertexP4uiv clan::OpenGL::functions->vertexP4uiv + #define glTexCoordP1ui clan::OpenGL::functions->texCoordP1ui + #define glTexCoordP1uiv clan::OpenGL::functions->texCoordP1uiv + #define glTexCoordP2ui clan::OpenGL::functions->texCoordP2ui + #define glTexCoordP2uiv clan::OpenGL::functions->texCoordP2uiv + #define glTexCoordP3ui clan::OpenGL::functions->texCoordP3ui + #define glTexCoordP3uiv clan::OpenGL::functions->texCoordP3uiv + #define glTexCoordP4ui clan::OpenGL::functions->texCoordP4ui + #define glTexCoordP4uiv clan::OpenGL::functions->texCoordP4uiv + #define glMultiTexCoordP1ui clan::OpenGL::functions->multiTexCoordP1ui + #define glMultiTexCoordP1uiv clan::OpenGL::functions->multiTexCoordP1uiv + #define glMultiTexCoordP2ui clan::OpenGL::functions->multiTexCoordP2ui + #define glMultiTexCoordP2uiv clan::OpenGL::functions->multiTexCoordP2uiv + #define glMultiTexCoordP3ui clan::OpenGL::functions->multiTexCoordP3ui + #define glMultiTexCoordP3uiv clan::OpenGL::functions->multiTexCoordP3uiv + #define glMultiTexCoordP4ui clan::OpenGL::functions->multiTexCoordP4ui + #define glMultiTexCoordP4uiv clan::OpenGL::functions->multiTexCoordP4uiv + #define glNormalP3ui clan::OpenGL::functions->normalP3ui + #define glNormalP3uiv clan::OpenGL::functions->normalP3uiv + #define glColorP3ui clan::OpenGL::functions->colorP3ui + #define glColorP3uiv clan::OpenGL::functions->colorP3uiv + #define glColorP4ui clan::OpenGL::functions->colorP4ui + #define glColorP4uiv clan::OpenGL::functions->colorP4uiv + #define glSecondaryColorP3ui clan::OpenGL::functions->secondaryColorP3ui + #define glSecondaryColorP3uiv clan::OpenGL::functions->secondaryColorP3uiv + #define glVertexAttribP1ui clan::OpenGL::functions->vertexAttribP1ui + #define glVertexAttribP1uiv clan::OpenGL::functions->vertexAttribP1uiv + #define glVertexAttribP2ui clan::OpenGL::functions->vertexAttribP2ui + #define glVertexAttribP2uiv clan::OpenGL::functions->vertexAttribP2uiv + #define glVertexAttribP3ui clan::OpenGL::functions->vertexAttribP3ui + #define glVertexAttribP3uiv clan::OpenGL::functions->vertexAttribP3uiv + #define glVertexAttribP4ui clan::OpenGL::functions->vertexAttribP4ui + #define glVertexAttribP4uiv clan::OpenGL::functions->vertexAttribP4uiv + #define glDrawArraysIndirect clan::OpenGL::functions->drawArraysIndirect + #define glDrawElementsIndirect clan::OpenGL::functions->drawElementsIndirect + #define glUniform1d clan::OpenGL::functions->uniform1d + #define glUniform2d clan::OpenGL::functions->uniform2d + #define glUniform3d clan::OpenGL::functions->uniform3d + #define glUniform4d clan::OpenGL::functions->uniform4d + #define glUniform1dv clan::OpenGL::functions->uniform1dv + #define glUniform2dv clan::OpenGL::functions->uniform2dv + #define glUniform3dv clan::OpenGL::functions->uniform3dv + #define glUniform4dv clan::OpenGL::functions->uniform4dv + #define glUniformMatrix2dv clan::OpenGL::functions->uniformMatrix2dv + #define glUniformMatrix3dv clan::OpenGL::functions->uniformMatrix3dv + #define glUniformMatrix4dv clan::OpenGL::functions->uniformMatrix4dv + #define glUniformMatrix2x3dv clan::OpenGL::functions->uniformMatrix2x3dv + #define glUniformMatrix2x4dv clan::OpenGL::functions->uniformMatrix2x4dv + #define glUniformMatrix3x2dv clan::OpenGL::functions->uniformMatrix3x2dv + #define glUniformMatrix3x4dv clan::OpenGL::functions->uniformMatrix3x4dv + #define glUniformMatrix4x2dv clan::OpenGL::functions->uniformMatrix4x2dv + #define glUniformMatrix4x3dv clan::OpenGL::functions->uniformMatrix4x3dv + #define glGetUniformdv clan::OpenGL::functions->getUniformdv + #define glGetSubroutineUniformLocation clan::OpenGL::functions->getSubroutineUniformLocation + #define glGetSubroutineIndex clan::OpenGL::functions->getSubroutineIndex + #define glGetActiveSubroutineUniformiv clan::OpenGL::functions->getActiveSubroutineUniformiv + #define glGetActiveSubroutineUniformName clan::OpenGL::functions->getActiveSubroutineUniformName + #define glGetActiveSubroutineName clan::OpenGL::functions->getActiveSubroutineName + #define glUniformSubroutinesuiv clan::OpenGL::functions->uniformSubroutinesuiv + #define glGetUniformSubroutineuiv clan::OpenGL::functions->getUniformSubroutineuiv + #define glGetProgramStageiv clan::OpenGL::functions->getProgramStageiv + #define glPatchParameteri clan::OpenGL::functions->patchParameteri + #define glPatchParameterfv clan::OpenGL::functions->patchParameterfv + #define glBindTransformFeedback clan::OpenGL::functions->bindTransformFeedback + #define glDeleteTransformFeedbacks clan::OpenGL::functions->deleteTransformFeedbacks + #define glGenTransformFeedbacks clan::OpenGL::functions->genTransformFeedbacks + #define glIsTransformFeedback clan::OpenGL::functions->isTransformFeedback + #define glPauseTransformFeedback clan::OpenGL::functions->pauseTransformFeedback + #define glResumeTransformFeedback clan::OpenGL::functions->resumeTransformFeedback + #define glDrawTransformFeedback clan::OpenGL::functions->drawTransformFeedback + #define glDrawTransformFeedbackStream clan::OpenGL::functions->drawTransformFeedbackStream + #define glBeginQueryIndexed clan::OpenGL::functions->beginQueryIndexed + #define glEndQueryIndexed clan::OpenGL::functions->endQueryIndexed + #define glGetQueryIndexediv clan::OpenGL::functions->getQueryIndexediv + #define glReleaseShaderCompiler clan::OpenGL::functions->releaseShaderCompiler + #define glShaderBinary clan::OpenGL::functions->shaderBinary + #define glGetShaderPrecisionFormat clan::OpenGL::functions->getShaderPrecisionFormat + #define glDepthRangef clan::OpenGL::functions->depthRangef + #define glClearDepthf clan::OpenGL::functions->clearDepthf + #define glGetProgramBinary clan::OpenGL::functions->getProgramBinary + #define glProgramBinary clan::OpenGL::functions->programBinary + #define glProgramParameteri clan::OpenGL::functions->programParameteri + #define glUseProgramStages clan::OpenGL::functions->useProgramStages + #define glActiveShaderProgram clan::OpenGL::functions->activeShaderProgram + #define glCreateShaderProgramv clan::OpenGL::functions->createShaderProgramv + #define glBindProgramPipeline clan::OpenGL::functions->bindProgramPipeline + #define glDeleteProgramPipelines clan::OpenGL::functions->deleteProgramPipelines + #define glGenProgramPipelines clan::OpenGL::functions->genProgramPipelines + #define glIsProgramPipeline clan::OpenGL::functions->isProgramPipeline + #define glGetProgramPipelineiv clan::OpenGL::functions->getProgramPipelineiv + #define glProgramUniform1i clan::OpenGL::functions->programUniform1i + #define glProgramUniform1iv clan::OpenGL::functions->programUniform1iv + #define glProgramUniform1f clan::OpenGL::functions->programUniform1f + #define glProgramUniform1fv clan::OpenGL::functions->programUniform1fv + #define glProgramUniform1d clan::OpenGL::functions->programUniform1d + #define glProgramUniform1dv clan::OpenGL::functions->programUniform1dv + #define glProgramUniform1ui clan::OpenGL::functions->programUniform1ui + #define glProgramUniform1uiv clan::OpenGL::functions->programUniform1uiv + #define glProgramUniform2i clan::OpenGL::functions->programUniform2i + #define glProgramUniform2iv clan::OpenGL::functions->programUniform2iv + #define glProgramUniform2f clan::OpenGL::functions->programUniform2f + #define glProgramUniform2fv clan::OpenGL::functions->programUniform2fv + #define glProgramUniform2d clan::OpenGL::functions->programUniform2d + #define glProgramUniform2dv clan::OpenGL::functions->programUniform2dv + #define glProgramUniform2ui clan::OpenGL::functions->programUniform2ui + #define glProgramUniform2uiv clan::OpenGL::functions->programUniform2uiv + #define glProgramUniform3i clan::OpenGL::functions->programUniform3i + #define glProgramUniform3iv clan::OpenGL::functions->programUniform3iv + #define glProgramUniform3f clan::OpenGL::functions->programUniform3f + #define glProgramUniform3fv clan::OpenGL::functions->programUniform3fv + #define glProgramUniform3d clan::OpenGL::functions->programUniform3d + #define glProgramUniform3dv clan::OpenGL::functions->programUniform3dv + #define glProgramUniform3ui clan::OpenGL::functions->programUniform3ui + #define glProgramUniform3uiv clan::OpenGL::functions->programUniform3uiv + #define glProgramUniform4i clan::OpenGL::functions->programUniform4i + #define glProgramUniform4iv clan::OpenGL::functions->programUniform4iv + #define glProgramUniform4f clan::OpenGL::functions->programUniform4f + #define glProgramUniform4fv clan::OpenGL::functions->programUniform4fv + #define glProgramUniform4d clan::OpenGL::functions->programUniform4d + #define glProgramUniform4dv clan::OpenGL::functions->programUniform4dv + #define glProgramUniform4ui clan::OpenGL::functions->programUniform4ui + #define glProgramUniform4uiv clan::OpenGL::functions->programUniform4uiv + #define glProgramUniformMatrix2fv clan::OpenGL::functions->programUniformMatrix2fv + #define glProgramUniformMatrix3fv clan::OpenGL::functions->programUniformMatrix3fv + #define glProgramUniformMatrix4fv clan::OpenGL::functions->programUniformMatrix4fv + #define glProgramUniformMatrix2dv clan::OpenGL::functions->programUniformMatrix2dv + #define glProgramUniformMatrix3dv clan::OpenGL::functions->programUniformMatrix3dv + #define glProgramUniformMatrix4dv clan::OpenGL::functions->programUniformMatrix4dv + #define glProgramUniformMatrix2x3fv clan::OpenGL::functions->programUniformMatrix2x3fv + #define glProgramUniformMatrix3x2fv clan::OpenGL::functions->programUniformMatrix3x2fv + #define glProgramUniformMatrix2x4fv clan::OpenGL::functions->programUniformMatrix2x4fv + #define glProgramUniformMatrix4x2fv clan::OpenGL::functions->programUniformMatrix4x2fv + #define glProgramUniformMatrix3x4fv clan::OpenGL::functions->programUniformMatrix3x4fv + #define glProgramUniformMatrix4x3fv clan::OpenGL::functions->programUniformMatrix4x3fv + #define glProgramUniformMatrix2x3dv clan::OpenGL::functions->programUniformMatrix2x3dv + #define glProgramUniformMatrix3x2dv clan::OpenGL::functions->programUniformMatrix3x2dv + #define glProgramUniformMatrix2x4dv clan::OpenGL::functions->programUniformMatrix2x4dv + #define glProgramUniformMatrix4x2dv clan::OpenGL::functions->programUniformMatrix4x2dv + #define glProgramUniformMatrix3x4dv clan::OpenGL::functions->programUniformMatrix3x4dv + #define glProgramUniformMatrix4x3dv clan::OpenGL::functions->programUniformMatrix4x3dv + #define glValidateProgramPipeline clan::OpenGL::functions->validateProgramPipeline + #define glGetProgramPipelineInfoLog clan::OpenGL::functions->getProgramPipelineInfoLog + #define glVertexAttribL1d clan::OpenGL::functions->vertexAttribL1d + #define glVertexAttribL2d clan::OpenGL::functions->vertexAttribL2d + #define glVertexAttribL3d clan::OpenGL::functions->vertexAttribL3d + #define glVertexAttribL4d clan::OpenGL::functions->vertexAttribL4d + #define glVertexAttribL1dv clan::OpenGL::functions->vertexAttribL1dv + #define glVertexAttribL2dv clan::OpenGL::functions->vertexAttribL2dv + #define glVertexAttribL3dv clan::OpenGL::functions->vertexAttribL3dv + #define glVertexAttribL4dv clan::OpenGL::functions->vertexAttribL4dv + #define glVertexAttribLPointer clan::OpenGL::functions->vertexAttribLPointer + #define glGetVertexAttribLdv clan::OpenGL::functions->getVertexAttribLdv + #define glViewportArrayv clan::OpenGL::functions->viewportArrayv + #define glViewportIndexedf clan::OpenGL::functions->viewportIndexedf + #define glViewportIndexedfv clan::OpenGL::functions->viewportIndexedfv + #define glScissorArrayv clan::OpenGL::functions->scissorArrayv + #define glScissorIndexed clan::OpenGL::functions->scissorIndexed + #define glScissorIndexedv clan::OpenGL::functions->scissorIndexedv + #define glDepthRangeArrayv clan::OpenGL::functions->depthRangeArrayv + #define glDepthRangeIndexed clan::OpenGL::functions->depthRangeIndexed + #define glGetFloati_v clan::OpenGL::functions->getFloati_v + #define glGetDoublei_v clan::OpenGL::functions->getDoublei_v + #define glCreateSyncFromCLeventARB clan::OpenGL::functions->createSyncFromCLeventARB + #define glDebugMessageControlARB clan::OpenGL::functions->debugMessageControlARB + #define glDebugMessageInsertARB clan::OpenGL::functions->debugMessageInsertARB + #define glDebugMessageCallbackARB clan::OpenGL::functions->debugMessageCallbackARB + #define glGetDebugMessageLogARB clan::OpenGL::functions->getDebugMessageLogARB + #define glGetGraphicsResetStatusARB clan::OpenGL::functions->getGraphicsResetStatusARB + #define glGetnMapdvARB clan::OpenGL::functions->getnMapdvARB + #define glGetnMapfvARB clan::OpenGL::functions->getnMapfvARB + #define glGetnMapivARB clan::OpenGL::functions->getnMapivARB + #define glGetnPixelMapfvARB clan::OpenGL::functions->getnPixelMapfvARB + #define glGetnPixelMapuivARB clan::OpenGL::functions->getnPixelMapuivARB + #define glGetnPixelMapusvARB clan::OpenGL::functions->getnPixelMapusvARB + #define glGetnPolygonStippleARB clan::OpenGL::functions->getnPolygonStippleARB + #define glGetnColorTableARB clan::OpenGL::functions->getnColorTableARB + #define glGetnConvolutionFilterARB clan::OpenGL::functions->getnConvolutionFilterARB + #define glGetnSeparableFilterARB clan::OpenGL::functions->getnSeparableFilterARB + #define glGetnHistogramARB clan::OpenGL::functions->getnHistogramARB + #define glGetnMinmaxARB clan::OpenGL::functions->getnMinmaxARB + #define glGetnTexImageARB clan::OpenGL::functions->getnTexImageARB + #define glReadnPixelsARB clan::OpenGL::functions->readnPixelsARB + #define glGetnCompressedTexImageARB clan::OpenGL::functions->getnCompressedTexImageARB + #define glGetnUniformfvARB clan::OpenGL::functions->getnUniformfvARB + #define glGetnUniformivARB clan::OpenGL::functions->getnUniformivARB + #define glGetnUniformuivARB clan::OpenGL::functions->getnUniformuivARB + #define glGetnUniformdvARB clan::OpenGL::functions->getnUniformdvARB + #define glDrawArraysInstancedBaseInstance clan::OpenGL::functions->drawArraysInstancedBaseInstance + #define glDrawElementsInstancedBaseInstance clan::OpenGL::functions->drawElementsInstancedBaseInstance + #define glDrawElementsInstancedBaseVertexBaseInstance clan::OpenGL::functions->drawElementsInstancedBaseVertexBaseInstance + #define glDrawTransformFeedbackInstanced clan::OpenGL::functions->drawTransformFeedbackInstanced + #define glDrawTransformFeedbackStreamInstanced clan::OpenGL::functions->drawTransformFeedbackStreamInstanced + #define glGetInternalformativ clan::OpenGL::functions->getInternalformativ + #define glGetActiveAtomicCounterBufferiv clan::OpenGL::functions->getActiveAtomicCounterBufferiv + #define glBindImageTexture clan::OpenGL::functions->bindImageTexture + #define glMemoryBarrier clan::OpenGL::functions->memoryBarrier + #define glTexStorage1D clan::OpenGL::functions->texStorage1D + #define glTexStorage2D clan::OpenGL::functions->texStorage2D + #define glTexStorage3D clan::OpenGL::functions->texStorage3D + #define glTextureStorage1DEXT clan::OpenGL::functions->textureStorage1DEXT + #define glTextureStorage2DEXT clan::OpenGL::functions->textureStorage2DEXT + #define glTextureStorage3DEXT clan::OpenGL::functions->textureStorage3DEXT + #define glDebugMessageControl clan::OpenGL::functions->debugMessageControl + #define glDebugMessageInsert clan::OpenGL::functions->debugMessageInsert + #define glDebugMessageCallback clan::OpenGL::functions->debugMessageCallback + #define glGetDebugMessageLog clan::OpenGL::functions->getDebugMessageLog + #define glPushDebugGroup clan::OpenGL::functions->pushDebugGroup + #define glPopDebugGroup clan::OpenGL::functions->popDebugGroup + #define glObjectLabel clan::OpenGL::functions->objectLabel + #define glGetObjectLabel clan::OpenGL::functions->getObjectLabel + #define glObjectPtrLabel clan::OpenGL::functions->objectPtrLabel + #define glGetObjectPtrLabel clan::OpenGL::functions->getObjectPtrLabel + #define glClearBufferData clan::OpenGL::functions->clearBufferData + #define glClearBufferSubData clan::OpenGL::functions->clearBufferSubData + #define glClearNamedBufferDataEXT clan::OpenGL::functions->clearNamedBufferDataEXT + #define glClearNamedBufferSubDataEXT clan::OpenGL::functions->clearNamedBufferSubDataEXT + #define glDispatchCompute clan::OpenGL::functions->dispatchCompute + #define glDispatchComputeIndirect clan::OpenGL::functions->dispatchComputeIndirect + #define glCopyImageSubData clan::OpenGL::functions->copyImageSubData + #define glFramebufferParameteri clan::OpenGL::functions->framebufferParameteri + #define glGetFramebufferParameteriv clan::OpenGL::functions->getFramebufferParameteriv + #define glNamedFramebufferParameteriEXT clan::OpenGL::functions->namedFramebufferParameteriEXT + #define glGetNamedFramebufferParameterivEXT clan::OpenGL::functions->getNamedFramebufferParameterivEXT + #define glGetInternalformati64v clan::OpenGL::functions->getInternalformati64v + #define glInvalidateTexSubImage clan::OpenGL::functions->invalidateTexSubImage + #define glInvalidateTexImage clan::OpenGL::functions->invalidateTexImage + #define glInvalidateBufferSubData clan::OpenGL::functions->invalidateBufferSubData + #define glInvalidateBufferData clan::OpenGL::functions->invalidateBufferData + #define glInvalidateFramebuffer clan::OpenGL::functions->invalidateFramebuffer + #define glInvalidateSubFramebuffer clan::OpenGL::functions->invalidateSubFramebuffer + #define glMultiDrawArraysIndirect clan::OpenGL::functions->multiDrawArraysIndirect + #define glMultiDrawElementsIndirect clan::OpenGL::functions->multiDrawElementsIndirect + #define glGetProgramInterfaceiv clan::OpenGL::functions->getProgramInterfaceiv + #define glGetProgramResourceIndex clan::OpenGL::functions->getProgramResourceIndex + #define glGetProgramResourceName clan::OpenGL::functions->getProgramResourceName + #define glGetProgramResourceiv clan::OpenGL::functions->getProgramResourceiv + #define glGetProgramResourceLocation clan::OpenGL::functions->getProgramResourceLocation + #define glGetProgramResourceLocationIndex clan::OpenGL::functions->getProgramResourceLocationIndex + #define glShaderStorageBlockBinding clan::OpenGL::functions->shaderStorageBlockBinding + #define glTexBufferRange clan::OpenGL::functions->texBufferRange + #define glTextureBufferRangeEXT clan::OpenGL::functions->textureBufferRangeEXT + #define glTexStorage2DMultisample clan::OpenGL::functions->texStorage2DMultisample + #define glTexStorage3DMultisample clan::OpenGL::functions->texStorage3DMultisample + #define glTextureStorage2DMultisampleEXT clan::OpenGL::functions->textureStorage2DMultisampleEXT + #define glTextureStorage3DMultisampleEXT clan::OpenGL::functions->textureStorage3DMultisampleEXT + #define glTextureView clan::OpenGL::functions->textureView + #define glBindVertexBuffer clan::OpenGL::functions->bindVertexBuffer + #define glVertexAttribFormat clan::OpenGL::functions->vertexAttribFormat + #define glVertexAttribIFormat clan::OpenGL::functions->vertexAttribIFormat + #define glVertexAttribLFormat clan::OpenGL::functions->vertexAttribLFormat + #define glVertexAttribBinding clan::OpenGL::functions->vertexAttribBinding + #define glVertexBindingDivisor clan::OpenGL::functions->vertexBindingDivisor + #define glVertexArrayBindVertexBufferEXT clan::OpenGL::functions->vertexArrayBindVertexBufferEXT + #define glVertexArrayVertexAttribFormatEXT clan::OpenGL::functions->vertexArrayVertexAttribFormatEXT + #define glVertexArrayVertexAttribIFormatEXT clan::OpenGL::functions->vertexArrayVertexAttribIFormatEXT + #define glVertexArrayVertexAttribLFormatEXT clan::OpenGL::functions->vertexArrayVertexAttribLFormatEXT + #define glVertexArrayVertexAttribBindingEXT clan::OpenGL::functions->vertexArrayVertexAttribBindingEXT + #define glVertexArrayVertexBindingDivisorEXT clan::OpenGL::functions->vertexArrayVertexBindingDivisorEXT + + // OpenGL 4.4 + #define glBufferStorage clan::OpenGL::functions->BufferStorage + #define glClearTexImage clan::OpenGL::functions->ClearTexImage + #define glClearTexSubImage clan::OpenGL::functions->ClearTexSubImage + #define glBindBuffersBase clan::OpenGL::functions->BindBuffersBase + #define glBindBuffersRange clan::OpenGL::functions->BindBuffersRange + #define glBindTextures clan::OpenGL::functions->BindTextures + #define glBindSamplers clan::OpenGL::functions->BindSamplers + #define glBindImageTextures clan::OpenGL::functions->BindImageTextures + #define glBindVertexBuffers clan::OpenGL::functions->BindVertexBuffers + + // OpenGL 4.5 + #define glClipControl clan::OpenGL::functions->ClipControl + #define glCreateTransformFeedbacks clan::OpenGL::functions->CreateTransformFeedbacks + #define glTransformFeedbackBufferBase clan::OpenGL::functions->TransformFeedbackBufferBase + #define glTransformFeedbackBufferRange clan::OpenGL::functions->TransformFeedbackBufferRange + #define glGetTransformFeedbackiv clan::OpenGL::functions->GetTransformFeedbackiv + #define glGetTransformFeedbacki_v clan::OpenGL::functions->GetTransformFeedbacki_v + #define glGetTransformFeedbacki64_v clan::OpenGL::functions->GetTransformFeedbacki64_v + #define glCreateBuffers clan::OpenGL::functions->CreateBuffers + #define glNamedBufferStorage clan::OpenGL::functions->NamedBufferStorage + #define glNamedBufferData clan::OpenGL::functions->NamedBufferData + #define glNamedBufferSubData clan::OpenGL::functions->NamedBufferSubData + #define glCopyNamedBufferSubData clan::OpenGL::functions->CopyNamedBufferSubData + #define glClearNamedBufferData clan::OpenGL::functions->ClearNamedBufferData + #define glClearNamedBufferSubData clan::OpenGL::functions->ClearNamedBufferSubData + #define glMapNamedBuffer clan::OpenGL::functions->MapNamedBuffer + #define glMapNamedBufferRange clan::OpenGL::functions->MapNamedBufferRange + #define glUnmapNamedBuffer clan::OpenGL::functions->UnmapNamedBuffer + #define glFlushMappedNamedBufferRange clan::OpenGL::functions->FlushMappedNamedBufferRange + #define glGetNamedBufferParameteriv clan::OpenGL::functions->GetNamedBufferParameteriv + #define glGetNamedBufferParameteri64v clan::OpenGL::functions->GetNamedBufferParameteri64v + #define glGetNamedBufferPointerv clan::OpenGL::functions->GetNamedBufferPointerv + #define glGetNamedBufferSubData clan::OpenGL::functions->GetNamedBufferSubData + #define glCreateFramebuffers clan::OpenGL::functions->CreateFramebuffers + #define glNamedFramebufferRenderbuffer clan::OpenGL::functions->NamedFramebufferRenderbuffer + #define glNamedFramebufferParameteri clan::OpenGL::functions->NamedFramebufferParameteri + #define glNamedFramebufferTexture clan::OpenGL::functions->NamedFramebufferTexture + #define glNamedFramebufferTextureLayer clan::OpenGL::functions->NamedFramebufferTextureLayer + #define glNamedFramebufferDrawBuffer clan::OpenGL::functions->NamedFramebufferDrawBuffer + #define glNamedFramebufferDrawBuffers clan::OpenGL::functions->NamedFramebufferDrawBuffers + #define glNamedFramebufferReadBuffer clan::OpenGL::functions->NamedFramebufferReadBuffer + #define glInvalidateNamedFramebufferData clan::OpenGL::functions->InvalidateNamedFramebufferData + #define glInvalidateNamedFramebufferSubData clan::OpenGL::functions->InvalidateNamedFramebufferSubData + #define glClearNamedFramebufferiv clan::OpenGL::functions->ClearNamedFramebufferiv + #define glClearNamedFramebufferuiv clan::OpenGL::functions->ClearNamedFramebufferuiv + #define glClearNamedFramebufferfv clan::OpenGL::functions->ClearNamedFramebufferfv + #define glClearNamedFramebufferfi clan::OpenGL::functions->ClearNamedFramebufferfi + #define glBlitNamedFramebuffer clan::OpenGL::functions->BlitNamedFramebuffer + #define glCheckNamedFramebufferStatus clan::OpenGL::functions->CheckNamedFramebufferStatus + #define glGetNamedFramebufferParameteriv clan::OpenGL::functions->GetNamedFramebufferParameteriv + #define glGetNamedFramebufferAttachmentParameteriv clan::OpenGL::functions->GetNamedFramebufferAttachmentParameteriv + #define glCreateRenderbuffers clan::OpenGL::functions->CreateRenderbuffers + #define glNamedRenderbufferStorage clan::OpenGL::functions->NamedRenderbufferStorage + #define glNamedRenderbufferStorageMultisample clan::OpenGL::functions->NamedRenderbufferStorageMultisample + #define glGetNamedRenderbufferParameteriv clan::OpenGL::functions->GetNamedRenderbufferParameteriv + #define glCreateTextures clan::OpenGL::functions->CreateTextures + #define glTextureBuffer clan::OpenGL::functions->TextureBuffer + #define glTextureBufferRange clan::OpenGL::functions->TextureBufferRange + #define glTextureStorage1D clan::OpenGL::functions->TextureStorage1D + #define glTextureStorage2D clan::OpenGL::functions->TextureStorage2D + #define glTextureStorage3D clan::OpenGL::functions->TextureStorage3D + #define glTextureStorage2DMultisample clan::OpenGL::functions->TextureStorage2DMultisample + #define glTextureStorage3DMultisample clan::OpenGL::functions->TextureStorage3DMultisample + #define glTextureSubImage1D clan::OpenGL::functions->TextureSubImage1D + #define glTextureSubImage2D clan::OpenGL::functions->TextureSubImage2D + #define glTextureSubImage3D clan::OpenGL::functions->TextureSubImage3D + #define glCompressedTextureSubImage1D clan::OpenGL::functions->CompressedTextureSubImage1D + #define glCompressedTextureSubImage2D clan::OpenGL::functions->CompressedTextureSubImage2D + #define glCompressedTextureSubImage3D clan::OpenGL::functions->CompressedTextureSubImage3D + #define glCopyTextureSubImage1D clan::OpenGL::functions->CopyTextureSubImage1D + #define glCopyTextureSubImage2D clan::OpenGL::functions->CopyTextureSubImage2D + #define glCopyTextureSubImage3D clan::OpenGL::functions->CopyTextureSubImage3D + #define glTextureParameterf clan::OpenGL::functions->TextureParameterf + #define glTextureParameterfv clan::OpenGL::functions->TextureParameterfv + #define glTextureParameteri clan::OpenGL::functions->TextureParameteri + #define glTextureParameterIiv clan::OpenGL::functions->TextureParameterIiv + #define glTextureParameterIuiv clan::OpenGL::functions->TextureParameterIuiv + #define glTextureParameteriv clan::OpenGL::functions->TextureParameteriv + #define glGenerateTextureMipmap clan::OpenGL::functions->GenerateTextureMipmap + #define glBindTextureUnit clan::OpenGL::functions->BindTextureUnit + #define glGetTextureImage clan::OpenGL::functions->GetTextureImage + #define glGetCompressedTextureImage clan::OpenGL::functions->GetCompressedTextureImage + #define glGetTextureLevelParameterfv clan::OpenGL::functions->GetTextureLevelParameterfv + #define glGetTextureLevelParameteriv clan::OpenGL::functions->GetTextureLevelParameteriv + #define glGetTextureParameterfv clan::OpenGL::functions->GetTextureParameterfv + #define glGetTextureParameterIiv clan::OpenGL::functions->GetTextureParameterIiv + #define glGetTextureParameterIuiv clan::OpenGL::functions->GetTextureParameterIuiv + #define glGetTextureParameteriv clan::OpenGL::functions->GetTextureParameteriv + #define glCreateVertexArrays clan::OpenGL::functions->CreateVertexArrays + #define glDisableVertexArrayAttrib clan::OpenGL::functions->DisableVertexArrayAttrib + #define glEnableVertexArrayAttrib clan::OpenGL::functions->EnableVertexArrayAttrib + #define glVertexArrayElementBuffer clan::OpenGL::functions->VertexArrayElementBuffer + #define glVertexArrayVertexBuffer clan::OpenGL::functions->VertexArrayVertexBuffer + #define glVertexArrayVertexBuffers clan::OpenGL::functions->VertexArrayVertexBuffers + #define glVertexArrayAttribBinding clan::OpenGL::functions->VertexArrayAttribBinding + #define glVertexArrayAttribFormat clan::OpenGL::functions->VertexArrayAttribFormat + #define glVertexArrayAttribIFormat clan::OpenGL::functions->VertexArrayAttribIFormat + #define glVertexArrayAttribLFormat clan::OpenGL::functions->VertexArrayAttribLFormat + #define glVertexArrayBindingDivisor clan::OpenGL::functions->VertexArrayBindingDivisor + #define glGetVertexArrayiv clan::OpenGL::functions->GetVertexArrayiv + #define glGetVertexArrayIndexediv clan::OpenGL::functions->GetVertexArrayIndexediv + #define glGetVertexArrayIndexed64iv clan::OpenGL::functions->GetVertexArrayIndexed64iv + #define glCreateSamplers clan::OpenGL::functions->CreateSamplers + #define glCreateProgramPipelines clan::OpenGL::functions->CreateProgramPipelines + #define glCreateQueries clan::OpenGL::functions->CreateQueries + #define glGetQueryBufferObjecti64v clan::OpenGL::functions->GetQueryBufferObjecti64v + #define glGetQueryBufferObjectiv clan::OpenGL::functions->GetQueryBufferObjectiv + #define glGetQueryBufferObjectui64v clan::OpenGL::functions->GetQueryBufferObjectui64v + #define glGetQueryBufferObjectuiv clan::OpenGL::functions->GetQueryBufferObjectuiv + #define glMemoryBarrierByRegion clan::OpenGL::functions->MemoryBarrierByRegion + #define glGetTextureSubImage clan::OpenGL::functions->GetTextureSubImage + #define glGetCompressedTextureSubImage clan::OpenGL::functions->GetCompressedTextureSubImage + #define glGetGraphicsResetStatus clan::OpenGL::functions->GetGraphicsResetStatus + #define glGetnCompressedTexImage clan::OpenGL::functions->GetnCompressedTexImage + #define glGetnTexImage clan::OpenGL::functions->GetnTexImage + #define glGetnUniformdv clan::OpenGL::functions->GetnUniformdv + #define glGetnUniformfv clan::OpenGL::functions->GetnUniformfv + #define glGetnUniformiv clan::OpenGL::functions->GetnUniformiv + #define glGetnUniformuiv clan::OpenGL::functions->GetnUniformuiv + #define glReadnPixels clan::OpenGL::functions->ReadnPixels + #define glGetnMapdv clan::OpenGL::functions->GetnMapdv + #define glGetnMapfv clan::OpenGL::functions->GetnMapfv + #define glGetnMapiv clan::OpenGL::functions->GetnMapiv + #define glGetnPixelMapfv clan::OpenGL::functions->GetnPixelMapfv + #define glGetnPixelMapuiv clan::OpenGL::functions->GetnPixelMapuiv + #define glGetnPixelMapusv clan::OpenGL::functions->GetnPixelMapusv + #define glGetnPolygonStipple clan::OpenGL::functions->GetnPolygonStipple + #define glGetnColorTable clan::OpenGL::functions->GetnColorTable + #define glGetnConvolutionFilter clan::OpenGL::functions->GetnConvolutionFilter + #define glGetnSeparableFilter clan::OpenGL::functions->GetnSeparableFilter + #define glGetnHistogram clan::OpenGL::functions->GetnHistogram + #define glGetnMinmax clan::OpenGL::functions->GetnMinmax + #define glTextureBarrier clan::OpenGL::functions->TextureBarrier + + // For Legacy OpenGL (For GL1 target) + #define glClientActiveTexture clan::OpenGL::functions->clientActiveTexture + #ifdef WIN32 + #define glWglCreatePbufferARB clan::OpenGL::functions->wglCreatePbufferARB + #define glWglGetPbufferDCARB clan::OpenGL::functions->wglGetPbufferDCARB + #define glWglReleasePbufferDCARB clan::OpenGL::functions->wglReleasePbufferDCARB + #define glWglDestroyPbufferARB clan::OpenGL::functions->wglDestroyPbufferARB + #define glWglQueryPbufferARB clan::OpenGL::functions->wglQueryPbufferARB + #endif + /// \} + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/client.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/client.h new file mode 100644 index 0000000..cf066aa --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/client.h @@ -0,0 +1,91 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + + +#pragma once + +#include "connection_site.h" // TODO: Remove +#include "../../Core/Signals/signal.h" + +namespace clan +{ + /// \addtogroup clanNetwork_NetGame clanNetwork NetGame + /// \{ + + class NetGameEvent; + class NetGameConnection; + class NetGameClient_Impl; + + /// \brief NetGameClient + class NetGameClient : NetGameConnectionSite + { + public: + NetGameClient(); + ~NetGameClient(); + + /// \brief Connect + /// + /// \param server = String + /// \param port = String + void connect(const std::string &server, const std::string &port); + + /// \brief Disconnect + void disconnect(); + + /// \brief Process events + void process_events(); + + /// \brief Send event + /// + /// \param game_event = Net Game Event + void send_event(const NetGameEvent &game_event); + Signal &sig_event_received(); + + /// \brief Sig connected + /// + /// \return Signal + Signal &sig_connected(); + + /// \brief Sig disconnected + /// + /// \return Signal + Signal &sig_disconnected(); + + private: + + /// \brief Add network event + /// + /// \param e = Net Game Network Event + void add_network_event(const NetGameNetworkEvent &e) override; + + std::shared_ptr impl; + }; + + /// \} +} + diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/connection.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/connection.h new file mode 100644 index 0000000..c0e9796 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/connection.h @@ -0,0 +1,93 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include +#include "event.h" + +namespace clan +{ + /// \addtogroup clanNetwork_NetGame clanNetwork NetGame + /// \{ + + class NetGameConnectionSite; + class NetGameConnection_Impl; + class SocketName; + class TCPConnection; + + /// \brief NetGameConnection + class NetGameConnection + { + public: + /// \brief Constructs a NetGameConnection + /// + /// \param site = Net Game Connection Site + /// \param connection = TCPConnection + NetGameConnection(NetGameConnectionSite *site, const TCPConnection &connection); + NetGameConnection(NetGameConnectionSite *site, const SocketName &socket_name); + + ~NetGameConnection(); + + /// \brief Set data + /// + /// \param name = String Ref + /// \param data = void + void set_data(const std::string &name, void *data); + + /// \brief Get data + /// + /// \param name = String Ref + /// + /// \return void + void *get_data(const std::string &name) const; + + /// \brief Send event + /// + /// \param game_event = Net Game Event + void send_event(const NetGameEvent &game_event); + + /// \brief Disconnects a client + void disconnect(); + + /// \brief Get Remote name + /// + /// \return remote_name + SocketName get_remote_name() const; + + private: + /// \brief Disallow copy constructors + NetGameConnection(NetGameConnection &other) = delete; + NetGameConnection &operator =(const NetGameConnection &other) = delete; + + NetGameConnection_Impl *impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/connection_site.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/connection_site.h new file mode 100644 index 0000000..9e7116f --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/connection_site.h @@ -0,0 +1,49 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanNetwork_NetGame clanNetwork NetGame + /// \{ + + class NetGameNetworkEvent; + + /// \brief NetGameConnectionSite + class NetGameConnectionSite + { + public: + /// \brief Add network event + /// + /// \param e = Net Game Network Event + virtual void add_network_event(const NetGameNetworkEvent &e) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/event.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/event.h new file mode 100644 index 0000000..ab58905 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/event.h @@ -0,0 +1,70 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "event_value.h" + +namespace clan +{ + /// \addtogroup clanNetwork_NetGame clanNetwork NetGame + /// \{ + + /// \brief NetGameEvent + class NetGameEvent + { + public: + /// Constructs a NetGameEvent + NetGameEvent(const std::string &name, std::vector arg = {}); + + /// \return The name of this event. + std::string get_name() const { return name; }; + + /// \return The number of arguments stored in this event. + unsigned int get_argument_count() const; + + /// Retrieves an argument in this event. + /// \param index Index number of the argument to retrieve. + /// \return A NetGameEventValue object containing the argument value. + NetGameEventValue get_argument(unsigned int index) const; + + /// Adds an argument into this event. + /// \param value The argument to store inside this event. + void add_argument(const NetGameEventValue &value); + + /// \return A string representation of this event, including all of its arguments. + std::string to_string() const; + + private: + std::string name; + std::vector arguments; + }; + + /// \} +} + diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/event_dispatcher.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/event_dispatcher.h new file mode 100644 index 0000000..85f04a8 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/event_dispatcher.h @@ -0,0 +1,67 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Chu Chin Kuan +*/ + +#pragma once + +#include "event.h" +#include + +namespace clan +{ + template + class NetGameEventDispatcher + { + public: + typedef std::function< void(const NetGameEvent &, Params...) > CallbackClass; + + CallbackClass &func_event(const std::string &name) { return event_handlers[name]; } + + /** \brief Dispatches the event object. + * \return true if the event handler is invoked and false if the + * event handler is not found. + */ + bool dispatch(const NetGameEvent &game_event, Params... params) + { + auto it = event_handlers.find(game_event.get_name()); + if (it != event_handlers.end() && (bool)it->second) + { + it->second(game_event, params...); + return true; + } + else + { + return false; + } + } + + private: + std::map event_handlers; + + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/event_value.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/event_value.h new file mode 100644 index 0000000..1a22a91 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/event_value.h @@ -0,0 +1,254 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../../Core/System/databuffer.h" + +namespace clan +{ + /// \addtogroup clanNetwork_NetGame clanNetwork NetGame + /// \{ + + /// \brief NetGameEventValue + class NetGameEventValue + { + public: + enum Type + { + null, + integer, + uinteger, + character, + ucharacter, + string, + boolean, + number, + complex, + binary + }; + + NetGameEventValue(); + + /// \brief Constructs a NetGameEventValue + /// + /// \param value = value + NetGameEventValue(int value); + + /// \brief Constructs a NetGameEventValue + /// + /// \param value = value + NetGameEventValue(unsigned int value); + + /// \brief Constructs a NetGameEventValue + /// + /// \param value = value + NetGameEventValue(char value); + + /// \brief Constructs a NetGameEventValue + /// + /// \param value = value + NetGameEventValue(unsigned char value); + + /// \brief Constructs a NetGameEventValue + /// + /// \param value = value + NetGameEventValue(float value); + + /// \brief Constructs a NetGameEventValue + /// + /// \param value = String + NetGameEventValue(const std::string &value); + + /// \brief Constructs a NetGameEventValue + /// + /// \param str = char + NetGameEventValue(const char *str); + + /// \brief Constructs a NetGameEventValue + /// + /// \param str = wchar_t + NetGameEventValue(const wchar_t *str); + + /// \brief Constructs a NetGameEventValue + /// + /// \param value = bool + explicit NetGameEventValue(bool value); + + /// \brief Constructs a NetGameEventValue + /// + /// \param value = DataBuffer + NetGameEventValue(const DataBuffer &value); + + /// \brief Constructs a NetGameEventValue + /// + /// \param type = Type + NetGameEventValue(Type type); + + /// \brief Get Type + /// + /// \return type + Type get_type() const; + + /// \brief Is Null + /// + /// \return true = null + bool is_null() const; + + /// \brief Is Uinteger + /// + /// \return true = uinteger + bool is_uinteger() const; + + /// \brief Is Integer + /// + /// \return true = integer + bool is_integer() const; + + /// \brief Is Ucharacter + /// + /// \return true = ucharacter + bool is_ucharacter() const; + + /// \brief Is Character + /// + /// \return true = character + bool is_character() const; + + /// \brief Is Number + /// + /// \return true = number + bool is_number() const; + + /// \brief Is String + /// + /// \return true = string + bool is_string() const; + + /// \brief Is Boolean + /// + /// \return true = boolean + bool is_boolean() const; + + /// \brief Is Binary + /// + /// \return true = binary + bool is_binary() const; + + /// \brief Is Complex + /// + /// \return true = complex + bool is_complex() const; + + unsigned int get_member_count() const; + const NetGameEventValue &get_member(unsigned int index) const; + + /// \brief Add member + /// + /// \param value = Net Game Event Value + void add_member(const NetGameEventValue &value); + + /// \brief Set member + /// + /// \param index = value + /// \param value = Net Game Event Value + void set_member(unsigned int index, const NetGameEventValue &value); + + /// \brief To unsigned integer + /// + /// \return unsigned int + unsigned int get_uinteger() const; + + /// \brief To integer + /// + /// \return int + int get_integer() const; + + /// \brief To unsigned character + /// + /// \return unsigned char + unsigned int get_ucharacter() const; + + /// \brief To character + /// + /// \return char + int get_character() const; + + /// \brief To number + /// + /// \return float + float get_number() const; + + /// \brief To string + /// + /// \return String + std::string get_string() const; + + /// \brief To boolean + /// + /// \return bool + bool get_boolean() const; + + /// \brief To binary + /// + /// \return binary + DataBuffer get_binary() const; + + inline operator unsigned int() const { return get_uinteger(); } + inline operator int() const { return get_integer(); } + inline operator unsigned char() const { return get_ucharacter(); } + inline operator float() const { return get_number(); } + inline operator std::string() const { return get_string(); } + inline operator bool() const { return get_boolean(); } + inline operator DataBuffer() const { return get_binary(); } + + /// Helper function to obtain a string representation of an EventValue object. + static std::string to_string(const NetGameEventValue &); + + private: + /// \brief Throw if not complex + void throw_if_not_complex() const; + + Type type; + union + { + int value_int; + unsigned int value_uint; + char value_char; + unsigned char value_uchar; + float value_float; + bool value_bool; + }; + std::string value_string; + DataBuffer value_binary; + std::vector value_complex; + }; + + /// \} +} + diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/server.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/server.h new file mode 100644 index 0000000..1897138 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/NetGame/server.h @@ -0,0 +1,92 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + + +#pragma once + + +#include "connection_site.h" // TODO: Remove +#include "../../Core/Signals/signal.h" + +namespace clan +{ + /// \addtogroup clanNetwork_NetGame clanNetwork NetGame + /// \{ + + class NetGameEvent; + class NetGameConnection; + class NetGameServer_Impl; + + /// \brief NetGameServer + class NetGameServer : NetGameConnectionSite + { + public: + NetGameServer(); + ~NetGameServer(); + + /// \brief Start + /// + /// \param port = String + void start(const std::string &port); + + /// \brief Start + /// + /// \param address = String + /// \param port = String + void start(const std::string &address, const std::string &port); + + /// \brief Process events + void process_events(); + + /// \brief Stop + void stop(); + + /// \brief Send event + /// + /// \param game_event = Net Game Event + void send_event(const NetGameEvent &game_event); + + Signal &sig_client_connected(); + Signal &sig_client_disconnected(); + Signal &sig_event_received(); + + private: + + /// \brief Listen thread main + void listen_thread_main(); + + /// \brief Add network event + /// + /// \param e = Net Game Network Event + void add_network_event(const NetGameNetworkEvent &e) override; + + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/network_condition_variable.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/network_condition_variable.h new file mode 100644 index 0000000..d8483fc --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/network_condition_variable.h @@ -0,0 +1,54 @@ + +#pragma once + +#include +#include +#include + +namespace clan +{ + class SocketHandle; + class NetworkConditionVariableImpl; + + /// \brief Base class for all classes that generate network events + class NetworkEvent + { + protected: + virtual SocketHandle *get_socket_handle() = 0; + + friend class NetworkConditionVariable; + }; + + /// \brief Condition variable that also awaken on network events + class NetworkConditionVariable + { + public: + NetworkConditionVariable(); + + /// \brief Waits for event changes or until notify is called + template + bool wait(Lock &lock, int count, NetworkEvent **events, int timeout = -1) + { + lock.unlock(); + try + { + bool result = wait_impl(count, events, timeout); + lock.lock(); + return result; + } + catch (...) + { + lock.lock(); + throw; + } + } + + /// \brief Awakens any thread waiting for event changes + void notify(); + + private: + bool wait_impl(int count, NetworkEvent **events, int timeout); + + std::shared_ptr impl; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/socket_name.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/socket_name.h new file mode 100644 index 0000000..8538952 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/socket_name.h @@ -0,0 +1,119 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + + +#pragma once + +#include + +struct sockaddr; + +namespace clan +{ + /// \addtogroup clanNetwork_Socket clanNetwork Socket + /// \{ + + class SocketName_Impl; + + /// \brief Socket name; container class for an IP address and port. + class SocketName + { + public: + /// \brief Constructs a new socket name. + /**

If no address is specified, the socket address will default to INADDR_ANY. + If no port is specified, it will default to port 0.

*/ + SocketName(); + + /// \brief Constructs a SocketName + /// + /// \param port = String + SocketName(const std::string &port); + + /// \brief Constructs a SocketName + /// + /// \param address = String + /// \param port = String + SocketName(const std::string &address, const std::string &port); + + /// \brief Returns the address part of the socket name. + std::string get_address() const; + + /// \brief Returns the port part of the socket name. + std::string get_port() const; + + /// \brief Returns true if objects are the same. + bool operator == (const SocketName &other_instance) const; + + /// \brief Returns true if the other address is less. + /**

This is used for sorting + purposes (eg. if you use a std::map), and sorts + the address based on lowest IP number address.

*/ + bool operator < (const SocketName &other_instance) const; + + /// \brief Returns true if the other address is greater. + /**

This is used for sorting + purposes (eg. if you use a std::map), and sorts + the address based on lowest IP number address.

*/ + bool operator > (const SocketName &other_instance) const; + + /// \brief Set the socket name using a hostname and port. + /// + /// \param hostname Can be an IPv4 dotted-quad, hostname or a valid IPv6 address. + /// \param port Port number. + void set_name(const std::string &hostname, const std::string &port); + + /// \brief Set the IP address. + void set_address(const std::string &address); + + /// \brief Set the IP port. + void set_port(const std::string &port); + + /// \brief Perform a DNS lookup, if needed, for the IP v4 address. + std::string lookup_ipv4() const; + + /// \brief Perform a DNS lookup, if needed, for the hostname. + std::string lookup_hostname() const; + + /// \brief Create socket name that uses the IP v4 address as its address. + SocketName to_ipv4(); + + /// \brief Create socket name that uses the hostname as its address. + SocketName to_hostname(); + + /// \brief Fill the socket name into a C sockets sockaddr structure. + void to_sockaddr(int domain, sockaddr *addr, int len) const; + + /// \brief Get the socket name from a C sockets sockaddr structure. + void from_sockaddr(int domain, sockaddr *addr, int len); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/tcp_connection.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/tcp_connection.h new file mode 100644 index 0000000..0547326 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/tcp_connection.h @@ -0,0 +1,61 @@ + +#pragma once + +#include "network_condition_variable.h" + +#include +#include +#include + +namespace clan +{ + class SocketName; + class Event; + class TCPSocket; + + /// \brief TCP/IP socket connection + class TCPConnection : public NetworkEvent + { + public: + static void init_sockets(); + + /// \brief Create null object + TCPConnection(); + + /// \brief Blocking connect to end point + TCPConnection(const SocketName &endpoint); + + ~TCPConnection(); + + /// \brief Returns true if it is a null object + bool is_null() const { return !impl; } + + /// \brief Returns the socket name of the local end point + SocketName get_local_name(); + + /// \brief Returns the socket name of the peer end point + SocketName get_remote_name(); + + /// \brief Close connection + void close(); + + /// \brief Write data to TCP socket + /// \return Bytes written, or -1 if buffer is full + int write(const void *data, int size); + + /// \brief Read data from TCP socket + /// \return Bytes read, 0 if remote closed connection, or -1 if buffer is empty + int read(void *data, int size); + + /// \internal Constructs a TCPConnection instance based on a socket handle + TCPConnection(const std::shared_ptr &impl); + + protected: + SocketHandle *get_socket_handle() override; + + private: + std::shared_ptr impl; + }; + + // To do: QOSAddSocketToFlow +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/tcp_listen.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/tcp_listen.h new file mode 100644 index 0000000..f7796ab --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/tcp_listen.h @@ -0,0 +1,43 @@ + +#pragma once + +#include "network_condition_variable.h" +#include +#include + +namespace clan +{ + class SocketName; + class TCPConnection; + class TCPSocket; + + /// \brief Listens for incoming TCP/IP socket connections + class TCPListen : public NetworkEvent + { + public: + /// \brief Create null object + TCPListen(); + + /// \brief Create a listening socket for the specified end point + TCPListen(const SocketName &endpoint, int backlog = 5, bool reuse_address = true); + + ~TCPListen(); + + /// \brief Returns true if it is a null object + bool is_null() const { return !impl; } + + /// \brief Stops listening for incoming messages and closes the socket + void close(); + + /// \brief Accept an incoming connection + /// \param end_point Socket name of the accepted peer + /// \return A TcpConnection for the accepted connection, or a null object if no incoming connections are available + TCPConnection accept(SocketName &end_point); + + protected: + SocketHandle *get_socket_handle() override; + + private: + std::shared_ptr impl; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/udp_socket.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/udp_socket.h new file mode 100644 index 0000000..ebf459f --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Network/Socket/udp_socket.h @@ -0,0 +1,41 @@ + +#pragma once + +#include "network_condition_variable.h" +#include +#include + +namespace clan +{ + class SocketName; + class UDPSocketImpl; + + /// \brief UDP/IP socket class + class UDPSocket : public NetworkEvent + { + public: + /// \brief Create socket object + UDPSocket(); + + ~UDPSocket(); + + /// \brief Close connection + void close(); + + /// \brief Bind socket to end point + void bind(const SocketName &endpoint); + + /// \brief Send UDP packet to end point + void send(const void *data, int size, const SocketName &endpoint); + + /// \brief Read receved UDP packet + /// \return Bytes read or 0 if no packet was available + int read(void *data, int size, SocketName &endpoint); + + protected: + SocketHandle *get_socket_handle() override; + + private: + std::shared_ptr impl; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/AudioWorld/audio_definition.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/AudioWorld/audio_definition.h new file mode 100644 index 0000000..c33b43c --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/AudioWorld/audio_definition.h @@ -0,0 +1,65 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + class AudioDefinition_Impl; + + class AudioDefinition + { + public: + AudioDefinition(); + + bool is_null() const { return !impl; } + + std::string get_sound_id() const; + + float get_attenuation_begin() const; + float get_attenuation_end() const; + float get_volume() const; + + bool is_looping() const; + bool is_ambience() const; + + void set_sound_id(const std::string &id); + + void set_attenuation_begin(float distance); + void set_attenuation_end(float distance); + void set_volume(float volume); + + void set_looping(bool loop); + void set_ambience(bool ambience); + + private: + std::shared_ptr impl; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/AudioWorld/audio_object.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/AudioWorld/audio_object.h new file mode 100644 index 0000000..4a56fcd --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/AudioWorld/audio_object.h @@ -0,0 +1,80 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "audio_definition.h" +#include "../../Core/Math/vec3.h" + +namespace clan +{ + class SoundBuffer; + class AudioWorld; + class AudioObject_Impl; + + class AudioObject + { + public: + AudioObject(); + AudioObject(AudioWorld &world); + AudioObject(AudioWorld &world, AudioDefinition definition); + + bool is_null() const { return !impl; } + + Vec3f get_position() const; + + float get_attenuation_begin() const; + float get_attenuation_end() const; + float get_volume() const; + bool is_looping() const; + bool is_ambience() const; + bool is_playing() const; + + void set_position(const Vec3f &position); + + void set_attenuation_begin(float distance); + void set_attenuation_end(float distance); + void set_volume(float volume); + + void set_sound(const std::string &id); + void set_sound(const SoundBuffer &buffer); + + void set_looping(bool loop); + void set_ambience(bool ambience); + + void play(); + void stop(); + + private: + std::shared_ptr impl; + + friend class AudioWorld; + friend class AudioWorld_Impl; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/AudioWorld/audio_world.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/AudioWorld/audio_world.h new file mode 100644 index 0000000..4161ed5 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/AudioWorld/audio_world.h @@ -0,0 +1,62 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../../Core/Math/vec3.h" +#include "../../Core/Math/quaternion.h" + +namespace clan +{ + class ResourceManager; + class SoundBuffer; + class AudioWorld_Impl; + + class AudioWorld + { + public: + AudioWorld(const ResourceManager &resources); + + void update(); + + void set_listener(const Vec3f &position, const Quaternionf &orientation); + + void enable_ambience(bool enable); + bool is_ambience_enabled() const; + + void enable_reverse_stereo(bool enable); + bool is_reverse_stereo_enabled() const; + + private: + std::shared_ptr impl; + + friend class AudioObject; + friend class AudioObject_Impl; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/Resources/sound_cache.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/Resources/sound_cache.h new file mode 100644 index 0000000..6eadad6 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/Resources/sound_cache.h @@ -0,0 +1,55 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + + +#pragma once + +#include "../../Core/Resources/resource.h" +#include + +namespace clan +{ + /// \addtogroup clanSound_Resources clanSound Resources + /// \{ + + class ResourceManager; + class SoundBuffer; + + class SoundCache + { + public: + virtual ~SoundCache() { } + virtual Resource get_sound(const std::string &id) = 0; + + static SoundCache &get(const ResourceManager &resources); + static void set(ResourceManager &resources, const std::shared_ptr &cache); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundFilters/echofilter.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundFilters/echofilter.h new file mode 100644 index 0000000..d25cbc3 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundFilters/echofilter.h @@ -0,0 +1,56 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include "../soundfilter.h" + +namespace clan +{ + /// \addtogroup clanSound_Filters clanSound Filters + /// \{ + + class EchoFilterProvider; + + /// \brief Echo Filter Class + class EchoFilter : public SoundFilter + { + public: + /// \brief Echo Filter Constructor + EchoFilter(int buffer_size = 32 * 1024, float shift_factor = 2.0f); + + /// \brief Echo Filter Destructor + virtual ~EchoFilter(); + + /// \brief Retrieves the provider. + EchoFilterProvider *get_provider() const; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundFilters/fadefilter.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundFilters/fadefilter.h new file mode 100644 index 0000000..9e1584f --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundFilters/fadefilter.h @@ -0,0 +1,65 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include "../soundfilter.h" + +namespace clan +{ + /// \addtogroup clanSound_Filters clanSound Filters + /// \{ + + class FadeFilterProvider; + + /// \brief Fade Filter Class + class FadeFilter : public SoundFilter + { + public: + /// \brief Fade Filter Constructor + FadeFilter(float initial_volume); + + /// \brief Fade Filter Destructor + virtual ~FadeFilter(); + + /// \brief Returns the current volume of the fade filter, from 0.0f (no volume) to 1.0f (full volume). + float get_volume() const; + + /// \brief Retrieves the provider. + FadeFilterProvider *get_provider() const; + + /// \brief Sets the volume instant. + void set_volume(float new_volume); + + /// \brief Fade to volume, from 0.0f (no volume) to 1.0f (full volume). + void fade_to_volume(float new_volume, int duration = 1000); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundFilters/inverse_echofilter.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundFilters/inverse_echofilter.h new file mode 100644 index 0000000..6c75aea --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundFilters/inverse_echofilter.h @@ -0,0 +1,56 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include "../soundfilter.h" + +namespace clan +{ + /// \addtogroup clanSound_Filters clanSound Filters + /// \{ + + class InverseEchoFilterProvider; + + /// \brief Inverse Echo Filter Class + class InverseEchoFilter : public SoundFilter + { + public: + /// \brief Inverse Echo Filter Constructor + InverseEchoFilter(int buffer_size = 64 * 1024); + + /// \brief Inverse Echo Filter Destructor + virtual ~InverseEchoFilter(); + + /// \brief Retrieves the provider. + InverseEchoFilterProvider *get_provider() const; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundfilter_provider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundfilter_provider.h new file mode 100644 index 0000000..0105037 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundfilter_provider.h @@ -0,0 +1,52 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanSound_Audio_Mixing clanSound Audio Mixing + /// \{ + + /// \brief Sound Filter Interface + class SoundFilterProvider + { + public: + virtual ~SoundFilterProvider() { return; } + + /// \brief Filter callback. + /**

All sound data is passed through this function, + which modifies the sample data accordingly to the function of the + filter.

+

The format of the sample data is always 16 bit stereo.

*/ + virtual void filter(float **sample_data, int num_samples, int channels) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider.h new file mode 100644 index 0000000..62bb7c5 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider.h @@ -0,0 +1,65 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanSound_Audio_Mixing clanSound Audio Mixing + /// \{ + + class SoundProvider_Session; + class SoundProvider_Impl; + + /// \brief Sound provider. + /// + /// Interface to sound sources. Used by the SoundBuffer class to start and stop playback. + class SoundProvider + { + public: + SoundProvider(); + virtual ~SoundProvider(); + + /// \brief Called by SoundBuffer when a new session starts. + /** \return The soundbuffer session to be attached to the newly started session.*/ + virtual SoundProvider_Session *begin_session() = 0; + + /// \brief Called by SoundBuffer when a session has finished. After this call, + /**

SoundBuffer will not access the session anymore. It can safely be deleted + here (and in most cases should be delete here).

*/ + virtual void end_session(SoundProvider_Session *session) = 0; + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_factory.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_factory.h new file mode 100644 index 0000000..6b34753 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_factory.h @@ -0,0 +1,75 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanSound_Sound_Providers clanSound Sound Providers + /// \{ + + class SoundProvider; + class InputSourceProvider; + class SoundProviderType; + class FileSystem; + class IODevice; + + /// \brief Sound Provider Factor class. + class SoundProviderFactory + { + public: + /// \brief Loads an sample file from 'filename', using the provider identified by 'type'. + /**

If the type is an empty string, it + uses the extension of the filename to determine what type + it is.

+

The input provider will be used as a the source for filename, + if specified.

*/ + static SoundProvider *load( + const std::string &filename, + bool streamed, + const FileSystem &fs, + const std::string &type = std::string() + ); + + /// \brief Loads an sample file from 'filename', using the provider identified by 'type'. + static SoundProvider *load( + const std::string &fullname, + bool streamed, + const std::string &type = std::string()); + + /// \brief Loads an sample file from 'file', using the provider identified by 'type'. + static SoundProvider *load( + IODevice &file, + bool streamed, + const std::string &type); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_raw.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_raw.h new file mode 100644 index 0000000..f743a65 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_raw.h @@ -0,0 +1,77 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + + +#pragma once + +#include "soundprovider.h" + +namespace clan +{ + /// \addtogroup clanSound_Sound_Providers clanSound Sound Providers + /// \{ + + class SoundProvider_Raw_Impl; + + /// \brief Sound provider in a raw PCM format (no header in file). + class SoundProvider_Raw : public SoundProvider + { + public: + /// \brief Constructs a sound provider based on some raw PCM data. + /// + /// \param sound_data Raw PCM data. + /// \param num_samples Number of samples to be read out of sound_data. + /// \param bytes_per_sample The size of a sample in bytes. This is 2 for 16 bit (signed), and 1 for 8 bit (unsigned). + /// \param stereo True if sound is stereo (two channels). + /// \param frequency Playback frequency for sample data. + SoundProvider_Raw( + void *sound_data, + int num_samples, + int bytes_per_sample, + bool stereo, + int frequency = 22050); + + virtual ~SoundProvider_Raw(); + + /// \brief Called by SoundBuffer when a new session starts. + /** \return The soundbuffer session to be attached to the newly started session.*/ + virtual SoundProvider_Session *begin_session() override; + + /// \brief Called by SoundBuffer when a session has finished. After this call, + /**

SoundBuffer will not access the session anymore. It can safely be deleted + here (and in most cases should be delete here).

*/ + virtual void end_session(SoundProvider_Session *session) override; + + private: + std::shared_ptr impl; + + friend class SoundProvider_Raw_Session; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_session.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_session.h new file mode 100644 index 0000000..c07af8c --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_session.h @@ -0,0 +1,103 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + + +#pragma once + +#include +#include "../soundformat.h" + +namespace clan +{ + /// \addtogroup clanSound_Audio_Mixing clanSound Audio Mixing + /// \{ + + class SoundProvider_Session_Impl; + + /// \brief Sound provider playback session. + /// + ///

Interface used by ClanLib during playback of sound providers.

+ class SoundProvider_Session + { + public: + SoundProvider_Session(); + virtual ~SoundProvider_Session(); + + /// \brief Returns the number of samples in the soundbuffer. + virtual int get_num_samples() const = 0; + + /// \brief Returns the playback frequency of the input data. + /** \return Playback frequency.*/ + virtual int get_frequency() const = 0; + + /// \brief Returns the current position in the playback stream. + virtual int get_position() const = 0; + + /// \brief Returns the number of channels filled when get_data is called. + virtual int get_num_channels() const = 0; + + /// \brief Enable/disable session looping. + /**

If this function returns false (default), the clanSound mixer will manually + try to simulate looping by setting the position to 0 when eof is encountered.

*/ + virtual bool set_looping(bool /* loop */) { return false; } + + /// \brief Returns true if no more input data is available. + /** \return True if end of input data. False otherwise.*/ + virtual bool eof() const = 0; + + /// \brief Stops the current stream. + virtual void stop() = 0; + + /// \brief Start/continue playing of the stream. + /** \return True for success. False otherwise.*/ + virtual bool play() = 0; + + /// \brief Sets the position within the current stream. + /// + /// \param pos Position to seek to. + /// + /// \return True for success. False otherwise. + virtual bool set_position(int pos) = 0; + + /// \brief Sets the end position within the current stream. + /// + /// \param pos = End position. + /// + /// \return True for success. False otherwise. + virtual bool set_end_position(int pos) = 0; + + /// \brief Called when a playback session needs more sample data. + /// + /// \param data_ptr = Points to a buffer that should be filled with sample data. + /// \param data_requested = Samples of data requested. + /// \return Number of samples actually filled with sample data. + virtual int get_data(float **data_ptr, int data_requested) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_type.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_type.h new file mode 100644 index 0000000..44a609a --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_type.h @@ -0,0 +1,63 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../../Core/IOData/file_system.h" + +namespace clan +{ + /// \addtogroup clanSound_Sound_Providers clanSound Sound Providers + /// \{ + + class SoundProvider; + class InputSourceProvider; + class FileSystem; + + /// \brief Sound provider type + class SoundProviderType + { + public: + /// \brief Registers a sound provider type in the SoundProviderFactory. + SoundProviderType(const std::string &type); + + /// \brief Unregisters a sound provider type in the SoundProviderFactory. + virtual ~SoundProviderType(); + + /// \brief Called to load with this sound provider type. + virtual SoundProvider *load( + const std::string &filename, + bool streamed, + const FileSystem &file_system) = 0; + + virtual SoundProvider *load( + IODevice &file, bool streamed) = 0; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_type_register.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_type_register.h new file mode 100644 index 0000000..a2d4efe --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_type_register.h @@ -0,0 +1,68 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "soundprovider_type.h" + +namespace clan +{ + /// \addtogroup clanSound_Sound_Providers clanSound Sound Providers + /// \{ + + /// \brief Class template to register a sound provider type. + /// + template + class SoundProviderType_Register : public SoundProviderType + { + public: + /// \brief Registers sound provider type in the SoundProviderFactory. + SoundProviderType_Register(const std::string &type) : SoundProviderType(type) + { + } + + /// \brief Called to load static with this sound provider type. + virtual SoundProvider *load( + const std::string &filename, + bool stream, + const FileSystem &fs) override + { + return new SoundProviderClass(filename, fs, stream); + } + + /// \brief Called to load static with this sound provider type. + virtual SoundProvider *load( + IODevice &file, + bool stream) override + { + return new SoundProviderClass(file, stream); + } + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_vorbis.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_vorbis.h new file mode 100644 index 0000000..22699c1 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_vorbis.h @@ -0,0 +1,82 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "soundprovider.h" +#include "../../Core/IOData/file_system.h" + +namespace clan +{ + /// \addtogroup clanVorbis_Sound_Providers clanVorbis Sound Providers + /// \{ + + class InputSourceProvider; + class SoundProvider_Vorbis_Impl; + + /// \brief Ogg Vorbis format sound provider. + class SoundProvider_Vorbis : public SoundProvider + { + public: + /// \brief Constructs a sound provider based on an ogg vorbis (.ogg) file. + /// + /// \param filename Filename of module file. + /// \param provider Input source provider used to retrieve module file. + /// \param stream If true, will stream from disk. If false, will load it to memory. + SoundProvider_Vorbis( + const std::string &filename, + const FileSystem &fs, + bool stream = false); + + SoundProvider_Vorbis( + const std::string &fullname, + bool stream = false); + + SoundProvider_Vorbis( + IODevice &file, + bool stream = false); + + virtual ~SoundProvider_Vorbis(); + + /// \brief Called by SoundBuffer when a new session starts. + /** \return The soundbuffer session to be attached to the newly started session.*/ + virtual SoundProvider_Session *begin_session() override; + + /// \brief Called by SoundBuffer when a session has finished. After this call, + /**

SoundBuffer will not access the session anymore. It can safely be deleted + here (and in most cases should be delete here).

*/ + virtual void end_session(SoundProvider_Session *session) override; + + private: + std::shared_ptr impl; + + friend class SoundProvider_Vorbis_Session; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_wave.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_wave.h new file mode 100644 index 0000000..2def0f8 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/SoundProviders/soundprovider_wave.h @@ -0,0 +1,82 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "soundprovider.h" +#include "../../Core/IOData/file_system.h" + +namespace clan +{ + /// \addtogroup clanSound_Sound_Providers clanSound Sound Providers + /// \{ + + class InputSourceProvider; + class SoundProvider_Wave_Impl; + + /// \brief Windows WAVE sample format (.wav) sound provider. + class SoundProvider_Wave : public SoundProvider + { + public: + /// \brief Constructs a sound provider based on a Windows wave (.wav) file. + /// + /// \param filename Filename of wave file. + /// \param provider Input source provider used to retrieve wave file. + /// \param stream If true, will stream from disk. If false, will load it to memory. + SoundProvider_Wave( + const std::string &filename, + const FileSystem &fs, + bool stream = false); + + SoundProvider_Wave( + const std::string &fullname, + bool stream = false); + + SoundProvider_Wave( + IODevice &file, + bool stream = false); + + virtual ~SoundProvider_Wave(); + + /// \brief Called by SoundBuffer when a new session starts. + /** \return The soundbuffer session to be attached to the newly started session.*/ + virtual SoundProvider_Session *begin_session() override; + + /// \brief Called by SoundBuffer when a session has finished. After this call, + /**

SoundBuffer will not access the session anymore. It can safely be deleted + here (and in most cases should be delete here).

*/ + virtual void end_session(SoundProvider_Session *session) override; + + private: + std::shared_ptr impl; + + friend class SoundProvider_Wave_Session; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/sound.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/sound.h new file mode 100644 index 0000000..c13f2ce --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/sound.h @@ -0,0 +1,63 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanSound_Audio_Mixing clanSound Audio Mixing + /// \{ + + class SoundOutput; + + /// \brief Sound interface in ClanLib. + /// + //

All the functions that share name with those in SoundOutput have the + // same functionality. The only difference is, that the ones Sound + // operate on a selected sound output. This saves the trouble of passing around + // a pointer to the sound output, when only a single one is used anyway.

+ class Sound + { + public: + /// \brief Returns the name of the current sound output: + static const std::string &get_name(); + + /// \brief Returns the mixing frequency of the current sound output. + static int get_mixing_frequency(); + + /// \brief Returns the current selected sound output. + static SoundOutput get_current_output(); + + /// \brief Change the current selected sound output. + /// + /// \param output The new current selected sound output. + static void select_output(const SoundOutput &output); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/sound_sse.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/sound_sse.h new file mode 100644 index 0000000..4db6ac4 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/sound_sse.h @@ -0,0 +1,90 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanSound_Audio_Mixing clanSound Audio Mixing + /// \{ + + /// \brief Sound related functions implemented as SIMD using SSE + class SoundSSE + { + public: + /// \brief Allocates memory that is 16-byte memory aligned + static void *aligned_alloc(int size); + + /// \brief Free memory allocated with aligned_alloc + static void aligned_free(void *ptr); + + /// \brief Unpacks 16 bit stereo samples into separate float channels + static void unpack_16bit_stereo(short *input, int size, float *output[2]); + + /// \brief Unpacks 16 bit mono samples into a single float channel + static void unpack_16bit_mono(short *input, int size, float *output); + + /// \brief Unpacks 8 bit stereo samples into separate float channels + static void unpack_8bit_stereo(unsigned char *input, int size, float *output[2]); + + /// \brief Unpacks 8 bit mono samples into a single float channel + static void unpack_8bit_mono(unsigned char *input, int size, float *output); + + /// \brief Unpacks float mono samples into a single float channel + static void unpack_float_mono(float *input, int size, float *output); + + /// \brief Unpacks float stereo samples into separate float channels + static void unpack_float_stereo(float *input, int size, float *output[2]); + + /// \brief Packs two float channels into a single 16 bit samples stream + static void pack_16bit_stereo(float *input[2], int size, short *output); + + /// \brief Packs two float channels into a single float samples stream + static void pack_float_stereo(float *input[2], int size, float *output); + + /// \brief Copy floats from one buffer to another + static void copy_float(float *input, int size, float *output); + + /// \brief Multiplies floats with a float + static void multiply_float(float *channel, int size, float volume); + + /// \brief Sets floats to a specific value + static void set_float(float *channel, int size, float value); + + /// \brief Mixes one float channel with specified volume into another float channel + static void mix_one_to_one(float *input, int size, float *output, float volume); + + /// \brief Mixes one float channel into many float channels with individual volumes for each channel + static void mix_one_to_many(float *input, int size, float **output, float *volume, int channels); + + /// \brief Mixes many float channels into one float channel with individual volumes for each channel + static void mix_many_to_one(float **input, float *volume, int channels, int size, float *output); + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundbuffer.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundbuffer.h new file mode 100644 index 0000000..fbaa904 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundbuffer.h @@ -0,0 +1,162 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "soundbuffer_session.h" +#include "../Core/Resources/resource.h" + +namespace clan +{ + /// \addtogroup clanSound_Audio_Mixing clanSound Audio Mixing + /// \{ + + class XMLResourceDocument; + class SoundOutput; + class SoundProvider; + class SoundBuffer_Session; + class SoundFilter; + class SoundBuffer_Impl; + class IODevice; + class FileSystem; + class ResourceManager; + + /// \brief Sample interface in ClanLib. + /// + ///

The SoundBuffer class represents a sample in ClanLib. It can + /// either be static or streamed. The soundbuffer gets its sample data from + /// a soundprovider, that is passed during construction.

+ class SoundBuffer + { + public: + /// \brief Construct a null instance + SoundBuffer(); + + /// \brief Construct sound buffer. + /**

A sound buffer can be constructed either as static or + streamed. If the sound buffer is loaded from resources, the + buffer type is determined by the resource option 'stream' + associated with the resource.

+ - +

SoundBuffer's internals are reference counted, so the copy + constructor will create a new soundbuffer object which shares + the same buffer as the original one. This means that if the copy + is modified, the original is affected as well.

+ - +

If delete_provider is true, the provider will be + deleted when the soundbuffer is deleted.

*/ + + SoundBuffer( + SoundProvider *provider); + + SoundBuffer( + const std::string &fullname, + bool streamed = false, + const std::string &format = ""); + + SoundBuffer( + const std::string &filename, + bool streamed, + const FileSystem &fs, + const std::string &type = ""); + + SoundBuffer( + IODevice &file, + bool streamed, + const std::string &type); + + /// \brief Retrieves a SoundBuffer resource from the resource manager + /// + /// \param gc = Graphic Context + /// \param resources = Resource manager + /// \param id = id + static Resource resource(const std::string &id, const ResourceManager &resources); + + /// \brief Loads a SoundBuffer from a XML resource definition + static SoundBuffer load(const std::string &id, const XMLResourceDocument &doc); + + virtual ~SoundBuffer(); + + /// \brief Returns the sound provider to be used for playback. + SoundProvider *get_provider() const; + + /// \brief Returns the start/default volume used when the buffer is played. + float get_volume() const; + + /// \brief Returns the default panning position when the buffer is played. + float get_pan() const; + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Sets the volume of the sound buffer in a relative measure (0->1) + /**

A value of 0 will effectively mute the sound (although it will + still be sampled), and a value of 1 will set the volume to "max".

+ \param new_volume New volume of sound buffer. */ + void set_volume(float new_volume); + + /// \brief Sets the panning of the sound buffer played in measures from -1 -> 1 + /**

Setting the pan with a value of -1 will pan the sound buffer to the + extreme left (left speaker only), 1 will pan the sound buffer to the + extreme right (right speaker only).

+ \param new_pan New pan of the sound buffer played.*/ + void set_pan(float new_pan); + + /// \brief Adds the sound filter to the sound buffer. + /// + /// \param filter Sound filter to pass sound through. + void add_filter(SoundFilter &filter); + + /// \brief Remove the sound filter from the sound buffer. + void remove_filter(SoundFilter &filter); + + /// \brief Plays the soundbuffer on the specified soundcard. + /// + /// \param looping looping + /// \param output Sound output to be used - NULL means use the current selected sound output (Sound::get_selected_output(). + /// + /// \return The playback session. + SoundBuffer_Session play(bool looping = false, SoundOutput *output = nullptr); + + /// \brief Prepares the soundbuffer for playback on the specified soundcard. + /// + /// \param output Sound output to be used - NULL means use the current selected sound output (Sound::get_selected_output(). + /// + /// \return The playback session. + SoundBuffer_Session prepare(bool looping = false, SoundOutput *output = nullptr); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundbuffer_session.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundbuffer_session.h new file mode 100644 index 0000000..4c6b0f7 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundbuffer_session.h @@ -0,0 +1,177 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanSound_Audio_Mixing clanSound Audio Mixing + /// \{ + + class SoundCard; + class SoundFilter; + class SoundBuffer; + class SoundBuffer_Session_Impl; + class SoundOutput; + + /// \brief SoundBuffer_Session provides control over a playing soundeffect. + /// + ///

Whenever a soundbuffer is played, it returns a SoundBuffer_Session + /// class, which can be used to control the sound (its volume, pitch, + /// pan, position). It can also be used to retrigger the sound + /// or to stop it.

+ class SoundBuffer_Session + { + public: + /// \brief Creates a null instance + SoundBuffer_Session(); + virtual ~SoundBuffer_Session(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Returns the current sample position of the playback. + int get_position() const; + + /// \brief Returns the sample position relative to the full length. + /// + /// The value returned will be between 0 and 1, where 0 + /// means the session is at the beginning, and 1 + /// means that the soundeffect has reached the end. + float get_position_relative() const; + + /// \brief Returns the total length (in samples) of the sound buffer played. + /// + /// Value returned will be -1 if the length is unknown (in + /// case of non-static soundeffects like streamed sound) + int get_length() const; + + /// \brief Returns the frequency of the session. + int get_frequency() const; + + /// \brief Returns the linear relative volume of the soundeffect. + /// + /// 0 means the soundeffect is muted, 1 means the soundeffect + /// is playing at "max" volume. + float get_volume() const; + + /// \brief Returns the current pan (in a measure from -1 -> 1). + /// + /// -1 means the soundeffect is only playing in the left speaker, + /// and 1 means the soundeffect is only playing in the right speaker. + float get_pan() const; + + /// \brief Returns whether this session loops + /// + /// \return true if session should loop, false otherwise + bool get_looping() const; + + /// \brief Returns true if the session is playing + bool is_playing(); + + /// \brief Sets the session position to 'new_pos'. + /// + /// \param new_pos = The new position of the session. + /// \return Returns true if operation completed succesfully. + bool set_position(int new_pos); + + /// \brief Sets the relative position of the session. + /// + /// Value must be between 0 and 1, where 0 sets the + /// session to the beginning, and 1 sets it + /// to the end of the sound buffer. + /// + /// \param new_pos New relative position. + /// \return Returns true if operation completed succesfully. + bool set_position_relative(float new_pos); + + /// \brief Sets the end position within the current stream. + /// + /// \param pos = End position. + /// + /// \return True for success. False otherwise. + bool set_end_position(int pos); + + /// \brief Sets the frequency of the session. + /// + /// \param new_freq New frequency of session. + void set_frequency(int new_freq); + + /// \brief Sets the volume of the session in a relative measure (0->1) + /// + /// A value of 0 will effectively mute the sound (although it will + /// still be sampled), and a value of 1 will set the volume to "max". + /// + /// \param new_volume New volume of session. + /// \return Returns true if the operation completed succesfully. + void set_volume(float new_volume); + + /// \brief Sets the panning of the session played in measures from -1 -> 1 + /// + /// Setting the pan with a value of -1 will pan the session to the + /// extreme left (left speaker only), 1 will pan the session to the + /// extreme right (right speaker only). + /// + /// \param new_pan New pan of the session played. + /// \return Returns true if the operation completed sucecsfully. + void set_pan(float new_pan); + + /// \brief Starts playback of the session. + void play(); + + /// \brief Stops playback of the session. + void stop(); + + /// \brief Determines whether this session should loop + /// + /// \param loop true if session should loop, false otherwise + void set_looping(bool loop); + + /// \brief Adds the sound filter to the session. See SoundFilter for details. + /// + /// \param filter Sound filter to pass sound through. + void add_filter(SoundFilter &filter); + + /// \brief Remove the sound filter from the session. See SoundFilter for details. + void remove_filter(SoundFilter &filter); + + private: + SoundBuffer_Session(SoundBuffer &soundbuffer, bool looping, SoundOutput &output); + std::shared_ptr impl; + + friend class SoundBuffer; + friend class SoundOutput_Impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundfilter.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundfilter.h new file mode 100644 index 0000000..1bf7825 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundfilter.h @@ -0,0 +1,88 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanSound_Audio_Mixing clanSound Audio Mixing + /// \{ + + class SoundFilter_Impl; + class SoundFilterProvider; + + /// \brief Sound Filter Class + class SoundFilter + { + public: + /// \brief Constructs a NULL instance + SoundFilter() { } + + /// \brief Constructs a sound filter + /// + /// \param provider = The provider + SoundFilter(SoundFilterProvider *provider); + + ~SoundFilter(); + + /// \brief Equality operator + bool operator==(const SoundFilter &other) const + { + return impl == other.impl; + } + + /// \brief Inequality operator + bool operator!=(const SoundFilter &other) const + { + return impl != other.impl; + } + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Retrieves the provider. + SoundFilterProvider *get_provider() const; + + /// \brief Filter callback. + /**

All sound data is passed through this function, + which modifies the sample data accordingly to the function of the + filter.

+

The format of the sample data is always 16 bit stereo.

*/ + void filter(float **sample_data, int num_samples, int channels); + + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundformat.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundformat.h new file mode 100644 index 0000000..9a2e810 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundformat.h @@ -0,0 +1,44 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +namespace clan +{ + /// \addtogroup clanSound_Audio_Mixing clanSound Audio Mixing + /// \{ + + /// \brief Sound Format Enums + enum SoundFormat + { + sf_8bit_unsigned, + sf_16bit_signed + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundoutput.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundoutput.h new file mode 100644 index 0000000..aa83329 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundoutput.h @@ -0,0 +1,115 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanSound_Audio_Mixing clanSound Audio Mixing + /// \{ + + class SoundFilter; + class SoundBuffer; + class SoundOutput_Description; + class SoundOutput_Impl; + + /// \brief SoundOutput interface in ClanLib. + /// + ///

SoundOutput is the interface to a sound output device. It is used to + /// control the main mixer volume and other global settings.

+ class SoundOutput + { + public: + /// \brief Constructs a null instance + SoundOutput(); + + /// \brief Constructs a SoundOutput + /// + /// \param mixing_frequency = value + /// \param latency = value + SoundOutput(int mixing_frequency, int latency = 50); + + /// \brief Constructs a SoundOutput + /// + /// \param desc = Sound Output_ Description + SoundOutput(const SoundOutput_Description &desc); + + virtual ~SoundOutput(); + + /// \brief Returns true if this object is invalid. + bool is_null() const { return !impl; } + + /// \brief Throw an exception if this object is invalid. + void throw_if_null() const; + + /// \brief Name of the output device. + const std::string &get_name() const; + + /// \brief Returns the mixing frequency for the sound output device. + int get_mixing_frequency() const; + + /// \brief Returns the mixing latency in milliseconds. + int get_mixing_latency() const; + + /// \brief Returns the main volume of the sound output. + float get_global_volume() const; + + /// \brief Returns the main panning position of the sound output. + float get_global_pan() const; + + /// \brief Stops all sample playbacks on the sound output. + void stop_all(); + + /// \brief Sets the main/mixer volume on the sound output. + void set_global_volume(float volume); + + /// \brief Sets the main panning position on the sound output. + void set_global_pan(float pan); + + /// \brief Adds the sound filter to the sound output. + /// + /// \param filter Sound filter to pass sound through. + void add_filter(SoundFilter &filter); + + /// \brief Remove the sound filter from the session. + void remove_filter(SoundFilter &filter); + + private: + SoundOutput(const std::weak_ptr impl); + + std::shared_ptr impl; + + friend class SoundBuffer; + friend class Sound; + friend class SoundBuffer_Session; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundoutput_description.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundoutput_description.h new file mode 100644 index 0000000..fcd1412 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/Sound/soundoutput_description.h @@ -0,0 +1,65 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + /// \addtogroup clanSound_Audio_Mixing clanSound Audio Mixing + /// \{ + + class SoundOutput_Description_Impl; + + /// \brief Sound output description class. + class SoundOutput_Description + { + public: + /// \brief Constructs a sound output description. + SoundOutput_Description(); + ~SoundOutput_Description(); + + /// \brief Returns the mixing frequency for the sound output device. + int get_mixing_frequency() const; + + /// \brief Returns the mixing latency in milliseconds. + int get_mixing_latency() const; + + /// \brief Sets the mixing frequency for the sound output device. + void set_mixing_frequency(int frequency); + + /// \brief Sets the mixing latency in milliseconds. + void set_mixing_latency(int latency); + + private: + std::shared_ptr impl; + }; + + /// \} +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Controller/window_controller.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Controller/window_controller.h new file mode 100644 index 0000000..9f23641 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Controller/window_controller.h @@ -0,0 +1,80 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../../Core/Signals/signal.h" + +namespace clan +{ + class View; + class WindowControllerImpl; + + /// Base class for controllers managing windows + class WindowController + { + public: + WindowController(); + virtual ~WindowController(); + + /// Returns the root view + const std::shared_ptr &root_view() const; + + /// Changes the root view + void set_root_view(std::shared_ptr root_view); + + /// Returns the window title + const std::string &title() const; + + /// Sets the window title + void set_title(const std::string &title); + + /// Sets the size of the window + void set_frame_size(const Sizef &size, bool resizable = true); + + /// Sets the size of the window + void set_content_size(const Sizef &size, bool resizable = true); + + /// Sets the icon used for the window + void set_icon(const std::vector &icon_images); + + /// Closes the window + void dismiss(); + + /// Slot container helping with automatic disconnection of connected slots when the controller is destroyed + SlotContainer slots; + + private: + WindowController(const WindowController &) = delete; + WindowController &operator=(const WindowController &) = delete; + + std::unique_ptr impl; + friend class WindowManager; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Controller/window_manager.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Controller/window_manager.h new file mode 100644 index 0000000..3b6a866 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Controller/window_manager.h @@ -0,0 +1,90 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include "../../Core/Math/point.h" +#include "window_controller.h" + +namespace clan +{ + class View; + class WindowManagerImpl; + + /// Manages one or more windows + class WindowManager + { + public: + WindowManager(); + ~WindowManager(); + + /// Notifices RunLoop to exit when last presented window is dismissed + void set_exit_on_last_close(bool enable = true); + + /// Shows a main window + void present_main(const std::shared_ptr &controller); + + template + std::shared_ptr present_main(Types &&... args) + { + auto controller = std::make_shared(std::forward(args)...); + present_main(controller); + return controller; + } + + /// Shows a modal dialog + void present_modal(View *owner, const std::shared_ptr &controller); + + template + std::shared_ptr present_modal(View *owner, Types &&... args) + { + auto controller = std::make_shared(std::forward(args)...); + present_modal(owner, controller); + return controller; + } + + /// Shows a popup window + void present_popup(View *owner, const Pointf &pos, const std::shared_ptr &controller); + + template + std::shared_ptr present_popup(View *owner, const Pointf &pos, Types &&... args) + { + auto controller = std::make_shared(std::forward(args)...); + present_popup(owner, controller); + return controller; + } + + private: + WindowManager(const WindowManager &) = delete; + WindowManager &operator=(const WindowManager &) = delete; + + std::unique_ptr impl; + friend class WindowController; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/activation_change_event.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/activation_change_event.h new file mode 100644 index 0000000..8a99677 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/activation_change_event.h @@ -0,0 +1,54 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "event.h" + +namespace clan +{ + /// Window activation change + enum class ActivationChangeType + { + activated, /// Window was activated + deactivated /// Window was deactivated + }; + + /// Window was activated or deactivated event + class ActivationChangeEvent : public EventUI + { + public: + ActivationChangeEvent(ActivationChangeType type) : _type(type) { } + + /// Window activation type + ActivationChangeType type() const { return _type; } + + private: + ActivationChangeType _type = ActivationChangeType::activated; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/close_event.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/close_event.h new file mode 100644 index 0000000..6dabad2 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/close_event.h @@ -0,0 +1,40 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "event.h" + +namespace clan +{ + /// Window close button was clicked event + class CloseEvent : public EventUI + { + public: + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/event.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/event.h new file mode 100644 index 0000000..622f583 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/event.h @@ -0,0 +1,95 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include + +namespace clan +{ + class View; + + /// UI event dispatch phase + enum class EventUIPhase + { + none, /// Event is not currently in any dispatch phase + capturing, /// Capture phase (inverse bubble from root to the target view) + at_target, /// Currently being dispatched to the target view + bubbling /// Event bubbling up from target view to root + }; + + /// Base class for events being dispatched through the view hiarchy + class EventUI + { + public: + virtual ~EventUI() { } + + /// Current active event phase during dispatch + EventUIPhase phase() const { return _phase; } + + /// The target view the event is fired for + std::shared_ptr target() { return _target; } + + /// View the event is currently being dispatched to + std::shared_ptr current_target() { return _current_target; } + + /// Flag if the event default action should be executed after dispatch + bool default_prevented() const { return _default_prevented; } + + /// Prevent default action from being executed after dispatch + void prevent_default() { _default_prevented = true; } + + //bool immediate_propagation_stopped() const { return _immediate_propagation_stopped; } + //void stop_immediate_propagation() { _propagation_stopped = true; _immediate_propagation_stopped = true; } + + /// Flag if event propagation should stop + bool propagation_stopped() const { return _propagation_stopped; } + + /// Stops event from propagating further + void stop_propagation() { _propagation_stopped = true; } + + /// Timestamp for event in milliseconds since 1970 + long long timestamp() const { return _timestamp; } + + /// Set event timestamp + void set_timestamp(long long ts) { _timestamp = ts; } + + private: + bool _default_prevented = false; + bool _propagation_stopped = false; + //bool _immediate_propagation_stopped = true; + EventUIPhase _phase = EventUIPhase::none; + std::shared_ptr _target; + std::shared_ptr _current_target; + long long _timestamp = 0; + + friend class View; + friend class ViewImpl; + friend class ViewTree; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/focus_change_event.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/focus_change_event.h new file mode 100644 index 0000000..79b2edc --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/focus_change_event.h @@ -0,0 +1,53 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "event.h" + +namespace clan +{ + /// Focus change type + enum class FocusChangeType + { + gained, /// View received the focus + lost /// View no longer has the focus + }; + + /// View focus changed event + class FocusChangeEvent : public EventUI + { + public: + FocusChangeEvent(FocusChangeType type) : _type(type) { } + + FocusChangeType type() const { return _type; } + + private: + FocusChangeType _type = FocusChangeType::gained; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/key_event.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/key_event.h new file mode 100644 index 0000000..20b7145 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/key_event.h @@ -0,0 +1,93 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "event.h" +#include "../../Core/Math/point.h" +#include "../../Display/Window/keys.h" +#include + +namespace clan +{ + /// Keyboard key event type + enum class KeyEventType + { + none, // No key event type specified + press, // Key was pressed + release // Key was released + }; + + /// Keyboard key event + class KeyEvent : public EventUI + { + public: + KeyEvent(KeyEventType type, Key key, int repeat_count, const std::string &text, const Pointf &pointer_pos, bool alt_down, bool shift_down, bool ctrl_down, bool cmd_down) : + _type(type), _key(key), _repeat_count(repeat_count), _text(text), _pointer_pos(pointer_pos), _alt_down(alt_down), _shift_down(shift_down), _ctrl_down(ctrl_down), _cmd_down(cmd_down) + { + } + + /// Key event type + KeyEventType type() const { return _type; } + + /// Key relevant for the event + Key key() const { return _key; } + + /// Key press repeat counter for key being held down + int repeat_count() const { return _repeat_count; } + + /// Unicode characters generated by this event + const std::string &text() const { return _text; } + + /// Cursor position returned in local content coordinates for the view specified + Pointf pointer_pos(View *view) const; + + /// True if the alt key was down + bool alt_down() const { return _alt_down; } + + /// True if the shift key was down + bool shift_down() const { return _shift_down; } + + /// True if the control key was down + bool ctrl_down() const { return _ctrl_down; } + + /// True if the command key was down + bool cmd_down() const { return _cmd_down; } + + private: + KeyEventType _type = KeyEventType::none; + Key _key = Key::none; + int _repeat_count = 0; + std::string _text; + Pointf _pointer_pos; + bool _alt_down = false; + bool _shift_down = false; + bool _ctrl_down = false; + bool _cmd_down = false; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/pointer_event.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/pointer_event.h new file mode 100644 index 0000000..1bb42b3 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/pointer_event.h @@ -0,0 +1,109 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "event.h" +#include "../../Core/Math/point.h" + +namespace clan +{ + /// Pointer button + enum class PointerButton + { + none, /// No button specified + left, /// Left button + right, /// Right button + middle, /// Middle/wheel button + wheel_up, /// Wheel up tick + wheel_down, /// Wheel down tick + xbutton1, /// Extra button 1 + xbutton2, /// Extra button 2 + xbutton3, /// Extra button 3 + xbutton4, /// Extra button 4 + xbutton5, /// Extra button 5 + xbutton6 /// Extra button 6 + }; + + /// Pointer event type + enum class PointerEventType + { + none, /// No event type specified + enter, /// Pointer entered area + leave, /// Pointer left area + move, /// Pointer moved above area + press, /// Pointer pressed + release, /// Pointer released + double_click, /// Pointer double click pressed + promixity_change /// Pen proximity changed + }; + + /// Pointer event + class PointerEvent : public EventUI + { + public: + PointerEvent(PointerEventType type, PointerButton button, const Pointf &pos, bool alt_down, bool shift_down, bool ctrl_down, bool cmd_down) : + _type(type), _button(button), _pos(pos), _alt_down(alt_down), _shift_down(shift_down), _ctrl_down(ctrl_down), _cmd_down(cmd_down) + { + } + + /// Pointer event type + PointerEventType type() const { return _type; } + + /// Pointer button relevant for the event + PointerButton button() const { return _button; } + + /// Pointer position relative to local view content coordinates + Pointf pos(View *view) const; + Pointf pos(const std::shared_ptr &view) const; + + /// Set event pointer position relative to local view content coordinates + void set_pos(View *view, const Pointf &pos); + + /// True if the alt key was down + bool alt_down() const { return _alt_down; } + + /// True if the shift key was down + bool shift_down() const { return _shift_down; } + + /// True if the control key was down + bool ctrl_down() const { return _ctrl_down; } + + /// True if the command key was down + bool cmd_down() const { return _cmd_down; } + + private: + PointerEventType _type = PointerEventType::enter; + PointerButton _button = PointerButton::none; + Pointf _pos; + bool _alt_down = false; + bool _shift_down = false; + bool _ctrl_down = false; + bool _cmd_down = false; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/resize_event.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/resize_event.h new file mode 100644 index 0000000..e8cf99d --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Events/resize_event.h @@ -0,0 +1,40 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "event.h" + +namespace clan +{ + /// Window resize event + class ResizeEvent : public EventUI + { + public: + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Image/image_source.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Image/image_source.h new file mode 100644 index 0000000..8d4063a --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/Image/image_source.h @@ -0,0 +1,50 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include +#include + +namespace clan +{ + class Canvas; + class Image; + + class ImageSource + { + public: + virtual Image image(Canvas &canvas) = 0; + static std::shared_ptr from_resource(const std::string &resource_name); + static std::shared_ptr from_callback(const std::function &get_image_callback); + static std::shared_ptr from_image(const Image &image); + + protected: + virtual ~ImageSource() { } + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/button_view.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/button_view.h new file mode 100644 index 0000000..156321d --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/button_view.h @@ -0,0 +1,66 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Artem Khomenko (add sticky property) +*/ + +#pragma once + +#include "../View/view.h" +#include "label_view.h" +#include "image_view.h" + +namespace clan +{ + class ButtonViewImpl; + + class ButtonView : public View + { + public: + ButtonView(); + ~ButtonView(); + + std::shared_ptr label(); + std::shared_ptr image_view(); + + bool disabled() const; + void set_disabled(); + void set_enabled(); + + void set_sticky(bool is_sticky); // If true - after first press the button remains pressed and need to press again. + bool sticky(); + bool pressed(); + void set_pressed(bool is_pressed); + + void move_label_before_image(); + void move_label_after_image(); + + std::function &func_clicked(); + + private: + std::unique_ptr impl; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/checkbox_view.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/checkbox_view.h new file mode 100644 index 0000000..6d55702 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/checkbox_view.h @@ -0,0 +1,78 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +** Mark Page +** Artem Khomenko (add label property and render_background()) +*/ + +#pragma once + +#include "../View/view.h" +#include "label_view.h" + +namespace clan +{ + class CheckBoxView_Impl; + + class CheckBoxView : public View + { + public: + + CheckBoxView(); + + std::shared_ptr label(); + + bool disabled() const; + void set_disabled(); + void set_enabled(); + + /// \brief Check + /// + /// \return checked state + bool checked() const; + + /// \brief Set checked + /// + /// \param enable = bool + void set_check(bool checked_state); + + /// \brief Func state changed + std::function &func_state_changed(); + + protected: + + /// Override - need to clear background under label due to Subpixel font rendering. + void render_background(Canvas &canvas) override; + + private: + std::shared_ptr impl; + + }; + +} + + diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/image_view.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/image_view.h new file mode 100644 index 0000000..a0c8ef5 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/image_view.h @@ -0,0 +1,79 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../View/view.h" +#include "../Image/image_source.h" + +namespace clan +{ + class Canvas; + class Image; + class ImageViewImpl; + + class ImageView : public View + { + public: + ImageView(); + + std::shared_ptr image(); + void set_image(const std::shared_ptr &image); + void set_image(const Image &image); + + std::shared_ptr highlighted_image(); + void set_highlighted_image(const std::shared_ptr &image); + void set_highlighted_image(const Image &image); + + /* + std::vector> animation_images(); + void set_animation_images(const std::vector> &images); + + std::vector> highlighted_animation_images(); + void set_highlighted_animation_images(const std::vector> &images); + + float animation_duration() const; + void set_animation_duration(float value); + + float animation_repeat_count() const; + void set_animation_repeat_count(float value); + + void start_animating(); + void stop_animating(); + bool is_animating() const; + */ + + protected: + void render_content(Canvas &canvas) override; + float calculate_preferred_width(Canvas &canvas) override; + float calculate_preferred_height(Canvas &canvas, float width) override; + + private: + std::shared_ptr impl; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/label_view.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/label_view.h new file mode 100644 index 0000000..2610cb1 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/label_view.h @@ -0,0 +1,97 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Artem Khomenko (modified set_text()) +*/ + +#pragma once + +#include "../View/view.h" +#include "../../Display/Font/font.h" +#include "../../Display/2D/color.h" + +namespace clan +{ + enum class TextAlignment + { + left, + right, + center, + justify/*, + start, + end*/ + }; + + enum class LineBreakMode + { + //word_wrapping, + //char_wrapping, + clipping, + truncating_head, + truncating_tail, + truncating_middle + }; + + class LabelViewImpl; + + class LabelView : public View + { + public: + LabelView(); + + std::string text() const; + + /// \brief Set text for display to the user + /// + /// \param value = Text + /// \param force_no_layout = when false or omitted, after setting the text occurs recalculate sizes + /// and positions of elements, what means complete repaint the entire window. When true - simply drawing + /// the new text. Also make sure that the style property "background color" is set for this or its parents. + void set_text(const std::string &value, bool force_no_layout = false); + + TextAlignment text_alignment() const; + void set_text_alignment(TextAlignment alignment); + + LineBreakMode line_break_mode() const; + void set_line_break_mode(LineBreakMode value); + + void layout_children(Canvas &canvas) override; + + /// Update the font in according to style. + void reset_font(); + + protected: + void render_content(Canvas &canvas) override; + float calculate_preferred_width(Canvas &canvas) override; + float calculate_preferred_height(Canvas &canvas, float width) override; + float calculate_first_baseline_offset(Canvas &canvas, float width) override; + float calculate_last_baseline_offset(Canvas &canvas, float width) override; + + private: + std::shared_ptr impl; + }; + +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/layout_views.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/layout_views.h new file mode 100644 index 0000000..24015c7 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/layout_views.h @@ -0,0 +1,62 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../View/view.h" +#include "../Style/style.h" + +namespace clan +{ + class RowView : public View + { + public: + RowView() + { + style()->set("flex-direction: row"); + } + }; + + class ColumnView : public View + { + public: + ColumnView() + { + style()->set("flex-direction: column"); + } + }; + + class SpacerView : public View + { + public: + SpacerView() + { + style()->set("flex: auto"); + } + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/listbox_view.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/listbox_view.h new file mode 100644 index 0000000..f098f87 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/listbox_view.h @@ -0,0 +1,72 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Artem Khomenko +*/ + +#pragma once + +#include "../View/view.h" +#include "scroll_view.h" + +namespace clan +{ + class ListBoxViewImpl; + + class ListBoxView : public ScrollView + { + public: + ListBoxView(); + ~ListBoxView(); + + void set_items(const std::vector> &items); + + template + void set_items(const std::vector &items, const std::function(const T &item)> &map_function) + { + std::vector> views; + views.reserve(items.size()); + for (const auto &item : items) + { + views.push_back(map_function(item)); + } + set_items(views); + } + + int selected_item() const; + void set_selected_item(int index); + + std::function &func_selection_changed(); + + void layout_children(Canvas &canvas) override; + + private: + std::unique_ptr impl; + + // Sets in set_selected_item() for scroll to selected in layout_children(). + bool needScrollToSelected = false; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/progress_view.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/progress_view.h new file mode 100644 index 0000000..2d2eaec --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/progress_view.h @@ -0,0 +1,52 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../View/view.h" + +namespace clan +{ + class Image; + + class ProgressView : public View + { + public: + float progress() const; + void set_progress(float value, bool animated = false); + + Image track_image() const; + void set_track_image(const Image &value); + + Image progress_image() const; + void set_progress_image(const Image &value); + + Colorf progress_color() const; + void set_progress_color(const Colorf &value); + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/radiobutton_view.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/radiobutton_view.h new file mode 100644 index 0000000..98abc3d --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/radiobutton_view.h @@ -0,0 +1,87 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Harry Storbacka +** Mark Page +*/ + +#pragma once + +#include "../View/view.h" + +namespace clan +{ + class RadioButtonView_Impl; + + /// \brief Radio button component. + class RadioButtonView : public View + { + public: + + RadioButtonView(); + + bool disabled() const; + void set_disabled(); + void set_enabled(); + + /// \brief Get Id + /// + /// \return id + int radio_id() const; + + /// \brief Is Selected + /// + /// \return true = selected + bool selected() const; + + /// \brief Get Group name + /// + /// \return group_name + std::string group_name() const; + + /// \brief Set id + /// + /// \param id = value + void set_radio_id(int id); + + /// \brief Set selected + /// + /// \param selected = bool + void set_selected(bool selected); + + /// \brief Set group name + void set_group_name(const std::string &str); + + /// \brief Func selected + std::function &func_selected(); + + private: + std::shared_ptr impl; + + friend class RadioButtonView_Impl; + }; + +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/scroll_view.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/scroll_view.h new file mode 100644 index 0000000..08e4da0 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/scroll_view.h @@ -0,0 +1,85 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Artem Khomenko +*/ + +#pragma once + +#include "../View/view.h" + +namespace clan +{ + enum class ContentOverflow + { + hidden, + scroll, + automatic + }; + + class ScrollBarView; + class ScrollViewImpl; + + class ScrollView : public View + { + public: + ScrollView(); + ~ScrollView(); + + std::shared_ptr scrollbar_x_view() const; + std::shared_ptr scrollbar_y_view() const; + + std::shared_ptr content_view() const; + + ContentOverflow overflow_x() const; + ContentOverflow overflow_y() const; + void set_overflow_x(ContentOverflow value); + void set_overflow_y(ContentOverflow value); + void set_overflow(ContentOverflow value_x, ContentOverflow value_y); + + Pointf content_offset() const; + void set_content_offset(const Pointf &offset, bool animated = false); + + void layout_children(Canvas &canvas) override; + + // Enable or disable. + bool disabled() const; + void set_disabled(); + void set_enabled(); + + /// Process mouse wheel events. When Shift pressed, scrolls horizontally, otherwise vertically. + void on_pointer_press(PointerEvent &e); + + protected: + float calculate_preferred_width(Canvas &canvas) override; + float calculate_preferred_height(Canvas &canvas, float width) override; + float calculate_first_baseline_offset(Canvas &canvas, float width) override; + float calculate_last_baseline_offset(Canvas &canvas, float width) override; + + private: + std::unique_ptr impl; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/scrollbar_view.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/scrollbar_view.h new file mode 100644 index 0000000..2f68d92 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/scrollbar_view.h @@ -0,0 +1,85 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Artem Khomenko +*/ + +#pragma once + +#include "../View/view.h" + +namespace clan +{ + class ScrollBarViewImpl; + + class ScrollBarView : public View + { + public: + // TODO: decide if "render_button_arrows" is this the best way of controlling rendering + ScrollBarView(bool render_button_arrows = true); + + std::shared_ptr button_decrement() const; + std::shared_ptr button_increment() const; + std::shared_ptr track() const; + std::shared_ptr thumb() const; + std::shared_ptr thumb_grip() const; + + bool vertical() const; + bool horizontal() const; + + void set_vertical(); + void set_horizontal(); + + bool disabled() const; + void set_disabled(); + void set_enabled(); + + double line_step() const; + double page_step() const; + + void set_line_step(double value); + void set_page_step(double value); + + /// When true the position can be only in integer amount of line_step. + void set_lock_to_line(bool lock); + + double min_position() const; + double max_position() const; + double position() const; + + void set_min_position(double value); + void set_max_position(double value); + void set_range(double min_value, double max_value); + void set_position(double value); + + Signal &sig_scroll(); + + void layout_children(Canvas &canvas) override; + + private: + std::shared_ptr impl; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/slider_view.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/slider_view.h new file mode 100644 index 0000000..d8963a3 --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/slider_view.h @@ -0,0 +1,78 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +** Mark Page +** Artem Khomenko +*/ + +#pragma once + +#include "../View/view.h" + +namespace clan +{ + class SliderViewImpl; + + class SliderView : public View + { + public: + SliderView(); + + std::shared_ptr track() const; + std::shared_ptr thumb() const; + + bool vertical() const; + bool horizontal() const; + + void set_vertical(); + void set_horizontal(); + + bool disabled() const; + void set_disabled(); + void set_enabled(); + + int max_position() const; + int position() const; + int min_position() const; + + void set_max_position(int v); + void set_position(int v); + void set_min_position(int v); + + void set_tick_count(int tick_count); + void set_page_step(int page_step); + + /// When true the position can be only in integer amount of tick_count. + void set_lock_to_ticks(bool lock); + + std::function &func_value_changed(); + + void layout_children(Canvas &canvas) override; + + private: + std::shared_ptr impl; + }; +} diff --git a/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/span_layout_view.h b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/span_layout_view.h new file mode 100644 index 0000000..274048b --- /dev/null +++ b/Extern/CompiledLibs/ClanLib/Include/ClanLib/UI/StandardViews/span_layout_view.h @@ -0,0 +1,67 @@ +/* +** ClanLib SDK +** Copyright (c) 1997-2016 The ClanLib Team +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +** +** Note: Some of the libraries ClanLib may link to may have additional +** requirements or restrictions. +** +** File Author(s): +** +** Magnus Norddahl +*/ + +#pragma once + +#include "../View/view.h" +#include "../../Display/Font/font.h" +#include "../../Display/2D/color.h" +#include "label_view.h" + +namespace clan +{ + class SpanLayoutViewImpl; + + class SpanLayoutView : public View + { + public: + SpanLayoutView(); + + const std::shared_ptr