├── .gitignore ├── .gitmodules ├── 3rd_party ├── glad │ ├── .gitignore │ ├── README.md │ ├── include │ │ ├── KHR │ │ │ └── khrplatform.h │ │ └── glad │ │ │ ├── glad.h │ │ │ ├── glad_egl.h │ │ │ ├── glad_glx.h │ │ │ └── glad_wgl.h │ └── src │ │ ├── glad.c │ │ ├── glad_egl.c │ │ ├── glad_glx.c │ │ └── glad_wgl.c ├── glfw │ ├── .mailmap │ ├── CMake │ │ ├── GenerateMappings.cmake │ │ ├── Info.plist.in │ │ ├── cmake_uninstall.cmake.in │ │ ├── glfw3.pc.in │ │ ├── glfw3Config.cmake.in │ │ ├── i686-w64-mingw32-clang.cmake │ │ ├── i686-w64-mingw32.cmake │ │ ├── modules │ │ │ ├── FindEpollShim.cmake │ │ │ └── FindOSMesa.cmake │ │ ├── x86_64-w64-mingw32-clang.cmake │ │ └── x86_64-w64-mingw32.cmake │ ├── CMakeLists.txt │ ├── LICENSE.md │ ├── README.md │ ├── deps │ │ ├── getopt.c │ │ ├── getopt.h │ │ ├── glad │ │ │ ├── gl.h │ │ │ ├── khrplatform.h │ │ │ ├── vk_platform.h │ │ │ └── vulkan.h │ │ ├── glad_gl.c │ │ ├── glad_vulkan.c │ │ ├── linmath.h │ │ ├── mingw │ │ │ ├── _mingw_dxhelper.h │ │ │ ├── dinput.h │ │ │ └── xinput.h │ │ ├── nuklear.h │ │ ├── nuklear_glfw_gl2.h │ │ ├── stb_image_write.h │ │ ├── tinycthread.c │ │ ├── tinycthread.h │ │ └── vs2008 │ │ │ └── stdint.h │ ├── docs │ │ ├── CMakeLists.txt │ │ ├── CODEOWNERS │ │ ├── CONTRIBUTING.md │ │ ├── Doxyfile.in │ │ ├── DoxygenLayout.xml │ │ ├── SUPPORT.md │ │ ├── build.dox │ │ ├── compat.dox │ │ ├── compile.dox │ │ ├── context.dox │ │ ├── extra.css │ │ ├── extra.css.map │ │ ├── extra.scss │ │ ├── footer.html │ │ ├── header.html │ │ ├── input.dox │ │ ├── internal.dox │ │ ├── intro.dox │ │ ├── main.dox │ │ ├── monitor.dox │ │ ├── moving.dox │ │ ├── news.dox │ │ ├── quick.dox │ │ ├── spaces.svg │ │ ├── vulkan.dox │ │ └── window.dox │ ├── examples │ │ ├── CMakeLists.txt │ │ ├── boing.c │ │ ├── gears.c │ │ ├── glfw.icns │ │ ├── glfw.ico │ │ ├── glfw.rc │ │ ├── heightmap.c │ │ ├── offscreen.c │ │ ├── particles.c │ │ ├── sharing.c │ │ ├── splitview.c │ │ ├── triangle-opengl.c │ │ ├── wave.c │ │ └── windows.c │ ├── include │ │ └── GLFW │ │ │ ├── glfw3.h │ │ │ └── glfw3native.h │ ├── src │ │ ├── CMakeLists.txt │ │ ├── cocoa_init.m │ │ ├── cocoa_joystick.h │ │ ├── cocoa_joystick.m │ │ ├── cocoa_monitor.m │ │ ├── cocoa_platform.h │ │ ├── cocoa_time.c │ │ ├── cocoa_window.m │ │ ├── context.c │ │ ├── egl_context.c │ │ ├── egl_context.h │ │ ├── glfw.rc.in │ │ ├── glfw_config.h.in │ │ ├── glx_context.c │ │ ├── glx_context.h │ │ ├── init.c │ │ ├── input.c │ │ ├── internal.h │ │ ├── linux_joystick.c │ │ ├── linux_joystick.h │ │ ├── mappings.h │ │ ├── mappings.h.in │ │ ├── monitor.c │ │ ├── nsgl_context.h │ │ ├── nsgl_context.m │ │ ├── null_init.c │ │ ├── null_joystick.c │ │ ├── null_joystick.h │ │ ├── null_monitor.c │ │ ├── null_platform.h │ │ ├── null_window.c │ │ ├── osmesa_context.c │ │ ├── osmesa_context.h │ │ ├── posix_thread.c │ │ ├── posix_thread.h │ │ ├── posix_time.c │ │ ├── posix_time.h │ │ ├── vulkan.c │ │ ├── wgl_context.c │ │ ├── wgl_context.h │ │ ├── win32_init.c │ │ ├── win32_joystick.c │ │ ├── win32_joystick.h │ │ ├── win32_monitor.c │ │ ├── win32_platform.h │ │ ├── win32_thread.c │ │ ├── win32_time.c │ │ ├── win32_window.c │ │ ├── window.c │ │ ├── wl_init.c │ │ ├── wl_monitor.c │ │ ├── wl_platform.h │ │ ├── wl_window.c │ │ ├── x11_init.c │ │ ├── x11_monitor.c │ │ ├── x11_platform.h │ │ ├── x11_window.c │ │ ├── xkb_unicode.c │ │ └── xkb_unicode.h │ └── tests │ │ ├── CMakeLists.txt │ │ ├── clipboard.c │ │ ├── cursor.c │ │ ├── empty.c │ │ ├── events.c │ │ ├── gamma.c │ │ ├── glfwinfo.c │ │ ├── icon.c │ │ ├── iconify.c │ │ ├── inputlag.c │ │ ├── joysticks.c │ │ ├── monitors.c │ │ ├── msaa.c │ │ ├── reopen.c │ │ ├── tearing.c │ │ ├── threads.c │ │ ├── timeout.c │ │ ├── title.c │ │ ├── triangle-vulkan.c │ │ └── window.c └── glm │ ├── CMakeLists.txt │ ├── CTestConfig.cmake │ ├── bench │ ├── CMakeLists.txt │ ├── core │ │ └── CMakeLists.txt │ ├── gtc │ │ └── CMakeLists.txt │ └── gtx │ │ └── CMakeLists.txt │ ├── copying.txt │ ├── doc │ ├── CMakeLists.txt │ ├── about.html │ ├── code.html │ ├── common │ │ ├── email.png │ │ ├── g-truc.png │ │ ├── logo.png │ │ ├── opengl.jpg │ │ ├── sourceforge.gif │ │ ├── style.css │ │ └── title.png │ ├── download.html │ ├── glm-0.9.3.pdf │ ├── goodies.html │ ├── goodies │ │ ├── logo1024x0640.png │ │ ├── logo1280x0800.png │ │ ├── logo1600x1000.png │ │ ├── logo1920x1200.png │ │ ├── logo2560x1600.png │ │ └── tenby-five.otf │ ├── image │ │ ├── 0029-mini.jpg │ │ ├── 0029.jpg │ │ ├── 0075-1.jpg │ │ ├── 0075-2.jpg │ │ ├── font-mini.png │ │ ├── font.png │ │ ├── logo-mini.png │ │ └── logo.png │ ├── index.html │ ├── man.doxy │ ├── pages.doxy │ ├── src │ │ ├── about.xsl │ │ ├── code.xsl │ │ ├── data.xml │ │ ├── download.xsl │ │ ├── dummy.cpp │ │ ├── goodies.xsl │ │ ├── link.xsl │ │ ├── news.xsl │ │ └── util.xsl │ └── theme │ │ ├── background.jpg │ │ ├── doxygen.css │ │ └── tabs.css │ ├── glm │ ├── CMakeLists.txt │ ├── core │ │ ├── _detail.hpp │ │ ├── _fixes.hpp │ │ ├── _swizzle.hpp │ │ ├── _swizzle_func.hpp │ │ ├── _vectorize.hpp │ │ ├── dummy.cpp │ │ ├── func_common.hpp │ │ ├── func_common.inl │ │ ├── func_exponential.hpp │ │ ├── func_exponential.inl │ │ ├── func_geometric.hpp │ │ ├── func_geometric.inl │ │ ├── func_integer.hpp │ │ ├── func_integer.inl │ │ ├── func_matrix.hpp │ │ ├── func_matrix.inl │ │ ├── func_noise.hpp │ │ ├── func_noise.inl │ │ ├── func_packing.hpp │ │ ├── func_packing.inl │ │ ├── func_trigonometric.hpp │ │ ├── func_trigonometric.inl │ │ ├── func_vector_relational.hpp │ │ ├── func_vector_relational.inl │ │ ├── hint.hpp │ │ ├── intrinsic_common.hpp │ │ ├── intrinsic_common.inl │ │ ├── intrinsic_exponential.hpp │ │ ├── intrinsic_exponential.inl │ │ ├── intrinsic_geometric.hpp │ │ ├── intrinsic_geometric.inl │ │ ├── intrinsic_matrix.hpp │ │ ├── intrinsic_matrix.inl │ │ ├── intrinsic_trigonometric.hpp │ │ ├── intrinsic_trigonometric.inl │ │ ├── intrinsic_vector_relational.hpp │ │ ├── intrinsic_vector_relational.inl │ │ ├── setup.hpp │ │ ├── type.hpp │ │ ├── type_float.hpp │ │ ├── type_gentype.hpp │ │ ├── type_gentype.inl │ │ ├── type_half.hpp │ │ ├── type_half.inl │ │ ├── type_int.hpp │ │ ├── type_mat.hpp │ │ ├── type_mat.inl │ │ ├── type_mat2x2.hpp │ │ ├── type_mat2x2.inl │ │ ├── type_mat2x3.hpp │ │ ├── type_mat2x3.inl │ │ ├── type_mat2x4.hpp │ │ ├── type_mat2x4.inl │ │ ├── type_mat3x2.hpp │ │ ├── type_mat3x2.inl │ │ ├── type_mat3x3.hpp │ │ ├── type_mat3x3.inl │ │ ├── type_mat3x4.hpp │ │ ├── type_mat3x4.inl │ │ ├── type_mat4x2.hpp │ │ ├── type_mat4x2.inl │ │ ├── type_mat4x3.hpp │ │ ├── type_mat4x3.inl │ │ ├── type_mat4x4.hpp │ │ ├── type_mat4x4.inl │ │ ├── type_size.hpp │ │ ├── type_vec.hpp │ │ ├── type_vec.inl │ │ ├── type_vec1.hpp │ │ ├── type_vec1.inl │ │ ├── type_vec2.hpp │ │ ├── type_vec2.inl │ │ ├── type_vec3.hpp │ │ ├── type_vec3.inl │ │ ├── type_vec4.hpp │ │ └── type_vec4.inl │ ├── ext.hpp │ ├── glm.hpp │ ├── gtc │ │ ├── half_float.hpp │ │ ├── half_float.inl │ │ ├── matrix_access.hpp │ │ ├── matrix_access.inl │ │ ├── matrix_integer.hpp │ │ ├── matrix_inverse.hpp │ │ ├── matrix_inverse.inl │ │ ├── matrix_transform.hpp │ │ ├── matrix_transform.inl │ │ ├── noise.hpp │ │ ├── noise.inl │ │ ├── quaternion.hpp │ │ ├── quaternion.inl │ │ ├── random.hpp │ │ ├── random.inl │ │ ├── swizzle.hpp │ │ ├── swizzle.inl │ │ ├── type_precision.hpp │ │ ├── type_precision.inl │ │ ├── type_ptr.hpp │ │ └── type_ptr.inl │ ├── gtx │ │ ├── associated_min_max.hpp │ │ ├── associated_min_max.inl │ │ ├── bit.hpp │ │ ├── bit.inl │ │ ├── closest_point.hpp │ │ ├── closest_point.inl │ │ ├── color_cast.hpp │ │ ├── color_cast.inl │ │ ├── color_space.hpp │ │ ├── color_space.inl │ │ ├── color_space_YCoCg.hpp │ │ ├── color_space_YCoCg.inl │ │ ├── compatibility.hpp │ │ ├── compatibility.inl │ │ ├── component_wise.hpp │ │ ├── component_wise.inl │ │ ├── constants.hpp │ │ ├── constants.inl │ │ ├── epsilon.hpp │ │ ├── epsilon.inl │ │ ├── euler_angles.hpp │ │ ├── euler_angles.inl │ │ ├── extend.hpp │ │ ├── extend.inl │ │ ├── extented_min_max.hpp │ │ ├── extented_min_max.inl │ │ ├── fast_exponential.hpp │ │ ├── fast_exponential.inl │ │ ├── fast_square_root.hpp │ │ ├── fast_square_root.inl │ │ ├── fast_trigonometry.hpp │ │ ├── fast_trigonometry.inl │ │ ├── gradient_paint.hpp │ │ ├── gradient_paint.inl │ │ ├── handed_coordinate_space.hpp │ │ ├── handed_coordinate_space.inl │ │ ├── inertia.hpp │ │ ├── inertia.inl │ │ ├── int_10_10_10_2.hpp │ │ ├── int_10_10_10_2.inl │ │ ├── integer.hpp │ │ ├── integer.inl │ │ ├── intersect.hpp │ │ ├── intersect.inl │ │ ├── log_base.hpp │ │ ├── log_base.inl │ │ ├── matrix_cross_product.hpp │ │ ├── matrix_cross_product.inl │ │ ├── matrix_interpolation.hpp │ │ ├── matrix_interpolation.inl │ │ ├── matrix_major_storage.hpp │ │ ├── matrix_major_storage.inl │ │ ├── matrix_operation.hpp │ │ ├── matrix_operation.inl │ │ ├── matrix_query.hpp │ │ ├── matrix_query.inl │ │ ├── mixed_product.hpp │ │ ├── mixed_product.inl │ │ ├── multiple.hpp │ │ ├── multiple.inl │ │ ├── noise.hpp │ │ ├── noise.inl │ │ ├── norm.hpp │ │ ├── norm.inl │ │ ├── normal.hpp │ │ ├── normal.inl │ │ ├── normalize_dot.hpp │ │ ├── normalize_dot.inl │ │ ├── number_precision.hpp │ │ ├── number_precision.inl │ │ ├── ocl_type.hpp │ │ ├── ocl_type.inl │ │ ├── optimum_pow.hpp │ │ ├── optimum_pow.inl │ │ ├── orthonormalize.hpp │ │ ├── orthonormalize.inl │ │ ├── perpendicular.hpp │ │ ├── perpendicular.inl │ │ ├── polar_coordinates.hpp │ │ ├── polar_coordinates.inl │ │ ├── projection.hpp │ │ ├── projection.inl │ │ ├── quaternion.hpp │ │ ├── quaternion.inl │ │ ├── random.hpp │ │ ├── random.inl │ │ ├── raw_data.hpp │ │ ├── raw_data.inl │ │ ├── reciprocal.hpp │ │ ├── reciprocal.inl │ │ ├── rotate_vector.hpp │ │ ├── rotate_vector.inl │ │ ├── simd_mat4.hpp │ │ ├── simd_mat4.inl │ │ ├── simd_vec4.hpp │ │ ├── simd_vec4.inl │ │ ├── spline.hpp │ │ ├── spline.inl │ │ ├── std_based_type.hpp │ │ ├── std_based_type.inl │ │ ├── string_cast.hpp │ │ ├── string_cast.inl │ │ ├── transform.hpp │ │ ├── transform.inl │ │ ├── transform2.hpp │ │ ├── transform2.inl │ │ ├── ulp.hpp │ │ ├── ulp.inl │ │ ├── unsigned_int.hpp │ │ ├── unsigned_int.inl │ │ ├── vec1.hpp │ │ ├── vec1.inl │ │ ├── vector_access.hpp │ │ ├── vector_access.inl │ │ ├── vector_angle.hpp │ │ ├── vector_angle.inl │ │ ├── vector_query.hpp │ │ ├── vector_query.inl │ │ ├── verbose_operator.hpp │ │ ├── verbose_operator.inl │ │ ├── wrap.hpp │ │ └── wrap.inl │ └── virtrev │ │ └── xstream.hpp │ ├── readme.txt │ ├── test │ ├── CMakeLists.txt │ ├── bug │ │ └── CMakeLists.txt │ ├── core │ │ ├── CMakeLists.txt │ │ ├── core_func_common.cpp │ │ ├── core_func_exponential.cpp │ │ ├── core_func_geometric.cpp │ │ ├── core_func_integer.cpp │ │ ├── core_func_matrix.cpp │ │ ├── core_func_noise.cpp │ │ ├── core_func_packing.cpp │ │ ├── core_func_swizzle.cpp │ │ ├── core_func_trigonometric.cpp │ │ ├── core_func_vector_relational.cpp │ │ ├── core_setup_message.cpp │ │ ├── core_setup_precision.cpp │ │ ├── core_type_float.cpp │ │ ├── core_type_half.cpp │ │ ├── core_type_int.cpp │ │ ├── core_type_length.cpp │ │ ├── core_type_mat2x2.cpp │ │ ├── core_type_mat2x3.cpp │ │ ├── core_type_mat2x4.cpp │ │ ├── core_type_mat3x2.cpp │ │ ├── core_type_mat3x3.cpp │ │ ├── core_type_mat3x4.cpp │ │ ├── core_type_mat4x2.cpp │ │ ├── core_type_mat4x3.cpp │ │ ├── core_type_mat4x4.cpp │ │ ├── core_type_vec1.cpp │ │ ├── core_type_vec2.cpp │ │ ├── core_type_vec3.cpp │ │ └── core_type_vec4.cpp │ ├── external │ │ └── gli │ │ │ ├── CMakeLists.txt │ │ │ ├── core │ │ │ ├── dummy.cpp │ │ │ ├── generate_mipmaps.hpp │ │ │ ├── generate_mipmaps.inl │ │ │ ├── image2d.hpp │ │ │ ├── image2d.inl │ │ │ ├── operation.hpp │ │ │ ├── operation.inl │ │ │ ├── operator.hpp │ │ │ ├── operator.inl │ │ │ ├── shared_array.hpp │ │ │ ├── shared_array.inl │ │ │ ├── shared_ptr.hpp │ │ │ ├── shared_ptr.inl │ │ │ ├── size.hpp │ │ │ ├── size.inl │ │ │ ├── texture2d.hpp │ │ │ ├── texture2d.inl │ │ │ ├── texture2d_array.hpp │ │ │ ├── texture2d_array.inl │ │ │ ├── texture_cube.hpp │ │ │ ├── texture_cube.inl │ │ │ ├── texture_cube_array.hpp │ │ │ └── texture_cube_array.inl │ │ │ ├── gli.hpp │ │ │ └── gtx │ │ │ ├── compression.hpp │ │ │ ├── compression.inl │ │ │ ├── fetch.hpp │ │ │ ├── fetch.inl │ │ │ ├── gl_texture2d.hpp │ │ │ ├── gl_texture2d.inl │ │ │ ├── gradient.hpp │ │ │ ├── gradient.inl │ │ │ ├── loader.hpp │ │ │ ├── loader.inl │ │ │ ├── loader_dds10.hpp │ │ │ ├── loader_dds10.inl │ │ │ ├── loader_dds9.hpp │ │ │ ├── loader_dds9.inl │ │ │ ├── loader_tga.hpp │ │ │ ├── loader_tga.inl │ │ │ ├── wavelet.hpp │ │ │ └── wavelet.inl │ ├── glm.cppcheck │ ├── gtc │ │ ├── CMakeLists.txt │ │ ├── gtc_half_float.cpp │ │ ├── gtc_matrix_access.cpp │ │ ├── gtc_matrix_integer.cpp │ │ ├── gtc_matrix_inverse.cpp │ │ ├── gtc_matrix_transform.cpp │ │ ├── gtc_noise.cpp │ │ ├── gtc_quaternion.cpp │ │ ├── gtc_random.cpp │ │ ├── gtc_swizzle.cpp │ │ ├── gtc_type_precision.cpp │ │ └── gtc_type_ptr.cpp │ └── gtx │ │ ├── CMakeLists.txt │ │ ├── gtx_bit.cpp │ │ ├── gtx_gradient_paint.cpp │ │ ├── gtx_integer.cpp │ │ ├── gtx_matrix_query.cpp │ │ ├── gtx_noise.cpp │ │ ├── gtx_quaternion.cpp │ │ ├── gtx_random.cpp │ │ ├── gtx_rotate_vector.cpp │ │ ├── gtx_simd_mat4.cpp │ │ ├── gtx_simd_vec4.cpp │ │ ├── gtx_string_cast.cpp │ │ ├── gtx_ulp.cpp │ │ ├── gtx_vector_angle.cpp │ │ └── gtx_vector_query.cpp │ └── util │ ├── FindGLM.cmake │ ├── autoexp.txt │ ├── autoexp.vc2010.dat │ ├── gen_external_templates.py │ ├── glm_core.cpp │ └── usertype.dat ├── CMakeLists.txt ├── LICENSE ├── README.md ├── server ├── LICENSE ├── client.js ├── index.html └── signaling-server.py └── src ├── Camera.h ├── Shader.h ├── Shaders ├── Cube.fs ├── Cube.vs ├── text.fs └── text.vs ├── common.h ├── dispatchqueue.cpp ├── dispatchqueue.hpp ├── encoder.cpp ├── encoder.h ├── fonts └── notomono.ttf ├── h264fileparser.cpp ├── h264fileparser.hpp ├── helpers.cpp ├── helpers.hpp ├── main.cpp ├── rtc_publisher.cpp ├── rtc_publisher.h ├── rtmp_publisher.cpp ├── rtmp_publisher.h ├── scene.cpp ├── scene.h ├── stream.cpp ├── stream.hpp ├── streamer.cpp └── streamer.h /.gitignore: -------------------------------------------------------------------------------- 1 | cmake-build-debug/3rd-party 2 | cmake-build-debug 3 | .vscode 4 | .DS_Store 5 | .idea 6 | 7 | .mp4 8 | 9 | build -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "3rd_party/librtc"] 2 | path = 3rd_party/librtc 3 | url = https://github.com/paullouisageneau/libdatachannel.git 4 | -------------------------------------------------------------------------------- /3rd_party/glad/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.xml 3 | *.kdev4 4 | build/ 5 | *.o -------------------------------------------------------------------------------- /3rd_party/glad/README.md: -------------------------------------------------------------------------------- 1 | glad 2 | ==== 3 | 4 | This branch contains an OpenGL loader generated with `glad` for the C programming 5 | language. 6 | 7 | python2 main.py --out-path=./ --generator=c 8 | 9 | It includes all functions needed for a OpenGL 4.4 compatability context including 10 | all extensions found in `gl.xml` fetched on 4th August 2013. -------------------------------------------------------------------------------- /3rd_party/glfw/.mailmap: -------------------------------------------------------------------------------- 1 | Camilla Löwy 2 | Camilla Löwy 3 | Camilla Löwy 4 | 5 | Emmanuel Gil Peyrot 6 | 7 | Marcus Geelnard 8 | Marcus Geelnard 9 | Marcus Geelnard 10 | 11 | -------------------------------------------------------------------------------- /3rd_party/glfw/CMake/GenerateMappings.cmake: -------------------------------------------------------------------------------- 1 | # Usage: 2 | # cmake -P GenerateMappings.cmake 3 | 4 | set(source_url "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt") 5 | set(source_path "${CMAKE_CURRENT_BINARY_DIR}/gamecontrollerdb.txt") 6 | set(template_path "${CMAKE_ARGV3}") 7 | set(target_path "${CMAKE_ARGV4}") 8 | 9 | if (NOT EXISTS "${template_path}") 10 | message(FATAL_ERROR "Failed to find template file ${template_path}") 11 | endif() 12 | 13 | file(DOWNLOAD "${source_url}" "${source_path}" 14 | STATUS download_status 15 | TLS_VERIFY on) 16 | 17 | list(GET download_status 0 status_code) 18 | list(GET download_status 1 status_message) 19 | 20 | if (status_code) 21 | message(FATAL_ERROR "Failed to download ${source_url}: ${status_message}") 22 | endif() 23 | 24 | file(STRINGS "${source_path}" lines) 25 | foreach(line ${lines}) 26 | if ("${line}" MATCHES "^[0-9a-fA-F].*$") 27 | set(GLFW_GAMEPAD_MAPPINGS "${GLFW_GAMEPAD_MAPPINGS}\"${line}\",\n") 28 | endif() 29 | endforeach() 30 | 31 | configure_file("${template_path}" "${target_path}" @ONLY NEWLINE_STYLE UNIX) 32 | file(REMOVE "${source_path}") 33 | 34 | -------------------------------------------------------------------------------- /3rd_party/glfw/CMake/Info.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${MACOSX_BUNDLE_EXECUTABLE_NAME} 9 | CFBundleGetInfoString 10 | ${MACOSX_BUNDLE_INFO_STRING} 11 | CFBundleIconFile 12 | ${MACOSX_BUNDLE_ICON_FILE} 13 | CFBundleIdentifier 14 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 19 | CFBundleName 20 | ${MACOSX_BUNDLE_BUNDLE_NAME} 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING} 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | ${MACOSX_BUNDLE_BUNDLE_VERSION} 29 | CSResourcesFileMapped 30 | 31 | LSRequiresCarbon 32 | 33 | NSHumanReadableCopyright 34 | ${MACOSX_BUNDLE_COPYRIGHT} 35 | NSHighResolutionCapable 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /3rd_party/glfw/CMake/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | 2 | if (NOT EXISTS "@GLFW_BINARY_DIR@/install_manifest.txt") 3 | message(FATAL_ERROR "Cannot find install manifest: \"@GLFW_BINARY_DIR@/install_manifest.txt\"") 4 | endif() 5 | 6 | file(READ "@GLFW_BINARY_DIR@/install_manifest.txt" files) 7 | string(REGEX REPLACE "\n" ";" files "${files}") 8 | 9 | foreach (file ${files}) 10 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 11 | if (EXISTS "$ENV{DESTDIR}${file}") 12 | exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 13 | OUTPUT_VARIABLE rm_out 14 | RETURN_VALUE rm_retval) 15 | if (NOT "${rm_retval}" STREQUAL 0) 16 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 17 | endif() 18 | elseif (IS_SYMLINK "$ENV{DESTDIR}${file}") 19 | EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 20 | OUTPUT_VARIABLE rm_out 21 | RETURN_VALUE rm_retval) 22 | if (NOT "${rm_retval}" STREQUAL 0) 23 | message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"") 24 | endif() 25 | else() 26 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 27 | endif() 28 | endforeach() 29 | 30 | -------------------------------------------------------------------------------- /3rd_party/glfw/CMake/glfw3.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 4 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 5 | 6 | Name: GLFW 7 | Description: A multi-platform library for OpenGL, window and input 8 | Version: @GLFW_VERSION@ 9 | URL: https://www.glfw.org/ 10 | Requires.private: @GLFW_PKG_DEPS@ 11 | Libs: -L${libdir} -l@GLFW_LIB_NAME@ 12 | Libs.private: @GLFW_PKG_LIBS@ 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /3rd_party/glfw/CMake/glfw3Config.cmake.in: -------------------------------------------------------------------------------- 1 | include(CMakeFindDependencyMacro) 2 | find_dependency(Threads) 3 | include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake") 4 | -------------------------------------------------------------------------------- /3rd_party/glfw/CMake/i686-w64-mingw32-clang.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 32-bit MinGW-w64 Clang 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-clang") 5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-clang++") 6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /3rd_party/glfw/CMake/i686-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 32-bit MinGW-w64 GCC 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /3rd_party/glfw/CMake/modules/FindEpollShim.cmake: -------------------------------------------------------------------------------- 1 | # Find EpollShim 2 | # Once done, this will define 3 | # 4 | # EPOLLSHIM_FOUND - System has EpollShim 5 | # EPOLLSHIM_INCLUDE_DIRS - The EpollShim include directories 6 | # EPOLLSHIM_LIBRARIES - The libraries needed to use EpollShim 7 | 8 | find_path(EPOLLSHIM_INCLUDE_DIRS NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim) 9 | find_library(EPOLLSHIM_LIBRARIES NAMES epoll-shim libepoll-shim HINTS /usr/local/lib) 10 | 11 | if (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES) 12 | set(EPOLLSHIM_FOUND TRUE) 13 | endif (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES) 14 | 15 | include(FindPackageHandleStandardArgs) 16 | find_package_handle_standard_args(EPOLLSHIM DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS) 17 | mark_as_advanced(EPOLLSHIM_INCLUDE_DIRS EPOLLSHIM_LIBRARIES) 18 | -------------------------------------------------------------------------------- /3rd_party/glfw/CMake/modules/FindOSMesa.cmake: -------------------------------------------------------------------------------- 1 | # Try to find OSMesa on a Unix system 2 | # 3 | # This will define: 4 | # 5 | # OSMESA_LIBRARIES - Link these to use OSMesa 6 | # OSMESA_INCLUDE_DIR - Include directory for OSMesa 7 | # 8 | # Copyright (c) 2014 Brandon Schaefer 9 | 10 | if (NOT WIN32) 11 | 12 | find_package (PkgConfig) 13 | pkg_check_modules (PKG_OSMESA QUIET osmesa) 14 | 15 | set (OSMESA_INCLUDE_DIR ${PKG_OSMESA_INCLUDE_DIRS}) 16 | set (OSMESA_LIBRARIES ${PKG_OSMESA_LIBRARIES}) 17 | 18 | endif () 19 | -------------------------------------------------------------------------------- /3rd_party/glfw/CMake/x86_64-w64-mingw32-clang.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 64-bit MinGW-w64 Clang 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-clang") 5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-clang++") 6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /3rd_party/glfw/CMake/x86_64-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 64-bit MinGW-w64 GCC 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /3rd_party/glfw/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | 3 | Copyright (c) 2006-2019 Camilla Löwy 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would 16 | be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not 19 | be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | 24 | -------------------------------------------------------------------------------- /3rd_party/glfw/deps/getopt.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, Kim Gräsman 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * * Redistributions of source code must retain the above copyright notice, 7 | * this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above copyright notice, 9 | * this list of conditions and the following disclaimer in the documentation 10 | * and/or other materials provided with the distribution. 11 | * * Neither the name of Kim Gräsman nor the names of contributors may be used 12 | * to endorse or promote products derived from this software without specific 13 | * prior written permission. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | * ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT, 19 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef INCLUDED_GETOPT_PORT_H 28 | #define INCLUDED_GETOPT_PORT_H 29 | 30 | #if defined(__cplusplus) 31 | extern "C" { 32 | #endif 33 | 34 | extern const int no_argument; 35 | extern const int required_argument; 36 | extern const int optional_argument; 37 | 38 | extern char* optarg; 39 | extern int optind, opterr, optopt; 40 | 41 | struct option { 42 | const char* name; 43 | int has_arg; 44 | int* flag; 45 | int val; 46 | }; 47 | 48 | int getopt(int argc, char* const argv[], const char* optstring); 49 | 50 | int getopt_long(int argc, char* const argv[], 51 | const char* optstring, const struct option* longopts, int* longindex); 52 | 53 | #if defined(__cplusplus) 54 | } 55 | #endif 56 | 57 | #endif // INCLUDED_GETOPT_PORT_H 58 | -------------------------------------------------------------------------------- /3rd_party/glfw/docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # NOTE: The order of this list determines the order of items in the Guides 3 | # (i.e. Pages) list in the generated documentation 4 | set(GLFW_DOXYGEN_SOURCES 5 | "include/GLFW/glfw3.h" 6 | "include/GLFW/glfw3native.h" 7 | "docs/main.dox" 8 | "docs/news.dox" 9 | "docs/quick.dox" 10 | "docs/moving.dox" 11 | "docs/compile.dox" 12 | "docs/build.dox" 13 | "docs/intro.dox" 14 | "docs/context.dox" 15 | "docs/monitor.dox" 16 | "docs/window.dox" 17 | "docs/input.dox" 18 | "docs/vulkan.dox" 19 | "docs/compat.dox" 20 | "docs/internal.dox") 21 | 22 | # Format the source list into a Doxyfile INPUT value that Doxygen can parse 23 | foreach(path IN LISTS GLFW_DOXYGEN_SOURCES) 24 | set(GLFW_DOXYGEN_INPUT "${GLFW_DOXYGEN_INPUT} \\\n\"${GLFW_SOURCE_DIR}/${path}\"") 25 | endforeach() 26 | 27 | configure_file(Doxyfile.in Doxyfile @ONLY) 28 | 29 | add_custom_target(docs ALL "${DOXYGEN_EXECUTABLE}" 30 | WORKING_DIRECTORY "${GLFW_BINARY_DIR}/docs" 31 | COMMENT "Generating HTML documentation" VERBATIM) 32 | 33 | set_target_properties(docs PROPERTIES FOLDER "GLFW3") 34 | 35 | -------------------------------------------------------------------------------- /3rd_party/glfw/docs/CODEOWNERS: -------------------------------------------------------------------------------- 1 | 2 | * @elmindreda 3 | 4 | src/wl_* @linkmauve 5 | 6 | docs/*.css @glfw/webdev 7 | docs/*.scss @glfw/webdev 8 | docs/*.html @glfw/webdev 9 | docs/*.xml @glfw/webdev 10 | 11 | -------------------------------------------------------------------------------- /3rd_party/glfw/docs/DoxygenLayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /3rd_party/glfw/docs/SUPPORT.md: -------------------------------------------------------------------------------- 1 | # Support resources 2 | 3 | See the [latest documentation](http://www.glfw.org/docs/latest/) for tutorials, 4 | guides and the API reference. 5 | 6 | If you have questions about using GLFW, we have a 7 | [forum](https://discourse.glfw.org/), and the `#glfw` IRC channel on 8 | [Freenode](http://freenode.net/). 9 | 10 | Bugs are reported to our [issue tracker](https://github.com/glfw/glfw/issues). 11 | Please check the [contribution 12 | guide](https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md) for 13 | information on what to include when reporting a bug. 14 | 15 | -------------------------------------------------------------------------------- /3rd_party/glfw/docs/extra.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sourceRoot":"","sources":["extra.scss"],"names":[],"mappings":"AA8EA,4GACI,gBACA,iBAGJ,yBACC,yDAGD,6HACC,sDAGD,yIACC,sDAGD,mBACI,WA9EuB,KA+EvB,iBAGJ,uBACC,MAzFoB,QA0FjB,iBAGJ,6UACC,gBAGD,mJACC,YAGD,yHACC,iBAGD,sBACC,gBAGD,4LACC,UAGD,yCACC,aAGD,kMACC,WAnHgC,QAsHjC,KACC,MA1HoB,QA6HrB,sDACC,MA/Ge,QAgHf,mBAGD,GACE,iBACA,eAGF,GACE,iBACA,gBACA,eAGF,GACE,iBACA,gBACA,eAGF,YACC,eACA,gBACA,gBACA,eACA,cAEA,aACA,mBACA,eACA,2BACA,mBACA,sBAGD,UACC,iBACA,mBACA,MA/J0B,KAgK1B,gBACA,qEAGD,YACC,qBACA,kBACA,YAGD,yBACC,WAGD,oCACC,iBACA,gBACA,cACA,MAlL0B,KAqL3B,YACC,eAGD,8CACC,qBAGD,mBACC,MA9L0B,KAiM3B,eACC,kBACA,YACA,eAGD,KACC,WAxM0B,KA2M3B,UACC,gBACA,cACA,eAGD,WACC,gBACA,cACA,eAGD,UACI,aAGJ,mBACI,iBACA,iBAGJ,WACC,gBACA,aACA,mBACA,eACA,2BACA,mBACA,sBAGD,mEACC,MA9OgC,QAiPjC,gCACC,MArPoB,QAwPrB,sCACC,MAjOoB,KAoOrB,yBACC,kBAGD,UACC,iBAGD,wBACC,gBACA,cACA,eACA,qBAGD,uDACC,gEACA,+BACA,+BACA,gBACA,MArPgB,KAwPjB,mBACC,MA5PoB,KA6PpB,aACA,kBACA,yBAGD,QACC,WACA,WAGD,WACC,iBAGD,WACC,mBAGD,WACC,cACA,eACA,qBAGD,oCACC,gEACA,kCACA,2BACA,MAlSe,QAmSf,yBACA,kBAGD,WACC,MA3QuB,QA8QxB,cACC,sBACA,2BACA,4BACA,mBAGD,cACC,sBACA,+BACA,8BACA,gBAGD,mCACC,wBACA,iBACA,sBACA,kBAGD,gIACC,MAxToB,KAyTpB,qBAGD,cACC,wBACA,iBACA,sBACA,kBAGD,iBACC,WACA,4EAGD,oCApSC,gEACA,kCACA,cACA,yBAqSD,wBAxSC,gEACA,kCACA,cACA,yBAySD,qBA5SC,gEACA,kCACA,cACA,yBA6SD,gBAhTC,gEACA,kCACA,cACA,yBAiTD,iGACC,kBACA,YACA,2BACA,aAGD,kRACC,cAGD,SACC,oBAGD,0BACC,mBACA,kBACA,YACA,YACA,cACA,2BACA,aAGD,+CACC,MA1YoB,QA6YrB,+BACC,cAGD,sBACC,cAGD,+CACC,cACA,iBAGD,mBACC,cAGD,KACC,aACA","file":"extra.css"} -------------------------------------------------------------------------------- /3rd_party/glfw/docs/footer.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /3rd_party/glfw/docs/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | $projectname: $title 9 | $title 10 | 11 | 12 | 13 | $treeview 14 | $search 15 | $mathjax 16 | 17 | $extrastylesheet 18 | 19 | 20 |
21 | 22 | 23 |
24 |
25 | GLFW 26 | 31 |
32 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /3rd_party/glfw/docs/main.dox: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | @mainpage notitle 4 | 5 | @section main_intro Introduction 6 | 7 | GLFW is a free, Open Source, multi-platform library for OpenGL, OpenGL ES and 8 | Vulkan application development. It provides a simple, platform-independent API 9 | for creating windows, contexts and surfaces, reading input, handling events, etc. 10 | 11 | @ref news_34 list new features, caveats and deprecations. 12 | 13 | @ref quick_guide is a guide for users new to GLFW. It takes you through how to 14 | write a small but complete program. 15 | 16 | There are guides for each section of the API: 17 | 18 | - @ref intro_guide – initialization, error handling and high-level design 19 | - @ref window_guide – creating and working with windows and framebuffers 20 | - @ref context_guide – working with OpenGL and OpenGL ES contexts 21 | - @ref vulkan_guide - working with Vulkan objects and extensions 22 | - @ref monitor_guide – enumerating and working with monitors and video modes 23 | - @ref input_guide – receiving events, polling and processing input 24 | 25 | Once you have written a program, see @ref compile_guide and @ref build_guide. 26 | 27 | The [reference documentation](modules.html) provides more detailed information 28 | about specific functions. 29 | 30 | @ref moving_guide explains what has changed and how to update existing code to 31 | use the new API. 32 | 33 | There is a section on @ref guarantees_limitations for pointer lifetimes, 34 | reentrancy, thread safety, event order and backward and forward compatibility. 35 | 36 | The [FAQ](https://www.glfw.org/faq.html) answers many common questions about the 37 | design, implementation and use of GLFW. 38 | 39 | Finally, @ref compat_guide explains what APIs, standards and protocols GLFW uses 40 | and what happens when they are not present on a given machine. 41 | 42 | This documentation was generated with Doxygen. The sources for it are available 43 | in both the [source distribution](https://www.glfw.org/download.html) and 44 | [GitHub repository](https://github.com/glfw/glfw). 45 | 46 | */ 47 | -------------------------------------------------------------------------------- /3rd_party/glfw/examples/glfw.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glfw/examples/glfw.icns -------------------------------------------------------------------------------- /3rd_party/glfw/examples/glfw.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glfw/examples/glfw.ico -------------------------------------------------------------------------------- /3rd_party/glfw/examples/glfw.rc: -------------------------------------------------------------------------------- 1 | 2 | GLFW_ICON ICON "glfw.ico" 3 | 4 | -------------------------------------------------------------------------------- /3rd_party/glfw/src/cocoa_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 Cocoa - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2017 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #define _GLFW_PLATFORM_JOYSTICK_STATE _GLFWjoystickNS ns 33 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE struct { int dummyJoystick; } 34 | 35 | #define _GLFW_PLATFORM_MAPPING_NAME "Mac OS X" 36 | 37 | // Cocoa-specific per-joystick data 38 | // 39 | typedef struct _GLFWjoystickNS 40 | { 41 | IOHIDDeviceRef device; 42 | CFMutableArrayRef axes; 43 | CFMutableArrayRef buttons; 44 | CFMutableArrayRef hats; 45 | } _GLFWjoystickNS; 46 | 47 | -------------------------------------------------------------------------------- /3rd_party/glfw/src/glfw.rc.in: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | VS_VERSION_INFO VERSIONINFO 5 | FILEVERSION @GLFW_VERSION_MAJOR@,@GLFW_VERSION_MINOR@,@GLFW_VERSION_PATCH@,0 6 | PRODUCTVERSION @GLFW_VERSION_MAJOR@,@GLFW_VERSION_MINOR@,@GLFW_VERSION_PATCH@,0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEFLAGS 0 9 | FILEOS VOS_NT_WINDOWS32 10 | FILETYPE VFT_DLL 11 | FILESUBTYPE 0 12 | { 13 | BLOCK "StringFileInfo" 14 | { 15 | BLOCK "040904B0" 16 | { 17 | VALUE "CompanyName", "GLFW" 18 | VALUE "FileDescription", "GLFW @GLFW_VERSION@ DLL" 19 | VALUE "FileVersion", "@GLFW_VERSION@" 20 | VALUE "OriginalFilename", "glfw3.dll" 21 | VALUE "ProductName", "GLFW" 22 | VALUE "ProductVersion", "@GLFW_VERSION@" 23 | } 24 | } 25 | BLOCK "VarFileInfo" 26 | { 27 | VALUE "Translation", 0x409, 1200 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /3rd_party/glfw/src/linux_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 Linux - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #define _GLFW_PLATFORM_JOYSTICK_STATE _GLFWjoystickLinux linjs 32 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE _GLFWlibraryLinux linjs 33 | 34 | #define _GLFW_PLATFORM_MAPPING_NAME "Linux" 35 | 36 | // Linux-specific joystick data 37 | // 38 | typedef struct _GLFWjoystickLinux 39 | { 40 | int fd; 41 | char path[PATH_MAX]; 42 | int keyMap[KEY_CNT - BTN_MISC]; 43 | int absMap[ABS_CNT]; 44 | struct input_absinfo absInfo[ABS_CNT]; 45 | int hats[4][2]; 46 | } _GLFWjoystickLinux; 47 | 48 | // Linux-specific joystick API data 49 | // 50 | typedef struct _GLFWlibraryLinux 51 | { 52 | int inotify; 53 | int watch; 54 | regex_t regex; 55 | GLFWbool dropped; 56 | } _GLFWlibraryLinux; 57 | 58 | void _glfwDetectJoystickConnectionLinux(void); 59 | 60 | -------------------------------------------------------------------------------- /3rd_party/glfw/src/null_init.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016 Google Inc. 5 | // Copyright (c) 2016-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | // It is fine to use C99 in this file because it will not be built with VS 28 | //======================================================================== 29 | 30 | #include "internal.h" 31 | 32 | #include 33 | 34 | 35 | ////////////////////////////////////////////////////////////////////////// 36 | ////// GLFW platform API ////// 37 | ////////////////////////////////////////////////////////////////////////// 38 | 39 | int _glfwPlatformInit(void) 40 | { 41 | _glfwInitTimerPOSIX(); 42 | _glfwPollMonitorsNull(); 43 | 44 | return GLFW_TRUE; 45 | } 46 | 47 | void _glfwPlatformTerminate(void) 48 | { 49 | free(_glfw.null.clipboardString); 50 | _glfwTerminateOSMesa(); 51 | } 52 | 53 | const char* _glfwPlatformGetVersionString(void) 54 | { 55 | return _GLFW_VERSION_NUMBER " null OSMesa"; 56 | } 57 | 58 | -------------------------------------------------------------------------------- /3rd_party/glfw/src/null_joystick.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016-2017 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | // It is fine to use C99 in this file because it will not be built with VS 27 | //======================================================================== 28 | 29 | #include "internal.h" 30 | 31 | 32 | ////////////////////////////////////////////////////////////////////////// 33 | ////// GLFW platform API ////// 34 | ////////////////////////////////////////////////////////////////////////// 35 | 36 | GLFWbool _glfwPlatformInitJoysticks(void) 37 | { 38 | return GLFW_TRUE; 39 | } 40 | 41 | void _glfwPlatformTerminateJoysticks(void) 42 | { 43 | } 44 | 45 | int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode) 46 | { 47 | return GLFW_FALSE; 48 | } 49 | 50 | void _glfwPlatformUpdateGamepadGUID(char* guid) 51 | { 52 | } 53 | 54 | -------------------------------------------------------------------------------- /3rd_party/glfw/src/null_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2017 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define _GLFW_PLATFORM_JOYSTICK_STATE struct { int dummyJoystick; } 28 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE struct { int dummyLibraryJoystick; } 29 | 30 | #define _GLFW_PLATFORM_MAPPING_NAME "" 31 | 32 | -------------------------------------------------------------------------------- /3rd_party/glfw/src/posix_thread.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include 29 | 30 | #define _GLFW_PLATFORM_TLS_STATE _GLFWtlsPOSIX posix 31 | #define _GLFW_PLATFORM_MUTEX_STATE _GLFWmutexPOSIX posix 32 | 33 | 34 | // POSIX-specific thread local storage data 35 | // 36 | typedef struct _GLFWtlsPOSIX 37 | { 38 | GLFWbool allocated; 39 | pthread_key_t key; 40 | 41 | } _GLFWtlsPOSIX; 42 | 43 | // POSIX-specific mutex data 44 | // 45 | typedef struct _GLFWmutexPOSIX 46 | { 47 | GLFWbool allocated; 48 | pthread_mutex_t handle; 49 | 50 | } _GLFWmutexPOSIX; 51 | 52 | -------------------------------------------------------------------------------- /3rd_party/glfw/src/posix_time.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #define _GLFW_PLATFORM_LIBRARY_TIMER_STATE _GLFWtimerPOSIX posix 29 | 30 | #include 31 | 32 | 33 | // POSIX-specific global timer data 34 | // 35 | typedef struct _GLFWtimerPOSIX 36 | { 37 | GLFWbool monotonic; 38 | uint64_t frequency; 39 | 40 | } _GLFWtimerPOSIX; 41 | 42 | 43 | void _glfwInitTimerPOSIX(void); 44 | 45 | -------------------------------------------------------------------------------- /3rd_party/glfw/src/win32_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2017 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define _GLFW_PLATFORM_JOYSTICK_STATE _GLFWjoystickWin32 win32 28 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE struct { int dummyLibraryJoystick; } 29 | 30 | #define _GLFW_PLATFORM_MAPPING_NAME "Windows" 31 | 32 | // Joystick element (axis, button or slider) 33 | // 34 | typedef struct _GLFWjoyobjectWin32 35 | { 36 | int offset; 37 | int type; 38 | } _GLFWjoyobjectWin32; 39 | 40 | // Win32-specific per-joystick data 41 | // 42 | typedef struct _GLFWjoystickWin32 43 | { 44 | _GLFWjoyobjectWin32* objects; 45 | int objectCount; 46 | IDirectInputDevice8W* device; 47 | DWORD index; 48 | GUID guid; 49 | } _GLFWjoystickWin32; 50 | 51 | void _glfwDetectJoystickConnectionWin32(void); 52 | void _glfwDetectJoystickDisconnectionWin32(void); 53 | 54 | -------------------------------------------------------------------------------- /3rd_party/glfw/src/xkb_unicode.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 Linux - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | long _glfwKeySym2Unicode(unsigned int keysym); 28 | 29 | -------------------------------------------------------------------------------- /3rd_party/glfw/tests/title.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // UTF-8 window title test 3 | // Copyright (c) Camilla Löwy 4 | // 5 | // This software is provided 'as-is', without any express or implied 6 | // warranty. In no event will the authors be held liable for any damages 7 | // arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it 11 | // freely, subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; you must not 14 | // claim that you wrote the original software. If you use this software 15 | // in a product, an acknowledgment in the product documentation would 16 | // be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, and must not 19 | // be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source 22 | // distribution. 23 | // 24 | //======================================================================== 25 | // 26 | // This test sets a UTF-8 window title 27 | // 28 | //======================================================================== 29 | 30 | #include 31 | #define GLFW_INCLUDE_NONE 32 | #include 33 | 34 | #include 35 | #include 36 | 37 | static void error_callback(int error, const char* description) 38 | { 39 | fprintf(stderr, "Error: %s\n", description); 40 | } 41 | 42 | int main(void) 43 | { 44 | GLFWwindow* window; 45 | 46 | glfwSetErrorCallback(error_callback); 47 | 48 | if (!glfwInit()) 49 | exit(EXIT_FAILURE); 50 | 51 | window = glfwCreateWindow(400, 400, "English 日本語 русский язык 官話", NULL, NULL); 52 | if (!window) 53 | { 54 | glfwTerminate(); 55 | exit(EXIT_FAILURE); 56 | } 57 | 58 | glfwMakeContextCurrent(window); 59 | gladLoadGL(glfwGetProcAddress); 60 | glfwSwapInterval(1); 61 | 62 | while (!glfwWindowShouldClose(window)) 63 | { 64 | glClear(GL_COLOR_BUFFER_BIT); 65 | glfwSwapBuffers(window); 66 | glfwWaitEvents(); 67 | } 68 | 69 | glfwTerminate(); 70 | exit(EXIT_SUCCESS); 71 | } 72 | 73 | -------------------------------------------------------------------------------- /3rd_party/glm/CTestConfig.cmake: -------------------------------------------------------------------------------- 1 | ## This file should be placed in the root directory of your project. 2 | ## Then modify the CMakeLists.txt file in the root directory of your 3 | ## project to incorporate the testing dashboard. 4 | ## # The following are required to uses Dart and the Cdash dashboard 5 | ## ENABLE_TESTING() 6 | ## INCLUDE(CTest) 7 | set(CTEST_PROJECT_NAME "glm") 8 | set(CTEST_NIGHTLY_START_TIME "00:00:00 EST") 9 | 10 | set(CTEST_DROP_METHOD "http") 11 | set(CTEST_DROP_SITE "my.cdash.org") 12 | set(CTEST_DROP_LOCATION "/submit.php?project=GLM") 13 | set(CTEST_DROP_SITE_CDASH TRUE) 14 | -------------------------------------------------------------------------------- /3rd_party/glm/bench/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | function(glmCreateBenchGTC NAME) 2 | set(SAMPLE_NAME bench-${NAME}) 3 | 4 | add_executable(${SAMPLE_NAME} ${NAME}.cpp) 5 | endfunction(glmCreateBenchGTC) 6 | 7 | add_subdirectory(core) 8 | add_subdirectory(gtc) 9 | add_subdirectory(gtx) 10 | 11 | 12 | -------------------------------------------------------------------------------- /3rd_party/glm/bench/core/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/bench/core/CMakeLists.txt -------------------------------------------------------------------------------- /3rd_party/glm/bench/gtc/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/bench/gtc/CMakeLists.txt -------------------------------------------------------------------------------- /3rd_party/glm/bench/gtx/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/bench/gtx/CMakeLists.txt -------------------------------------------------------------------------------- /3rd_party/glm/copying.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2005 - 2012 G-Truc Creation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /3rd_party/glm/doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(NAME glm-doc) 2 | 3 | file(GLOB ROOT_TXT *.doxy ../*.txt ./theme/*.css) 4 | file(GLOB ROOT_CPP src/*.cpp) 5 | file(GLOB ROOT_XML src/*.xml) 6 | file(GLOB ROOT_XSL src/*.xsl) 7 | 8 | source_group("TXT Files" FILES ${ROOT_TXT}) 9 | source_group("XML Files" FILES ${ROOT_XML}) 10 | source_group("XSL Files" FILES ${ROOT_XSL}) 11 | 12 | add_executable(${NAME} ${ROOT_CPP} ${ROOT_XML} ${ROOT_XSL} ${ROOT_TXT}) 13 | -------------------------------------------------------------------------------- /3rd_party/glm/doc/about.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/about.html -------------------------------------------------------------------------------- /3rd_party/glm/doc/code.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/code.html -------------------------------------------------------------------------------- /3rd_party/glm/doc/common/email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/common/email.png -------------------------------------------------------------------------------- /3rd_party/glm/doc/common/g-truc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/common/g-truc.png -------------------------------------------------------------------------------- /3rd_party/glm/doc/common/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/common/logo.png -------------------------------------------------------------------------------- /3rd_party/glm/doc/common/opengl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/common/opengl.jpg -------------------------------------------------------------------------------- /3rd_party/glm/doc/common/sourceforge.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/common/sourceforge.gif -------------------------------------------------------------------------------- /3rd_party/glm/doc/common/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/common/title.png -------------------------------------------------------------------------------- /3rd_party/glm/doc/download.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/download.html -------------------------------------------------------------------------------- /3rd_party/glm/doc/glm-0.9.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/glm-0.9.3.pdf -------------------------------------------------------------------------------- /3rd_party/glm/doc/goodies.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/goodies.html -------------------------------------------------------------------------------- /3rd_party/glm/doc/goodies/logo1024x0640.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/goodies/logo1024x0640.png -------------------------------------------------------------------------------- /3rd_party/glm/doc/goodies/logo1280x0800.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/goodies/logo1280x0800.png -------------------------------------------------------------------------------- /3rd_party/glm/doc/goodies/logo1600x1000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/goodies/logo1600x1000.png -------------------------------------------------------------------------------- /3rd_party/glm/doc/goodies/logo1920x1200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/goodies/logo1920x1200.png -------------------------------------------------------------------------------- /3rd_party/glm/doc/goodies/logo2560x1600.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/goodies/logo2560x1600.png -------------------------------------------------------------------------------- /3rd_party/glm/doc/goodies/tenby-five.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/goodies/tenby-five.otf -------------------------------------------------------------------------------- /3rd_party/glm/doc/image/0029-mini.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/image/0029-mini.jpg -------------------------------------------------------------------------------- /3rd_party/glm/doc/image/0029.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/image/0029.jpg -------------------------------------------------------------------------------- /3rd_party/glm/doc/image/0075-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/image/0075-1.jpg -------------------------------------------------------------------------------- /3rd_party/glm/doc/image/0075-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/image/0075-2.jpg -------------------------------------------------------------------------------- /3rd_party/glm/doc/image/font-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/image/font-mini.png -------------------------------------------------------------------------------- /3rd_party/glm/doc/image/font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/image/font.png -------------------------------------------------------------------------------- /3rd_party/glm/doc/image/logo-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/image/logo-mini.png -------------------------------------------------------------------------------- /3rd_party/glm/doc/image/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/image/logo.png -------------------------------------------------------------------------------- /3rd_party/glm/doc/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/index.html -------------------------------------------------------------------------------- /3rd_party/glm/doc/src/dummy.cpp: -------------------------------------------------------------------------------- 1 | #include "../../glm/glm.hpp" // glm::vec3, glm::vec4, glm::ivec4, glm::mat4 2 | #include 3 | 4 | struct triangle 5 | { 6 | glm::vec3 Position[3]; 7 | glm::vec3 Normal; 8 | }; 9 | 10 | void computeNormal(triangle & Triangle) 11 | { 12 | glm::vec3 const & a = Triangle.Position[0]; 13 | glm::vec3 const & b = Triangle.Position[1]; 14 | glm::vec3 const & c = Triangle.Position[2]; 15 | Triangle.Normal = glm::normalize(glm::cross(c - a, b - a)); 16 | } 17 | 18 | #include "../../glm/gtc/matrix_transform.hpp" // glm::translate, glm::rotate, glm::scale 19 | #include "../../glm/gtc/type_ptr.hpp" // glm::value_ptr 20 | #include "../../glm/gtc/quaternion.hpp" // glm::quat 21 | //#include "../../glm/ext.hpp" 22 | 23 | glm::vec4 const ClearColor = glm::vec4(glm::vec3(0.0f), 1.0f); 24 | glm::ivec4 const Viewport = glm::ivec4(0, 0, 640, 480); 25 | 26 | void glUniformMatrix4fv(int location, int count, bool transpose, const float * value); 27 | 28 | void ticket0023() 29 | { 30 | std::vector vals; 31 | vals.push_back(1); 32 | vals.push_back(2); 33 | vals.push_back(3); 34 | std::vector::iterator it1, it2; 35 | it1 = vals.begin(); 36 | it2 = vals.end(); 37 | it1 != it2; // <-- Here 38 | glm::vec3 c; 39 | glm::quat q; 40 | } 41 | 42 | int main() 43 | { 44 | //triangle Triangle; 45 | //computeNormal(Triangle); 46 | 47 | float Translate = 1.0f; 48 | glm::vec2 Rotate; 49 | 50 | glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f); 51 | glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate)); 52 | glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); 53 | glm::mat4 View = glm::rotate(ViewRotateX, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); 54 | glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f)); 55 | glm::mat4 MVP = Projection * View * Model; 56 | 57 | //glUniformMatrix4fv(LocationMVP, 1, GL_FALSE, glm::value_ptr(MVP)); 58 | 59 | ticket0023(); 60 | } 61 | -------------------------------------------------------------------------------- /3rd_party/glm/doc/theme/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/doc/theme/background.jpg -------------------------------------------------------------------------------- /3rd_party/glm/glm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(NAME glm) 2 | 3 | file(GLOB ROOT_SOURCE *.cpp) 4 | file(GLOB ROOT_INLINE *.inl) 5 | file(GLOB ROOT_HEADER *.hpp) 6 | 7 | file(GLOB_RECURSE CORE_SOURCE ./core/*.cpp) 8 | file(GLOB_RECURSE CORE_INLINE ./core/*.inl) 9 | file(GLOB_RECURSE CORE_HEADER ./core/*.hpp) 10 | 11 | file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp) 12 | file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl) 13 | file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp) 14 | 15 | file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) 16 | file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) 17 | file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) 18 | 19 | file(GLOB_RECURSE VIRTREV_SOURCE ./virtrev/*.cpp) 20 | file(GLOB_RECURSE VIRTREV_INLINE ./virtrev/*.inl) 21 | file(GLOB_RECURSE VIRTREV_HEADER ./virtrev/*.hpp) 22 | 23 | source_group("Core Files" FILES ${CORE_SOURCE}) 24 | source_group("Core Files" FILES ${CORE_INLINE}) 25 | source_group("Core Files" FILES ${CORE_HEADER}) 26 | source_group("GTC Files" FILES ${GTC_SOURCE}) 27 | source_group("GTC Files" FILES ${GTC_INLINE}) 28 | source_group("GTC Files" FILES ${GTC_HEADER}) 29 | source_group("GTX Files" FILES ${GTX_SOURCE}) 30 | source_group("GTX Files" FILES ${GTX_INLINE}) 31 | source_group("GTX Files" FILES ${GTX_HEADER}) 32 | source_group("VIRTREV Files" FILES ${VIRTREV_SOURCE}) 33 | source_group("VIRTREV Files" FILES ${VIRTREV_INLINE}) 34 | source_group("VIRTREV Files" FILES ${VIRTREV_HEADER}) 35 | 36 | include_directories(..) 37 | 38 | add_executable(${NAME} 39 | ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} 40 | ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} 41 | ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} 42 | ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} 43 | ${VIRTREV_SOURCE} ${VIRTREV_INLINE} ${VIRTREV_HEADER}) 44 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/core/_fixes.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/_fixes.hpp 25 | /// @date 2011-02-21 / 2011-11-22 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #include 30 | 31 | //! Workaround for compatibility with other libraries 32 | #ifdef max 33 | #undef max 34 | #endif 35 | 36 | //! Workaround for compatibility with other libraries 37 | #ifdef min 38 | #undef min 39 | #endif 40 | 41 | //! Workaround for Android 42 | #ifdef isnan 43 | #undef isnan 44 | #endif 45 | 46 | //! Workaround for Android 47 | #ifdef isinf 48 | #undef isinf 49 | #endif 50 | 51 | //! Workaround for Chrone Native Client 52 | #ifdef log2 53 | #undef log2 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/core/dummy.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/dummy.cpp 25 | /// @date 2011-01-19 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /// 28 | /// GLM is a header only library. There is nothing to compile. 29 | /// dummy.cpp exist only a wordaround for CMake file. 30 | /////////////////////////////////////////////////////////////////////////////////// 31 | 32 | #define GLM_MESSAGES 33 | #include "../glm.hpp" 34 | #include "../ext.hpp" 35 | 36 | //#error "GLM is a header only library" 37 | 38 | int main() 39 | { 40 | 41 | } 42 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/core/func_common.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/glm/core/func_common.hpp -------------------------------------------------------------------------------- /3rd_party/glm/glm/core/func_common.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/glm/core/func_common.inl -------------------------------------------------------------------------------- /3rd_party/glm/glm/core/func_integer.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/glm/core/func_integer.hpp -------------------------------------------------------------------------------- /3rd_party/glm/glm/core/hint.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/hint.hpp 25 | /// @date 2008-08-14 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_core_type 30 | #define glm_core_type 31 | 32 | namespace glm 33 | { 34 | // Use dont_care, nicest and fastest to optimize implementations. 35 | class dont_care {}; 36 | class nicest {}; 37 | class fastest {}; 38 | }//namespace glm 39 | 40 | #endif//glm_core_type 41 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/core/intrinsic_exponential.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/intrinsic_exponential.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/core/intrinsic_trigonometric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/intrinsic_trigonometric.hpp 25 | /// @date 2009-06-09 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_detail_intrinsic_trigonometric 30 | #define glm_detail_intrinsic_trigonometric 31 | 32 | #include "setup.hpp" 33 | 34 | #if((GLM_ARCH & GLM_ARCH_SSE2) != GLM_ARCH_SSE2) 35 | # error "SSE2 instructions not supported or enabled" 36 | #else 37 | 38 | namespace glm{ 39 | namespace detail 40 | { 41 | 42 | }//namespace detail 43 | }//namespace glm 44 | 45 | #include "intrinsic_trigonometric.inl" 46 | 47 | #endif//GLM_ARCH 48 | #endif//glm_detail_intrinsic_trigonometric 49 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/core/intrinsic_trigonometric.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/intrinsic_trigonometric.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/core/intrinsic_vector_relational.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/intrinsic_vector_relational.hpp 25 | /// @date 2009-06-09 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_detail_intrinsic_vector_relational 30 | #define glm_detail_intrinsic_vector_relational 31 | 32 | #include "setup.hpp" 33 | 34 | #if((GLM_ARCH & GLM_ARCH_SSE2) != GLM_ARCH_SSE2) 35 | # error "SSE2 instructions not supported or enabled" 36 | #else 37 | 38 | namespace glm{ 39 | namespace detail 40 | { 41 | 42 | }//namespace detail 43 | }//namespace glm 44 | 45 | #include "intrinsic_vector_relational.inl" 46 | 47 | #endif//GLM_ARCH 48 | #endif//glm_detail_intrinsic_vector_relational 49 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/core/type_mat.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_mat.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/core/type_size.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_size.hpp 25 | /// @date 2008-10-05 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_core_type_size 30 | #define glm_core_type_size 31 | 32 | #include 33 | 34 | namespace glm{ 35 | namespace detail 36 | { 37 | //typedef std::size_t size_t; 38 | typedef int sizeType; 39 | 40 | }//namespace detail 41 | }//namespace glm 42 | 43 | #endif//glm_core_type_size 44 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/core/type_vec.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_vec.hpp 25 | /// @date 2010-01-26 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #ifndef glm_core_type_vec 30 | #define glm_core_type_vec 31 | 32 | #include "type_gentype.hpp" 33 | 34 | namespace glm{ 35 | namespace detail 36 | { 37 | 38 | }//namespace detail 39 | }//namespace glm 40 | 41 | #endif//glm_core_type_vec 42 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/core/type_vec.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_vec.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtc/type_precision.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref gtc_swizzle 24 | /// @file glm/gtc/swizzle.inl 25 | /// @date 2009-06-14 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | namespace glm 30 | { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/closest_point.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-30 5 | // Updated : 2008-10-05 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/closest_point.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef glm_gtx_closest_point 11 | #define glm_gtx_closest_point 12 | 13 | namespace glm 14 | { 15 | template 16 | GLM_FUNC_QUALIFIER detail::tvec3 closestPointOnLine 17 | ( 18 | detail::tvec3 const & point, 19 | detail::tvec3 const & a, 20 | detail::tvec3 const & b 21 | ) 22 | { 23 | valType LineLength = distance(a, b); 24 | detail::tvec3 Vector = point - a; 25 | detail::tvec3 LineDirection = (b - a) / LineLength; 26 | 27 | // Project Vector to LineDirection to get the distance of point from a 28 | valType Distance = dot(Vector, LineDirection); 29 | 30 | if(Distance <= valType(0)) return a; 31 | if(Distance >= LineLength) return b; 32 | return a + LineDirection * Distance; 33 | } 34 | }//namespace glm 35 | 36 | #endif//glm_gtx_closest_point 37 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/compatibility.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-03-16 5 | // Updated : 2008-10-24 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/compatibility.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | // isfinite 13 | template 14 | GLM_FUNC_QUALIFIER bool isfinite( 15 | genType const & x) 16 | { 17 | # if(GLM_COMPILER & GLM_COMPILER_VC) 18 | return _finite(x); 19 | # elif(GLM_COMPILER & GLM_COMPILER_GCC) 20 | # if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) 21 | return _isfinite(x) != 0; 22 | # else 23 | return std::isfinite(x) != 0; 24 | # endif 25 | # else 26 | return std::isfinite(x) != 0; 27 | # endif 28 | 29 | } 30 | 31 | template 32 | GLM_FUNC_QUALIFIER detail::tvec2 isfinite( 33 | detail::tvec2 const & x) 34 | { 35 | return detail::tvec2( 36 | isfinite(x.x), 37 | isfinite(x.y)); 38 | } 39 | 40 | template 41 | GLM_FUNC_QUALIFIER detail::tvec3 isfinite( 42 | detail::tvec3 const & x) 43 | { 44 | return detail::tvec3( 45 | isfinite(x.x), 46 | isfinite(x.y), 47 | isfinite(x.z)); 48 | } 49 | 50 | template 51 | GLM_FUNC_QUALIFIER detail::tvec4 isfinite( 52 | detail::tvec4 const & x) 53 | { 54 | return detail::tvec4( 55 | isfinite(x.x), 56 | isfinite(x.y), 57 | isfinite(x.z), 58 | isfinite(x.w)); 59 | } 60 | 61 | }//namespace glm 62 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/component_wise.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-05-21 5 | // Updated : 2010-02-12 6 | // Licence : This source is under MIT License 7 | // File : gtx_component_wise.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER typename genType::value_type compAdd(genType const & v) 14 | { 15 | typename genType::size_type result = typename genType::value_type(0); 16 | for(typename genType::size_type i = 0; i < v.length(); ++i) 17 | result += v[i]; 18 | return result; 19 | } 20 | 21 | template 22 | GLM_FUNC_QUALIFIER typename genType::value_type compMul(genType const & v) 23 | { 24 | typename genType::value_type result = typename genType::value_type(1); 25 | for(typename genType::size_type i = 0; i < v.length(); ++i) 26 | result *= v[i]; 27 | return result; 28 | } 29 | 30 | template 31 | GLM_FUNC_QUALIFIER typename genType::value_type compMin(genType const & v) 32 | { 33 | typename genType::value_type result = typename genType::value_type(v[0]); 34 | for(typename genType::size_type i = 1; i < v.length(); ++i) 35 | result = min(result, v[i]); 36 | return result; 37 | } 38 | 39 | template 40 | GLM_FUNC_QUALIFIER typename genType::value_type compMax(genType const & v) 41 | { 42 | typename genType::value_type result = typename genType::value_type(v[0]); 43 | for(typename genType::size_type i = 1; i < v.length(); ++i) 44 | result = max(result, v[i]); 45 | return result; 46 | } 47 | }//namespace glm 48 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/extend.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2006-01-07 5 | // Updated : 2008-10-05 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/extend.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | genType extend 14 | ( 15 | genType const & Origin, 16 | genType const & Source, 17 | genType const & Distance 18 | ) 19 | { 20 | return Origin + (Source - Origin) * Distance; 21 | } 22 | 23 | template 24 | detail::tvec2 extend 25 | ( 26 | detail::tvec2 const & Origin, 27 | detail::tvec2 const & Source, 28 | valType const & Distance 29 | ) 30 | { 31 | return Origin + (Source - Origin) * Distance; 32 | } 33 | 34 | template 35 | detail::tvec3 extend 36 | ( 37 | detail::tvec3 const & Origin, 38 | detail::tvec3 const & Source, 39 | valType const & Distance 40 | ) 41 | { 42 | return Origin + (Source - Origin) * Distance; 43 | } 44 | 45 | template 46 | detail::tvec4 extend 47 | ( 48 | detail::tvec4 const & Origin, 49 | detail::tvec4 const & Source, 50 | valType const & Distance 51 | ) 52 | { 53 | return Origin + (Source - Origin) * Distance; 54 | } 55 | }//namespace glm 56 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/gradient_paint.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2009-03-06 5 | // Updated : 2009-03-09 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/gradient_paint.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | valType radialGradient 14 | ( 15 | detail::tvec2 const & Center, 16 | valType const & Radius, 17 | detail::tvec2 const & Focal, 18 | detail::tvec2 const & Position 19 | ) 20 | { 21 | detail::tvec2 F = Focal - Center; 22 | detail::tvec2 D = Position - Focal; 23 | valType Radius2 = pow2(Radius); 24 | valType Fx2 = pow2(F.x); 25 | valType Fy2 = pow2(F.y); 26 | 27 | valType Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x)); 28 | valType Denominator = Radius2 - (Fx2 + Fy2); 29 | return Numerator / Denominator; 30 | } 31 | 32 | template 33 | valType linearGradient 34 | ( 35 | detail::tvec2 const & Point0, 36 | detail::tvec2 const & Point1, 37 | detail::tvec2 const & Position 38 | ) 39 | { 40 | detail::tvec2 Dist = Point1 - Point0; 41 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); 42 | } 43 | }//namespace glm 44 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/handed_coordinate_space.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2009-02-19 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/handed_coordinate_space.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER bool rightHanded 14 | ( 15 | detail::tvec3 const & tangent, 16 | detail::tvec3 const & binormal, 17 | detail::tvec3 const & normal 18 | ) 19 | { 20 | return dot(cross(normal, tangent), binormal) > T(0); 21 | } 22 | 23 | template 24 | GLM_FUNC_QUALIFIER bool leftHanded 25 | ( 26 | detail::tvec3 const & tangent, 27 | detail::tvec3 const & binormal, 28 | detail::tvec3 const & normal 29 | ) 30 | { 31 | return dot(cross(normal, tangent), binormal) < T(0); 32 | } 33 | }//namespace glm 34 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/int_10_10_10_2.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-07-07 5 | // Updated : 2010-07-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/int_10_10_10_2.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | GLM_FUNC_QUALIFIER dword uint10_10_10_2_cast 13 | ( 14 | glm::vec4 const & v 15 | ) 16 | { 17 | return dword(uint(v.x * 2047.f) << 0 | uint(v.y * 2047.f) << 10 | uint(v.z * 2047.f) << 20 | uint(v.w * 3.f) << 30); 18 | } 19 | }//namespace glm 20 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/log_base.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-10-24 5 | // Updated : 2008-10-24 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/log_base.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include "../core/_vectorize.hpp" 11 | 12 | namespace glm 13 | { 14 | template 15 | GLM_FUNC_QUALIFIER genType log( 16 | genType const & x, 17 | genType const & base) 18 | { 19 | assert(x != genType(0)); 20 | 21 | return glm::log(x) / glm::log(base); 22 | } 23 | 24 | VECTORIZE_VEC_SCA(log) 25 | VECTORIZE_VEC_VEC(log) 26 | }//namespace glm 27 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/matrix_cross_product.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2005-12-21 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/matrix_cross_product.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tmat3x3 matrixCross3 14 | ( 15 | detail::tvec3 const & x 16 | ) 17 | { 18 | detail::tmat3x3 Result(T(0)); 19 | Result[0][1] = x.z; 20 | Result[1][0] = -x.z; 21 | Result[0][2] = -x.y; 22 | Result[2][0] = x.y; 23 | Result[1][2] = x.x; 24 | Result[2][1] = -x.x; 25 | return Result; 26 | } 27 | 28 | template 29 | GLM_FUNC_QUALIFIER detail::tmat4x4 matrixCross4 30 | ( 31 | detail::tvec3 const & x 32 | ) 33 | { 34 | detail::tmat4x4 Result(T(0)); 35 | Result[0][1] = x.z; 36 | Result[1][0] = -x.z; 37 | Result[0][2] = -x.y; 38 | Result[2][0] = x.y; 39 | Result[1][2] = x.x; 40 | Result[2][1] = -x.x; 41 | return Result; 42 | } 43 | 44 | }//namespace glm 45 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/mixed_product.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-04-03 5 | // Updated : 2008-09-17 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/mixed_product.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER valType mixedProduct 14 | ( 15 | detail::tvec3 const & v1, 16 | detail::tvec3 const & v2, 17 | detail::tvec3 const & v3 18 | ) 19 | { 20 | return dot(cross(v1, v2), v3); 21 | } 22 | }//namespace glm 23 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/noise.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": 5 | // https://github.com/ashima/webgl-noise 6 | // Following Stefan Gustavson's paper "Simplex noise demystified": 7 | // http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | // Created : 2011-04-21 10 | // Updated : 2011-04-21 11 | // Licence : This source is under MIT License 12 | // File : glm/gtx/noise.inl 13 | /////////////////////////////////////////////////////////////////////////////////////////////////// 14 | // Dependency: 15 | // - GLM core 16 | /////////////////////////////////////////////////////////////////////////////////////////////////// 17 | 18 | namespace glm{ 19 | 20 | }//namespace glm 21 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/normal.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2011-06-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/normal.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tvec3 triangleNormal 14 | ( 15 | detail::tvec3 const & p1, 16 | detail::tvec3 const & p2, 17 | detail::tvec3 const & p3 18 | ) 19 | { 20 | return normalize(cross(p1 - p2, p1 - p3)); 21 | } 22 | }//namespace glm 23 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/number_precision.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-05-10 5 | // Updated : 2007-05-10 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/number_precision.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/ocl_type.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/glm/gtx/ocl_type.inl -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/optimum_pow.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2005-12-27 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/optimum_pow.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER genType pow2(const genType& x) 14 | { 15 | return x * x; 16 | } 17 | 18 | template 19 | GLM_FUNC_QUALIFIER genType pow3(const genType& x) 20 | { 21 | return x * x * x; 22 | } 23 | 24 | template 25 | GLM_FUNC_QUALIFIER genType pow4(const genType& x) 26 | { 27 | return x * x * x * x; 28 | } 29 | 30 | GLM_FUNC_QUALIFIER bool powOfTwo(int x) 31 | { 32 | return !(x & (x - 1)); 33 | } 34 | 35 | GLM_FUNC_QUALIFIER detail::tvec2 powOfTwo(const detail::tvec2& x) 36 | { 37 | return detail::tvec2( 38 | powOfTwo(x.x), 39 | powOfTwo(x.y)); 40 | } 41 | 42 | GLM_FUNC_QUALIFIER detail::tvec3 powOfTwo(const detail::tvec3& x) 43 | { 44 | return detail::tvec3( 45 | powOfTwo(x.x), 46 | powOfTwo(x.y), 47 | powOfTwo(x.z)); 48 | } 49 | 50 | GLM_FUNC_QUALIFIER detail::tvec4 powOfTwo(const detail::tvec4& x) 51 | { 52 | return detail::tvec4( 53 | powOfTwo(x.x), 54 | powOfTwo(x.y), 55 | powOfTwo(x.z), 56 | powOfTwo(x.w)); 57 | } 58 | }//namespace glm 59 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/orthonormalize.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2005-12-21 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/orthonormalize.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tmat3x3 orthonormalize 14 | ( 15 | const detail::tmat3x3& m 16 | ) 17 | { 18 | detail::tmat3x3 r = m; 19 | 20 | r[0] = normalize(r[0]); 21 | 22 | float d0 = dot(r[0], r[1]); 23 | r[1] -= r[0] * d0; 24 | r[1] = normalize(r[1]); 25 | 26 | float d1 = dot(r[1], r[2]); 27 | d0 = dot(r[0], r[2]); 28 | r[2] -= r[0] * d0 + r[1] * d1; 29 | r[2] = normalize(r[2]); 30 | 31 | return r; 32 | } 33 | 34 | template 35 | GLM_FUNC_QUALIFIER detail::tvec3 orthonormalize 36 | ( 37 | const detail::tvec3& x, 38 | const detail::tvec3& y 39 | ) 40 | { 41 | return normalize(x - y * dot(y, x)); 42 | } 43 | }//namespace glm 44 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/perpendicular.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2009-03-06 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/perpendicular.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER vecType perp 14 | ( 15 | vecType const & x, 16 | vecType const & Normal 17 | ) 18 | { 19 | return x - proj(x, Normal); 20 | } 21 | }//namespace glm 22 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/polar_coordinates.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-03-06 5 | // Updated : 2009-05-01 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/polar_coordinates.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tvec3 polar 14 | ( 15 | detail::tvec3 const & euclidean 16 | ) 17 | { 18 | T length = length(euclidean); 19 | detail::tvec3 tmp = euclidean / length; 20 | T xz_dist = sqrt(tmp.x * tmp.x + tmp.z * tmp.z); 21 | 22 | return detail::tvec3( 23 | degrees(atan(xz_dist, tmp.y)), // latitude 24 | degrees(atan(tmp.x, tmp.z)), // longitude 25 | xz_dist); // xz distance 26 | } 27 | 28 | template 29 | GLM_FUNC_QUALIFIER detail::tvec3 euclidean 30 | ( 31 | detail::tvec3 const & polar 32 | ) 33 | { 34 | T latitude = radians(polar.x); 35 | T longitude = radians(polar.y); 36 | return detail::tvec3( 37 | cos(latitude) * sin(longitude), 38 | sin(latitude), 39 | cos(latitude) * cos(longitude)); 40 | } 41 | 42 | }//namespace glm 43 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/projection.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2009-03-06 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/projection.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER vecType proj 14 | ( 15 | vecType const & x, 16 | vecType const & Normal 17 | ) 18 | { 19 | return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; 20 | } 21 | }//namespace glm 22 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/raw_data.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-11-19 5 | // Updated : 2008-11-19 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/raw_data.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | // Dependency: 10 | // - GLM core 11 | /////////////////////////////////////////////////////////////////////////////////////////////////// 12 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/simd_vec4.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/glm/gtx/simd_vec4.hpp -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/std_based_type.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-06-08 5 | // Updated : 2008-06-08 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/std_based_type.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/unsigned_int.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #if(defined(GLM_MESSAGES)) 25 | # pragma message("GLM: GLM_GTX_unsigned_int extension is deprecated, include GLM_GTX_integer instead") 26 | #endif 27 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/unsigned_int.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-24 5 | // Updated : 2008-10-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/unsigned_int.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | 13 | }//namespace glm 14 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/vec1.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/glm/gtx/vec1.inl -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/vector_access.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2006-01-16 5 | // Updated : 2008-10-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/vector_access.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER void set 14 | ( 15 | detail::tvec2& v, 16 | valType const & x, 17 | valType const & y 18 | ) 19 | { 20 | v.x = x; 21 | v.y = y; 22 | } 23 | 24 | template 25 | GLM_FUNC_QUALIFIER void set 26 | ( 27 | detail::tvec3& v, 28 | valType const & x, 29 | valType const & y, 30 | valType const & z 31 | ) 32 | { 33 | v.x = x; 34 | v.y = y; 35 | v.z = z; 36 | } 37 | 38 | template 39 | GLM_FUNC_QUALIFIER void set 40 | ( 41 | detail::tvec4& v, 42 | valType const & x, 43 | valType const & y, 44 | valType const & z, 45 | valType const & w 46 | ) 47 | { 48 | v.x = x; 49 | v.y = y; 50 | v.z = z; 51 | v.w = w; 52 | } 53 | }//namespace glm 54 | -------------------------------------------------------------------------------- /3rd_party/glm/glm/gtx/vector_angle.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-30 5 | // Updated : 2008-09-29 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/vector_angle.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER typename genType::value_type angle 14 | ( 15 | genType const & x, 16 | genType const & y 17 | ) 18 | { 19 | return degrees(acos(dot(x, y))); 20 | } 21 | 22 | //! \todo epsilon is hard coded to 0.01 23 | template 24 | GLM_FUNC_QUALIFIER valType orientedAngle 25 | ( 26 | detail::tvec2 const & x, 27 | detail::tvec2 const & y 28 | ) 29 | { 30 | valType Angle = glm::degrees(acos(dot(x, y))); 31 | detail::tvec2 TransformedVector = glm::rotate(x, Angle); 32 | if(all(equalEpsilon(y, TransformedVector, valType(0.01)))) 33 | return Angle; 34 | else 35 | return -Angle; 36 | } 37 | 38 | template 39 | GLM_FUNC_QUALIFIER valType orientedAngle 40 | ( 41 | detail::tvec3 const & x, 42 | detail::tvec3 const & y, 43 | detail::tvec3 const & ref 44 | ) 45 | { 46 | valType Angle = glm::degrees(glm::acos(glm::dot(x, y))); 47 | 48 | if(glm::dot(ref, glm::cross(x, y)) < valType(0)) 49 | return -Angle; 50 | else 51 | return Angle; 52 | } 53 | }//namespace glm 54 | -------------------------------------------------------------------------------- /3rd_party/glm/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | function(glmCreateTestGTC NAME) 2 | set(SAMPLE_NAME test-${NAME}) 3 | add_executable(${SAMPLE_NAME} ${NAME}.cpp) 4 | 5 | add_test( 6 | NAME ${SAMPLE_NAME} 7 | COMMAND $ ) 8 | endfunction() 9 | 10 | add_subdirectory(bug) 11 | add_subdirectory(core) 12 | add_subdirectory(gtc) 13 | add_subdirectory(gtx) 14 | 15 | 16 | -------------------------------------------------------------------------------- /3rd_party/glm/test/bug/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/3rd_party/glm/test/bug/CMakeLists.txt -------------------------------------------------------------------------------- /3rd_party/glm/test/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | glmCreateTestGTC(core_type_float) 2 | glmCreateTestGTC(core_type_half) 3 | glmCreateTestGTC(core_type_int) 4 | glmCreateTestGTC(core_type_length) 5 | glmCreateTestGTC(core_type_mat2x2) 6 | glmCreateTestGTC(core_type_mat2x3) 7 | glmCreateTestGTC(core_type_mat2x4) 8 | glmCreateTestGTC(core_type_mat3x2) 9 | glmCreateTestGTC(core_type_mat3x3) 10 | glmCreateTestGTC(core_type_mat3x4) 11 | glmCreateTestGTC(core_type_mat4x2) 12 | glmCreateTestGTC(core_type_mat4x3) 13 | glmCreateTestGTC(core_type_mat4x4) 14 | glmCreateTestGTC(core_type_vec1) 15 | glmCreateTestGTC(core_type_vec2) 16 | glmCreateTestGTC(core_type_vec3) 17 | glmCreateTestGTC(core_type_vec4) 18 | glmCreateTestGTC(core_func_common) 19 | glmCreateTestGTC(core_func_exponential) 20 | glmCreateTestGTC(core_func_geometric) 21 | glmCreateTestGTC(core_func_integer) 22 | glmCreateTestGTC(core_func_matrix) 23 | glmCreateTestGTC(core_func_noise) 24 | glmCreateTestGTC(core_func_packing) 25 | glmCreateTestGTC(core_func_trigonometric) 26 | glmCreateTestGTC(core_func_vector_relational) 27 | glmCreateTestGTC(core_func_swizzle) 28 | glmCreateTestGTC(core_setup_message) 29 | glmCreateTestGTC(core_setup_precision) 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_func_exponential.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-01-15 5 | // Updated : 2011-09-13 6 | // Licence : This source is under MIT licence 7 | // File : test/core/func_exponential.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | 12 | int main() 13 | { 14 | int Failed = 0; 15 | 16 | return Failed; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_func_geometric.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-01-15 5 | // Updated : 2011-11-14 6 | // Licence : This source is under MIT licence 7 | // File : test/gtx/func_geometric.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | #include 12 | 13 | int test_reflect() 14 | { 15 | int Error = 0; 16 | 17 | { 18 | glm::vec2 A(1.0f,-1.0f); 19 | glm::vec2 B(0.0f, 1.0f); 20 | glm::vec2 C = glm::reflect(A, B); 21 | Error += C == glm::vec2(1.0, 1.0) ? 0 : 1; 22 | } 23 | 24 | { 25 | glm::dvec2 A(1.0f,-1.0f); 26 | glm::dvec2 B(0.0f, 1.0f); 27 | glm::dvec2 C = glm::reflect(A, B); 28 | Error += C == glm::dvec2(1.0, 1.0) ? 0 : 1; 29 | } 30 | 31 | return Error; 32 | } 33 | 34 | int test_refract() 35 | { 36 | int Error = 0; 37 | 38 | { 39 | float A(-1.0f); 40 | float B(1.0f); 41 | float C = glm::refract(A, B, 0.5f); 42 | Error += C == -1.0f ? 0 : 1; 43 | } 44 | 45 | { 46 | glm::vec2 A(0.0f,-1.0f); 47 | glm::vec2 B(0.0f, 1.0f); 48 | glm::vec2 C = glm::refract(A, B, 0.5f); 49 | Error += glm::all(glm::equalEpsilon(C, glm::vec2(0.0, -1.0), 0.0001f)) ? 0 : 1; 50 | } 51 | 52 | { 53 | glm::dvec2 A(0.0f,-1.0f); 54 | glm::dvec2 B(0.0f, 1.0f); 55 | glm::dvec2 C = glm::refract(A, B, 0.5); 56 | Error += C == glm::dvec2(0.0, -1.0) ? 0 : 1; 57 | } 58 | 59 | return Error; 60 | } 61 | 62 | int main() 63 | { 64 | int Error(0); 65 | 66 | Error += test_reflect(); 67 | Error += test_refract(); 68 | 69 | return Error; 70 | } 71 | 72 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_func_noise.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-01-15 5 | // Updated : 2011-09-13 6 | // Licence : This source is under MIT licence 7 | // File : test/gtx/func_noise.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | 12 | int main() 13 | { 14 | int Failed = 0; 15 | 16 | return Failed; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_func_swizzle.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-10-16 5 | // Updated : 2011-10-16 6 | // Licence : This source is under MIT License 7 | // File : test/core/core_func_swizzle.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLM_FORCE_ONLY_XYZW 11 | # define GLM_FORCE_ONLY_XYZW 12 | #endif 13 | //#ifndef GLM_FORCE_PURE 14 | //# define GLM_FORCE_PURE 15 | //#endif 16 | #ifndef GLM_MESSAGES 17 | # define GLM_MESSAGES 18 | #endif 19 | #ifndef GLM_SWIZZLE 20 | # define GLM_SWIZZLE 21 | #endif 22 | #ifndef GLM_FORCE_CXX98 23 | # define GLM_FORCE_CXX98 24 | #endif 25 | #include 26 | 27 | int test_vec2_swizzle() 28 | { 29 | int Error = 0; 30 | 31 | glm::ivec2 A(1, 2); 32 | glm::ivec2 B = A.xy(); 33 | glm::ivec2 C(0); 34 | C.xy() = B.xy(); 35 | 36 | Error += A == B ? 0 : 1; 37 | Error += A == C ? 0 : 1; 38 | 39 | return Error; 40 | } 41 | 42 | int test_vec3_swizzle() 43 | { 44 | int Error = 0; 45 | 46 | glm::ivec3 A(1, 2, 3); 47 | glm::ivec3 B = A.xyz(); 48 | glm::ivec3 C(0); 49 | C.xyz() = B.xyz(); 50 | 51 | Error += A == B ? 0 : 1; 52 | Error += A == C ? 0 : 1; 53 | 54 | return Error; 55 | } 56 | 57 | int test_vec4_swizzle() 58 | { 59 | int Error = 0; 60 | 61 | glm::ivec4 A(1, 2, 3, 4); 62 | glm::ivec4 B = A.xyzw(); 63 | glm::ivec4 C(0); 64 | C.xyzw() = B.xyzw(); 65 | 66 | Error += A == B ? 0 : 1; 67 | Error += A == C ? 0 : 1; 68 | 69 | return Error; 70 | } 71 | 72 | int main() 73 | { 74 | int Error = 0; 75 | 76 | Error += test_vec2_swizzle(); 77 | Error += test_vec3_swizzle(); 78 | Error += test_vec4_swizzle(); 79 | 80 | return Error; 81 | } 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_func_trigonometric.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-01-15 5 | // Updated : 2011-09-13 6 | // Licence : This source is under MIT licence 7 | // File : test/core/func_trigonometric.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | 12 | int main() 13 | { 14 | int Failed = 0; 15 | 16 | return Failed; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_func_vector_relational.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-01-15 5 | // Updated : 2011-09-13 6 | // Licence : This source is under MIT licence 7 | // File : test/core/vector_relational.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | 12 | int main() 13 | { 14 | int Failed = 0; 15 | 16 | return Failed; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_setup_precision.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-05-31 5 | // Updated : 2011-05-31 6 | // Licence : This source is under MIT License 7 | // File : test/core/setup_precision_highp.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #define GLM_PRECISION_HIGHP_FLOAT 11 | #include 12 | 13 | static int test_mat() 14 | { 15 | int Error = 0; 16 | 17 | Error += sizeof(glm::mat2) == sizeof(glm::highp_mat2) ? 0 : 1; 18 | Error += sizeof(glm::mat3) == sizeof(glm::highp_mat3) ? 0 : 1; 19 | Error += sizeof(glm::mat4) == sizeof(glm::highp_mat4) ? 0 : 1; 20 | 21 | Error += sizeof(glm::mat2x2) == sizeof(glm::highp_mat2x2) ? 0 : 1; 22 | Error += sizeof(glm::mat2x3) == sizeof(glm::highp_mat2x3) ? 0 : 1; 23 | Error += sizeof(glm::mat2x4) == sizeof(glm::highp_mat2x4) ? 0 : 1; 24 | Error += sizeof(glm::mat3x2) == sizeof(glm::highp_mat3x2) ? 0 : 1; 25 | Error += sizeof(glm::mat3x3) == sizeof(glm::highp_mat3x3) ? 0 : 1; 26 | Error += sizeof(glm::mat3x4) == sizeof(glm::highp_mat3x4) ? 0 : 1; 27 | Error += sizeof(glm::mat4x2) == sizeof(glm::highp_mat4x2) ? 0 : 1; 28 | Error += sizeof(glm::mat4x3) == sizeof(glm::highp_mat4x3) ? 0 : 1; 29 | Error += sizeof(glm::mat4x4) == sizeof(glm::highp_mat4x4) ? 0 : 1; 30 | 31 | return Error; 32 | } 33 | 34 | static int test_vec() 35 | { 36 | int Error = 0; 37 | 38 | Error += sizeof(glm::vec2) == sizeof(glm::highp_vec2) ? 0 : 1; 39 | Error += sizeof(glm::vec3) == sizeof(glm::highp_vec3) ? 0 : 1; 40 | Error += sizeof(glm::vec4) == sizeof(glm::highp_vec4) ? 0 : 1; 41 | 42 | return Error; 43 | } 44 | 45 | int main() 46 | { 47 | int Error = 0; 48 | 49 | Error += test_mat(); 50 | Error += test_vec(); 51 | 52 | return Error; 53 | } 54 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_type_float.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-08-31 5 | // Updated : 2011-05-06 6 | // Licence : This source is under MIT License 7 | // File : test/core/type_float.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | 12 | int test_float_size() 13 | { 14 | return 15 | sizeof(glm::float_t) != sizeof(glm::lowp_float) && 16 | sizeof(glm::float_t) != sizeof(glm::mediump_float) && 17 | sizeof(glm::float_t) != sizeof(glm::highp_float); 18 | } 19 | 20 | int test_float_precision() 21 | { 22 | return ( 23 | sizeof(glm::lowp_float) <= sizeof(glm::mediump_float) && 24 | sizeof(glm::mediump_float) <= sizeof(glm::highp_float)) ? 0 : 1; 25 | } 26 | 27 | int test_vec2() 28 | { 29 | return 0; 30 | } 31 | 32 | int main() 33 | { 34 | int Error = 0; 35 | 36 | Error += test_float_size(); 37 | Error += test_float_precision(); 38 | 39 | return Error; 40 | } 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_type_int.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-08-31 5 | // Updated : 2011-05-06 6 | // Licence : This source is under MIT License 7 | // File : test/core/type_int.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | 12 | int test_int_size() 13 | { 14 | return 15 | sizeof(glm::int_t) != sizeof(glm::lowp_int) && 16 | sizeof(glm::int_t) != sizeof(glm::mediump_int) && 17 | sizeof(glm::int_t) != sizeof(glm::highp_int); 18 | } 19 | 20 | int test_uint_size() 21 | { 22 | return 23 | sizeof(glm::uint_t) != sizeof(glm::lowp_uint) && 24 | sizeof(glm::uint_t) != sizeof(glm::mediump_uint) && 25 | sizeof(glm::uint_t) != sizeof(glm::highp_uint); 26 | } 27 | 28 | int test_int_precision() 29 | { 30 | return ( 31 | sizeof(glm::lowp_int) <= sizeof(glm::mediump_int) && 32 | sizeof(glm::mediump_int) <= sizeof(glm::highp_int)) ? 0 : 1; 33 | } 34 | 35 | int test_uint_precision() 36 | { 37 | return ( 38 | sizeof(glm::lowp_uint) <= sizeof(glm::mediump_uint) && 39 | sizeof(glm::mediump_uint) <= sizeof(glm::highp_uint)) ? 0 : 1; 40 | } 41 | 42 | int main() 43 | { 44 | int Error = 0; 45 | 46 | Error += test_int_size(); 47 | Error += test_int_precision(); 48 | Error += test_uint_size(); 49 | Error += test_uint_precision(); 50 | 51 | return Error; 52 | } 53 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_type_mat2x2.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-08-31 5 | // Updated : 2008-08-31 6 | // Licence : This source is under MIT License 7 | // File : test/core/type_mat2x2.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | 12 | static int test_operators() 13 | { 14 | glm::mat2x2 l(1.0f); 15 | glm::mat2x2 m(1.0f); 16 | glm::vec2 u(1.0f); 17 | glm::vec2 v(1.0f); 18 | float x = 1.0f; 19 | glm::vec2 a = m * u; 20 | glm::vec2 b = v * m; 21 | glm::mat2x2 n = x / m; 22 | glm::mat2x2 o = m / x; 23 | glm::mat2x2 p = x * m; 24 | glm::mat2x2 q = m * x; 25 | bool R = m != q; 26 | bool S = m == l; 27 | 28 | return (S && !R) ? 0 : 1; 29 | } 30 | 31 | int main() 32 | { 33 | int Error = 0; 34 | 35 | Error += test_operators(); 36 | 37 | return Error; 38 | } 39 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_type_mat2x3.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-08-31 5 | // Updated : 2008-08-31 6 | // Licence : This source is under MIT License 7 | // File : test/core/type_mat2x3.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | 12 | static int test_operators() 13 | { 14 | glm::mat2x3 l(1.0f); 15 | glm::mat2x3 m(1.0f); 16 | glm::vec2 u(1.0f); 17 | glm::vec3 v(1.0f); 18 | float x = 1.0f; 19 | glm::vec3 a = m * u; 20 | glm::vec2 b = v * m; 21 | glm::mat2x3 n = x / m; 22 | glm::mat2x3 o = m / x; 23 | glm::mat2x3 p = x * m; 24 | glm::mat2x3 q = m * x; 25 | bool R = m != q; 26 | bool S = m == l; 27 | 28 | return (S && !R) ? 0 : 1; 29 | } 30 | 31 | int main() 32 | { 33 | int Error = 0; 34 | 35 | Error += test_operators(); 36 | 37 | return Error; 38 | } 39 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_type_mat2x4.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-08-31 5 | // Updated : 2008-08-31 6 | // Licence : This source is under MIT License 7 | // File : test/core/type_mat2x4.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | 12 | static int test_operators() 13 | { 14 | glm::mat2x4 l(1.0f); 15 | glm::mat2x4 m(1.0f); 16 | glm::vec2 u(1.0f); 17 | glm::vec4 v(1.0f); 18 | float x = 1.0f; 19 | glm::vec4 a = m * u; 20 | glm::vec2 b = v * m; 21 | glm::mat2x4 n = x / m; 22 | glm::mat2x4 o = m / x; 23 | glm::mat2x4 p = x * m; 24 | glm::mat2x4 q = m * x; 25 | bool R = m != q; 26 | bool S = m == l; 27 | 28 | return (S && !R) ? 0 : 1; 29 | } 30 | 31 | int main() 32 | { 33 | int Error = 0; 34 | 35 | Error += test_operators(); 36 | 37 | return Error; 38 | } 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_type_mat3x2.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-08-31 5 | // Updated : 2008-08-31 6 | // Licence : This source is under MIT License 7 | // File : test/core/type_mat3x2.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | 12 | static bool test_operators() 13 | { 14 | glm::mat3x2 l(1.0f); 15 | glm::mat3x2 m(1.0f); 16 | glm::vec3 u(1.0f); 17 | glm::vec2 v(1.0f); 18 | float x = 1.0f; 19 | glm::vec2 a = m * u; 20 | glm::vec3 b = v * m; 21 | glm::mat3x2 n = x / m; 22 | glm::mat3x2 o = m / x; 23 | glm::mat3x2 p = x * m; 24 | glm::mat3x2 q = m * x; 25 | bool R = m != q; 26 | bool S = m == l; 27 | 28 | return (S && !R) ? 0 : 1; 29 | } 30 | 31 | int main() 32 | { 33 | int Error = 0; 34 | 35 | Error += test_operators(); 36 | 37 | return Error; 38 | } 39 | 40 | 41 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_type_mat3x3.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-08-31 5 | // Updated : 2008-08-31 6 | // Licence : This source is under MIT License 7 | // File : test/core/type_mat3x3.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | #include 12 | 13 | void print(glm::dmat3 const & Mat0) 14 | { 15 | printf("mat3(\n"); 16 | printf("\tvec3(%2.3f, %2.3f, %2.3f)\n", Mat0[0][0], Mat0[0][1], Mat0[0][2]); 17 | printf("\tvec3(%2.3f, %2.3f, %2.3f)\n", Mat0[1][0], Mat0[1][1], Mat0[1][2]); 18 | printf("\tvec3(%2.3f, %2.3f, %2.3f))\n\n", Mat0[2][0], Mat0[2][1], Mat0[2][2]); 19 | } 20 | 21 | int test_mat3x3() 22 | { 23 | glm::dmat3 Mat0( 24 | glm::dvec3(0.6f, 0.2f, 0.3f), 25 | glm::dvec3(0.2f, 0.7f, 0.5f), 26 | glm::dvec3(0.3f, 0.5f, 0.7f)); 27 | glm::dmat3 Inv0 = glm::inverse(Mat0); 28 | glm::dmat3 Res0 = Mat0 * Inv0; 29 | 30 | print(Mat0); 31 | print(Inv0); 32 | print(Res0); 33 | 34 | return 0; 35 | } 36 | 37 | static int test_operators() 38 | { 39 | glm::mat3x3 l(1.0f); 40 | glm::mat3x3 m(1.0f); 41 | glm::vec3 u(1.0f); 42 | glm::vec3 v(1.0f); 43 | float x = 1.0f; 44 | glm::vec3 a = m * u; 45 | glm::vec3 b = v * m; 46 | glm::mat3x3 n = x / m; 47 | glm::mat3x3 o = m / x; 48 | glm::mat3x3 p = x * m; 49 | glm::mat3x3 q = m * x; 50 | bool R = m != q; 51 | bool S = m == l; 52 | 53 | return (S && !R) ? 0 : 1; 54 | } 55 | 56 | int main() 57 | { 58 | int Error = 0; 59 | 60 | Error += test_mat3x3(); 61 | Error += test_operators(); 62 | 63 | return Error; 64 | } 65 | 66 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_type_mat3x4.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-08-31 5 | // Updated : 2008-08-31 6 | // Licence : This source is under MIT License 7 | // File : test/core/type_mat3x4.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | 12 | static bool test_operators() 13 | { 14 | glm::mat3x4 l(1.0f); 15 | glm::mat3x4 m(1.0f); 16 | glm::vec3 u(1.0f); 17 | glm::vec4 v(1.0f); 18 | float x = 1.0f; 19 | glm::vec4 a = m * u; 20 | glm::vec3 b = v * m; 21 | glm::mat3x4 n = x / m; 22 | glm::mat3x4 o = m / x; 23 | glm::mat3x4 p = x * m; 24 | glm::mat3x4 q = m * x; 25 | bool R = m != q; 26 | bool S = m == l; 27 | 28 | return (S && !R) ? 0 : 1; 29 | } 30 | 31 | int main() 32 | { 33 | int Error = 0; 34 | 35 | Error += test_operators(); 36 | 37 | return Error; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_type_mat4x2.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-08-31 5 | // Updated : 2008-08-31 6 | // Licence : This source is under MIT License 7 | // File : test/core/type_mat4x2.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | 12 | static int test_operators() 13 | { 14 | glm::mat4x2 l(1.0f); 15 | glm::mat4x2 m(1.0f); 16 | glm::vec4 u(1.0f); 17 | glm::vec2 v(1.0f); 18 | float x = 1.0f; 19 | glm::vec2 a = m * u; 20 | glm::vec4 b = v * m; 21 | glm::mat4x2 n = x / m; 22 | glm::mat4x2 o = m / x; 23 | glm::mat4x2 p = x * m; 24 | glm::mat4x2 q = m * x; 25 | bool R = m != q; 26 | bool S = m == l; 27 | 28 | return (S && !R) ? 0 : 1; 29 | } 30 | 31 | int main() 32 | { 33 | int Error = 0; 34 | 35 | Error += test_operators(); 36 | 37 | return Error; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_type_mat4x3.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-08-31 5 | // Updated : 2008-08-31 6 | // Licence : This source is under MIT License 7 | // File : test/core/type_mat4x3.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | 12 | static int test_operators() 13 | { 14 | glm::mat4x3 l(1.0f); 15 | glm::mat4x3 m(1.0f); 16 | glm::vec4 u(1.0f); 17 | glm::vec3 v(1.0f); 18 | float x = 1.0f; 19 | glm::vec3 a = m * u; 20 | glm::vec4 b = v * m; 21 | glm::mat4x3 n = x / m; 22 | glm::mat4x3 o = m / x; 23 | glm::mat4x3 p = x * m; 24 | glm::mat4x3 q = m * x; 25 | bool R = m != q; 26 | bool S = m == l; 27 | 28 | return (S && !R) ? 0 : 1; 29 | } 30 | 31 | int main() 32 | { 33 | int Error = 0; 34 | 35 | Error += test_operators(); 36 | 37 | return Error; 38 | } 39 | 40 | 41 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_type_mat4x4.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-08-31 5 | // Updated : 2008-08-31 6 | // Licence : This source is under MIT License 7 | // File : test/core/type_mat4x4.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #define GLM_PRECISION_HIGHP_FLOAT 11 | #include 12 | #include 13 | 14 | void print(glm::dmat4 const & Mat0) 15 | { 16 | printf("mat4(\n"); 17 | printf("\tvec4(%2.3f, %2.3f, %2.3f, %2.3f)\n", Mat0[0][0], Mat0[0][1], Mat0[0][2], Mat0[0][3]); 18 | printf("\tvec4(%2.3f, %2.3f, %2.3f, %2.3f)\n", Mat0[1][0], Mat0[1][1], Mat0[1][2], Mat0[1][3]); 19 | printf("\tvec4(%2.3f, %2.3f, %2.3f, %2.3f)\n", Mat0[2][0], Mat0[2][1], Mat0[2][2], Mat0[2][3]); 20 | printf("\tvec4(%2.3f, %2.3f, %2.3f, %2.3f))\n\n", Mat0[3][0], Mat0[3][1], Mat0[3][2], Mat0[3][3]); 21 | } 22 | 23 | int test_mat4x4() 24 | { 25 | glm::dmat4 Mat0( 26 | glm::dvec4(0.6f, 0.2f, 0.3f, 0.4f), 27 | glm::dvec4(0.2f, 0.7f, 0.5f, 0.3f), 28 | glm::dvec4(0.3f, 0.5f, 0.7f, 0.2f), 29 | glm::dvec4(0.4f, 0.3f, 0.2f, 0.6f)); 30 | glm::dmat4 Inv0 = glm::inverse(Mat0); 31 | glm::dmat4 Res0 = Mat0 * Inv0; 32 | 33 | print(Mat0); 34 | print(Inv0); 35 | print(Res0); 36 | 37 | return 0; 38 | } 39 | 40 | static bool test_operators() 41 | { 42 | glm::mat4x4 l(1.0f); 43 | glm::mat4x4 m(1.0f); 44 | glm::vec4 u(1.0f); 45 | glm::vec4 v(1.0f); 46 | float x = 1.0f; 47 | glm::vec4 a = m * u; 48 | glm::vec4 b = v * m; 49 | glm::mat4x4 n = x / m; 50 | glm::mat4x4 o = m / x; 51 | glm::mat4x4 p = x * m; 52 | glm::mat4x4 q = m * x; 53 | bool R = m != q; 54 | bool S = m == l; 55 | 56 | return (S && !R) ? 0 : 1; 57 | } 58 | 59 | int main() 60 | { 61 | int Error = 0; 62 | 63 | Error += test_mat4x4(); 64 | Error += test_operators(); 65 | 66 | return Error; 67 | } 68 | -------------------------------------------------------------------------------- /3rd_party/glm/test/core/core_type_vec1.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-08-31 5 | // Updated : 2008-08-31 6 | // Licence : This source is under MIT License 7 | // File : test/core/type_vec1.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #define GLM_SWIZZLE 11 | #include 12 | 13 | static int test_operators() 14 | { 15 | glm::vec4 A(1.0f); 16 | glm::vec4 B(1.0f); 17 | bool R = A != B; 18 | bool S = A == B; 19 | 20 | return (S && !R) ? 0 : 1; 21 | } 22 | 23 | int main() 24 | { 25 | int Error = 0; 26 | 27 | Error += test_operators(); 28 | 29 | return Error; 30 | } 31 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(NAME gli) 2 | 3 | file(GLOB ROOT_SOURCE *.cpp) 4 | file(GLOB ROOT_INLINE *.inl) 5 | file(GLOB ROOT_HEADER *.hpp) 6 | 7 | file(GLOB_RECURSE CORE_SOURCE ./core/*.cpp) 8 | file(GLOB_RECURSE CORE_INLINE ./core/*.inl) 9 | file(GLOB_RECURSE CORE_HEADER ./core/*.hpp) 10 | 11 | file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) 12 | file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) 13 | file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) 14 | 15 | source_group("Core Files" FILES ${CORE_SOURCE}) 16 | source_group("Core Files" FILES ${CORE_INLINE}) 17 | source_group("Core Files" FILES ${CORE_HEADER}) 18 | source_group("GTX Files" FILES ${GTX_SOURCE}) 19 | source_group("GTX Files" FILES ${GTX_INLINE}) 20 | source_group("GTX Files" FILES ${GTX_HEADER}) 21 | 22 | include_directories(..) 23 | 24 | add_executable(${NAME} 25 | ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} 26 | ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} 27 | ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} ) 28 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/core/dummy.cpp: -------------------------------------------------------------------------------- 1 | int main() 2 | { 3 | 4 | } 5 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/core/generate_mipmaps.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-09-27 5 | // Updated : 2010-09-27 6 | // Licence : This source is under MIT License 7 | // File : gli/core/generate_mipmaps.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_GENERATE_MIPMAPS_INCLUDED 11 | #define GLI_GENERATE_MIPMAPS_INCLUDED 12 | 13 | #include "texture2d.hpp" 14 | 15 | namespace gli 16 | { 17 | texture2D generateMipmaps( 18 | texture2D const & Texture, 19 | texture2D::level_type const & BaseLevel); 20 | 21 | }//namespace gli 22 | 23 | #include "generate_mipmaps.inl" 24 | 25 | #endif//GLI_GENERATE_MIPMAPS_INCLUDED 26 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/core/operator.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-01-19 5 | // Updated : 2010-01-19 6 | // Licence : This source is under MIT License 7 | // File : gli/core/operator.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_OPERATOR_INCLUDED 11 | #define GLI_OPERATOR_INCLUDED 12 | 13 | #include "texture2d.hpp" 14 | 15 | namespace gli{ 16 | namespace detail 17 | { 18 | 19 | }//namespace detail 20 | 21 | texture2D operator+(texture2D const & TextureA, texture2D const & TextureB); 22 | texture2D operator-(texture2D const & TextureA, texture2D const & TextureB); 23 | 24 | }//namespace gli 25 | 26 | #include "operator.inl" 27 | 28 | #endif//GLI_OPERATOR_INCLUDED 29 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/core/shared_array.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-12-19 5 | // Updated : 2005-06-13 6 | // Licence : This source is under MIT License 7 | // File : gli/shared_array.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_SHARED_ARRAY_INCLUDED 11 | #define GLI_SHARED_ARRAY_INCLUDED 12 | 13 | namespace gli 14 | { 15 | template 16 | class shared_array 17 | { 18 | public: 19 | 20 | shared_array(); 21 | shared_array(shared_array const & SharedArray); 22 | shared_array(T * Pointer); 23 | virtual ~shared_array(); 24 | 25 | void reset(); 26 | void reset(T * Pointer); 27 | 28 | T & operator*(); 29 | T * operator->(); 30 | T const & operator*() const; 31 | T const * const operator->() const; 32 | 33 | T * get(); 34 | T const * const get() const; 35 | 36 | shared_array & operator=(shared_array const & SharedArray); 37 | bool operator==(shared_array const & SharedArray) const; 38 | bool operator!=(shared_array const & SharedArray) const; 39 | 40 | private: 41 | int * Counter; 42 | T * Pointer; 43 | }; 44 | }//namespace gli 45 | 46 | #include "shared_array.inl" 47 | 48 | #endif //GLI_SHARED_ARRAY_INCLUDED 49 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/core/shared_ptr.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-12-19 5 | // Updated : 2005-06-13 6 | // Licence : This source is under MIT License 7 | // File : gli/fetch.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_SHARED_PTR_INCLUDED 11 | #define GLI_SHARED_PTR_INCLUDED 12 | 13 | namespace gli 14 | { 15 | template 16 | class shared_ptr 17 | { 18 | public: 19 | shared_ptr(); 20 | shared_ptr(shared_ptr const & SmartPtr); 21 | shared_ptr(T* pPointer); 22 | ~shared_ptr(); 23 | 24 | T& operator*(); 25 | T* operator->(); 26 | const T& operator*() const; 27 | const T* operator->() const; 28 | shared_ptr& operator=(shared_ptr const & SmartPtr); 29 | shared_ptr& operator=(T* pPointer); 30 | bool operator==(shared_ptr const & SmartPtr) const; 31 | bool operator!=(shared_ptr const & SmartPtr) const; 32 | 33 | private: 34 | int* m_pReference; 35 | T* m_pPointer; 36 | }; 37 | }//namespace gli 38 | 39 | #include "shared_ptr.inl" 40 | 41 | #endif //GLI_SHARED_PTR_INCLUDED 42 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/core/size.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-09-08 5 | // Updated : 2010-09-08 6 | // Licence : This source is under MIT License 7 | // File : gli/core/size.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_CORE_SIZE_INCLUDED 11 | #define GLI_CORE_SIZE_INCLUDED 12 | 13 | #include "texture2d.hpp" 14 | 15 | namespace gli 16 | { 17 | //template 18 | image2D::size_type size( 19 | image2D const & Image, 20 | image2D::size_type const & SizeType); 21 | 22 | //template 23 | texture2D::size_type size( 24 | texture2D const & Texture, 25 | texture2D::size_type const & SizeType); 26 | 27 | }//namespace gli 28 | 29 | #include "size.inl" 30 | 31 | #endif//GLI_CORE_SIZE_INCLUDED 32 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/core/size.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-12-19 5 | // Updated : 2010-09-08 6 | // Licence : This source is under MIT License 7 | // File : gli/core/size.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace gli 11 | { 12 | inline image2D::size_type size 13 | ( 14 | image2D const & Image, 15 | image2D::size_type const & SizeType 16 | ) 17 | { 18 | switch(SizeType) 19 | { 20 | case LINEAR_SIZE: 21 | return detail::sizeLinear(Image); 22 | case BLOCK_SIZE: 23 | return detail::sizeBlock(Image.format()); 24 | case BIT_PER_PIXEL: 25 | return detail::sizeBitPerPixel(Image.format()); 26 | case COMPONENT: 27 | return detail::sizeComponent(Image.format()); 28 | default: 29 | assert(0); 30 | return 0; 31 | }; 32 | } 33 | 34 | inline texture2D::size_type size 35 | ( 36 | texture2D const & Texture, 37 | texture2D::size_type const & SizeType 38 | ) 39 | { 40 | texture2D::size_type Size = 0; 41 | for(texture2D::level_type Level = 0; Level < Texture.levels(); ++Level) 42 | Size += size(Texture[Level], SizeType); 43 | 44 | return Size; 45 | } 46 | 47 | }//namespace 48 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/core/texture2d_array.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-04-06 5 | // Updated : 2011-04-06 6 | // Licence : This source is under MIT License 7 | // File : gli/core/texture2d_array.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_CORE_TEXTURE2D_ARRAY_INCLUDED 11 | #define GLI_CORE_TEXTURE2D_ARRAY_INCLUDED 12 | 13 | #include "texture2d.hpp" 14 | 15 | namespace gli 16 | { 17 | class texture2DArray 18 | { 19 | public: 20 | typedef texture2D::dimensions_type dimensions_type; 21 | typedef texture2D::texcoord_type texcoord_type; 22 | typedef texture2D::size_type size_type; 23 | typedef texture2D::value_type value_type; 24 | typedef texture2D::format_type format_type; 25 | typedef texture2D::data_type data_type; 26 | typedef texture2D::level_type level_type; 27 | typedef std::vector::size_type layer_type; 28 | 29 | public: 30 | texture2DArray(); 31 | 32 | explicit texture2DArray( 33 | layer_type const & Layers, 34 | level_type const & Levels); 35 | 36 | ~texture2DArray(); 37 | 38 | texture2D & operator[] ( 39 | layer_type const & Layer); 40 | texture2D const & operator[] ( 41 | layer_type const & Layer) const; 42 | 43 | bool empty() const; 44 | format_type format() const; 45 | layer_type layers() const; 46 | level_type levels() const; 47 | void resize( 48 | layer_type const & Layers, 49 | level_type const & Levels); 50 | 51 | private: 52 | std::vector Arrays; 53 | }; 54 | 55 | }//namespace gli 56 | 57 | #include "texture2d_array.inl" 58 | 59 | #endif//GLI_CORE_TEXTURE2D_ARRAY_INCLUDED 60 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/core/texture2d_array.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-04-06 5 | // Updated : 2011-04-06 6 | // Licence : This source is under MIT License 7 | // File : gli/core/texture_cube.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace gli 11 | { 12 | inline texture2DArray::texture2DArray() 13 | {} 14 | 15 | inline texture2DArray::texture2DArray 16 | ( 17 | texture2DArray::layer_type const & Layers, 18 | texture2DArray::level_type const & Levels 19 | ) 20 | { 21 | this->Arrays.resize(Layers); 22 | for(texture2DArray::size_type i = 0; i < this->Arrays.size(); ++i) 23 | this->Arrays[i].resize(Levels); 24 | } 25 | 26 | inline texture2DArray::~texture2DArray() 27 | {} 28 | 29 | inline texture2D & texture2DArray::operator[] 30 | ( 31 | layer_type const & Layer 32 | ) 33 | { 34 | return this->Arrays[Layer]; 35 | } 36 | 37 | inline texture2D const & texture2DArray::operator[] 38 | ( 39 | layer_type const & Layer 40 | ) const 41 | { 42 | return this->Arrays[Layer]; 43 | } 44 | 45 | inline bool texture2DArray::empty() const 46 | { 47 | return this->Arrays.empty(); 48 | } 49 | 50 | inline texture2DArray::format_type texture2DArray::format() const 51 | { 52 | return this->Arrays.empty() ? FORMAT_NULL : this->Arrays[0].format(); 53 | } 54 | 55 | inline texture2DArray::layer_type texture2DArray::layers() const 56 | { 57 | return this->Arrays.size(); 58 | } 59 | 60 | inline texture2DArray::level_type texture2DArray::levels() const 61 | { 62 | if(this->empty()) 63 | return 0; 64 | return this->Arrays[0].levels(); 65 | } 66 | 67 | inline void texture2DArray::resize 68 | ( 69 | texture2DArray::layer_type const & Layers, 70 | texture2DArray::level_type const & Levels 71 | ) 72 | { 73 | this->Arrays.resize(Layers); 74 | for(texture2DArray::layer_type i = 0; i < this->Arrays.size(); ++i) 75 | this->Arrays[i].resize(Levels); 76 | } 77 | 78 | }//namespace gli 79 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/core/texture_cube.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-04-06 5 | // Updated : 2011-04-06 6 | // Licence : This source is under MIT License 7 | // File : gli/core/texture_cube.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_CORE_TEXTURE_CUBE_INCLUDED 11 | #define GLI_CORE_TEXTURE_CUBE_INCLUDED 12 | 13 | #include "texture2d.hpp" 14 | 15 | namespace gli 16 | { 17 | enum face 18 | { 19 | POSITIVE_X, 20 | NEGATIVE_X, 21 | POSITIVE_Y, 22 | NEGATIVE_Y, 23 | POSITIVE_Z, 24 | NEGATIVE_Z, 25 | FACE_MAX 26 | }; 27 | 28 | class textureCube 29 | { 30 | public: 31 | typedef texture2D::dimensions_type dimensions_type; 32 | typedef texture2D::texcoord_type texcoord_type; 33 | typedef texture2D::size_type size_type; 34 | typedef texture2D::value_type value_type; 35 | typedef texture2D::format_type format_type; 36 | typedef texture2D::data_type data_type; 37 | typedef texture2D::level_type level_type; 38 | typedef face face_type; 39 | 40 | public: 41 | textureCube(); 42 | 43 | explicit textureCube(level_type const & Levels); 44 | 45 | ~textureCube(); 46 | 47 | texture2D & operator[] ( 48 | face_type const & Face); 49 | texture2D const & operator[] ( 50 | face_type const & Face) const; 51 | 52 | bool empty() const; 53 | format_type format() const; 54 | level_type levels() const; 55 | void resize(level_type const & Levels); 56 | 57 | private: 58 | std::vector Faces; 59 | }; 60 | 61 | }//namespace gli 62 | 63 | #include "texture_cube.inl" 64 | 65 | #endif//GLI_CORE_TEXTURE_CUBE_INCLUDED 66 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/core/texture_cube.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-04-06 5 | // Updated : 2011-04-06 6 | // Licence : This source is under MIT License 7 | // File : gli/core/texture_cube.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace gli 11 | { 12 | inline textureCube::textureCube() 13 | {} 14 | 15 | inline textureCube::textureCube 16 | ( 17 | level_type const & Levels 18 | ) 19 | { 20 | this->Faces.resize(FACE_MAX); 21 | for(textureCube::size_type i = 0; i < FACE_MAX; ++i) 22 | this->Faces[i].resize(Levels); 23 | } 24 | 25 | inline textureCube::~textureCube() 26 | {} 27 | 28 | inline texture2D & textureCube::operator[] 29 | ( 30 | face_type const & Face 31 | ) 32 | { 33 | return this->Faces[Face]; 34 | } 35 | 36 | inline texture2D const & textureCube::operator[] 37 | ( 38 | face_type const & Face 39 | ) const 40 | { 41 | return this->Faces[Face]; 42 | } 43 | 44 | inline bool textureCube::empty() const 45 | { 46 | return this->Faces.size() == 0; 47 | } 48 | 49 | inline textureCube::format_type textureCube::format() const 50 | { 51 | return this->Faces.empty() ? FORMAT_NULL : this->Faces[0].format(); 52 | } 53 | 54 | inline textureCube::level_type textureCube::levels() const 55 | { 56 | if(this->empty()) 57 | return 0; 58 | return this->Faces[POSITIVE_X].levels(); 59 | } 60 | 61 | inline void textureCube::resize 62 | ( 63 | level_type const & Levels 64 | ) 65 | { 66 | for(textureCube::size_type i = 0; i < FACE_MAX; ++i) 67 | this->Faces[i].resize(Levels); 68 | } 69 | 70 | }//namespace gli 71 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/core/texture_cube_array.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-04-06 5 | // Updated : 2011-04-06 6 | // Licence : This source is under MIT License 7 | // File : gli/core/texture_cube_array.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_CORE_TEXTURE_CUBE_ARRAY_INCLUDED 11 | #define GLI_CORE_TEXTURE_CUBE_ARRAY_INCLUDED 12 | 13 | #include "texture_cube.hpp" 14 | 15 | namespace gli 16 | { 17 | class textureCubeArray 18 | { 19 | public: 20 | typedef textureCube::dimensions_type dimensions_type; 21 | typedef textureCube::texcoord_type texcoord_type; 22 | typedef textureCube::size_type size_type; 23 | typedef textureCube::value_type value_type; 24 | typedef textureCube::format_type format_type; 25 | typedef std::vector data_type; 26 | typedef textureCube::level_type level_type; 27 | typedef data_type::size_type layer_type; 28 | 29 | public: 30 | textureCubeArray(); 31 | 32 | explicit textureCubeArray( 33 | layer_type const & Layers, 34 | level_type const & Levels); 35 | 36 | ~textureCubeArray(); 37 | 38 | textureCube & operator[] ( 39 | layer_type const & Layer); 40 | textureCube const & operator[] ( 41 | layer_type const & Layer) const; 42 | 43 | bool empty() const; 44 | format_type format() const; 45 | layer_type layers() const; 46 | level_type levels() const; 47 | void resize( 48 | layer_type const & Layers, 49 | level_type const & Levels); 50 | 51 | private: 52 | data_type Arrays; 53 | }; 54 | 55 | }//namespace gli 56 | 57 | #include "texture_cube_array.inl" 58 | 59 | #endif//GLI_CORE_TEXTURE_CUBE_ARRAY_INCLUDED 60 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/core/texture_cube_array.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-04-06 5 | // Updated : 2011-04-06 6 | // Licence : This source is under MIT License 7 | // File : gli/core/texture_cube_array.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace gli 11 | { 12 | inline textureCubeArray::textureCubeArray() 13 | {} 14 | 15 | inline textureCubeArray::textureCubeArray 16 | ( 17 | layer_type const & Layers, 18 | level_type const & Levels 19 | ) 20 | { 21 | this->Arrays.resize(Layers); 22 | for(textureCubeArray::size_type i = 0; i < this->Arrays.size(); ++i) 23 | this->Arrays[i].resize(Levels); 24 | } 25 | 26 | inline textureCubeArray::~textureCubeArray() 27 | {} 28 | 29 | inline textureCube & textureCubeArray::operator[] 30 | ( 31 | layer_type const & Layer 32 | ) 33 | { 34 | return this->Arrays[Layer]; 35 | } 36 | 37 | inline textureCube const & textureCubeArray::operator[] 38 | ( 39 | layer_type const & Layer 40 | ) const 41 | { 42 | return this->Arrays[Layer]; 43 | } 44 | 45 | inline bool textureCubeArray::empty() const 46 | { 47 | return this->Arrays.empty(); 48 | } 49 | 50 | inline textureCubeArray::format_type textureCubeArray::format() const 51 | { 52 | return this->Arrays.empty() ? FORMAT_NULL : this->Arrays[0].format(); 53 | } 54 | 55 | inline textureCubeArray::level_type textureCubeArray::levels() const 56 | { 57 | if(this->empty()) 58 | return 0; 59 | return this->Arrays[0].levels(); 60 | } 61 | 62 | inline void textureCubeArray::resize 63 | ( 64 | layer_type const & Layers, 65 | level_type const & Levels 66 | ) 67 | { 68 | for(textureCubeArray::size_type i = 0; i < this->Arrays.size(); ++i) 69 | this->Arrays[i].resize(Levels); 70 | } 71 | 72 | }//namespace gli 73 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/gli.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-12-19 5 | // Updated : 2010-09-29 6 | // Licence : This source is under MIT License 7 | // File : gli/gli.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | /*! \mainpage OpenGL Image 11 | * 12 | */ 13 | 14 | #ifndef GLI_GLI_INCLUDED 15 | #define GLI_GLI_INCLUDED 16 | 17 | #define GLI_VERSION 31 18 | #define GLI_VERSION_MAJOR 0 19 | #define GLI_VERSION_MINOR 3 20 | #define GLI_VERSION_PATCH 1 21 | #define GLI_VERSION_REVISION 0 22 | 23 | #include "./core/texture2d.hpp" 24 | #include "./core/texture2d_array.hpp" 25 | #include "./core/texture_cube.hpp" 26 | #include "./core/texture_cube_array.hpp" 27 | #include "./core/size.hpp" 28 | #include "./core/operation.hpp" 29 | #include "./core/generate_mipmaps.hpp" 30 | 31 | #endif//GLI_GLI_INCLUDED 32 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/gtx/compression.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-12-19 5 | // Updated : 2010-01-09 6 | // Licence : This source is under MIT License 7 | // File : gli/gtx/compression.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_GTX_COMPRESSION_INCLUDED 11 | #define GLI_GTX_COMPRESSION_INCLUDED 12 | 13 | namespace gli{ 14 | namespace gtx{ 15 | namespace compression 16 | { 17 | 18 | 19 | }//namespace compression 20 | }//namespace gtx 21 | }//namespace gli 22 | 23 | namespace gli{using namespace gtx::compression;} 24 | 25 | #include "compression.inl" 26 | 27 | #endif//GLI_GTX_COMPRESSION_INCLUDED 28 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/gtx/compression.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-12-19 5 | // Updated : 2010-01-09 6 | // Licence : This source is under MIT License 7 | // File : gli/gtx/compression.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/gtx/fetch.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-12-19 5 | // Updated : 2010-09-27 6 | // Licence : This source is under MIT License 7 | // File : gli/gtx/fetch.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_GTX_FETCH_INCLUDED 11 | #define GLI_GTX_FETCH_INCLUDED 12 | 13 | #include "../gli.hpp" 14 | 15 | namespace gli{ 16 | namespace gtx{ 17 | namespace fetch 18 | { 19 | template 20 | genType texelFetch( 21 | texture2D const & Texture, 22 | texture2D::dimensions_type const & Texcoord, 23 | texture2D::level_type const & Level); 24 | 25 | template 26 | genType textureLod( 27 | texture2D const & Texture, 28 | texture2D::texcoord_type const & Texcoord, 29 | texture2D::level_type const & Level); 30 | 31 | template 32 | void texelWrite( 33 | texture2D & Texture, 34 | texture2D::dimensions_type const & Texcoord, 35 | texture2D::level_type const & Level, 36 | genType const & Color); 37 | 38 | }//namespace fetch 39 | }//namespace gtx 40 | }//namespace gli 41 | 42 | namespace gli{using namespace gtx::fetch;} 43 | 44 | #include "fetch.inl" 45 | 46 | #endif//GLI_GTX_FETCH_INCLUDED 47 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/gtx/gl_texture2d.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-09-27 5 | // Updated : 2010-10-01 6 | // Licence : This source is under MIT License 7 | // File : gli/gtx/gl_texture2d.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_GTX_GL_TEXTURE2D_INCLUDED 11 | #define GLI_GTX_GL_TEXTURE2D_INCLUDED 12 | 13 | #include "../gli.hpp" 14 | #include "loader.hpp" 15 | 16 | #ifndef GL_VERSION_1_1 17 | #error "ERROR: OpenGL must be included before GLI_GTX_gl_texture2d" 18 | #endif//GL_VERSION_1_1 19 | 20 | namespace gli{ 21 | namespace gtx{ 22 | namespace gl_texture2d 23 | { 24 | GLuint createTexture2D(std::string const & Filename); 25 | }//namespace gl_texture2d 26 | }//namespace gtx 27 | }//namespace gli 28 | 29 | namespace gli{using namespace gtx::gl_texture2d;} 30 | 31 | #include "gl_texture2d.inl" 32 | 33 | #endif//GLI_GTX_GL_TEXTURE2D_INCLUDED 34 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/gtx/gradient.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-12-19 5 | // Updated : 2010-01-09 6 | // Licence : This source is under MIT License 7 | // File : gli/gtx/gradient.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_GTX_GRADIENT_INCLUDED 11 | #define GLI_GTX_GRADIENT_INCLUDED 12 | 13 | #include "../gli.hpp" 14 | 15 | namespace gli{ 16 | namespace gtx{ 17 | namespace gradient 18 | { 19 | texture2D radial( 20 | texture2D::dimensions_type const & Size, 21 | texture2D::texcoord_type const & Center, 22 | float const & Radius, 23 | texture2D::texcoord_type const & Focal); 24 | 25 | texture2D linear( 26 | texture2D::dimensions_type const & Size, 27 | texture2D::texcoord_type const & Point0, 28 | texture2D::texcoord_type const & Point1); 29 | 30 | }//namespace gradient 31 | }//namespace gtx 32 | }//namespace gli 33 | 34 | namespace gli{using namespace gtx::gradient;} 35 | 36 | #include "gradient.inl" 37 | 38 | #endif//GLI_GTX_GRADIENT_INCLUDED 39 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/gtx/loader.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-09-08 5 | // Updated : 2010-09-27 6 | // Licence : This source is under MIT License 7 | // File : gli/gtx/loader.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_GTX_LOADER_INCLUDED 11 | #define GLI_GTX_LOADER_INCLUDED 12 | 13 | #include "../gli.hpp" 14 | #include "loader_dds9.hpp" 15 | #include "loader_dds10.hpp" 16 | #include "loader_tga.hpp" 17 | 18 | namespace gli{ 19 | namespace gtx{ 20 | namespace loader 21 | { 22 | inline texture2D load( 23 | std::string const & Filename); 24 | 25 | inline void save( 26 | texture2D const & Image, 27 | std::string const & Filename); 28 | 29 | }//namespace loader 30 | }//namespace gtx 31 | }//namespace gli 32 | 33 | namespace gli{using namespace gtx::loader;} 34 | 35 | #include "loader.inl" 36 | 37 | #endif//GLI_GTX_LOADER_INCLUDED 38 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/gtx/loader.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-09-08 5 | // Updated : 2010-09-27 6 | // Licence : This source is under MIT License 7 | // File : gli/gtx/loader.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace gli{ 11 | namespace gtx{ 12 | namespace loader 13 | { 14 | inline texture2D load 15 | ( 16 | std::string const & Filename 17 | ) 18 | { 19 | if(Filename.find(".dds") != std::string::npos) 20 | return loadDDS10(Filename); 21 | else if(Filename.find(".tga") != std::string::npos) 22 | return loadTGA(Filename); 23 | else 24 | { 25 | assert(0); // File format not supported 26 | return texture2D(); 27 | } 28 | } 29 | 30 | inline void save 31 | ( 32 | texture2D const & Image, 33 | std::string const & Filename 34 | ) 35 | { 36 | char const * File = Filename.c_str(); 37 | 38 | if(Filename.find(".dds") != std::string::npos) 39 | saveDDS10(Image, Filename); 40 | else if(Filename.find(".tga") != std::string::npos) 41 | saveTGA(Image, Filename); 42 | else 43 | assert(0); // File format not supported 44 | } 45 | 46 | }//namespace loader 47 | }//namespace gtx 48 | }//namespace gli 49 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/gtx/loader_dds10.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-09-26 5 | // Updated : 2010-09-27 6 | // Licence : This source is under MIT License 7 | // File : gli/gtx/loader_dds10.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_GTX_LOADER_DDS10_INCLUDED 11 | #define GLI_GTX_LOADER_DDS10_INCLUDED 12 | 13 | #include "../gli.hpp" 14 | #include 15 | 16 | namespace gli{ 17 | namespace gtx{ 18 | namespace loader_dds10 19 | { 20 | texture2D loadDDS10( 21 | std::string const & Filename); 22 | 23 | void saveDDS10( 24 | texture2D const & Image, 25 | std::string const & Filename); 26 | 27 | }//namespace loader_dds10 28 | }//namespace gtx 29 | }//namespace gli 30 | 31 | namespace gli{using namespace gtx::loader_dds10;} 32 | 33 | #include "loader_dds10.inl" 34 | 35 | #endif//GLI_GTX_LOADER_DDS10_INCLUDED 36 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/gtx/loader_dds9.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-09-08 5 | // Updated : 2010-09-27 6 | // Licence : This source is under MIT License 7 | // File : gli/gtx/loader_dds9.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_GTX_LOADER_DDS9_INCLUDED 11 | #define GLI_GTX_LOADER_DDS9_INCLUDED 12 | 13 | #include "../gli.hpp" 14 | #include 15 | 16 | namespace gli{ 17 | namespace gtx{ 18 | namespace loader_dds9 19 | { 20 | texture2D loadDDS9( 21 | std::string const & Filename); 22 | 23 | void saveDDS9( 24 | texture2D const & Texture, 25 | std::string const & Filename); 26 | 27 | void saveTextureCubeDDS9( 28 | textureCube const & Texture, 29 | std::string const & Filename); 30 | 31 | }//namespace loader_dds9 32 | }//namespace gtx 33 | }//namespace gli 34 | 35 | namespace gli{using namespace gtx::loader_dds9;} 36 | 37 | #include "loader_dds9.inl" 38 | 39 | #endif//GLI_GTX_LOADER_DDS9_INCLUDED 40 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/gtx/loader_tga.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-09-08 5 | // Updated : 2010-09-27 6 | // Licence : This source is under MIT License 7 | // File : gli/gtx/loader_tga.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_GTX_LOADER_TGA_INCLUDED 11 | #define GLI_GTX_LOADER_TGA_INCLUDED 12 | 13 | #include "../gli.hpp" 14 | #include 15 | #include 16 | 17 | namespace gli{ 18 | namespace gtx{ 19 | namespace loader_tga 20 | { 21 | texture2D loadTGA( 22 | std::string const & Filename); 23 | 24 | void saveTGA( 25 | texture2D const & Image, 26 | std::string const & Filename); 27 | 28 | }//namespace loader_tga 29 | }//namespace gtx 30 | }//namespace gli 31 | 32 | namespace gli{using namespace gtx::loader_tga;} 33 | 34 | #include "loader_tga.inl" 35 | 36 | #endif//GLI_GTX_LOADER_TGA_INCLUDED 37 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/gtx/wavelet.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-01-09 5 | // Updated : 2010-01-09 6 | // Licence : This source is under MIT License 7 | // File : gli/gtx/wavelet.hpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef GLI_GTX_WAVELET_INCLUDED 11 | #define GLI_GTX_WAVELET_INCLUDED 12 | 13 | namespace gli{ 14 | namespace gtx{ 15 | namespace wavelet 16 | { 17 | 18 | 19 | }//namespace wavelet 20 | }//namespace gtx 21 | }//namespace gli 22 | 23 | namespace gli{using namespace gtx::wavelet;} 24 | 25 | #include "wavelet.inl" 26 | 27 | #endif//GLI_GTX_WAVELET_INCLUDED 28 | -------------------------------------------------------------------------------- /3rd_party/glm/test/external/gli/gtx/wavelet.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-01-09 5 | // Updated : 2010-01-09 6 | // Licence : This source is under MIT License 7 | // File : gli/gtx/wavelet.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | -------------------------------------------------------------------------------- /3rd_party/glm/test/glm.cppcheck: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /3rd_party/glm/test/gtc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | glmCreateTestGTC(gtc_half_float) 2 | glmCreateTestGTC(gtc_matrix_access) 3 | glmCreateTestGTC(gtc_matrix_integer) 4 | glmCreateTestGTC(gtc_matrix_inverse) 5 | glmCreateTestGTC(gtc_matrix_transform) 6 | glmCreateTestGTC(gtc_noise) 7 | glmCreateTestGTC(gtc_quaternion) 8 | glmCreateTestGTC(gtc_random) 9 | glmCreateTestGTC(gtc_swizzle) 10 | glmCreateTestGTC(gtc_type_precision) 11 | glmCreateTestGTC(gtc_type_ptr) 12 | -------------------------------------------------------------------------------- /3rd_party/glm/test/gtc/gtc_matrix_integer.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-09-16 5 | // Updated : 2010-09-16 6 | // Licence : This source is under MIT licence 7 | // File : test/gtc/matrix_integer.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | #include 12 | 13 | int main() 14 | { 15 | int Failed = 0; 16 | 17 | return Failed; 18 | } 19 | -------------------------------------------------------------------------------- /3rd_party/glm/test/gtc/gtc_matrix_inverse.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-09-16 5 | // Updated : 2010-09-16 6 | // Licence : This source is under MIT licence 7 | // File : test/gtc/matrix_inverse.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | #include 12 | 13 | int main() 14 | { 15 | int Failed = 0; 16 | 17 | return Failed; 18 | } 19 | -------------------------------------------------------------------------------- /3rd_party/glm/test/gtc/gtc_matrix_transform.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-09-16 5 | // Updated : 2010-09-16 6 | // Licence : This source is under MIT licence 7 | // File : test/gtc/matrix_transform.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | #include 12 | 13 | int main() 14 | { 15 | int Failed = 0; 16 | 17 | glm::mat4 Pick = glm::pickMatrix(glm::vec2(1, 2), glm::vec2(3, 4), glm::ivec4(0, 0, 320, 240)); 18 | 19 | return Failed; 20 | } 21 | -------------------------------------------------------------------------------- /3rd_party/glm/test/gtc/gtc_quaternion.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-09-16 5 | // Updated : 2011-05-25 6 | // Licence : This source is under MIT licence 7 | // File : test/gtc/quaternion.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | int test_quat_precision() 15 | { 16 | int Error = 0; 17 | 18 | Error += sizeof(glm::lowp_quat) <= sizeof(glm::mediump_quat) ? 0 : 1; 19 | Error += sizeof(glm::mediump_quat) <= sizeof(glm::highp_quat) ? 0 : 1; 20 | 21 | return Error; 22 | } 23 | 24 | int test_quat_type() 25 | { 26 | glm::quat A; 27 | glm::dquat B; 28 | 29 | return 0; 30 | } 31 | 32 | int main() 33 | { 34 | int Error = 0; 35 | 36 | Error += test_quat_precision(); 37 | Error += test_quat_type(); 38 | 39 | return Error; 40 | } 41 | -------------------------------------------------------------------------------- /3rd_party/glm/test/gtx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | glmCreateTestGTC(gtx_bit) 2 | glmCreateTestGTC(gtx_gradient_paint) 3 | glmCreateTestGTC(gtx_integer) 4 | glmCreateTestGTC(gtx_matrix_query) 5 | glmCreateTestGTC(gtx_noise) 6 | glmCreateTestGTC(gtx_quaternion) 7 | glmCreateTestGTC(gtx_random) 8 | glmCreateTestGTC(gtx_rotate_vector) 9 | glmCreateTestGTC(gtx_simd_vec4) 10 | glmCreateTestGTC(gtx_simd_mat4) 11 | glmCreateTestGTC(gtx_string_cast) 12 | glmCreateTestGTC(gtx_ulp) 13 | glmCreateTestGTC(gtx_vector_angle) 14 | glmCreateTestGTC(gtx_vector_query) 15 | -------------------------------------------------------------------------------- /3rd_party/glm/test/gtx/gtx_gradient_paint.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-10-13 5 | // Updated : 2011-10-13 6 | // Licence : This source is under MIT licence 7 | // File : test/gtx/gradient_paint.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | #include 12 | 13 | int test_radialGradient() 14 | { 15 | int Error = 0; 16 | 17 | float Gradient = glm::radialGradient(glm::vec2(0), 1.0f, glm::vec2(1), glm::vec2(0.5)); 18 | Error += Gradient != 0.0f ? 0 : 1; 19 | 20 | return Error; 21 | } 22 | 23 | int test_linearGradient() 24 | { 25 | int Error = 0; 26 | 27 | float Gradient = glm::linearGradient(glm::vec2(0), glm::vec2(1), glm::vec2(0.5)); 28 | Error += Gradient != 0.0f ? 0 : 1; 29 | 30 | return Error; 31 | } 32 | 33 | int main() 34 | { 35 | int Error = 0; 36 | 37 | Error += test_radialGradient(); 38 | Error += test_linearGradient(); 39 | 40 | return Error; 41 | } 42 | 43 | 44 | -------------------------------------------------------------------------------- /3rd_party/glm/test/gtx/gtx_integer.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-10-11 5 | // Updated : 2011-10-11 6 | // Licence : This source is under MIT licence 7 | // File : test/gtx/gtx_integer.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | int test_floor_log2() 16 | { 17 | int Error = 0; 18 | 19 | for(std::size_t i = 1; i < 1000000; ++i) 20 | { 21 | glm::uint A = glm::floor_log2(glm::uint(i)); 22 | glm::uint B = glm::uint(glm::floor(glm::log2(double(i)))); // Will fail with float, lack of accuracy 23 | 24 | Error += A == B ? 0 : 1; 25 | assert(!Error); 26 | } 27 | 28 | return Error; 29 | } 30 | 31 | int test_log2() 32 | { 33 | int Error = 0; 34 | 35 | for(std::size_t i = 1; i < 24; ++i) 36 | { 37 | glm::uint A = glm::log2(glm::uint(1 << i)); 38 | glm::uint B = glm::uint(glm::log2(double(1 << i))); 39 | 40 | //Error += glm::equalEpsilon(double(A), B, 1.0) ? 0 : 1; 41 | Error += glm::abs(double(A) - B) <= 24 ? 0 : 1; 42 | assert(!Error); 43 | 44 | printf("Log2(%d) Error: %d, %d\n", 1 << i, A, B); 45 | } 46 | 47 | printf("log2 error: %d\n", Error); 48 | 49 | return Error; 50 | } 51 | 52 | int test_nlz() 53 | { 54 | int Error = 0; 55 | 56 | for(glm::uint i = 1; i < glm::uint(33); ++i) 57 | Error += glm::nlz(i) == glm::uint(31u) - glm::findMSB(i) ? 0 : 1; 58 | //printf("%d, %d\n", glm::nlz(i), 31u - glm::findMSB(i)); 59 | 60 | return Error; 61 | } 62 | 63 | int main() 64 | { 65 | int Error = 0; 66 | 67 | Error += test_nlz(); 68 | Error += test_floor_log2(); 69 | Error += test_log2(); 70 | 71 | return Error; 72 | } 73 | -------------------------------------------------------------------------------- /3rd_party/glm/test/gtx/gtx_matrix_query.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-11-22 5 | // Updated : 2011-11-22 6 | // Licence : This source is under MIT licence 7 | // File : test/gtx/matrix_query.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | #include 12 | 13 | int test_isNull() 14 | { 15 | int Error(0); 16 | 17 | bool TestA = glm::isNull(glm::mat4(0), 0.00001f); 18 | Error += TestA ? 0 : 1; 19 | 20 | return Error; 21 | } 22 | 23 | int test_isIdentity() 24 | { 25 | int Error(0); 26 | 27 | { 28 | bool TestA = glm::isIdentity(glm::mat2(1), 0.00001f); 29 | Error += TestA ? 0 : 1; 30 | } 31 | { 32 | bool TestA = glm::isIdentity(glm::mat3(1), 0.00001f); 33 | Error += TestA ? 0 : 1; 34 | } 35 | { 36 | bool TestA = glm::isIdentity(glm::mat4(1), 0.00001f); 37 | Error += TestA ? 0 : 1; 38 | } 39 | 40 | return Error; 41 | } 42 | 43 | int test_isNormalized() 44 | { 45 | int Error(0); 46 | 47 | bool TestA = glm::isNormalized(glm::mat4(1), 0.00001f); 48 | Error += TestA ? 0 : 1; 49 | 50 | return Error; 51 | } 52 | 53 | int test_isOrthogonal() 54 | { 55 | int Error(0); 56 | 57 | bool TestA = glm::isOrthogonal(glm::mat4(1), 0.00001f); 58 | Error += TestA ? 0 : 1; 59 | 60 | return Error; 61 | } 62 | 63 | int main() 64 | { 65 | int Error(0); 66 | 67 | Error += test_isNull(); 68 | Error += test_isIdentity(); 69 | Error += test_isNormalized(); 70 | Error += test_isOrthogonal(); 71 | 72 | return Error; 73 | } 74 | 75 | 76 | -------------------------------------------------------------------------------- /3rd_party/glm/test/gtx/gtx_simd_vec4.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-09-16 5 | // Updated : 2010-09-16 6 | // Licence : This source is under MIT licence 7 | // File : test/gtx/simd-vec4.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #if(GLM_ARCH != GLM_ARCH_PURE) 15 | 16 | int main() 17 | { 18 | glm::simdVec4 A1(0.0f, 0.1f, 0.2f, 0.3f); 19 | glm::simdVec4 B1(0.4f, 0.5f, 0.6f, 0.7f); 20 | glm::simdVec4 C1 = A1 + B1; 21 | glm::simdVec4 D1 = A1.swizzle(); 22 | glm::simdVec4 E1(glm::vec4(1.0f)); 23 | glm::vec4 F1 = glm::vec4_cast(E1); 24 | //glm::vec4 G1(E1); 25 | 26 | //printf("A1(%2.3f, %2.3f, %2.3f, %2.3f)\n", A1.x, A1.y, A1.z, A1.w); 27 | //printf("B1(%2.3f, %2.3f, %2.3f, %2.3f)\n", B1.x, B1.y, B1.z, B1.w); 28 | //printf("C1(%2.3f, %2.3f, %2.3f, %2.3f)\n", C1.x, C1.y, C1.z, C1.w); 29 | //printf("D1(%2.3f, %2.3f, %2.3f, %2.3f)\n", D1.x, D1.y, D1.z, D1.w); 30 | 31 | return 0; 32 | } 33 | 34 | #else 35 | 36 | int main() 37 | { 38 | int Error = 0; 39 | 40 | return Error; 41 | } 42 | 43 | #endif//(GLM_ARCH != GLM_ARCH_PURE) 44 | -------------------------------------------------------------------------------- /3rd_party/glm/test/gtx/gtx_vector_query.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2011-11-23 5 | // Updated : 2011-11-23 6 | // Licence : This source is under MIT licence 7 | // File : test/gtx/vector_query.cpp 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include 11 | #include 12 | 13 | int test_areCollinear() 14 | { 15 | int Error(0); 16 | 17 | { 18 | bool TestA = glm::areCollinear(glm::vec2(-1), glm::vec2(1), 0.00001f); 19 | Error += TestA ? 0 : 1; 20 | } 21 | 22 | { 23 | bool TestA = glm::areCollinear(glm::vec3(-1), glm::vec3(1), 0.00001f); 24 | Error += TestA ? 0 : 1; 25 | } 26 | 27 | { 28 | bool TestA = glm::areCollinear(glm::vec4(-1), glm::vec4(1), 0.00001f); 29 | Error += TestA ? 0 : 1; 30 | } 31 | 32 | return Error; 33 | } 34 | 35 | int test_areOrthogonal() 36 | { 37 | int Error(0); 38 | 39 | bool TestA = glm::areOrthogonal(glm::vec2(1, 0), glm::vec2(0, 1), 0.00001f); 40 | Error += TestA ? 0 : 1; 41 | 42 | return Error; 43 | } 44 | 45 | int test_isNormalized() 46 | { 47 | int Error(0); 48 | 49 | bool TestA = glm::isNormalized(glm::vec4(1, 0, 0, 0), 0.00001f); 50 | Error += TestA ? 0 : 1; 51 | 52 | return Error; 53 | } 54 | 55 | int test_isNull() 56 | { 57 | int Error(0); 58 | 59 | bool TestA = glm::isNull(glm::vec4(0), 0.00001f); 60 | Error += TestA ? 0 : 1; 61 | 62 | return Error; 63 | } 64 | 65 | int test_areOrthonormal() 66 | { 67 | int Error(0); 68 | 69 | bool TestA = glm::areOrthonormal(glm::vec2(1, 0), glm::vec2(0, 1), 0.00001f); 70 | Error += TestA ? 0 : 1; 71 | 72 | return Error; 73 | } 74 | 75 | int main() 76 | { 77 | int Error(0); 78 | 79 | Error += test_areCollinear(); 80 | Error += test_areOrthogonal(); 81 | Error += test_isNormalized(); 82 | Error += test_isNull(); 83 | Error += test_areOrthonormal(); 84 | 85 | return Error; 86 | } 87 | 88 | 89 | -------------------------------------------------------------------------------- /3rd_party/glm/util/autoexp.txt: -------------------------------------------------------------------------------- 1 | [Visualizer] 2 | 3 | glm::detail::tvec2<*>{ 4 | preview ( 5 | #(#($c.x,$c.y)) 6 | ) 7 | children ( 8 | #([x]: $c.x,[y]: $c.y) 9 | ) 10 | } 11 | 12 | glm::detail::tvec3<*>{ 13 | preview ( 14 | #($e.x,$e.y,$e.z) 15 | ) 16 | children ( 17 | #([x]: $e.x,[y]: $e.y,[z]: $e.z) 18 | ) 19 | } 20 | 21 | glm::detail::tvec4<*>{ 22 | preview ( 23 | #($c.x,$c.y,$c.z,$c.w) 24 | ) 25 | children ( 26 | #([x]: $e.x,[y]: $e.y,[z]: $e.z, #([w]: $e.w)) 27 | ) 28 | } 29 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.17) 2 | project(ors) 3 | 4 | set(CMAKE_CXX_STANDARD 17) 5 | set(CMAKE_CXX_FLAGS "-D__STDC_CONSTANT_MACROS") 6 | 7 | find_package(PkgConfig REQUIRED) 8 | pkg_check_modules(LIBAV REQUIRED IMPORTED_TARGET 9 | libavdevice 10 | libavfilter 11 | libavformat 12 | libavcodec 13 | libswresample 14 | libswscale 15 | libavutil 16 | ) 17 | 18 | find_package(Freetype REQUIRED) 19 | 20 | if(CMAKE_HOST_APPLE) 21 | add_compile_options(-Wno-deprecated-declarations) 22 | endif(CMAKE_HOST_APPLE) 23 | 24 | option(GLFW_BUILD_DOCS OFF) 25 | option(GLFW_BUILD_EXAMPLES OFF) 26 | option(GLFW_BUILD_TESTS OFF) 27 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/glfw) 28 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/glfw/include) 29 | LIST(APPEND LIBS glfw ${GLFW_LIBRARIES}) 30 | 31 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/glad/include) 32 | set(GLAD_SRC ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/glad/src/glad.c) 33 | if(NOT WIN32) 34 | LIST(APPEND LIBS dl) 35 | endif() 36 | 37 | include_directories(3rd_party/glm) 38 | 39 | add_subdirectory(3rd_party/librtc) 40 | 41 | add_executable( 42 | ors 43 | ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp 44 | ${CMAKE_CURRENT_SOURCE_DIR}/src/encoder.cpp 45 | ${CMAKE_CURRENT_SOURCE_DIR}/src/rtmp_publisher.cpp 46 | ${CMAKE_CURRENT_SOURCE_DIR}/src/streamer.cpp 47 | ${CMAKE_CURRENT_SOURCE_DIR}/src/scene.cpp 48 | ${CMAKE_CURRENT_SOURCE_DIR}/src/rtc_publisher.cpp 49 | ${CMAKE_CURRENT_SOURCE_DIR}/src/dispatchqueue.cpp 50 | ${CMAKE_CURRENT_SOURCE_DIR}/src/h264fileparser.cpp 51 | ${CMAKE_CURRENT_SOURCE_DIR}/src/helpers.cpp 52 | ${CMAKE_CURRENT_SOURCE_DIR}/src/stream.cpp 53 | ${GLAD_SRC} 54 | ) 55 | 56 | find_package(Threads REQUIRED) 57 | #target_include_directories(pic2video PRIVATE ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${AVDEVICE_INCLUDE_DIR}) 58 | target_link_libraries(ors ${LIBS} PkgConfig::LIBAV LibDataChannel::LibDataChannel Threads::Threads nlohmann_json ${FREETYPE_LIBRARIES}) 59 | target_include_directories(ors PUBLIC ${FREETYPE_INCLUDE_DIRS}) 60 | #target_link_libraries(pic2video PRIVATE ${AVCODEC_LIBRARY} ${AVFORMAT_LIBRARY} ${AVUTIL_LIBRARY} ${AVDEVICE_LIBRARY}) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Song Tingyu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Pixel Streaming 2 | 3 | The proj is based on cloud rendering.(云渲染) 4 | 5 | ### 1 Set Up 6 | Please make sure ffmpeg is installed first. 7 | CentOS and macos is recommended. 8 | And please note that the server file is from libdatachannel repo. 9 | ```shell 10 | git submodule update --init --recursive 11 | cmake -B cmake-build-debug 12 | cd cmake-build-debug 13 | make 14 | ``` 15 | before running the program, please make sure the server is set up. 16 | ```shell 17 | cd server 18 | python3 signaling-server.py 19 | python3 -m http.server --bind 127.0.0.1 8080 20 | ``` 21 | then just run the program, and open http://127.0.0.1:8080/, and press start. 22 | 23 | ### 2 Funcs 24 | 25 | Lots of work still need to be done. 26 | 27 | - [x] Record OpenGL app screen and encode to H.264 28 | - [x] Rtmp Streamer, which can push the H.264 raw frame in buffer to server 29 | - [x] Webrtc 30 | - [ ] HEVC 31 | - [x] Multi-thread 32 | - [ ] Parallel 33 | - [ ] Integrate with Irrlicht Game Engine. 34 | 35 | ### 3 Next Steps 36 | 2021.11.8 37 | - [x] Use librtc(libdatachannel is the origin name) to send memory video. 38 | - [ ] Implement with HEVC 39 | 40 | **Please note: the repo's license is MIT, but the 3rd_party/librtc is GPL.** 41 | 42 | -------------------------------------------------------------------------------- /server/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | libdatachannel media example 6 | 28 | 29 | 30 | 31 | 32 |

Options

33 | 34 |
35 | 36 | 37 |
38 | 39 | 40 | 41 | 42 |

State

43 |

44 | ICE gathering state: 45 |

46 |

47 | ICE connection state: 48 |

49 |

50 | Signaling state: 51 |

52 | 53 | 57 | 58 |

Data channel

59 |

60 | 
61 | 

SDP

62 | 63 |

Offer

64 |

65 | 
66 | 

Answer

67 |

68 | 
69 | 
70 | 
71 | 
72 | 
73 | 


--------------------------------------------------------------------------------
/src/Shaders/Cube.fs:
--------------------------------------------------------------------------------
1 | #version 330 core
2 | out vec4 FragColor;
3 | 
4 | uniform vec4 inputColor;
5 | 
6 | void main()
7 | {
8 |     FragColor = inputColor; // set alle 4 vector values to 1.0
9 | }


--------------------------------------------------------------------------------
/src/Shaders/Cube.vs:
--------------------------------------------------------------------------------
 1 | #version 330 core
 2 | layout (location = 0) in vec3 aPos;
 3 | 
 4 | uniform mat4 model;
 5 | uniform mat4 view;
 6 | uniform mat4 projection;
 7 | 
 8 | void main()
 9 | {
10 | 	gl_Position = projection * view * model * vec4(aPos, 1.0);
11 | }


--------------------------------------------------------------------------------
/src/Shaders/text.fs:
--------------------------------------------------------------------------------
 1 | #version 330 core
 2 | in vec2 TexCoords;
 3 | out vec4 color;
 4 | 
 5 | uniform sampler2D text;
 6 | uniform vec3 textColor;
 7 | 
 8 | void main()
 9 | {    
10 |     vec4 sampled = vec4(1.0, 1.0, 1.0, texture(text, TexCoords).r);
11 |     color = vec4(textColor, 1.0) * sampled;
12 | }


--------------------------------------------------------------------------------
/src/Shaders/text.vs:
--------------------------------------------------------------------------------
 1 | #version 330 core
 2 | layout (location = 0) in vec4 vertex; // 
 3 | out vec2 TexCoords;
 4 | 
 5 | uniform mat4 projection;
 6 | 
 7 | void main()
 8 | {
 9 |     gl_Position = projection * vec4(vertex.xy, 0.0, 1.0);
10 |     TexCoords = vertex.zw;
11 | }


--------------------------------------------------------------------------------
/src/dispatchqueue.hpp:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * libdatachannel streamer example
 3 |  * Copyright (c) 2020 Filip Klembara (in2core)
 4 |  *
 5 |  * This program is free software; you can redistribute it and/or
 6 |  * modify it under the terms of the GNU General Public License
 7 |  * as published by the Free Software Foundation; either version 2
 8 |  * of the License, or (at your option) any later version.
 9 |  *
10 |  * This program is distributed in the hope that it will be useful,
11 |  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 |  * GNU General Public License for more details.
14 |  *
15 |  * You should have received a copy of the GNU General Public License
16 |  * along with this program; If not, see .
17 |  */
18 | 
19 | #ifndef dispatchqueue_hpp
20 | #define dispatchqueue_hpp
21 | 
22 | #include 
23 | #include 
24 | #include 
25 | #include 
26 | #include 
27 | 
28 | class DispatchQueue {
29 |     typedef std::function fp_t;
30 | 
31 | public:
32 |     DispatchQueue(std::string name, size_t threadCount = 1);
33 |     ~DispatchQueue();
34 | 
35 |     // dispatch and copy
36 |     void dispatch(const fp_t& op);
37 |     // dispatch and move
38 |     void dispatch(fp_t&& op);
39 | 
40 |     void removePending();
41 | 
42 |     // Deleted operations
43 |     DispatchQueue(const DispatchQueue& rhs) = delete;
44 |     DispatchQueue& operator=(const DispatchQueue& rhs) = delete;
45 |     DispatchQueue(DispatchQueue&& rhs) = delete;
46 |     DispatchQueue& operator=(DispatchQueue&& rhs) = delete;
47 | 
48 | private:
49 |     std::string name;
50 |     std::mutex lockMutex;
51 |     std::vector threads;
52 |     std::queue queue;
53 |     std::condition_variable condition;
54 |     bool quit = false;
55 | 
56 |     void dispatchThreadHandler(void);
57 | };
58 | 
59 | #endif /* dispatchqueue_hpp */
60 | 


--------------------------------------------------------------------------------
/src/encoder.h:
--------------------------------------------------------------------------------
 1 | //
 2 | // Created by 宋庭聿 on 2021/10/22.
 3 | //
 4 | 
 5 | #ifndef ENCODER_H
 6 | #define ENCODER_H
 7 | 
 8 | extern "C"{
 9 | #include
10 | #include 
11 | #include 
12 | #include 
13 | #include 
14 | #include 
15 | #include 
16 | #include 
17 | };
18 | 
19 | #include 
20 | #include 
21 | 
22 | const int AV_CODEC_ID = AV_CODEC_ID_H264;
23 | 
24 | #include
25 | #include
26 | 
27 | #include "rtmp_publisher.h"
28 | 
29 | class Encoder {
30 | public:
31 |     Encoder();
32 |     void Init();
33 |     void GenOnePkt(uint8_t* buffer,uint8_t** ret_buf,int& ret_buf_size);
34 |     void DumpLocalVideo();
35 |     void FlushEncoder(int streamIndex);
36 |     void EndEncode();
37 | private:
38 |     int frame_count;
39 |     uint8_t * in_buf[2];
40 |     char* out_filename;
41 |     FILE* fout;
42 | private:
43 |     AVCodec* codec;
44 |     AVCodecContext* codecCtx;
45 |     AVFormatContext* ofctx;
46 |     AVStream* stream;
47 |     AVOutputFormat* outputFormat;
48 |     AVPacket* pkt;
49 |     AVFrame* frameYUV;
50 |     SwsContext* swsContext;
51 | // For debug
52 | private:
53 |     void rgb24toppm(uint8_t* buf,int width,int height);
54 |     void yuv420toppm(AVFrame* frame);
55 |     void write_ppm_header(FILE* fp);
56 |     void flip(uint8_t** buf);
57 | };
58 | 
59 | 
60 | #endif
61 | 


--------------------------------------------------------------------------------
/src/fonts/notomono.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cjmdaixi/opengl-webrtc-streamer/f465bf7d950be298aea1ab5efafaee14ca4140ae/src/fonts/notomono.ttf


--------------------------------------------------------------------------------
/src/helpers.hpp:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * libdatachannel streamer example
 3 |  * Copyright (c) 2020 Filip Klembara (in2core)
 4 |  *
 5 |  * This program is free software; you can redistribute it and/or
 6 |  * modify it under the terms of the GNU General Public License
 7 |  * as published by the Free Software Foundation; either version 2
 8 |  * of the License, or (at your option) any later version.
 9 |  *
10 |  * This program is distributed in the hope that it will be useful,
11 |  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 |  * GNU General Public License for more details.
14 |  *
15 |  * You should have received a copy of the GNU General Public License
16 |  * along with this program; If not, see .
17 |  */
18 | 
19 | #ifndef helpers_hpp
20 | #define helpers_hpp
21 | 
22 | #include "rtc/rtc.hpp"
23 | 
24 | #include 
25 | 
26 | struct ClientTrackData {
27 |     std::shared_ptr track;
28 | 	std::shared_ptr sender;
29 | 
30 | 	ClientTrackData(std::shared_ptr track, std::shared_ptr sender);
31 | };
32 | 
33 | struct Client {
34 |     enum class State {
35 |         Waiting,
36 |         WaitingForVideo,
37 |         Ready
38 |     };
39 |     const std::shared_ptr & peerConnection = _peerConnection;
40 |     Client(std::shared_ptr pc) {
41 |         _peerConnection = pc;
42 |     }
43 |     std::optional> video;
44 |     std::optional> dataChannel{};
45 |     void setState(State state);
46 |     State getState();
47 | 
48 | private:
49 |     std::shared_mutex _mutex;
50 |     State state = State::Waiting;
51 |     std::string id;
52 |     std::shared_ptr _peerConnection;
53 | };
54 | 
55 | struct ClientTrack {
56 |     std::string id;
57 |     std::shared_ptr trackData;
58 |     ClientTrack(std::string id, std::shared_ptr trackData);
59 | };
60 | 
61 | uint64_t currentTimeInMicroSeconds();
62 | 
63 | #endif /* helpers_hpp */
64 | 


--------------------------------------------------------------------------------
/src/main.cpp:
--------------------------------------------------------------------------------
 1 | #include 
 2 | #include 
 3 | 
 4 | #include "scene.h"
 5 | #include "streamer.h"
 6 | 
 7 | void SetScene(Scene* scene){
 8 |     scene->SetUpEnv();
 9 |     scene->SetObjs();
10 |     scene->SetCallback();
11 | }
12 | 
13 | void do_main(int argc,char* argv[])
14 | {
15 |     Scene* scene = new Scene();
16 |     Streamer* streamer = new Streamer(*scene);
17 |     SetScene(scene);
18 |     scene->AttachStreamer(streamer);
19 |     streamer->beginStream();
20 |     scene->DrawScene();
21 |     streamer->endStream();
22 |     scene->Terminate();
23 |     return;
24 | }
25 | 
26 | int main(int argc,char* argv[])
27 | {
28 |     do_main(argc,argv);
29 |     return 0;
30 | }
31 | 
32 | 


--------------------------------------------------------------------------------
/src/rtc_publisher.h:
--------------------------------------------------------------------------------
 1 | //
 2 | // Created by 宋庭聿 on 2021/11/12.
 3 | //
 4 | 
 5 | #ifndef RTC_PUBLISHER_H
 6 | #define RTC_PUBLISHER_H
 7 | 
 8 | #include "nlohmann/json.hpp"
 9 | #include "common.h"
10 | #include "h264fileparser.hpp"
11 | #include "helpers.hpp"
12 | 
13 | using namespace rtc;
14 | using namespace std;
15 | using namespace std::chrono_literals;
16 | 
17 | using json = nlohmann::json;
18 | 
19 | template  weak_ptr make_weak_ptr(shared_ptr ptr) { return ptr; }
20 | 
21 | class RtcPublisher {
22 | public:
23 |     RtcPublisher(){
24 |         cache_index = 0;
25 |         ws = make_shared();
26 |         rtcThread = new DispatchQueue("RtcThread") ;
27 |         video = make_shared(25,true);
28 |     }
29 |     void setUp();
30 |     void publish(uint8_t *buf, int size);
31 |     ~RtcPublisher(){
32 |         dc->close();
33 |         pc->close();
34 |         ws->close();
35 |     }
36 | protected:
37 |     Configuration rtc_config;
38 |     shared_ptr ws;
39 |     std::shared_ptr video;
40 |     optional> avStream;
41 |     DispatchQueue* rtcThread;
42 |     shared_ptr dc;
43 |     shared_ptr pc;
44 |     int cache_index;
45 |     std::vector buffer_cache;
46 |     unordered_map> clients{};
47 | 
48 |     shared_ptr createPeerConnection(const Configuration &config,
49 |                                             weak_ptr wws,
50 |                                             string id);
51 | 
52 |     shared_ptr createStream(const unsigned int fps);
53 | 
54 |     void addToStream(shared_ptr client, bool isAddingVideo);
55 | 
56 |     void startStream();
57 | 
58 |     void wsOnMessage(json message,Configuration config, shared_ptr ws);
59 | 
60 |     shared_ptr addVideo(const shared_ptr pc, const uint8_t payloadType,
61 |                                          const uint32_t ssrc, const string cname, const string msid,
62 |                                          const function onOpen);
63 | 
64 | 
65 |     void sendInitialNalus(shared_ptr stream, shared_ptr video);
66 | };
67 | 
68 | #endif //RTC_PUBLISHER_H
69 | 


--------------------------------------------------------------------------------
/src/rtmp_publisher.h:
--------------------------------------------------------------------------------
 1 | //
 2 | // Created by 宋庭聿 on 2021/10/22.
 3 | //
 4 | 
 5 | #ifndef RTMP_PUBLISHER_H
 6 | #define RTMP_PUBLISHER_H
 7 | 
 8 | extern "C"{
 9 | #include
10 | #include
11 | #include
12 | };
13 | 
14 | #include "common.h"
15 | #include 
16 | #define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
17 | #define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
18 | 
19 | class RtmpPublisher {
20 | public:
21 |     RtmpPublisher();
22 |     void setUp();
23 |     void publish(uint8_t* buf,int size);
24 |     void endPublish();
25 | private:
26 |     int pts_cnt;
27 |     AVOutputFormat *ofmt;
28 |     AVFormatContext *ofmt_ctx;
29 |     AVStream* out_stream;
30 |     AVCodecParameters  * out_codecpar;
31 |     AVCodec *out_codec ;
32 |     AVCodecContext *out_codec_ctx;
33 |     //AVPacket* pkt;
34 | };
35 | 
36 | 
37 | #endif
38 | 


--------------------------------------------------------------------------------
/src/scene.h:
--------------------------------------------------------------------------------
 1 | //
 2 | // Created by 宋庭聿 on 2021/10/22.
 3 | //
 4 | 
 5 | #ifndef SCENE_H
 6 | #define SCENE_H
 7 | 
 8 | #include "common.h"
 9 | #include "camera.h"
10 | #include "shader.h"
11 | #include 
12 | #include 
13 | #include 
14 | #include FT_FREETYPE_H
15 | #include "streamer.h"
16 | #include
17 | 
18 | struct Character {
19 |     GLuint TextureID;   // ID handle of the glyph texture
20 |     glm::ivec2 Size;    // Size of glyph
21 |     glm::ivec2 Bearing;  // Offset from baseline to left/top of glyph
22 |     GLuint Advance;    // Horizontal offset to advance to next glyph
23 | };
24 | 
25 | class Scene {
26 | public:
27 |     Scene();
28 |     void SetUpEnv();
29 |     void SetObjs(); // Set objs for drawing
30 |     void SetCallback();
31 |     void DrawScene();
32 |     void Terminate();
33 |     void AttachStreamer(Streamer* streamer);
34 |     Camera* get_camera();
35 | private:
36 |     int frame_count;
37 |     float prev_time;
38 |     float delta_t;
39 |     void Notify(uint8_t* buf);
40 |     void loadFonts();
41 |     void renderText(std::string text,GLfloat x, GLfloat y, GLfloat scale, glm::vec3 color);
42 |     Streamer* streamer_; // This can be changed to a list
43 | private:
44 |     GLFWwindow* window;
45 |     unsigned int VBO,tVBO;
46 |     unsigned int VAO,tVAO;
47 |     Shader* shader;
48 |     Shader* textShader;
49 |     Camera* camera;
50 |     glm::vec3 lightPos;
51 |     std::map Characters;
52 | };
53 | 
54 | 
55 | #endif
56 | 


--------------------------------------------------------------------------------
/src/stream.hpp:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * libdatachannel streamer example
 3 |  * Copyright (c) 2020 Filip Klembara (in2core)
 4 |  *
 5 |  * This program is free software; you can redistribute it and/or
 6 |  * modify it under the terms of the GNU General Public License
 7 |  * as published by the Free Software Foundation; either version 2
 8 |  * of the License, or (at your option) any later version.
 9 |  *
10 |  * This program is distributed in the hope that it will be useful,
11 |  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 |  * GNU General Public License for more details.
14 |  *
15 |  * You should have received a copy of the GNU General Public License
16 |  * along with this program; If not, see .
17 |  */
18 | 
19 | #ifndef stream_hpp
20 | #define stream_hpp
21 | 
22 | #include "dispatchqueue.hpp"
23 | #include "rtc/rtc.hpp"
24 | 
25 | class StreamSource {
26 | protected:
27 |     uint64_t sampleTime_us = 0;
28 |     rtc::binary sample = {};
29 | 
30 | public:
31 |     StreamSource() { }
32 |     virtual void start() = 0;
33 |     virtual void stop();
34 |     virtual void loadNextSample(std::vector& buffer) = 0;
35 | 
36 |     inline uint64_t getSampleTime_us() { return sampleTime_us; }
37 |     inline rtc::binary getSample() { return sample; }
38 | 
39 |     ~StreamSource();
40 | };
41 | 
42 | class Stream: std::enable_shared_from_this {
43 |     uint64_t startTime = 0;
44 |     std::mutex mutex;
45 |     DispatchQueue dispatchQueue = DispatchQueue("StreamQueue");
46 | 
47 |     bool _isRunning = false;
48 | public:
49 |     const std::shared_ptr video;
50 |     Stream(std::shared_ptr video);
51 |     enum class StreamSourceType {
52 |         Audio,
53 |         Video
54 |     };
55 |     ~Stream();
56 | 
57 | private:
58 |     rtc::synchronized_callback sampleHandler;
59 | 
60 |     std::pair, StreamSourceType> unsafePrepareForSample();
61 | 
62 |     void sendSample();
63 | public:
64 |     void publishSample();
65 |     void publishSample2(int id,uint8_t* data,int size);
66 |     void onSample(std::function handler);
67 |     void start();
68 |     void stop();
69 |     const bool & isRunning = _isRunning;
70 | };
71 | 
72 | 
73 | #endif /* stream_hpp */
74 | 


--------------------------------------------------------------------------------
/src/streamer.cpp:
--------------------------------------------------------------------------------
 1 | //
 2 | // Created by 宋庭聿 on 2021/10/22.
 3 | //
 4 | 
 5 | #include "streamer.h"
 6 | 
 7 | #include 
 8 | 
 9 | using namespace rtc;
10 | 
11 | Streamer::Streamer(Scene & scene):scene_(scene)
12 | {
13 |     encoder = nullptr;
14 |     rtmp_publisher = nullptr;
15 | }
16 | 
17 | void Streamer::initRtmp() {
18 |     rtmp_publisher = new RtmpPublisher();
19 |     rtmp_publisher->setUp();
20 | }
21 | 
22 | void Streamer::beginStream()
23 | {
24 |     encoder = new Encoder();
25 |     encoder->Init();
26 |     if(rtmp_publish_option){
27 |         initRtmp();
28 |     }
29 |     else if(rtc_publish_option){
30 |         initRtc();
31 |     }
32 | }
33 | 
34 | void Streamer::encode(uint8_t *buffer)
35 | {
36 |     int ret_buf_size = 0;
37 |     uint8_t* ret_buf = nullptr;
38 |     encoder->GenOnePkt(buffer,&ret_buf,ret_buf_size);
39 |     if(rtmp_publish_option)
40 |         rtmpPublish(ret_buf,ret_buf_size);
41 |     if(rtc_publish_option)
42 |         rtcPublish(ret_buf,ret_buf_size);
43 |     free(ret_buf); // malloced in encoder
44 | }
45 | 
46 | void Streamer::rtmpPublish(uint8_t *buf, int size) {
47 |     rtmp_publisher->publish(buf,size);
48 | }
49 | 
50 | void Streamer::rtcPublish(uint8_t *buf, int size) {
51 |     rtc_publisher->publish(buf,size);
52 | }
53 | 
54 | void Streamer::endStream()
55 | {
56 |     encoder->EndEncode();
57 | }
58 | 
59 | void Streamer::initRtc()
60 | {
61 |     rtc_publisher = new RtcPublisher();
62 |     rtc_publisher->setUp();
63 | }
64 | 


--------------------------------------------------------------------------------
/src/streamer.h:
--------------------------------------------------------------------------------
 1 | //
 2 | // Created by 宋庭聿 on 2021/10/22.
 3 | //
 4 | 
 5 | #ifndef STREAMER_H
 6 | #define STREAMER_H
 7 | 
 8 | #include 
 9 | #include 
10 | #include 
11 | #include "encoder.h"
12 | #include "rtmp_publisher.h"
13 | #include "rtc_publisher.h"
14 | 
15 | class Scene;
16 | 
17 | using json = nlohmann::json;
18 | 
19 | class Streamer {
20 | public:
21 |     Streamer(Scene & scene);
22 |     void beginStream();
23 |     void endStream();
24 |     void encode(uint8_t* buffer);
25 | private:
26 |     Scene & scene_;
27 |     Encoder* encoder;
28 |     RtmpPublisher* rtmp_publisher;
29 |     RtcPublisher* rtc_publisher;
30 | private:
31 |     void initRtc();
32 |     void initRtmp();
33 |     void rtmpPublish(uint8_t* buf,int size);
34 |     void rtcPublish(uint8_t* buf,int size);
35 | };
36 | 
37 | 
38 | #endif //STREAMER_H
39 | 


--------------------------------------------------------------------------------