├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── bootstrap_windows.bat ├── data ├── do_not_delete.txt ├── shaders │ ├── atmospheric_scattering │ │ ├── aerial_perspective.comp │ │ ├── definitions.glsl │ │ ├── functions.glsl │ │ ├── multi_scattering.comp │ │ ├── sky_apply.frag │ │ ├── sky_common.h │ │ ├── sky_lut.comp │ │ └── transmittance_lut.comp │ ├── debug_line.frag │ ├── debug_line_2d_cpu.vert │ ├── debug_line_cpu.vert │ ├── debug_print │ │ ├── debug_gpu_font.frag │ │ ├── debug_gpu_font.h │ │ ├── debug_gpu_font.vert │ │ ├── debug_gpu_text.hfx │ │ └── debug_gpu_text_dispatch.comp │ ├── fullscreen_triangle.vert │ ├── ocean_bruneton │ │ ├── common.h │ │ ├── ocean.frag │ │ ├── ocean.h │ │ ├── ocean.vert │ │ └── skymap.comp │ ├── platform.h │ ├── test.comp │ └── test.vert └── textures │ ├── inscatter.raw │ ├── irradiance.raw │ └── noise.pgm ├── generate_project.bat └── source ├── devgames_2024 └── main.cpp ├── external ├── SDL2-2.28.5 │ ├── BUGS.txt │ ├── COPYING.txt │ ├── README-SDL.txt │ ├── README.txt │ ├── WhatsNew.txt │ ├── cmake │ │ ├── sdl2-config-version.cmake │ │ └── sdl2-config.cmake │ ├── docs │ │ ├── CONTRIBUTING.md │ │ ├── README-android.md │ │ ├── README-cmake.md │ │ ├── README-directfb.md │ │ ├── README-dynapi.md │ │ ├── README-emscripten.md │ │ ├── README-gdk.md │ │ ├── README-gesture.md │ │ ├── README-git.md │ │ ├── README-hg.md │ │ ├── README-ios.md │ │ ├── README-kmsbsd.md │ │ ├── README-linux.md │ │ ├── README-macos.md │ │ ├── README-n3ds.md │ │ ├── README-nacl.md │ │ ├── README-ngage.md │ │ ├── README-os2.md │ │ ├── README-pandora.md │ │ ├── README-platforms.md │ │ ├── README-porting.md │ │ ├── README-ps2.md │ │ ├── README-psp.md │ │ ├── README-raspberrypi.md │ │ ├── README-riscos.md │ │ ├── README-touch.md │ │ ├── README-versions.md │ │ ├── README-visualc.md │ │ ├── README-vita.md │ │ ├── README-wince.md │ │ ├── README-windows.md │ │ ├── README-winrt.md │ │ ├── README.md │ │ ├── doxyfile │ │ └── release_checklist.md │ └── include │ │ ├── SDL.h │ │ ├── SDL_assert.h │ │ ├── SDL_atomic.h │ │ ├── SDL_audio.h │ │ ├── SDL_bits.h │ │ ├── SDL_blendmode.h │ │ ├── SDL_clipboard.h │ │ ├── SDL_config.h │ │ ├── SDL_cpuinfo.h │ │ ├── SDL_egl.h │ │ ├── SDL_endian.h │ │ ├── SDL_error.h │ │ ├── SDL_events.h │ │ ├── SDL_filesystem.h │ │ ├── SDL_gamecontroller.h │ │ ├── SDL_gesture.h │ │ ├── SDL_guid.h │ │ ├── SDL_haptic.h │ │ ├── SDL_hidapi.h │ │ ├── SDL_hints.h │ │ ├── SDL_joystick.h │ │ ├── SDL_keyboard.h │ │ ├── SDL_keycode.h │ │ ├── SDL_loadso.h │ │ ├── SDL_locale.h │ │ ├── SDL_log.h │ │ ├── SDL_main.h │ │ ├── SDL_messagebox.h │ │ ├── SDL_metal.h │ │ ├── SDL_misc.h │ │ ├── SDL_mouse.h │ │ ├── SDL_mutex.h │ │ ├── SDL_name.h │ │ ├── SDL_opengl.h │ │ ├── SDL_opengl_glext.h │ │ ├── SDL_opengles.h │ │ ├── SDL_opengles2.h │ │ ├── SDL_opengles2_gl2.h │ │ ├── SDL_opengles2_gl2ext.h │ │ ├── SDL_opengles2_gl2platform.h │ │ ├── SDL_opengles2_khrplatform.h │ │ ├── SDL_pixels.h │ │ ├── SDL_platform.h │ │ ├── SDL_power.h │ │ ├── SDL_quit.h │ │ ├── SDL_rect.h │ │ ├── SDL_render.h │ │ ├── SDL_revision.h │ │ ├── SDL_rwops.h │ │ ├── SDL_scancode.h │ │ ├── SDL_sensor.h │ │ ├── SDL_shape.h │ │ ├── SDL_stdinc.h │ │ ├── SDL_surface.h │ │ ├── SDL_system.h │ │ ├── SDL_syswm.h │ │ ├── SDL_test.h │ │ ├── SDL_test_assert.h │ │ ├── SDL_test_common.h │ │ ├── SDL_test_compare.h │ │ ├── SDL_test_crc32.h │ │ ├── SDL_test_font.h │ │ ├── SDL_test_fuzzer.h │ │ ├── SDL_test_harness.h │ │ ├── SDL_test_images.h │ │ ├── SDL_test_log.h │ │ ├── SDL_test_md5.h │ │ ├── SDL_test_memory.h │ │ ├── SDL_test_random.h │ │ ├── SDL_thread.h │ │ ├── SDL_timer.h │ │ ├── SDL_touch.h │ │ ├── SDL_types.h │ │ ├── SDL_version.h │ │ ├── SDL_video.h │ │ ├── SDL_vulkan.h │ │ ├── begin_code.h │ │ └── close_code.h ├── StackWalker.cpp ├── StackWalker.h ├── cglm │ ├── aabb2d.h │ ├── affine-mat.h │ ├── affine-post.h │ ├── affine-pre.h │ ├── affine.h │ ├── affine2d.h │ ├── applesimd.h │ ├── bezier.h │ ├── box.h │ ├── call.h │ ├── call │ │ ├── aabb2d.h │ │ ├── affine.h │ │ ├── affine2d.h │ │ ├── bezier.h │ │ ├── box.h │ │ ├── cam.h │ │ ├── clipspace │ │ │ ├── ortho_lh_no.h │ │ │ ├── ortho_lh_zo.h │ │ │ ├── ortho_rh_no.h │ │ │ ├── ortho_rh_zo.h │ │ │ ├── persp_lh_no.h │ │ │ ├── persp_lh_zo.h │ │ │ ├── persp_rh_no.h │ │ │ ├── persp_rh_zo.h │ │ │ ├── project_no.h │ │ │ ├── project_zo.h │ │ │ ├── view_lh_no.h │ │ │ ├── view_lh_zo.h │ │ │ ├── view_rh_no.h │ │ │ └── view_rh_zo.h │ │ ├── curve.h │ │ ├── ease.h │ │ ├── euler.h │ │ ├── frustum.h │ │ ├── io.h │ │ ├── ivec2.h │ │ ├── ivec3.h │ │ ├── ivec4.h │ │ ├── mat2.h │ │ ├── mat2x3.h │ │ ├── mat2x4.h │ │ ├── mat3.h │ │ ├── mat3x2.h │ │ ├── mat3x4.h │ │ ├── mat4.h │ │ ├── mat4x2.h │ │ ├── mat4x3.h │ │ ├── plane.h │ │ ├── project.h │ │ ├── quat.h │ │ ├── ray.h │ │ ├── sphere.h │ │ ├── vec2.h │ │ ├── vec3.h │ │ └── vec4.h │ ├── cam.h │ ├── cglm.h │ ├── clipspace │ │ ├── ortho_lh_no.h │ │ ├── ortho_lh_zo.h │ │ ├── ortho_rh_no.h │ │ ├── ortho_rh_zo.h │ │ ├── persp.h │ │ ├── persp_lh_no.h │ │ ├── persp_lh_zo.h │ │ ├── persp_rh_no.h │ │ ├── persp_rh_zo.h │ │ ├── project_no.h │ │ ├── project_zo.h │ │ ├── view_lh.h │ │ ├── view_lh_no.h │ │ ├── view_lh_zo.h │ │ ├── view_rh.h │ │ ├── view_rh_no.h │ │ └── view_rh_zo.h │ ├── color.h │ ├── common.h │ ├── curve.h │ ├── ease.h │ ├── euler.h │ ├── frustum.h │ ├── handed │ │ ├── euler_to_quat_lh.h │ │ └── euler_to_quat_rh.h │ ├── io.h │ ├── ivec2.h │ ├── ivec3.h │ ├── ivec4.h │ ├── mat2.h │ ├── mat2x3.h │ ├── mat2x4.h │ ├── mat3.h │ ├── mat3x2.h │ ├── mat3x4.h │ ├── mat4.h │ ├── mat4x2.h │ ├── mat4x3.h │ ├── plane.h │ ├── project.h │ ├── quat.h │ ├── ray.h │ ├── simd │ │ ├── arm.h │ │ ├── avx │ │ │ ├── affine.h │ │ │ └── mat4.h │ │ ├── intrin.h │ │ ├── neon │ │ │ ├── affine.h │ │ │ ├── mat2.h │ │ │ ├── mat4.h │ │ │ └── quat.h │ │ ├── sse2 │ │ │ ├── affine.h │ │ │ ├── mat2.h │ │ │ ├── mat3.h │ │ │ ├── mat4.h │ │ │ └── quat.h │ │ ├── wasm.h │ │ ├── wasm │ │ │ ├── affine.h │ │ │ ├── mat2.h │ │ │ ├── mat3.h │ │ │ ├── mat4.h │ │ │ └── quat.h │ │ └── x86.h │ ├── sphere.h │ ├── struct.h │ ├── struct │ │ ├── aabb2d.h │ │ ├── affine-mat.h │ │ ├── affine-post.h │ │ ├── affine-pre.h │ │ ├── affine.h │ │ ├── affine2d.h │ │ ├── box.h │ │ ├── cam.h │ │ ├── clipspace │ │ │ ├── ortho_lh_no.h │ │ │ ├── ortho_lh_zo.h │ │ │ ├── ortho_rh_no.h │ │ │ ├── ortho_rh_zo.h │ │ │ ├── persp_lh_no.h │ │ │ ├── persp_lh_zo.h │ │ │ ├── persp_rh_no.h │ │ │ ├── persp_rh_zo.h │ │ │ ├── project_no.h │ │ │ ├── project_zo.h │ │ │ ├── view_lh_no.h │ │ │ ├── view_lh_zo.h │ │ │ ├── view_rh_no.h │ │ │ └── view_rh_zo.h │ │ ├── color.h │ │ ├── curve.h │ │ ├── euler.h │ │ ├── frustum.h │ │ ├── handed │ │ │ ├── euler_to_quat_lh.h │ │ │ └── euler_to_quat_rh.h │ │ ├── io.h │ │ ├── mat2.h │ │ ├── mat2x3.h │ │ ├── mat2x4.h │ │ ├── mat3.h │ │ ├── mat3x2.h │ │ ├── mat3x4.h │ │ ├── mat4.h │ │ ├── mat4x2.h │ │ ├── mat4x3.h │ │ ├── plane.h │ │ ├── project.h │ │ ├── quat.h │ │ ├── sphere.h │ │ ├── vec2-ext.h │ │ ├── vec2.h │ │ ├── vec3-ext.h │ │ ├── vec3.h │ │ ├── vec4-ext.h │ │ └── vec4.h │ ├── types-struct.h │ ├── types.h │ ├── util.h │ ├── vec2-ext.h │ ├── vec2.h │ ├── vec3-ext.h │ ├── vec3.h │ ├── vec4-ext.h │ ├── vec4.h │ └── version.h ├── googletest │ ├── CMakeLists.txt │ ├── README.md │ ├── cmake │ │ ├── Config.cmake.in │ │ ├── gtest.pc.in │ │ ├── gtest_main.pc.in │ │ ├── internal_utils.cmake │ │ └── libgtest.la.in │ ├── docs │ │ └── README.md │ ├── include │ │ └── gtest │ │ │ ├── gtest-assertion-result.h │ │ │ ├── gtest-death-test.h │ │ │ ├── gtest-matchers.h │ │ │ ├── gtest-message.h │ │ │ ├── gtest-param-test.h │ │ │ ├── gtest-printers.h │ │ │ ├── gtest-spi.h │ │ │ ├── gtest-test-part.h │ │ │ ├── gtest-typed-test.h │ │ │ ├── gtest.h │ │ │ ├── gtest_pred_impl.h │ │ │ ├── gtest_prod.h │ │ │ └── internal │ │ │ ├── custom │ │ │ ├── README.md │ │ │ ├── gtest-port.h │ │ │ ├── gtest-printers.h │ │ │ └── gtest.h │ │ │ ├── gtest-death-test-internal.h │ │ │ ├── gtest-filepath.h │ │ │ ├── gtest-internal.h │ │ │ ├── gtest-param-util.h │ │ │ ├── gtest-port-arch.h │ │ │ ├── gtest-port.h │ │ │ ├── gtest-string.h │ │ │ └── gtest-type-util.h │ ├── samples │ │ ├── prime_tables.h │ │ ├── sample1.cc │ │ ├── sample1.h │ │ ├── sample10_unittest.cc │ │ ├── sample1_unittest.cc │ │ ├── sample2.cc │ │ ├── sample2.h │ │ ├── sample2_unittest.cc │ │ ├── sample3-inl.h │ │ ├── sample3_unittest.cc │ │ ├── sample4.cc │ │ ├── sample4.h │ │ ├── sample4_unittest.cc │ │ ├── sample5_unittest.cc │ │ ├── sample6_unittest.cc │ │ ├── sample7_unittest.cc │ │ ├── sample8_unittest.cc │ │ └── sample9_unittest.cc │ ├── src │ │ ├── gtest-all.cc │ │ ├── gtest-assertion-result.cc │ │ ├── gtest-death-test.cc │ │ ├── gtest-filepath.cc │ │ ├── gtest-internal-inl.h │ │ ├── gtest-matchers.cc │ │ ├── gtest-port.cc │ │ ├── gtest-printers.cc │ │ ├── gtest-test-part.cc │ │ ├── gtest-typed-test.cc │ │ ├── gtest.cc │ │ └── gtest_main.cc │ └── test │ │ ├── BUILD.bazel │ │ ├── googletest-break-on-failure-unittest.py │ │ ├── googletest-break-on-failure-unittest_.cc │ │ ├── googletest-catch-exceptions-test.py │ │ ├── googletest-catch-exceptions-test_.cc │ │ ├── googletest-color-test.py │ │ ├── googletest-color-test_.cc │ │ ├── googletest-death-test-test.cc │ │ ├── googletest-death-test_ex_test.cc │ │ ├── googletest-env-var-test.py │ │ ├── googletest-env-var-test_.cc │ │ ├── googletest-failfast-unittest.py │ │ ├── googletest-failfast-unittest_.cc │ │ ├── googletest-filepath-test.cc │ │ ├── googletest-filter-unittest.py │ │ ├── googletest-filter-unittest_.cc │ │ ├── googletest-global-environment-unittest.py │ │ ├── googletest-global-environment-unittest_.cc │ │ ├── googletest-json-outfiles-test.py │ │ ├── googletest-json-output-unittest.py │ │ ├── googletest-list-tests-unittest.py │ │ ├── googletest-list-tests-unittest_.cc │ │ ├── googletest-listener-test.cc │ │ ├── googletest-message-test.cc │ │ ├── googletest-options-test.cc │ │ ├── googletest-output-test-golden-lin.txt │ │ ├── googletest-output-test.py │ │ ├── googletest-output-test_.cc │ │ ├── googletest-param-test-invalid-name1-test.py │ │ ├── googletest-param-test-invalid-name1-test_.cc │ │ ├── googletest-param-test-invalid-name2-test.py │ │ ├── googletest-param-test-invalid-name2-test_.cc │ │ ├── googletest-param-test-test.cc │ │ ├── googletest-param-test-test.h │ │ ├── googletest-param-test2-test.cc │ │ ├── googletest-port-test.cc │ │ ├── googletest-printers-test.cc │ │ ├── googletest-setuptestsuite-test.py │ │ ├── googletest-setuptestsuite-test_.cc │ │ ├── googletest-shuffle-test.py │ │ ├── googletest-shuffle-test_.cc │ │ ├── googletest-test-part-test.cc │ │ ├── googletest-throw-on-failure-test.py │ │ ├── googletest-throw-on-failure-test_.cc │ │ ├── googletest-uninitialized-test.py │ │ ├── googletest-uninitialized-test_.cc │ │ ├── gtest-typed-test2_test.cc │ │ ├── gtest-typed-test_test.cc │ │ ├── gtest-typed-test_test.h │ │ ├── gtest-unittest-api_test.cc │ │ ├── gtest_all_test.cc │ │ ├── gtest_assert_by_exception_test.cc │ │ ├── gtest_dirs_test.cc │ │ ├── gtest_environment_test.cc │ │ ├── gtest_help_test.py │ │ ├── gtest_help_test_.cc │ │ ├── gtest_json_test_utils.py │ │ ├── gtest_list_output_unittest.py │ │ ├── gtest_list_output_unittest_.cc │ │ ├── gtest_main_unittest.cc │ │ ├── gtest_no_test_unittest.cc │ │ ├── gtest_pred_impl_unittest.cc │ │ ├── gtest_premature_exit_test.cc │ │ ├── gtest_prod_test.cc │ │ ├── gtest_repeat_test.cc │ │ ├── gtest_skip_check_output_test.py │ │ ├── gtest_skip_environment_check_output_test.py │ │ ├── gtest_skip_in_environment_setup_test.cc │ │ ├── gtest_skip_test.cc │ │ ├── gtest_sole_header_test.cc │ │ ├── gtest_stress_test.cc │ │ ├── gtest_test_macro_stack_footprint_test.cc │ │ ├── gtest_test_utils.py │ │ ├── gtest_testbridge_test.py │ │ ├── gtest_testbridge_test_.cc │ │ ├── gtest_throw_on_failure_ex_test.cc │ │ ├── gtest_unittest.cc │ │ ├── gtest_xml_outfile1_test_.cc │ │ ├── gtest_xml_outfile2_test_.cc │ │ ├── gtest_xml_outfiles_test.py │ │ ├── gtest_xml_output_unittest.py │ │ ├── gtest_xml_output_unittest_.cc │ │ ├── gtest_xml_test_utils.py │ │ ├── production.cc │ │ └── production.h ├── imgui │ ├── .editorconfig │ ├── .gitattributes │ ├── .github │ │ ├── FUNDING.yml │ │ ├── issue_template.md │ │ ├── pull_request_template.md │ │ └── workflows │ │ │ ├── build.yml │ │ │ ├── scheduled.yml │ │ │ └── static-analysis.yml │ ├── .gitignore │ ├── LICENSE.txt │ ├── backends │ │ ├── imgui_impl_allegro5.cpp │ │ ├── imgui_impl_allegro5.h │ │ ├── imgui_impl_android.cpp │ │ ├── imgui_impl_android.h │ │ ├── imgui_impl_dx10.cpp │ │ ├── imgui_impl_dx10.h │ │ ├── imgui_impl_dx11.cpp │ │ ├── imgui_impl_dx11.h │ │ ├── imgui_impl_dx12.cpp │ │ ├── imgui_impl_dx12.h │ │ ├── imgui_impl_dx9.cpp │ │ ├── imgui_impl_dx9.h │ │ ├── imgui_impl_glfw.cpp │ │ ├── imgui_impl_glfw.h │ │ ├── imgui_impl_glut.cpp │ │ ├── imgui_impl_glut.h │ │ ├── imgui_impl_metal.h │ │ ├── imgui_impl_metal.mm │ │ ├── imgui_impl_opengl2.cpp │ │ ├── imgui_impl_opengl2.h │ │ ├── imgui_impl_opengl3.cpp │ │ ├── imgui_impl_opengl3.h │ │ ├── imgui_impl_opengl3_loader.h │ │ ├── imgui_impl_osx.h │ │ ├── imgui_impl_osx.mm │ │ ├── imgui_impl_sdl2.cpp │ │ ├── imgui_impl_sdl2.h │ │ ├── imgui_impl_sdl3.cpp │ │ ├── imgui_impl_sdl3.h │ │ ├── imgui_impl_sdlrenderer2.cpp │ │ ├── imgui_impl_sdlrenderer2.h │ │ ├── imgui_impl_sdlrenderer3.cpp │ │ ├── imgui_impl_sdlrenderer3.h │ │ ├── imgui_impl_vulkan.cpp │ │ ├── imgui_impl_vulkan.h │ │ ├── imgui_impl_wgpu.cpp │ │ ├── imgui_impl_wgpu.h │ │ ├── imgui_impl_win32.cpp │ │ ├── imgui_impl_win32.h │ │ └── vulkan │ │ │ ├── generate_spv.sh │ │ │ ├── glsl_shader.frag │ │ │ ├── glsl_shader.frag.u32 │ │ │ ├── glsl_shader.vert │ │ │ └── glsl_shader.vert.u32 │ ├── docs │ │ ├── BACKENDS.md │ │ ├── CHANGELOG.txt │ │ ├── CONTRIBUTING.md │ │ ├── EXAMPLES.md │ │ ├── FAQ.md │ │ ├── FONTS.md │ │ ├── README.md │ │ └── TODO.txt │ ├── examples │ │ ├── README.txt │ │ ├── example_allegro5 │ │ │ ├── README.md │ │ │ ├── example_allegro5.vcxproj │ │ │ ├── example_allegro5.vcxproj.filters │ │ │ ├── imconfig_allegro5.h │ │ │ └── main.cpp │ │ ├── example_android_opengl3 │ │ │ ├── CMakeLists.txt │ │ │ ├── android │ │ │ │ ├── .gitignore │ │ │ │ ├── app │ │ │ │ │ ├── build.gradle │ │ │ │ │ └── src │ │ │ │ │ │ └── main │ │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ │ └── java │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ ├── build.gradle │ │ │ │ └── settings.gradle │ │ │ └── main.cpp │ │ ├── example_apple_metal │ │ │ ├── README.md │ │ │ ├── example_apple_metal.xcodeproj │ │ │ │ └── project.pbxproj │ │ │ ├── iOS │ │ │ │ ├── Info-iOS.plist │ │ │ │ └── LaunchScreen.storyboard │ │ │ ├── macOS │ │ │ │ ├── Info-macOS.plist │ │ │ │ └── MainMenu.storyboard │ │ │ └── main.mm │ │ ├── example_apple_opengl2 │ │ │ ├── example_apple_opengl2.xcodeproj │ │ │ │ └── project.pbxproj │ │ │ └── main.mm │ │ ├── example_emscripten_wgpu │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ └── main.cpp │ │ ├── example_glfw_metal │ │ │ ├── Makefile │ │ │ └── main.mm │ │ ├── example_glfw_opengl2 │ │ │ ├── Makefile │ │ │ ├── build_win32.bat │ │ │ ├── example_glfw_opengl2.vcxproj │ │ │ ├── example_glfw_opengl2.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_glfw_opengl3 │ │ │ ├── Makefile │ │ │ ├── Makefile.emscripten │ │ │ ├── build_win32.bat │ │ │ ├── example_glfw_opengl3.vcxproj │ │ │ ├── example_glfw_opengl3.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_glfw_vulkan │ │ │ ├── CMakeLists.txt │ │ │ ├── build_win32.bat │ │ │ ├── build_win64.bat │ │ │ ├── example_glfw_vulkan.vcxproj │ │ │ ├── example_glfw_vulkan.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_glut_opengl2 │ │ │ ├── Makefile │ │ │ ├── example_glut_opengl2.vcxproj │ │ │ ├── example_glut_opengl2.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_null │ │ │ ├── Makefile │ │ │ ├── build_win32.bat │ │ │ └── main.cpp │ │ ├── example_sdl2_directx11 │ │ │ ├── build_win32.bat │ │ │ ├── example_sdl2_directx11.vcxproj │ │ │ ├── example_sdl2_directx11.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_sdl2_metal │ │ │ ├── Makefile │ │ │ └── main.mm │ │ ├── example_sdl2_opengl2 │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── build_win32.bat │ │ │ ├── example_sdl2_opengl2.vcxproj │ │ │ ├── example_sdl2_opengl2.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_sdl2_opengl3 │ │ │ ├── Makefile │ │ │ ├── Makefile.emscripten │ │ │ ├── README.md │ │ │ ├── build_win32.bat │ │ │ ├── example_sdl2_opengl3.vcxproj │ │ │ ├── example_sdl2_opengl3.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_sdl2_sdlrenderer2 │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── build_win32.bat │ │ │ ├── example_sdl2_sdlrenderer2.vcxproj │ │ │ ├── example_sdl2_sdlrenderer2.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_sdl2_vulkan │ │ │ ├── build_win32.bat │ │ │ ├── example_sdl2_vulkan.vcxproj │ │ │ ├── example_sdl2_vulkan.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_sdl3_opengl3 │ │ │ ├── Makefile │ │ │ ├── Makefile.emscripten │ │ │ ├── README.md │ │ │ ├── build_win32.bat │ │ │ ├── example_sdl3_opengl3.vcxproj │ │ │ ├── example_sdl3_opengl3.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_sdl3_sdlrenderer3 │ │ │ ├── Makefile │ │ │ ├── build_win32.bat │ │ │ ├── example_sdl3_sdlrenderer3.vcxproj │ │ │ ├── example_sdl3_sdlrenderer3.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_win32_directx10 │ │ │ ├── build_win32.bat │ │ │ ├── example_win32_directx10.vcxproj │ │ │ ├── example_win32_directx10.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_win32_directx11 │ │ │ ├── build_win32.bat │ │ │ ├── example_win32_directx11.vcxproj │ │ │ ├── example_win32_directx11.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_win32_directx12 │ │ │ ├── build_win32.bat │ │ │ ├── example_win32_directx12.vcxproj │ │ │ ├── example_win32_directx12.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_win32_directx9 │ │ │ ├── build_win32.bat │ │ │ ├── example_win32_directx9.vcxproj │ │ │ ├── example_win32_directx9.vcxproj.filters │ │ │ └── main.cpp │ │ ├── example_win32_opengl3 │ │ │ ├── build_win32.bat │ │ │ ├── example_win32_opengl3.vcxproj │ │ │ ├── example_win32_opengl3.vcxproj.filters │ │ │ └── main.cpp │ │ ├── imgui_examples.sln │ │ └── libs │ │ │ ├── emscripten │ │ │ ├── emscripten_mainloop_stub.h │ │ │ └── shell_minimal.html │ │ │ ├── glfw │ │ │ ├── COPYING.txt │ │ │ └── include │ │ │ │ └── GLFW │ │ │ │ ├── glfw3.h │ │ │ │ └── glfw3native.h │ │ │ └── usynergy │ │ │ ├── README.txt │ │ │ ├── uSynergy.c │ │ │ └── uSynergy.h │ ├── imconfig.h │ ├── imgui.cpp │ ├── imgui.h │ ├── imgui_demo.cpp │ ├── imgui_draw.cpp │ ├── imgui_internal.h │ ├── imgui_tables.cpp │ ├── imgui_widgets.cpp │ ├── imstb_rectpack.h │ ├── imstb_textedit.h │ ├── imstb_truetype.h │ └── misc │ │ ├── README.txt │ │ ├── cpp │ │ ├── README.txt │ │ ├── imgui_stdlib.cpp │ │ └── imgui_stdlib.h │ │ ├── debuggers │ │ ├── README.txt │ │ ├── imgui.gdb │ │ ├── imgui.natstepfilter │ │ └── imgui.natvis │ │ ├── fonts │ │ ├── Cousine-Regular.ttf │ │ ├── DroidSans.ttf │ │ ├── Karla-Regular.ttf │ │ ├── ProggyClean.ttf │ │ ├── ProggyTiny.ttf │ │ ├── Roboto-Medium.ttf │ │ └── binary_to_compressed_c.cpp │ │ ├── freetype │ │ ├── README.md │ │ ├── imgui_freetype.cpp │ │ └── imgui_freetype.h │ │ └── single_file │ │ └── imgui_single_file.h ├── json.hpp ├── stb_image.h ├── stb_truetype.h ├── thsvs.h ├── tlsf.c ├── tlsf.h ├── vk_mem_alloc.h ├── volk.c ├── volk.h └── wyhash.h ├── idra ├── application │ ├── application.cpp │ ├── application.hpp │ ├── game_camera.cpp │ ├── game_camera.hpp │ ├── window.cpp │ └── window.hpp ├── game │ ├── ui_render_system.cpp │ └── ui_render_system.hpp ├── gameplay │ ├── type_writer.cpp │ └── type_writer.hpp ├── gpu │ ├── command_buffer.cpp │ ├── command_buffer.hpp │ ├── gpu_device.hpp │ ├── gpu_device_vulkan.cpp │ ├── gpu_enums.hpp │ ├── gpu_profiler.cpp │ ├── gpu_profiler.hpp │ ├── gpu_resources.cpp │ ├── gpu_resources.hpp │ ├── idra_imgui.cpp │ ├── idra_imgui.hpp │ └── vulkan_forward_declarations.hpp ├── graphics │ ├── atmospheric_scattering.cpp │ ├── atmospheric_scattering.hpp │ ├── crt_post_process.cpp │ ├── crt_post_process.hpp │ ├── debug_renderer.cpp │ ├── debug_renderer.hpp │ ├── gpu_debug_print_system.cpp │ ├── gpu_debug_print_system.hpp │ ├── graphics_asset_loaders.cpp │ ├── graphics_asset_loaders.hpp │ ├── graphics_blueprints.cpp │ ├── graphics_blueprints.hpp │ ├── render_system_interface.hpp │ ├── sprite_animation.cpp │ ├── sprite_animation.hpp │ ├── sprite_batch.cpp │ ├── sprite_batch.hpp │ ├── sprite_render_system.cpp │ └── sprite_render_system.hpp ├── imgui │ ├── imgui_helpers.cpp │ ├── imgui_helpers.hpp │ ├── widgets.cpp │ └── widgets.hpp └── kernel │ ├── allocator.cpp │ ├── allocator.hpp │ ├── array.hpp │ ├── assert.hpp │ ├── asset.cpp │ ├── asset.hpp │ ├── bit.cpp │ ├── bit.hpp │ ├── blob.cpp │ ├── blob.hpp │ ├── camera.cpp │ ├── camera.hpp │ ├── color.cpp │ ├── color.hpp │ ├── file.cpp │ ├── file.hpp │ ├── hash_map.hpp │ ├── input.cpp │ ├── input.hpp │ ├── lexer.cpp │ ├── lexer.hpp │ ├── log.cpp │ ├── log.hpp │ ├── memory.cpp │ ├── memory.hpp │ ├── memory_hooks.cpp │ ├── memory_hooks.hpp │ ├── numerics.cpp │ ├── numerics.hpp │ ├── platform.hpp │ ├── pool.cpp │ ├── pool.hpp │ ├── relative_data_structures.hpp │ ├── span.hpp │ ├── string.cpp │ ├── string.hpp │ ├── string_view.hpp │ ├── task_manager.cpp │ ├── task_manager.hpp │ ├── thread.cpp │ ├── thread.hpp │ ├── time.cpp │ ├── time.hpp │ ├── utf.hpp │ └── windows_forward_declarations.hpp └── tools ├── asset_compiler ├── CMakeLists.txt ├── asset_compiler.cpp └── asset_compiler.hpp ├── shader_compiler ├── CMakeLists.txt ├── shader_compiler.cpp └── shader_compiler.hpp └── shader_compiler_cli ├── CMakeLists.txt └── main.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | /[Bb]in/ 2 | /[Bb]uild/ 3 | /[Dd]ebug/ 4 | /[Rr]elease/ 5 | /**/.vs/ 6 | /**/x64/ 7 | /[Pp]roject/ 8 | 9 | # MSVC user extensions 10 | *.opensdf 11 | *.sdf 12 | *.suo 13 | *.user 14 | *.obj 15 | *.pdb 16 | *.idb 17 | *.log 18 | *.tlog 19 | *.lastbuildstate 20 | *.dll 21 | *.lib 22 | *.exp 23 | *.opendb 24 | *.ini 25 | *.exe 26 | *.ilk 27 | *.cache 28 | 29 | # Shader binaries 30 | *.spv 31 | 32 | # VS code 33 | .vscode 34 | *.code-workspace 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Gabriel Sassone 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 | # DevGames 2024 2 | 3 | Source code : https://www.github.com/jorenjoestar/devgames2024/ 4 | 5 | Setup 6 | 7 | Launch bootstrap.bat to create project through makefile and create basic directory 8 | layout, preferably from a console terminal. 9 | 10 | To generate the Visual Studio project, launch generate_project.bat. 11 | Note: it defaults to CMake installed with Visual Studio 2022. Change the CMake executable 12 | location at your need inside the generate_project.bat file. 13 | 14 | When loading the first time, there will be multiple windows with random sizes. 15 | One of them is the renderer showing the actual demo. 16 | Move/resize the windows around as you like! 17 | 18 | To properly execute the application from Visual Studio: 19 | 20 | 1. In Solution Explorer window, right click on devgames_2024 project and left click on 'set as startup project' 21 | 2. Again in Solution Explorer window, right click on devgames_2024 projectg and left click on 'properties'. Under the Debugging properties, change the Working Directory to $(TargetDir). This will ensure that the executable is run from the devcon2024 bin directory correctly. 22 | 23 | -------------------------------------------------------------------------------- /bootstrap_windows.bat: -------------------------------------------------------------------------------- 1 | 2 | @echo on 3 | 4 | mkdir project 5 | cd project 6 | "C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe" .. 7 | cd .. 8 | 9 | mkdir bin 10 | cd bin 11 | echo "Do not delete me">do_not_delete.txt 12 | cd .. 13 | 14 | mkdir data 15 | cd data 16 | echo "Do not delete me">do_not_delete.txt 17 | cd .. -------------------------------------------------------------------------------- /data/do_not_delete.txt: -------------------------------------------------------------------------------- 1 | "Do not delete me" 2 | -------------------------------------------------------------------------------- /data/shaders/debug_line.frag: -------------------------------------------------------------------------------- 1 | 2 | layout (location = 0) in vec4 Frag_Color; 3 | layout (location = 1) in vec2 Frag_UV; 4 | 5 | layout (location = 0) out vec4 Out_Color; 6 | 7 | float saturate(float v) { 8 | return clamp(v, 0.0, 1.0); 9 | } 10 | 11 | void main() 12 | { 13 | vec4 col = Frag_Color; 14 | //float alpha_u = saturate(1 - abs(Frag_UV.x * 0.7 - 0.35)); 15 | float alpha_v = saturate(1 - abs(Frag_UV.y * 2 - 1)); 16 | col.a *= alpha_v; 17 | 18 | Out_Color = col; 19 | } -------------------------------------------------------------------------------- /data/shaders/debug_line_2d_cpu.vert: -------------------------------------------------------------------------------- 1 | 2 | layout (location = 0) in vec2 point_a; 3 | layout (location = 1) in uvec4 color_a; 4 | layout (location = 2) in vec2 point_b; 5 | layout (location = 3) in uvec4 color_b; 6 | 7 | layout (location = 0) out vec4 Frag_Color; 8 | layout (location = 1) out vec2 Frag_UV; 9 | 10 | vec2 segmentInstanceGeometry[6] = { vec2(0, -0.5), vec2(1, -0.5), vec2(1, 0.5), vec2(0, -0.5), vec2(1, 0.5), vec2(0, 0.5)}; 11 | vec2 uv[6] = { vec2(0, 0), vec2(1, 0), vec2(1, 1), vec2(0, 0), vec2(1, 1), vec2(0, 1)}; 12 | 13 | void main() 14 | { 15 | // 2D Line working 16 | vec2 position = segmentInstanceGeometry[gl_VertexIndex % 6]; 17 | vec2 x_basis = point_b.xy - point_a.xy; 18 | vec2 y_basis = normalize( vec2(-x_basis.y, x_basis.x) ); 19 | 20 | const float width = 0.005; 21 | vec3 point = vec3(point_a.xy + x_basis * position.x + y_basis * width * position.y, 0); 22 | gl_Position = vec4(point.xyz, 1.0f); // * ortho projection ? 23 | 24 | // Colors are stored in a Uint decompressed to 4 floats, but they range from 0 to 255. 25 | Frag_Color = mix(color_a, color_b, position.x) / 255.f; 26 | Frag_UV = uv[gl_VertexIndex % 6]; 27 | } -------------------------------------------------------------------------------- /data/shaders/debug_print/debug_gpu_font.frag: -------------------------------------------------------------------------------- 1 | 2 | layout (location = 0) in vec2 uv; 3 | layout (location = 1) flat in uint global_data_index; 4 | 5 | layout (location = 0) out vec4 out_color; 6 | 7 | void main() { 8 | 9 | vec4 char_data = data[global_data_index]; 10 | vec2 duv = uv * CHAR_SIZE; 11 | vec2 print_pos = vec2(0, 10); 12 | float textPixel = print_char(char_data, duv, print_pos); 13 | 14 | if (textPixel < 0.01f) 15 | discard; 16 | 17 | vec3 col = vec3(1); 18 | col *= mix(vec3(0.2),vec3(0.5,1,0),textPixel); 19 | out_color = vec4(col.rgb, 1); 20 | } -------------------------------------------------------------------------------- /data/shaders/debug_print/debug_gpu_text_dispatch.comp: -------------------------------------------------------------------------------- 1 | 2 | uint debug_write(uint index, vec4 char) { 3 | data[index] = char; 4 | ++index; 5 | return index; 6 | } 7 | 8 | layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in; 9 | void main() { 10 | ivec3 pos = ivec3(gl_GlobalInvocationID.xyz); 11 | 12 | // Write global label with gpu font system data 13 | uint entry_index = atomicAdd(current_entry_index, 1); 14 | uint data_index = atomicAdd(current_data_index, 16); 15 | 16 | data[data_index] = ch_t; 17 | data[data_index + 1] = ch_e; 18 | data[data_index + 2] = ch_s; 19 | data[data_index + 3] = ch_t; 20 | data[data_index + 4] = ch_spc; 21 | data[data_index + 5] = ch_i; 22 | data[data_index + 6] = ch_d; 23 | data[data_index + 7] = ch_r; 24 | data[data_index + 8] = ch_a; 25 | data[data_index + 9] = ch_spc; 26 | data[data_index + 10] = get_digit(current_data_index, 1); 27 | data[data_index + 11] = get_digit(current_data_index, 0); 28 | data[data_index + 12] = ch_spc; 29 | data[data_index + 13] = get_digit(current_entry_index, 1); 30 | data[data_index + 14] = get_digit(current_entry_index, 0); 31 | 32 | vec2 print_pos = floor(vec2(STRWIDTH(1), STRHEIGHT(4))); 33 | entries[entry_index].x = print_pos.x; 34 | entries[entry_index].y = print_pos.y; 35 | entries[entry_index].offset = data_index; 36 | entries[entry_index].count = 16; 37 | 38 | // Write single character dispatch informations 39 | uint global_index = 0; 40 | for (uint e = 0; e < current_entry_index; ++e) { 41 | uint entry_data_index = entries[0].offset; 42 | for (uint i = 0; i < entries[0].count; ++i) { 43 | dispatches[global_index].x = e; 44 | dispatches[global_index].y = i; 45 | 46 | ++global_index; 47 | } 48 | } 49 | 50 | // Write indirect draw values 51 | vertex_count = 6; 52 | instance_count = global_index; 53 | first_vertex = 0; 54 | first_instance = 0; 55 | pad00 = 0; 56 | } 57 | -------------------------------------------------------------------------------- /data/shaders/fullscreen_triangle.vert: -------------------------------------------------------------------------------- 1 | 2 | layout (location = 0) out vec2 vTexCoord; 3 | layout (location = 1) flat out uint out_texture_id; 4 | 5 | void main() { 6 | 7 | vTexCoord.xy = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2); 8 | gl_Position = vec4(vTexCoord.xy * 2.0f - 1.0f, 0.0f, 1.0f); 9 | gl_Position.y = -gl_Position.y; 10 | 11 | out_texture_id = gl_InstanceIndex; 12 | } 13 | -------------------------------------------------------------------------------- /data/shaders/ocean_bruneton/common.h: -------------------------------------------------------------------------------- 1 | const float g = 9.81; 2 | const float M_PI = 3.141592657; 3 | 4 | const float SUN_INTENSITY = 100.0; 5 | const vec3 earthPos = vec3(0.0, 0.0, 6360010.0); 6 | 7 | // ---------------------------------------------------------------------------- 8 | // PHYSICAL MODEL PARAMETERS 9 | // ---------------------------------------------------------------------------- 10 | 11 | const float SCALE = 1000.0; 12 | 13 | const float Rg = 6360.0 * SCALE; 14 | const float Rt = 6420.0 * SCALE; 15 | const float RL = 6421.0 * SCALE; 16 | 17 | const int RES_R = 32; 18 | const int RES_MU = 128; 19 | const int RES_MU_S = 32; 20 | const int RES_NU = 8; 21 | 22 | // Rayleigh 23 | const float HR = 8.0 * SCALE; 24 | const vec3 betaR = vec3(5.8e-3, 1.35e-2, 3.31e-2) / SCALE; 25 | 26 | // Mie 27 | // DEFAULT 28 | const float HM = 1.2 * SCALE; 29 | const vec3 betaMSca = vec3(4e-3) / SCALE; 30 | const vec3 betaMEx = betaMSca / 0.9; 31 | const float mieG = 0.8; 32 | // CLEAR SKY 33 | /*const float HM = 1.2 * SCALE; 34 | const vec3 betaMSca = vec3(20e-3) / SCALE; 35 | const vec3 betaMEx = betaMSca / 0.9; 36 | const float mieG = 0.76;*/ 37 | // PARTLY CLOUDY 38 | /*const float HM = 3.0 * SCALE; 39 | const vec3 betaMSca = vec3(3e-3) / SCALE; 40 | const vec3 betaMEx = betaMSca / 0.9; 41 | const float mieG = 0.65;*/ 42 | -------------------------------------------------------------------------------- /data/shaders/test.comp: -------------------------------------------------------------------------------- 1 | 2 | 3 | layout(set = 1, binding = 0) uniform sampler2D src; 4 | 5 | layout(set = 1, binding = 1) uniform writeonly image2D dst; 6 | 7 | // TODO(marco): use push constants to select LOD 8 | 9 | layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; 10 | 11 | void main() { 12 | ivec2 texel_position00 = ivec2( gl_GlobalInvocationID.xy ) * 2; 13 | ivec2 texel_position01 = texel_position00 + ivec2(0, 1); 14 | ivec2 texel_position10 = texel_position00 + ivec2(1, 0); 15 | ivec2 texel_position11 = texel_position00 + ivec2(1, 1); 16 | 17 | float color00 = texelFetch( src, texel_position00, 0 ).r; 18 | float color01 = texelFetch( src, texel_position01, 0 ).r; 19 | float color10 = texelFetch( src, texel_position10, 0 ).r; 20 | float color11 = texelFetch( src, texel_position11, 0 ).r; 21 | 22 | float result = 0;//max( max( max( color00, color01 ), color10 ), color11 ); 23 | 24 | imageStore( dst, ivec2( gl_GlobalInvocationID.xy ), vec4( result, gl_GlobalInvocationID.xy / 64.0f, 0 ) ); 25 | 26 | groupMemoryBarrier(); 27 | barrier(); 28 | } -------------------------------------------------------------------------------- /data/shaders/test.vert: -------------------------------------------------------------------------------- 1 | 2 | layout( location = 0 ) in vec2 Position; 3 | layout( std140, binding = 0 ) uniform LocalConstants { mat4 ProjMtx; }; 4 | 5 | void main() { 6 | gl_Position = vec4( Position.xy,0,1 ); 7 | } -------------------------------------------------------------------------------- /data/textures/inscatter.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorenJoestar/devgames2024/587d5c80ce631d922d55fae28410ede95b7ee9de/data/textures/inscatter.raw -------------------------------------------------------------------------------- /data/textures/irradiance.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorenJoestar/devgames2024/587d5c80ce631d922d55fae28410ede95b7ee9de/data/textures/irradiance.raw -------------------------------------------------------------------------------- /data/textures/noise.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorenJoestar/devgames2024/587d5c80ce631d922d55fae28410ede95b7ee9de/data/textures/noise.pgm -------------------------------------------------------------------------------- /generate_project.bat: -------------------------------------------------------------------------------- 1 | 2 | @echo on 3 | 4 | cd project 5 | "C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe" .. 6 | cd .. 7 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/BUGS.txt: -------------------------------------------------------------------------------- 1 | 2 | Bugs are now managed in the SDL issue tracker, here: 3 | 4 | https://github.com/libsdl-org/SDL/issues 5 | 6 | You may report bugs there, and search to see if a given issue has already 7 | been reported, discussed, and maybe even fixed. 8 | 9 | 10 | You may also find help at the SDL forums/mailing list: 11 | 12 | https://discourse.libsdl.org/ 13 | 14 | Bug reports are welcome here, but we really appreciate if you use the issue 15 | tracker, as bugs discussed on the mailing list may be forgotten or missed. 16 | 17 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/COPYING.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 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 be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/README-SDL.txt: -------------------------------------------------------------------------------- 1 | 2 | Please distribute this file with the SDL runtime environment: 3 | 4 | The Simple DirectMedia Layer (SDL for short) is a cross-platform library 5 | designed to make it easy to write multi-media software, such as games 6 | and emulators. 7 | 8 | The Simple DirectMedia Layer library source code is available from: 9 | https://www.libsdl.org/ 10 | 11 | This library is distributed under the terms of the zlib license: 12 | http://www.zlib.net/zlib_license.html 13 | 14 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | 4 | (SDL) 5 | 6 | Version 2.0 7 | 8 | --- 9 | https://www.libsdl.org/ 10 | 11 | Simple DirectMedia Layer is a cross-platform development library designed 12 | to provide low level access to audio, keyboard, mouse, joystick, and graphics 13 | hardware via OpenGL and Direct3D. It is used by video playback software, 14 | emulators, and popular games including Valve's award winning catalog 15 | and many Humble Bundle games. 16 | 17 | More extensive documentation is available in the docs directory, starting 18 | with README.md 19 | 20 | Enjoy! 21 | Sam Lantinga (slouken@libsdl.org) 22 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/docs/README-git.md: -------------------------------------------------------------------------------- 1 | git 2 | ========= 3 | 4 | The latest development version of SDL is available via git. 5 | Git allows you to get up-to-the-minute fixes and enhancements; 6 | as a developer works on a source tree, you can use "git" to mirror that 7 | source tree instead of waiting for an official release. Please look 8 | at the Git website ( https://git-scm.com/ ) for more 9 | information on using git, where you can also download software for 10 | macOS, Windows, and Unix systems. 11 | 12 | git clone https://github.com/libsdl-org/SDL 13 | 14 | If you are building SDL via configure, you will need to run autogen.sh 15 | before running configure. 16 | 17 | There is a web interface to the Git repository at: 18 | http://github.com/libsdl-org/SDL/ 19 | 20 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/docs/README-hg.md: -------------------------------------------------------------------------------- 1 | We are no longer hosted in Mercurial. Please see README-git.md for details. 2 | 3 | Thanks! 4 | 5 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/docs/README-kmsbsd.md: -------------------------------------------------------------------------------- 1 | KMSDRM on *BSD 2 | ================================================== 3 | 4 | KMSDRM is supported on FreeBSD and OpenBSD. DragonFlyBSD works but requires being a root user. NetBSD isn't supported yet because the application will crash when creating the KMSDRM screen. 5 | 6 | WSCONS support has been brought back, but only as an input backend. It will not be brought back as a video backend to ease maintenance. 7 | 8 | OpenBSD note: Note that the video backend assumes that the user has read/write permissions to the /dev/drm* devices. 9 | 10 | 11 | SDL2 WSCONS input backend features 12 | =================================================== 13 | 1. It is keymap-aware; it will work properly with different keymaps. 14 | 2. It has mouse support. 15 | 3. Accent input is supported. 16 | 4. Compose keys are supported. 17 | 5. AltGr and Meta Shift keys work as intended. 18 | 19 | Partially working or no input on OpenBSD/NetBSD. 20 | ================================================== 21 | 22 | The WSCONS input backend needs read/write access to the /dev/wskbd* devices, without which it will not work properly. /dev/wsmouse must also be read/write accessible, otherwise mouse input will not work. 23 | 24 | Partially working or no input on FreeBSD. 25 | ================================================== 26 | 27 | The evdev devices are only accessible to the root user by default. Edit devfs rules to allow access to such devices. The /dev/kbd* devices are also only accessible to the root user by default. Edit devfs rules to allow access to such devices. 28 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/docs/README-n3ds.md: -------------------------------------------------------------------------------- 1 | # Nintendo 3DS 2 | 3 | SDL port for the Nintendo 3DS [Homebrew toolchain](https://devkitpro.org/) contributed by: 4 | 5 | - [Pierre Wendling](https://github.com/FtZPetruska) 6 | 7 | Credits to: 8 | 9 | - The awesome people who ported SDL to other homebrew platforms. 10 | - The Devkitpro team for making all the tools necessary to achieve this. 11 | 12 | ## Building 13 | 14 | To build for the Nintendo 3DS, make sure you have devkitARM and cmake installed and run: 15 | 16 | ```bash 17 | cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/3DS.cmake" -DCMAKE_BUILD_TYPE=Release 18 | cmake --build build 19 | cmake --install build 20 | ``` 21 | 22 | ## Notes 23 | 24 | - Currently only software rendering is supported. 25 | - SDL2main should be used to ensure ROMFS is enabled. 26 | - By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function. 27 | - `SDL_GetBasePath` returns the romfs root instead of the executable's directory. 28 | - The Nintendo 3DS uses a cooperative threading model on a single core, meaning a thread will never yield unless done manually through the `SDL_Delay` functions, or blocking waits (`SDL_LockMutex`, `SDL_SemWait`, `SDL_CondWait`, `SDL_WaitThread`). To avoid starving other threads, `SDL_SemTryWait` and `SDL_SemWaitTimeout` will yield if they fail to acquire the semaphore, see https://github.com/libsdl-org/SDL/pull/6776 for more information. 29 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/docs/README-ngage.md: -------------------------------------------------------------------------------- 1 | Nokia N-Gage 2 | ============ 3 | 4 | SDL2 port for Symbian S60v1 and v2 with a main focus on the Nokia N-Gage 5 | (Classic and QD) by [Michael Fitzmayer](https://github.com/mupfdev). 6 | 7 | Compiling 8 | --------- 9 | 10 | SDL is part of the [N-Gage SDK.](https://github.com/ngagesdk) project. 11 | The library is included in the 12 | [toolchain](https://github.com/ngagesdk/ngage-toolchain) as a 13 | sub-module. 14 | 15 | A complete example project based on SDL2 can be found in the GitHub 16 | account of the SDK: [Wordle](https://github.com/ngagesdk/wordle). 17 | 18 | Current level of implementation 19 | ------------------------------- 20 | 21 | The video driver currently provides full screen video support with 22 | keyboard input. 23 | 24 | At the moment only the software renderer works. 25 | 26 | Audio is not yet implemented. 27 | 28 | Acknowledgements 29 | ---------------- 30 | 31 | Thanks to Hannu Viitala, Kimmo Kinnunen and Markus Mertama for the 32 | valuable insight into Symbian programming. Without the SDL 1.2 port 33 | which was specially developed for CDoom (Doom for the Nokia 9210), this 34 | adaptation would not have been possible. 35 | 36 | I would like to thank my friends 37 | [Razvan](https://twitter.com/bewarerazvan) and [Dan 38 | Whelan](https://danwhelan.ie/), for their continuous support. Without 39 | you and the [N-Gage community](https://discord.gg/dbUzqJ26vs), I would 40 | have lost my patience long ago. 41 | 42 | Last but not least, I would like to thank the development team of 43 | [EKA2L1](https://12z1.com/) (an experimental Symbian OS emulator). Your 44 | patience and support in troubleshooting helped me a lot. 45 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/docs/README-pandora.md: -------------------------------------------------------------------------------- 1 | Pandora 2 | ===================================================================== 3 | 4 | ( http://openpandora.org/ ) 5 | - A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES 6 | support to work on the pandora under the framebuffer. This driver do not have 7 | input support for now, so if you use it you will have to add your own control code. 8 | The video driver name is "pandora" so if you have problem running it from 9 | the framebuffer, try to set the following variable before starting your application : 10 | "export SDL_VIDEODRIVER=pandora" 11 | 12 | - OpenGL ES support was added to the x11 driver, so it's working like the normal 13 | x11 driver one with OpenGLX support, with SDL input event's etc.. 14 | 15 | 16 | David Carré (Cpasjuste) 17 | cpasjuste@gmail.com 18 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/docs/README-platforms.md: -------------------------------------------------------------------------------- 1 | Platforms 2 | ========= 3 | 4 | We maintain the list of supported platforms on our wiki now, and how to 5 | build and install SDL for those platforms: 6 | 7 | https://wiki.libsdl.org/Installation 8 | 9 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/docs/README-ps2.md: -------------------------------------------------------------------------------- 1 | PS2 2 | ====== 3 | SDL2 port for the Sony Playstation 2 contributed by: 4 | - Francisco Javier Trujillo Mata 5 | 6 | 7 | Credit to 8 | - The guys that ported SDL to PSP & Vita because I'm taking them as reference. 9 | - David G. F. for helping me with several issues and tests. 10 | 11 | ## Building 12 | To build SDL2 library for the PS2, make sure you have the latest PS2Dev status and run: 13 | ```bash 14 | cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake 15 | cmake --build build 16 | cmake --install build 17 | ``` 18 | 19 | ## Hints 20 | The PS2 port has a special Hint for having a dynamic VSYNC. The Hint is `SDL_HINT_PS2_DYNAMIC_VSYNC`. 21 | If you enabled the dynamic vsync having as well `SDL_RENDERER_PRESENTVSYNC` enabled, then if the app is not able to run at 60 FPS, automatically the `vsync` will be disabled having a better performance, instead of droping FPS to 30. 22 | 23 | ## Notes 24 | If you trying to debug a SDL app through [ps2client](https://github.com/ps2dev/ps2client) you need to avoid the IOP reset, otherwise you will lose the conection with your computer. 25 | So to avoid the reset of the IOP CPU, you need to call to the macro `SDL_PS2_SKIP_IOP_RESET();`. 26 | It could be something similar as: 27 | ```c 28 | ..... 29 | 30 | SDL_PS2_SKIP_IOP_RESET(); 31 | 32 | int main(int argc, char *argv[]) 33 | { 34 | ..... 35 | ``` 36 | For a release binary is recommendable to reset the IOP always. 37 | 38 | Remember to do a clean compilation everytime you enable or disable the `SDL_PS2_SKIP_IOP_RESET` otherwise the change won't be reflected. 39 | 40 | ## Getting PS2 Dev 41 | [Installing PS2 Dev](https://github.com/ps2dev/ps2dev) 42 | 43 | ## Running on PCSX2 Emulator 44 | [PCSX2](https://github.com/PCSX2/pcsx2) 45 | 46 | [More PCSX2 information](https://pcsx2.net/) 47 | 48 | ## To Do 49 | - PS2 Screen Keyboard 50 | - Dialogs 51 | - Others 52 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/docs/README-psp.md: -------------------------------------------------------------------------------- 1 | PSP 2 | ====== 3 | SDL2 port for the Sony PSP contributed by: 4 | - Captian Lex 5 | - Francisco Javier Trujillo Mata 6 | - Wouter Wijsman 7 | 8 | 9 | Credit to 10 | Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP 11 | Geecko for his PSP GU lib "Glib2d" 12 | 13 | ## Building 14 | To build SDL2 library for the PSP, make sure you have the latest PSPDev status and run: 15 | ```bash 16 | cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake 17 | cmake --build build 18 | cmake --install build 19 | ``` 20 | 21 | 22 | ## Getting PSP Dev 23 | [Installing PSP Dev](https://github.com/pspdev/pspdev) 24 | 25 | ## Running on PPSSPP Emulator 26 | [PPSSPP](https://github.com/hrydgard/ppsspp) 27 | 28 | [Build Instructions](https://github.com/hrydgard/ppsspp/wiki/Build-instructions) 29 | 30 | 31 | ## Compiling a HelloWorld 32 | [PSP Hello World](https://psp-dev.org/doku.php?id=tutorial:hello_world) 33 | 34 | ## To Do 35 | - PSP Screen Keyboard 36 | - Dialogs 37 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/docs/README-riscos.md: -------------------------------------------------------------------------------- 1 | RISC OS 2 | ======= 3 | 4 | Requirements: 5 | 6 | * RISC OS 3.5 or later. 7 | * [SharedUnixLibrary](http://www.riscos.info/packages/LibraryDetails.html#SharedUnixLibraryarm). 8 | * [DigitalRenderer](http://www.riscos.info/packages/LibraryDetails.html#DRendererarm), for audio support. 9 | * [Iconv](http://www.netsurf-browser.org/projects/iconv/), for `SDL_iconv` and related functions. 10 | 11 | 12 | Compiling: 13 | ---------- 14 | 15 | Currently, SDL2 for RISC OS only supports compiling with GCCSDK under Linux. Both the autoconf and CMake build systems are supported. 16 | 17 | The following commands can be used to build SDL2 for RISC OS using autoconf: 18 | 19 | ./configure --host=arm-unknown-riscos --prefix=$GCCSDK_INSTALL_ENV --disable-gcc-atomics 20 | make 21 | make install 22 | 23 | The following commands can be used to build SDL2 for RISC OS using CMake: 24 | 25 | cmake -Bbuild-riscos -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake -DRISCOS=ON -DCMAKE_INSTALL_PREFIX=$GCCSDK_INSTALL_ENV -DCMAKE_BUILD_TYPE=Release -DSDL_GCC_ATOMICS=OFF 26 | cmake --build build-riscos 27 | cmake --build build-riscos --target install 28 | 29 | 30 | Current level of implementation 31 | ------------------------------- 32 | 33 | The video driver currently provides full screen video support with keyboard and mouse input. Windowed mode is not yet supported, but is planned in the future. Only software rendering is supported. 34 | 35 | The filesystem APIs return either Unix-style paths or RISC OS-style paths based on the value of the `__riscosify_control` symbol, as is standard for UnixLib functions. 36 | 37 | The audio, loadso, thread and timer APIs are currently provided by UnixLib. 38 | 39 | GCC atomics are currently broken on some platforms, meaning it's currently necessary to compile with `--disable-gcc-atomics` using autotools or `-DSDL_GCC_ATOMICS=OFF` using CMake. 40 | 41 | The joystick, locale and power APIs are not yet implemented. 42 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/docs/README-vita.md: -------------------------------------------------------------------------------- 1 | PS Vita 2 | ======= 3 | SDL port for the Sony Playstation Vita and Sony Playstation TV 4 | 5 | Credit to 6 | * xerpi, cpasjuste and rsn8887 for initial (vita2d) port 7 | * vitasdk/dolcesdk devs 8 | * CBPS discord (Namely Graphene and SonicMastr) 9 | 10 | Building 11 | -------- 12 | To build for the PSVita, make sure you have vitasdk and cmake installed and run: 13 | ``` 14 | cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake -DCMAKE_BUILD_TYPE=Release 15 | cmake --build build 16 | cmake --install build 17 | ``` 18 | 19 | 20 | Notes 21 | ----- 22 | * gles1/gles2 support and renderers are disabled by default and can be enabled by configuring with `-DVIDEO_VITA_PVR=ON` 23 | These renderers support 720p and 1080i resolutions. These can be specified with: 24 | `SDL_setenv("VITA_RESOLUTION", "720", 1);` and `SDL_setenv("VITA_RESOLUTION", "1080", 1);` 25 | * Desktop GL 1.X and 2.X support and renderers are also disabled by default and also can be enabled with `-DVIDEO_VITA_PVR=ON` as long as gl4es4vita is present in your SDK. 26 | They support the same resolutions as the gles1/gles2 backends and require specifying `SDL_setenv("VITA_PVR_OGL", "1", 1);` 27 | anytime before video subsystem initialization. 28 | * gles2 support via PIB is disabled by default and can be enabled by configuring with `-DVIDEO_VITA_PIB=ON` 29 | * By default SDL emits mouse events for touch events on every touchscreen. 30 | Vita has two touchscreens, so it's recommended to use `SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");` and handle touch events instead. 31 | Individual touchscreens can be disabled with: 32 | `SDL_setenv("VITA_DISABLE_TOUCH_FRONT", "1", 1);` and `SDL_setenv("VITA_DISABLE_TOUCH_BACK", "1", 1);` 33 | * Support for L2/R2/R3/R3 buttons, haptic feedback and gamepad led only available on PSTV, or when using external ds4 gamepad on vita. 34 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/docs/README-wince.md: -------------------------------------------------------------------------------- 1 | WinCE 2 | ===== 3 | 4 | Windows CE is no longer supported by SDL. 5 | 6 | We have left the CE support in SDL 1.2 for those that must have it, and we 7 | have support for Windows Phone 8 and WinRT in SDL2, as of SDL 2.0.3. 8 | 9 | --ryan. 10 | 11 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/docs/release_checklist.md: -------------------------------------------------------------------------------- 1 | # Release checklist 2 | 3 | When changing the version, run `build-scripts/update-version.sh X Y Z`, 4 | where `X Y Z` are the major version, minor version, and patch level. So 5 | `2 28 1` means "change the version to 2.28.1". This script does much of the 6 | mechanical work. 7 | 8 | 9 | ## New feature release 10 | 11 | * Update `WhatsNew.txt` 12 | 13 | * Bump version number to 2.EVEN.0: 14 | 15 | * `./build-scripts/update-version.sh 2 EVEN 0` 16 | 17 | * Do the release 18 | 19 | * Update the website file include/header.inc.php to reflect the new version 20 | 21 | ## New bugfix release 22 | 23 | * Check that no new API/ABI was added 24 | 25 | * If it was, do a new feature release (see above) instead 26 | 27 | * Bump version number from 2.Y.Z to 2.Y.(Z+1) (Y is even) 28 | 29 | * `./build-scripts/update-version.sh 2 Y Z+1` 30 | 31 | * Do the release 32 | 33 | * Update the website file include/header.inc.php to reflect the new version 34 | 35 | ## After a feature release 36 | 37 | * Create a branch like `release-2.24.x` 38 | 39 | * Bump version number to 2.ODD.0 for next development branch 40 | 41 | * `./build-scripts/update-version.sh 2 ODD 0` 42 | 43 | ## New development prerelease 44 | 45 | * Bump version number from 2.Y.Z to 2.Y.(Z+1) (Y is odd) 46 | 47 | * `./build-scripts/update-version.sh 2 Y Z+1` 48 | 49 | * Do the release 50 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/include/SDL_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2023 Sam Lantinga 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 be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDLname_h_ 23 | #define SDLname_h_ 24 | 25 | #if defined(__STDC__) || defined(__cplusplus) 26 | #define NeedFunctionPrototypes 1 27 | #endif 28 | 29 | #define SDL_NAME(X) SDL_##X 30 | 31 | #endif /* SDLname_h_ */ 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/include/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2023 Sam Lantinga 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 be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifdef __IPHONEOS__ 30 | #include 31 | #include 32 | #else 33 | #include 34 | #include 35 | #endif 36 | 37 | #ifndef APIENTRY 38 | #define APIENTRY 39 | #endif 40 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/include/SDL_opengles2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2023 Sam Lantinga 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 be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles2.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #if !defined(_MSC_VER) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS) 30 | 31 | #ifdef __IPHONEOS__ 32 | #include 33 | #include 34 | #else 35 | #include 36 | #include 37 | #include 38 | #endif 39 | 40 | #else /* _MSC_VER */ 41 | 42 | /* OpenGL ES2 headers for Visual Studio */ 43 | #include "SDL_opengles2_khrplatform.h" 44 | #include "SDL_opengles2_gl2platform.h" 45 | #include "SDL_opengles2_gl2.h" 46 | #include "SDL_opengles2_gl2ext.h" 47 | 48 | #endif /* _MSC_VER */ 49 | 50 | #ifndef APIENTRY 51 | #define APIENTRY GL_APIENTRY 52 | #endif 53 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/include/SDL_opengles2_gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* 5 | ** Copyright 2017-2020 The Khronos Group Inc. 6 | ** SPDX-License-Identifier: Apache-2.0 7 | */ 8 | 9 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 10 | * 11 | * Adopters may modify khrplatform.h and this file to suit their platform. 12 | * Please contribute modifications back to Khronos as pull requests on the 13 | * public github repository: 14 | * https://github.com/KhronosGroup/OpenGL-Registry 15 | */ 16 | 17 | /*#include */ 18 | 19 | #ifndef GL_APICALL 20 | #define GL_APICALL KHRONOS_APICALL 21 | #endif 22 | 23 | #ifndef GL_APIENTRY 24 | #define GL_APIENTRY KHRONOS_APIENTRY 25 | #endif 26 | 27 | #endif /* __gl2platform_h_ */ 28 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/include/SDL_revision.h: -------------------------------------------------------------------------------- 1 | /* Generated by updaterev.sh, do not edit */ 2 | #ifdef SDL_VENDOR_INFO 3 | #define SDL_REVISION "SDL-release-2.28.5-0-g15ead9a40 (" SDL_VENDOR_INFO ")" 4 | #else 5 | #define SDL_REVISION "SDL-release-2.28.5-0-g15ead9a40" 6 | #endif 7 | #define SDL_REVISION_NUMBER 0 8 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/include/SDL_test_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2023 Sam Lantinga 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 be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_memory.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_memory_h_ 31 | #define SDL_test_memory_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | /** 41 | * \brief Start tracking SDL memory allocations 42 | * 43 | * \note This should be called before any other SDL functions for complete tracking coverage 44 | */ 45 | int SDLTest_TrackAllocations(void); 46 | 47 | /** 48 | * \brief Print a log of any outstanding allocations 49 | * 50 | * \note This can be called after SDL_Quit() 51 | */ 52 | void SDLTest_LogAllocations(void); 53 | 54 | 55 | /* Ends C function definitions when using C++ */ 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | #include "close_code.h" 60 | 61 | #endif /* SDL_test_memory_h_ */ 62 | 63 | /* vi: set ts=4 sw=4 expandtab: */ 64 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/include/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2023 Sam Lantinga 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 be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_types.h 24 | * 25 | * \deprecated 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_stdinc.h" 30 | -------------------------------------------------------------------------------- /source/external/SDL2-2.28.5/include/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2023 Sam Lantinga 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 be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file close_code.h 24 | * 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #ifndef SDL_begin_code_h 30 | #error close_code.h included without matching begin_code.h 31 | #endif 32 | #undef SDL_begin_code_h 33 | 34 | /* Reset structure packing at previous byte alignment */ 35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 36 | #ifdef __BORLANDC__ 37 | #pragma nopackwarning 38 | #endif 39 | #pragma pack(pop) 40 | #endif /* Compiler needs structure packing set */ 41 | -------------------------------------------------------------------------------- /source/external/cglm/call.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_call_h 9 | #define cglm_call_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "cglm.h" 15 | #include "call/vec2.h" 16 | #include "call/vec3.h" 17 | #include "call/vec4.h" 18 | #include "call/ivec2.h" 19 | #include "call/ivec3.h" 20 | #include "call/ivec4.h" 21 | #include "call/mat2.h" 22 | #include "call/mat2x3.h" 23 | #include "call/mat2x4.h" 24 | #include "call/mat3.h" 25 | #include "call/mat3x2.h" 26 | #include "call/mat3x4.h" 27 | #include "call/mat4.h" 28 | #include "call/mat4x2.h" 29 | #include "call/mat4x3.h" 30 | #include "call/affine.h" 31 | #include "call/cam.h" 32 | #include "call/quat.h" 33 | #include "call/euler.h" 34 | #include "call/plane.h" 35 | #include "call/frustum.h" 36 | #include "call/aabb2d.h" 37 | #include "call/box.h" 38 | #include "call/io.h" 39 | #include "call/project.h" 40 | #include "call/sphere.h" 41 | #include "call/ease.h" 42 | #include "call/curve.h" 43 | #include "call/bezier.h" 44 | #include "call/ray.h" 45 | #include "call/affine2d.h" 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | #endif /* cglm_call_h */ 51 | -------------------------------------------------------------------------------- /source/external/cglm/call/aabb2d.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_aabb2d_h 9 | #define cglmc_aabb2d_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_aabb2d_copy(vec2 aabb[2], vec2 dest[2]); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_aabb2d_transform(vec2 aabb[2], mat3 m, vec2 dest[2]); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_aabb2d_merge(vec2 aabb1[2], vec2 aabb2[2], vec2 dest[2]); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_aabb2d_crop(vec2 aabb[2], vec2 cropAabb[2], vec2 dest[2]); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_aabb2d_crop_until(vec2 aabb[2], 35 | vec2 cropAabb[2], 36 | vec2 clampAabb[2], 37 | vec2 dest[2]); 38 | 39 | CGLM_EXPORT 40 | void 41 | glmc_aabb2d_invalidate(vec2 aabb[2]); 42 | 43 | CGLM_EXPORT 44 | bool 45 | glmc_aabb2d_isvalid(vec2 aabb[2]); 46 | 47 | CGLM_EXPORT 48 | float 49 | glmc_aabb2d_size(vec2 aabb[2]); 50 | 51 | CGLM_EXPORT 52 | float 53 | glmc_aabb2d_radius(vec2 aabb[2]); 54 | 55 | CGLM_EXPORT 56 | void 57 | glmc_aabb2d_center(vec2 aabb[2], vec2 dest); 58 | 59 | CGLM_EXPORT 60 | bool 61 | glmc_aabb2d_aabb(vec2 aabb[2], vec2 other[2]); 62 | 63 | CGLM_EXPORT 64 | bool 65 | glmc_aabb2d_point(vec2 aabb[2], vec2 point); 66 | 67 | CGLM_EXPORT 68 | bool 69 | glmc_aabb2d_contains(vec2 aabb[2], vec2 other[2]); 70 | 71 | CGLM_EXPORT 72 | bool 73 | glmc_aabb2d_circle(vec2 aabb[2], vec3 s); 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | #endif /* cglmc_aabb2d_h */ 79 | 80 | 81 | -------------------------------------------------------------------------------- /source/external/cglm/call/affine2d.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_affine2d_h 9 | #define cglmc_affine2d_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_translate2d_make(mat3 m, vec2 v); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_translate2d_to(mat3 m, vec2 v, mat3 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_translate2d(mat3 m, vec2 v); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_translate2d_x(mat3 m, float to); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_translate2d_y(mat3 m, float to); 35 | 36 | CGLM_EXPORT 37 | void 38 | glmc_scale2d_to(mat3 m, vec2 v, mat3 dest); 39 | 40 | CGLM_EXPORT 41 | void 42 | glmc_scale2d_make(mat3 m, vec2 v); 43 | 44 | CGLM_EXPORT 45 | void 46 | glmc_scale2d(mat3 m, vec2 v); 47 | 48 | CGLM_EXPORT 49 | void 50 | glmc_scale2d_uni(mat3 m, float s); 51 | 52 | CGLM_EXPORT 53 | void 54 | glmc_rotate2d_make(mat3 m, float angle); 55 | 56 | CGLM_EXPORT 57 | void 58 | glmc_rotate2d(mat3 m, float angle); 59 | 60 | CGLM_EXPORT 61 | void 62 | glmc_rotate2d_to(mat3 m, float angle, mat3 dest); 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | #endif /* cglmc_affine2d_h */ 68 | -------------------------------------------------------------------------------- /source/external/cglm/call/bezier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_bezier_h 9 | #define cglmc_bezier_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | float 18 | glmc_bezier(float s, float p0, float c0, float c1, float p1); 19 | 20 | CGLM_EXPORT 21 | float 22 | glmc_hermite(float s, float p0, float t0, float t1, float p1); 23 | 24 | CGLM_EXPORT 25 | float 26 | glmc_decasteljau(float prm, float p0, float c0, float c1, float p1); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* cglmc_bezier_h */ 32 | -------------------------------------------------------------------------------- /source/external/cglm/call/box.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_box_h 9 | #define cglmc_box_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_aabb_transform(vec3 box[2], mat4 m, vec3 dest[2]); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_aabb_merge(vec3 box1[2], vec3 box2[2], vec3 dest[2]); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_aabb_crop(vec3 box[2], vec3 cropBox[2], vec3 dest[2]); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_aabb_crop_until(vec3 box[2], 31 | vec3 cropBox[2], 32 | vec3 clampBox[2], 33 | vec3 dest[2]); 34 | 35 | CGLM_EXPORT 36 | bool 37 | glmc_aabb_frustum(vec3 box[2], vec4 planes[6]); 38 | 39 | CGLM_EXPORT 40 | void 41 | glmc_aabb_invalidate(vec3 box[2]); 42 | 43 | CGLM_EXPORT 44 | bool 45 | glmc_aabb_isvalid(vec3 box[2]); 46 | 47 | CGLM_EXPORT 48 | float 49 | glmc_aabb_size(vec3 box[2]); 50 | 51 | CGLM_EXPORT 52 | float 53 | glmc_aabb_radius(vec3 box[2]); 54 | 55 | CGLM_EXPORT 56 | void 57 | glmc_aabb_center(vec3 box[2], vec3 dest); 58 | 59 | CGLM_EXPORT 60 | bool 61 | glmc_aabb_aabb(vec3 box[2], vec3 other[2]); 62 | 63 | CGLM_EXPORT 64 | bool 65 | glmc_aabb_point(vec3 box[2], vec3 point); 66 | 67 | CGLM_EXPORT 68 | bool 69 | glmc_aabb_contains(vec3 box[2], vec3 other[2]); 70 | 71 | CGLM_EXPORT 72 | bool 73 | glmc_aabb_sphere(vec3 box[2], vec4 s); 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | #endif /* cglmc_box_h */ 79 | 80 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/ortho_lh_no.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_ortho_lh_no_h 9 | #define cglmc_ortho_lh_no_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_ortho_lh_no(float left, float right, 19 | float bottom, float top, 20 | float nearZ, float farZ, 21 | mat4 dest); 22 | 23 | CGLM_EXPORT 24 | void 25 | glmc_ortho_aabb_lh_no(vec3 box[2], mat4 dest); 26 | 27 | CGLM_EXPORT 28 | void 29 | glmc_ortho_aabb_p_lh_no(vec3 box[2], float padding, mat4 dest); 30 | 31 | CGLM_EXPORT 32 | void 33 | glmc_ortho_aabb_pz_lh_no(vec3 box[2], float padding, mat4 dest); 34 | 35 | CGLM_EXPORT 36 | void 37 | glmc_ortho_default_lh_no(float aspect, mat4 dest); 38 | 39 | CGLM_EXPORT 40 | void 41 | glmc_ortho_default_s_lh_no(float aspect, float size, mat4 dest); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif /* cglmc_ortho_lh_no_h */ 47 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/ortho_lh_zo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_ortho_lh_zo_h 9 | #define cglmc_ortho_lh_zo_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_ortho_lh_zo(float left, float right, 19 | float bottom, float top, 20 | float nearZ, float farZ, 21 | mat4 dest); 22 | 23 | CGLM_EXPORT 24 | void 25 | glmc_ortho_aabb_lh_zo(vec3 box[2], mat4 dest); 26 | 27 | CGLM_EXPORT 28 | void 29 | glmc_ortho_aabb_p_lh_zo(vec3 box[2], float padding, mat4 dest); 30 | 31 | CGLM_EXPORT 32 | void 33 | glmc_ortho_aabb_pz_lh_zo(vec3 box[2], float padding, mat4 dest); 34 | 35 | CGLM_EXPORT 36 | void 37 | glmc_ortho_default_lh_zo(float aspect, mat4 dest); 38 | 39 | CGLM_EXPORT 40 | void 41 | glmc_ortho_default_s_lh_zo(float aspect, float size, mat4 dest); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif /* cglmc_ortho_lh_zo_h */ 47 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/ortho_rh_no.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_ortho_rh_no_h 9 | #define cglmc_ortho_rh_no_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_ortho_rh_no(float left, float right, 19 | float bottom, float top, 20 | float nearZ, float farZ, 21 | mat4 dest); 22 | 23 | CGLM_EXPORT 24 | void 25 | glmc_ortho_aabb_rh_no(vec3 box[2], mat4 dest); 26 | 27 | CGLM_EXPORT 28 | void 29 | glmc_ortho_aabb_p_rh_no(vec3 box[2], float padding, mat4 dest); 30 | 31 | CGLM_EXPORT 32 | void 33 | glmc_ortho_aabb_pz_rh_no(vec3 box[2], float padding, mat4 dest); 34 | 35 | CGLM_EXPORT 36 | void 37 | glmc_ortho_default_rh_no(float aspect, mat4 dest); 38 | 39 | CGLM_EXPORT 40 | void 41 | glmc_ortho_default_s_rh_no(float aspect, float size, mat4 dest); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif /* cglmc_ortho_rh_no_h */ 47 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/ortho_rh_zo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_ortho_rh_zo_h 9 | #define cglmc_ortho_rh_zo_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_ortho_rh_zo(float left, float right, 19 | float bottom, float top, 20 | float nearZ, float farZ, 21 | mat4 dest); 22 | 23 | CGLM_EXPORT 24 | void 25 | glmc_ortho_aabb_rh_zo(vec3 box[2], mat4 dest); 26 | 27 | CGLM_EXPORT 28 | void 29 | glmc_ortho_aabb_p_rh_zo(vec3 box[2], float padding, mat4 dest); 30 | 31 | CGLM_EXPORT 32 | void 33 | glmc_ortho_aabb_pz_rh_zo(vec3 box[2], float padding, mat4 dest); 34 | 35 | CGLM_EXPORT 36 | void 37 | glmc_ortho_default_rh_zo(float aspect, mat4 dest); 38 | 39 | CGLM_EXPORT 40 | void 41 | glmc_ortho_default_s_rh_zo(float aspect, float size, mat4 dest); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif /* cglmc_ortho_rh_zo_h */ 47 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/project_no.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_project_no_h 9 | #define cglmc_project_no_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_unprojecti_no(vec3 pos, mat4 invMat, vec4 vp, vec3 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_project_no(vec3 pos, mat4 m, vec4 vp, vec3 dest); 23 | 24 | CGLM_EXPORT 25 | float 26 | glmc_project_z_no(vec3 pos, mat4 m); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* cglmc_project_no_h */ 32 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/project_zo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_project_zo_h 9 | #define cglmc_project_zo_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_unprojecti_zo(vec3 pos, mat4 invMat, vec4 vp, vec3 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_project_zo(vec3 pos, mat4 m, vec4 vp, vec3 dest); 23 | 24 | CGLM_EXPORT 25 | float 26 | glmc_project_z_zo(vec3 pos, mat4 m); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* cglmc_project_zo_h */ 32 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/view_lh_no.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_view_lh_no_h 9 | #define cglmc_view_lh_no_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_lookat_lh_no(vec3 eye, vec3 center, vec3 up, mat4 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_look_lh_no(vec3 eye, vec3 dir, vec3 up, mat4 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_look_anyup_lh_no(vec3 eye, vec3 dir, mat4 dest); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* cglmc_view_lh_no_h */ 32 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/view_lh_zo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_view_lh_zo_h 9 | #define cglmc_view_lh_zo_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_lookat_lh_zo(vec3 eye, vec3 center, vec3 up, mat4 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_look_lh_zo(vec3 eye, vec3 dir, vec3 up, mat4 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_look_anyup_lh_zo(vec3 eye, vec3 dir, mat4 dest); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* cglmc_view_lh_zo_h */ 32 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/view_rh_no.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_view_rh_no_h 9 | #define cglmc_view_rh_no_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_lookat_rh_no(vec3 eye, vec3 center, vec3 up, mat4 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_look_rh_no(vec3 eye, vec3 dir, vec3 up, mat4 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_look_anyup_rh_no(vec3 eye, vec3 dir, mat4 dest); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* cglmc_view_rh_no_h */ 32 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/view_rh_zo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_view_rh_zo_h 9 | #define cglmc_view_rh_zo_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_lookat_rh_zo(vec3 eye, vec3 center, vec3 up, mat4 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_look_rh_zo(vec3 eye, vec3 dir, vec3 up, mat4 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_look_anyup_rh_zo(vec3 eye, vec3 dir, mat4 dest); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* cglmc_view_rh_zo_h */ 32 | -------------------------------------------------------------------------------- /source/external/cglm/call/curve.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_curve_h 9 | #define cglmc_curve_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | float 18 | glmc_smc(float s, mat4 m, vec4 c); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | #endif /* cglmc_curve_h */ 24 | -------------------------------------------------------------------------------- /source/external/cglm/call/euler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_euler_h 9 | #define cglmc_euler_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_euler_angles(mat4 m, vec3 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_euler(vec3 angles, mat4 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_euler_xyz(vec3 angles, mat4 dest); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_euler_zyx(vec3 angles, mat4 dest); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_euler_zxy(vec3 angles, mat4 dest); 35 | 36 | CGLM_EXPORT 37 | void 38 | glmc_euler_xzy(vec3 angles, mat4 dest); 39 | 40 | CGLM_EXPORT 41 | void 42 | glmc_euler_yzx(vec3 angles, mat4 dest); 43 | 44 | CGLM_EXPORT 45 | void 46 | glmc_euler_yxz(vec3 angles, mat4 dest); 47 | 48 | CGLM_EXPORT 49 | void 50 | glmc_euler_by_order(vec3 angles, glm_euler_seq axis, mat4 dest); 51 | 52 | CGLM_EXPORT 53 | void 54 | glmc_euler_xyz_quat(vec3 angles, versor dest); 55 | 56 | CGLM_EXPORT 57 | void 58 | glmc_euler_xzy_quat(vec3 angles, versor dest); 59 | 60 | CGLM_EXPORT 61 | void 62 | glmc_euler_yxz_quat(vec3 angles, versor dest); 63 | 64 | CGLM_EXPORT 65 | void 66 | glmc_euler_yzx_quat(vec3 angles, versor dest); 67 | 68 | CGLM_EXPORT 69 | void 70 | glmc_euler_zxy_quat(vec3 angles, versor dest); 71 | 72 | CGLM_EXPORT 73 | void 74 | glmc_euler_zyx_quat(vec3 angles, versor dest); 75 | 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | #endif /* cglmc_euler_h */ 81 | -------------------------------------------------------------------------------- /source/external/cglm/call/frustum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_frustum_h 9 | #define cglmc_frustum_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_frustum_planes(mat4 m, vec4 dest[6]); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_frustum_corners(mat4 invMat, vec4 dest[8]); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_frustum_center(vec4 corners[8], vec4 dest); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_frustum_box(vec4 corners[8], mat4 m, vec3 box[2]); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_frustum_corners_at(vec4 corners[8], 35 | float splitDist, 36 | float farDist, 37 | vec4 planeCorners[4]); 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif /* cglmc_frustum_h */ 42 | -------------------------------------------------------------------------------- /source/external/cglm/call/io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_io_h 9 | #define cglmc_io_h 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #include "../cglm.h" 16 | 17 | CGLM_EXPORT 18 | void 19 | glmc_mat4_print(mat4 matrix, 20 | FILE * __restrict ostream); 21 | 22 | CGLM_EXPORT 23 | void 24 | glmc_mat3_print(mat3 matrix, 25 | FILE * __restrict ostream); 26 | 27 | CGLM_EXPORT 28 | void 29 | glmc_vec4_print(vec4 vec, 30 | FILE * __restrict ostream); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_vec3_print(vec3 vec, 35 | FILE * __restrict ostream); 36 | 37 | CGLM_EXPORT 38 | void 39 | glmc_versor_print(versor vec, 40 | FILE * __restrict ostream); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif /* cglmc_io_h */ 46 | -------------------------------------------------------------------------------- /source/external/cglm/call/mat2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_mat2_h 9 | #define cglmc_mat2_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_mat2_copy(mat2 mat, mat2 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_mat2_identity(mat2 mat); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_mat2_identity_array(mat2 * __restrict mat, size_t count); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_mat2_zero(mat2 mat); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_mat2_mul(mat2 m1, mat2 m2, mat2 dest); 35 | 36 | CGLM_EXPORT 37 | void 38 | glmc_mat2_transpose_to(mat2 m, mat2 dest); 39 | 40 | CGLM_EXPORT 41 | void 42 | glmc_mat2_transpose(mat2 m); 43 | 44 | CGLM_EXPORT 45 | void 46 | glmc_mat2_mulv(mat2 m, vec2 v, vec2 dest); 47 | 48 | CGLM_EXPORT 49 | float 50 | glmc_mat2_trace(mat2 m); 51 | 52 | CGLM_EXPORT 53 | void 54 | glmc_mat2_scale(mat2 m, float s); 55 | 56 | CGLM_EXPORT 57 | float 58 | glmc_mat2_det(mat2 mat); 59 | 60 | CGLM_EXPORT 61 | void 62 | glmc_mat2_inv(mat2 mat, mat2 dest); 63 | 64 | CGLM_EXPORT 65 | void 66 | glmc_mat2_swap_col(mat2 mat, int col1, int col2); 67 | 68 | CGLM_EXPORT 69 | void 70 | glmc_mat2_swap_row(mat2 mat, int row1, int row2); 71 | 72 | CGLM_EXPORT 73 | float 74 | glmc_mat2_rmc(vec2 r, mat2 m, vec2 c); 75 | 76 | CGLM_EXPORT 77 | void 78 | glmc_mat2_make(float * __restrict src, mat2 dest); 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #endif /* cglmc_mat2_h */ 84 | -------------------------------------------------------------------------------- /source/external/cglm/call/mat2x3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_mat2x3_h 9 | #define cglmc_mat2x3_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_mat2x3_copy(mat2x3 mat, mat2x3 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_mat2x3_zero(mat2x3 mat); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_mat2x3_make(float * __restrict src, mat2x3 dest); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_mat2x3_mul(mat2x3 m1, mat3x2 m2, mat2 dest); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_mat2x3_mulv(mat2x3 m, vec3 v, vec2 dest); 35 | 36 | CGLM_EXPORT 37 | void 38 | glmc_mat2x3_transpose(mat2x3 m, mat3x2 dest); 39 | 40 | CGLM_EXPORT 41 | void 42 | glmc_mat2x3_scale(mat2x3 m, float s); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | #endif /* cglmc_mat2x3_h */ 48 | -------------------------------------------------------------------------------- /source/external/cglm/call/mat2x4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_mat2x4_h 9 | #define cglmc_mat2x4_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_mat2x4_copy(mat2x4 mat, mat2x4 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_mat2x4_zero(mat2x4 mat); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_mat2x4_make(float * __restrict src, mat2x4 dest); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_mat2x4_mul(mat2x4 m1, mat4x2 m2, mat2 dest); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_mat2x4_mulv(mat2x4 m, vec4 v, vec2 dest); 35 | 36 | CGLM_EXPORT 37 | void 38 | glmc_mat2x4_transpose(mat2x4 m, mat4x2 dest); 39 | 40 | CGLM_EXPORT 41 | void 42 | glmc_mat2x4_scale(mat2x4 m, float s); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | #endif /* cglmc_mat2x4_h */ 48 | -------------------------------------------------------------------------------- /source/external/cglm/call/mat3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_mat3_h 9 | #define cglmc_mat3_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | /* DEPRECATED! use _copy, _ucopy versions */ 17 | #define glmc_mat3_dup(mat, dest) glmc_mat3_copy(mat, dest) 18 | 19 | CGLM_EXPORT 20 | void 21 | glmc_mat3_copy(mat3 mat, mat3 dest); 22 | 23 | CGLM_EXPORT 24 | void 25 | glmc_mat3_identity(mat3 mat); 26 | 27 | CGLM_EXPORT 28 | void 29 | glmc_mat3_zero(mat3 mat); 30 | 31 | CGLM_EXPORT 32 | void 33 | glmc_mat3_identity_array(mat3 * __restrict mat, size_t count); 34 | 35 | CGLM_EXPORT 36 | void 37 | glmc_mat3_mul(mat3 m1, mat3 m2, mat3 dest); 38 | 39 | CGLM_EXPORT 40 | void 41 | glmc_mat3_transpose_to(mat3 m, mat3 dest); 42 | 43 | CGLM_EXPORT 44 | void 45 | glmc_mat3_transpose(mat3 m); 46 | 47 | CGLM_EXPORT 48 | void 49 | glmc_mat3_mulv(mat3 m, vec3 v, vec3 dest); 50 | 51 | CGLM_EXPORT 52 | float 53 | glmc_mat3_trace(mat3 m); 54 | 55 | CGLM_EXPORT 56 | void 57 | glmc_mat3_quat(mat3 m, versor dest); 58 | 59 | CGLM_EXPORT 60 | void 61 | glmc_mat3_scale(mat3 m, float s); 62 | 63 | CGLM_EXPORT 64 | float 65 | glmc_mat3_det(mat3 mat); 66 | 67 | CGLM_EXPORT 68 | void 69 | glmc_mat3_inv(mat3 mat, mat3 dest); 70 | 71 | CGLM_EXPORT 72 | void 73 | glmc_mat3_swap_col(mat3 mat, int col1, int col2); 74 | 75 | CGLM_EXPORT 76 | void 77 | glmc_mat3_swap_row(mat3 mat, int row1, int row2); 78 | 79 | CGLM_EXPORT 80 | float 81 | glmc_mat3_rmc(vec3 r, mat3 m, vec3 c); 82 | 83 | CGLM_EXPORT 84 | void 85 | glmc_mat3_make(float * __restrict src, mat3 dest); 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | #endif /* cglmc_mat3_h */ 91 | -------------------------------------------------------------------------------- /source/external/cglm/call/mat3x2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_mat3x2_h 9 | #define cglmc_mat3x2_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_mat3x2_copy(mat3x2 mat, mat3x2 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_mat3x2_zero(mat3x2 mat); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_mat3x2_make(float * __restrict src, mat3x2 dest); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_mat3x2_mul(mat3x2 m1, mat2x3 m2, mat3 dest); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_mat3x2_mulv(mat3x2 m, vec2 v, vec3 dest); 35 | 36 | CGLM_EXPORT 37 | void 38 | glmc_mat3x2_transpose(mat3x2 m, mat2x3 dest); 39 | 40 | CGLM_EXPORT 41 | void 42 | glmc_mat3x2_scale(mat3x2 m, float s); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | #endif /* cglmc_mat3x2_h */ 48 | -------------------------------------------------------------------------------- /source/external/cglm/call/mat3x4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_mat3x4_h 9 | #define cglmc_mat3x4_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_mat3x4_copy(mat3x4 mat, mat3x4 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_mat3x4_zero(mat3x4 mat); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_mat3x4_make(float * __restrict src, mat3x4 dest); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_mat3x4_mul(mat3x4 m1, mat4x3 m2, mat3 dest); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_mat3x4_mulv(mat3x4 m, vec4 v, vec3 dest); 35 | 36 | CGLM_EXPORT 37 | void 38 | glmc_mat3x4_transpose(mat3x4 m, mat4x3 dest); 39 | 40 | CGLM_EXPORT 41 | void 42 | glmc_mat3x4_scale(mat3x4 m, float s); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | #endif /* cglmc_mat3x4_h */ 48 | -------------------------------------------------------------------------------- /source/external/cglm/call/mat4x2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_mat4x2_h 9 | #define cglmc_mat4x2_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_mat4x2_copy(mat4x2 mat, mat4x2 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_mat4x2_zero(mat4x2 mat); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_mat4x2_make(float * __restrict src, mat4x2 dest); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_mat4x2_mul(mat4x2 m1, mat2x4 m2, mat4 dest); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_mat4x2_mulv(mat4x2 m, vec2 v, vec4 dest); 35 | 36 | CGLM_EXPORT 37 | void 38 | glmc_mat4x2_transpose(mat4x2 m, mat2x4 dest); 39 | 40 | CGLM_EXPORT 41 | void 42 | glmc_mat4x2_scale(mat4x2 m, float s); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | #endif /* cglmc_mat4x2_h */ 48 | -------------------------------------------------------------------------------- /source/external/cglm/call/mat4x3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_mat4x3_h 9 | #define cglmc_mat4x3_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_mat4x3_copy(mat4x3 mat, mat4x3 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_mat4x3_zero(mat4x3 mat); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_mat4x3_make(float * __restrict src, mat4x3 dest); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_mat4x3_mul(mat4x3 m1, mat3x4 m2, mat4 dest); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_mat4x3_mulv(mat4x3 m, vec3 v, vec4 dest); 35 | 36 | CGLM_EXPORT 37 | void 38 | glmc_mat4x3_transpose(mat4x3 m, mat3x4 dest); 39 | 40 | CGLM_EXPORT 41 | void 42 | glmc_mat4x3_scale(mat4x3 m, float s); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | #endif /* cglmc_mat4x3_h */ 48 | -------------------------------------------------------------------------------- /source/external/cglm/call/plane.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_plane_h 9 | #define cglmc_plane_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_plane_normalize(vec4 plane); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | #endif /* cglmc_plane_h */ 24 | -------------------------------------------------------------------------------- /source/external/cglm/call/project.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_project_h 9 | #define cglmc_project_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_unprojecti(vec3 pos, mat4 invMat, vec4 vp, vec3 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_unproject(vec3 pos, mat4 m, vec4 vp, vec3 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_project(vec3 pos, mat4 m, vec4 vp, vec3 dest); 27 | 28 | CGLM_EXPORT 29 | float 30 | glmc_project_z(vec3 pos, mat4 m); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_pickmatrix(vec2 center, vec2 size, vec4 vp, mat4 dest); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | #endif /* cglmc_project_h */ 40 | 41 | 42 | -------------------------------------------------------------------------------- /source/external/cglm/call/ray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_ray_h 9 | #define cglmc_ray_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | #include "../cglm.h" 14 | 15 | CGLM_EXPORT 16 | bool 17 | glmc_ray_triangle(vec3 origin, 18 | vec3 direction, 19 | vec3 v0, 20 | vec3 v1, 21 | vec3 v2, 22 | float *d); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif /* cglmc_ray_h */ 28 | -------------------------------------------------------------------------------- /source/external/cglm/call/sphere.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_sphere_h 9 | #define cglmc_sphere_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | float 18 | glmc_sphere_radii(vec4 s); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_sphere_transform(vec4 s, mat4 m, vec4 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_sphere_merge(vec4 s1, vec4 s2, vec4 dest); 27 | 28 | CGLM_EXPORT 29 | bool 30 | glmc_sphere_sphere(vec4 s1, vec4 s2); 31 | 32 | CGLM_EXPORT 33 | bool 34 | glmc_sphere_point(vec4 s, vec3 point); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | #endif /* cglmc_sphere_h */ 40 | -------------------------------------------------------------------------------- /source/external/cglm/cglm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_h 9 | #define cglm_h 10 | 11 | #include "common.h" 12 | #include "vec2.h" 13 | #include "vec3.h" 14 | #include "vec4.h" 15 | #include "ivec2.h" 16 | #include "ivec3.h" 17 | #include "ivec4.h" 18 | #include "mat4.h" 19 | #include "mat4x2.h" 20 | #include "mat4x3.h" 21 | #include "mat3.h" 22 | #include "mat3x2.h" 23 | #include "mat3x4.h" 24 | #include "mat2.h" 25 | #include "mat2x3.h" 26 | #include "mat2x4.h" 27 | #include "affine.h" 28 | #include "cam.h" 29 | #include "frustum.h" 30 | #include "quat.h" 31 | #include "euler.h" 32 | #include "plane.h" 33 | #include "aabb2d.h" 34 | #include "box.h" 35 | #include "color.h" 36 | #include "util.h" 37 | #include "io.h" 38 | #include "project.h" 39 | #include "sphere.h" 40 | #include "ease.h" 41 | #include "curve.h" 42 | #include "bezier.h" 43 | #include "ray.h" 44 | #include "affine2d.h" 45 | 46 | #endif /* cglm_h */ 47 | -------------------------------------------------------------------------------- /source/external/cglm/clipspace/persp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | /* 9 | Functions: 10 | CGLM_INLINE void glm_persp_decomp_far(mat4 proj, float *farZ) 11 | CGLM_INLINE float glm_persp_fovy(mat4 proj) 12 | CGLM_INLINE float glm_persp_aspect(mat4 proj) 13 | CGLM_INLINE void glm_persp_sizes(mat4 proj, float fovy, vec4 dest) 14 | */ 15 | 16 | #ifndef cglm_persp_h 17 | #define cglm_persp_h 18 | 19 | #include "../common.h" 20 | #include "../plane.h" 21 | #include "../mat4.h" 22 | 23 | /*! 24 | * @brief returns field of view angle along the Y-axis (in radians) 25 | * 26 | * if you need to degrees, use glm_deg to convert it or use this: 27 | * fovy_deg = glm_deg(glm_persp_fovy(projMatrix)) 28 | * 29 | * @param[in] proj perspective projection matrix 30 | */ 31 | CGLM_INLINE 32 | float 33 | glm_persp_fovy(mat4 proj) { 34 | return 2.0f * atanf(1.0f / proj[1][1]); 35 | } 36 | 37 | /*! 38 | * @brief returns aspect ratio of perspective projection 39 | * 40 | * @param[in] proj perspective projection matrix 41 | */ 42 | CGLM_INLINE 43 | float 44 | glm_persp_aspect(mat4 proj) { 45 | return proj[1][1] / proj[0][0]; 46 | } 47 | 48 | #endif /* cglm_persp_h */ 49 | -------------------------------------------------------------------------------- /source/external/cglm/color.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_color_h 9 | #define cglm_color_h 10 | 11 | #include "common.h" 12 | #include "vec3.h" 13 | 14 | /*! 15 | * @brief averages the color channels into one value 16 | * 17 | * @param[in] rgb RGB color 18 | */ 19 | CGLM_INLINE 20 | float 21 | glm_luminance(vec3 rgb) { 22 | vec3 l = {0.212671f, 0.715160f, 0.072169f}; 23 | return glm_dot(rgb, l); 24 | } 25 | 26 | #endif /* cglm_color_h */ 27 | -------------------------------------------------------------------------------- /source/external/cglm/curve.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_curve_h 9 | #define cglm_curve_h 10 | 11 | #include "common.h" 12 | #include "vec4.h" 13 | #include "mat4.h" 14 | 15 | /*! 16 | * @brief helper function to calculate S*M*C multiplication for curves 17 | * 18 | * This function does not encourage you to use SMC, 19 | * instead it is a helper if you use SMC. 20 | * 21 | * if you want to specify S as vector then use more generic glm_mat4_rmc() func. 22 | * 23 | * Example usage: 24 | * B(s) = glm_smc(s, GLM_BEZIER_MAT, (vec4){p0, c0, c1, p1}) 25 | * 26 | * @param[in] s parameter between 0 and 1 (this will be [s3, s2, s, 1]) 27 | * @param[in] m basis matrix 28 | * @param[in] c position/control vector 29 | * 30 | * @return B(s) 31 | */ 32 | CGLM_INLINE 33 | float 34 | glm_smc(float s, mat4 m, vec4 c) { 35 | vec4 vs; 36 | glm_vec4_cubic(s, vs); 37 | return glm_mat4_rmc(vs, m, c); 38 | } 39 | 40 | #endif /* cglm_curve_h */ 41 | -------------------------------------------------------------------------------- /source/external/cglm/plane.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_plane_h 9 | #define cglm_plane_h 10 | 11 | #include "common.h" 12 | #include "vec3.h" 13 | #include "vec4.h" 14 | 15 | /* 16 | Plane equation: Ax + By + Cz + D = 0; 17 | 18 | It stored in vec4 as [A, B, C, D]. (A, B, C) is normal and D is distance 19 | */ 20 | 21 | /* 22 | Functions: 23 | CGLM_INLINE void glm_plane_normalize(vec4 plane); 24 | */ 25 | 26 | /*! 27 | * @brief normalizes a plane 28 | * 29 | * @param[in, out] plane plane to normalize 30 | */ 31 | CGLM_INLINE 32 | void 33 | glm_plane_normalize(vec4 plane) { 34 | float norm; 35 | 36 | if ((norm = glm_vec3_norm(plane)) == 0.0f) { 37 | glm_vec4_zero(plane); 38 | return; 39 | } 40 | 41 | glm_vec4_scale(plane, 1.0f / norm, plane); 42 | } 43 | 44 | #endif /* cglm_plane_h */ 45 | -------------------------------------------------------------------------------- /source/external/cglm/simd/neon/mat2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_mat2_neon_h 9 | #define cglm_mat2_neon_h 10 | #if defined(CGLM_NEON_FP) 11 | 12 | #include "../../common.h" 13 | #include "../intrin.h" 14 | 15 | CGLM_INLINE 16 | void 17 | glm_mat2_mul_neon(mat2 m1, mat2 m2, mat2 dest) { 18 | float32x4x2_t a1; 19 | glmm_128 x0, x1, x2; 20 | float32x2_t dc, ba; 21 | 22 | x1 = glmm_load(m1[0]); /* d c b a */ 23 | x2 = glmm_load(m2[0]); /* h g f e */ 24 | 25 | dc = vget_high_f32(x1); 26 | ba = vget_low_f32(x1); 27 | 28 | /* g g e e, h h f f */ 29 | a1 = vtrnq_f32(x2, x2); 30 | 31 | /* 32 | dest[0][0] = a * e + c * f; 33 | dest[0][1] = b * e + d * f; 34 | dest[1][0] = a * g + c * h; 35 | dest[1][1] = b * g + d * h; 36 | */ 37 | x0 = glmm_fmadd(vcombine_f32(ba, ba), a1.val[0], 38 | vmulq_f32(vcombine_f32(dc, dc), a1.val[1])); 39 | 40 | glmm_store(dest[0], x0); 41 | } 42 | 43 | #endif 44 | #endif /* cglm_mat2_neon_h */ 45 | -------------------------------------------------------------------------------- /source/external/cglm/simd/neon/quat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_quat_neon_h 9 | #define cglm_quat_neon_h 10 | #if defined(CGLM_NEON_FP) 11 | 12 | #include "../../common.h" 13 | #include "../intrin.h" 14 | 15 | CGLM_INLINE 16 | void 17 | glm_quat_mul_neon(versor p, versor q, versor dest) { 18 | /* 19 | + (a1 b2 + b1 a2 + c1 d2 − d1 c2)i 20 | + (a1 c2 − b1 d2 + c1 a2 + d1 b2)j 21 | + (a1 d2 + b1 c2 − c1 b2 + d1 a2)k 22 | a1 a2 − b1 b2 − c1 c2 − d1 d2 23 | */ 24 | 25 | glmm_128 xp, xq, xqr, r, x, y, z, s2, s3; 26 | glmm_128 s1 = glmm_float32x4_SIGNMASK_NPPN; 27 | 28 | float32x2_t qh, ql; 29 | 30 | xp = glmm_load(p); /* 3 2 1 0 */ 31 | xq = glmm_load(q); 32 | 33 | r = vmulq_f32(glmm_splat_w(xp), xq); 34 | x = glmm_splat_x(xp); 35 | y = glmm_splat_y(xp); 36 | z = glmm_splat_z(xp); 37 | 38 | ql = vget_high_f32(s1); 39 | s3 = vcombine_f32(ql, ql); 40 | s2 = vzipq_f32(s3, s3).val[0]; 41 | 42 | xqr = vrev64q_f32(xq); 43 | qh = vget_high_f32(xqr); 44 | ql = vget_low_f32(xqr); 45 | 46 | r = glmm_fmadd(glmm_xor(x, s3), vcombine_f32(qh, ql), r); 47 | 48 | r = glmm_fmadd(glmm_xor(y, s2), vcombine_f32(vget_high_f32(xq), 49 | vget_low_f32(xq)), r); 50 | 51 | r = glmm_fmadd(glmm_xor(z, s1), vcombine_f32(ql, qh), r); 52 | 53 | glmm_store(dest, r); 54 | } 55 | 56 | #endif 57 | #endif /* cglm_quat_neon_h */ 58 | -------------------------------------------------------------------------------- /source/external/cglm/simd/sse2/mat2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_mat2_sse_h 9 | #define cglm_mat2_sse_h 10 | #if defined( __SSE__ ) || defined( __SSE2__ ) 11 | 12 | #include "../../common.h" 13 | #include "../intrin.h" 14 | 15 | CGLM_INLINE 16 | void 17 | glm_mat2_mul_sse2(mat2 m1, mat2 m2, mat2 dest) { 18 | __m128 x0, x1, x2, x3, x4; 19 | 20 | x1 = glmm_load(m1[0]); /* d c b a */ 21 | x2 = glmm_load(m2[0]); /* h g f e */ 22 | 23 | x3 = glmm_shuff1(x2, 2, 2, 0, 0); 24 | x4 = glmm_shuff1(x2, 3, 3, 1, 1); 25 | x0 = _mm_movelh_ps(x1, x1); 26 | x2 = _mm_movehl_ps(x1, x1); 27 | 28 | /* 29 | dest[0][0] = a * e + c * f; 30 | dest[0][1] = b * e + d * f; 31 | dest[1][0] = a * g + c * h; 32 | dest[1][1] = b * g + d * h; 33 | */ 34 | x0 = glmm_fmadd(x0, x3, _mm_mul_ps(x2, x4)); 35 | 36 | glmm_store(dest[0], x0); 37 | } 38 | 39 | CGLM_INLINE 40 | void 41 | glm_mat2_transp_sse2(mat2 m, mat2 dest) { 42 | /* d c b a */ 43 | /* d b c a */ 44 | glmm_store(dest[0], glmm_shuff1(glmm_load(m[0]), 3, 1, 2, 0)); 45 | } 46 | 47 | #endif 48 | #endif /* cglm_mat2_sse_h */ 49 | -------------------------------------------------------------------------------- /source/external/cglm/simd/sse2/quat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_quat_simd_h 9 | #define cglm_quat_simd_h 10 | #if defined( __SSE__ ) || defined( __SSE2__ ) 11 | 12 | #include "../../common.h" 13 | #include "../intrin.h" 14 | 15 | CGLM_INLINE 16 | void 17 | glm_quat_mul_sse2(versor p, versor q, versor dest) { 18 | /* 19 | + (a1 b2 + b1 a2 + c1 d2 − d1 c2)i 20 | + (a1 c2 − b1 d2 + c1 a2 + d1 b2)j 21 | + (a1 d2 + b1 c2 − c1 b2 + d1 a2)k 22 | a1 a2 − b1 b2 − c1 c2 − d1 d2 23 | */ 24 | 25 | __m128 xp, xq, x1, x2, x3, r, x, y, z; 26 | 27 | xp = glmm_load(p); /* 3 2 1 0 */ 28 | xq = glmm_load(q); 29 | x1 = glmm_float32x4_SIGNMASK_NPNP; /* TODO: _mm_set1_ss() + shuff ? */ 30 | r = _mm_mul_ps(glmm_splat_w(xp), xq); 31 | 32 | x2 = _mm_unpackhi_ps(x1, x1); 33 | x3 = glmm_shuff1(x1, 3, 2, 0, 1); 34 | x = glmm_splat_x(xp); 35 | y = glmm_splat_y(xp); 36 | z = glmm_splat_z(xp); 37 | 38 | x = _mm_xor_ps(x, x1); 39 | y = _mm_xor_ps(y, x2); 40 | z = _mm_xor_ps(z, x3); 41 | 42 | x1 = glmm_shuff1(xq, 0, 1, 2, 3); 43 | x2 = glmm_shuff1(xq, 1, 0, 3, 2); 44 | x3 = glmm_shuff1(xq, 2, 3, 0, 1); 45 | 46 | r = glmm_fmadd(x, x1, r); 47 | r = glmm_fmadd(y, x2, r); 48 | r = glmm_fmadd(z, x3, r); 49 | 50 | glmm_store(dest, r); 51 | } 52 | 53 | #endif 54 | #endif /* cglm_quat_simd_h */ 55 | -------------------------------------------------------------------------------- /source/external/cglm/simd/wasm/mat2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_mat2_wasm_h 9 | #define cglm_mat2_wasm_h 10 | #if defined(__wasm__) && defined(__wasm_simd128__) 11 | 12 | #include "../../common.h" 13 | #include "../intrin.h" 14 | 15 | CGLM_INLINE 16 | void 17 | glm_mat2_mul_wasm(mat2 m1, mat2 m2, mat2 dest) { 18 | glmm_128 x0, x1, x2, x3, x4; 19 | 20 | x1 = glmm_load(m1[0]); /* d c b a */ 21 | x2 = glmm_load(m2[0]); /* h g f e */ 22 | 23 | x3 = glmm_shuff1(x2, 2, 2, 0, 0); 24 | x4 = glmm_shuff1(x2, 3, 3, 1, 1); 25 | /* x0 = _mm_movelh_ps(x1, x1); */ 26 | x0 = wasm_i32x4_shuffle(x1, x1, 0, 1, 4, 5); 27 | /* x2 = _mm_movehl_ps(x1, x1); */ 28 | x2 = wasm_i32x4_shuffle(x1, x1, 6, 7, 2, 3); 29 | 30 | /* 31 | dest[0][0] = a * e + c * f; 32 | dest[0][1] = b * e + d * f; 33 | dest[1][0] = a * g + c * h; 34 | dest[1][1] = b * g + d * h; 35 | */ 36 | x0 = glmm_fmadd(x0, x3, wasm_f32x4_mul(x2, x4)); 37 | 38 | glmm_store(dest[0], x0); 39 | } 40 | 41 | CGLM_INLINE 42 | void 43 | glm_mat2_transp_wasm(mat2 m, mat2 dest) { 44 | /* d c b a */ 45 | /* d b c a */ 46 | glmm_store(dest[0], glmm_shuff1(glmm_load(m[0]), 3, 1, 2, 0)); 47 | } 48 | 49 | #endif 50 | #endif /* cglm_mat2_wasm_h */ 51 | -------------------------------------------------------------------------------- /source/external/cglm/simd/wasm/quat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_quat_wasm_h 9 | #define cglm_quat_wasm_h 10 | #if defined(__wasm__) && defined(__wasm_simd128__) 11 | 12 | #include "../../common.h" 13 | #include "../intrin.h" 14 | 15 | CGLM_INLINE 16 | void 17 | glm_quat_mul_wasm(versor p, versor q, versor dest) { 18 | /* 19 | + (a1 b2 + b1 a2 + c1 d2 − d1 c2)i 20 | + (a1 c2 − b1 d2 + c1 a2 + d1 b2)j 21 | + (a1 d2 + b1 c2 − c1 b2 + d1 a2)k 22 | a1 a2 − b1 b2 − c1 c2 − d1 d2 23 | */ 24 | 25 | glmm_128 xp, xq, x1, x2, x3, r, x, y, z; 26 | 27 | xp = glmm_load(p); /* 3 2 1 0 */ 28 | xq = glmm_load(q); 29 | /* x1 = wasm_f32x4_const(0.f, -0.f, 0.f, -0.f); */ 30 | x1 = glmm_float32x4_SIGNMASK_PNPN; /* TODO: _mm_set1_ss() + shuff ? */ 31 | r = wasm_f32x4_mul(glmm_splat_w(xp), xq); 32 | /* x2 = _mm_unpackhi_ps(x1, x1); */ 33 | x2 = wasm_i32x4_shuffle(x1, x1, 2, 6, 3, 7); 34 | x3 = glmm_shuff1(x1, 3, 2, 0, 1); 35 | x = glmm_splat_x(xp); 36 | y = glmm_splat_y(xp); 37 | z = glmm_splat_z(xp); 38 | 39 | x = wasm_v128_xor(x, x1); 40 | y = wasm_v128_xor(y, x2); 41 | z = wasm_v128_xor(z, x3); 42 | 43 | x1 = glmm_shuff1(xq, 0, 1, 2, 3); 44 | x2 = glmm_shuff1(xq, 1, 0, 3, 2); 45 | x3 = glmm_shuff1(xq, 2, 3, 0, 1); 46 | 47 | r = glmm_fmadd(x, x1, r); 48 | r = glmm_fmadd(y, x2, r); 49 | r = glmm_fmadd(z, x3, r); 50 | 51 | glmm_store(dest, r); 52 | } 53 | 54 | #endif 55 | #endif /* cglm_quat_wasm_h */ 56 | -------------------------------------------------------------------------------- /source/external/cglm/struct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_structs_h 9 | #define cglm_structs_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "cglm.h" 15 | #include "types-struct.h" 16 | #include "struct/vec2.h" 17 | #include "struct/vec3.h" 18 | #include "struct/vec4.h" 19 | #include "struct/mat2.h" 20 | #include "struct/mat2x3.h" 21 | #include "struct/mat2x4.h" 22 | #include "struct/mat3.h" 23 | #include "struct/mat3x2.h" 24 | #include "struct/mat3x4.h" 25 | #include "struct/mat4.h" 26 | #include "struct/mat4x2.h" 27 | #include "struct/mat4x3.h" 28 | #include "struct/affine.h" 29 | #include "struct/frustum.h" 30 | #include "struct/plane.h" 31 | #include "struct/box.h" 32 | #include "struct/color.h" 33 | #include "struct/io.h" 34 | #include "struct/cam.h" 35 | #include "struct/quat.h" 36 | #include "struct/euler.h" 37 | #include "struct/project.h" 38 | #include "struct/sphere.h" 39 | #include "struct/curve.h" 40 | #include "struct/affine2d.h" 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif /* cglm_structs_h */ 46 | -------------------------------------------------------------------------------- /source/external/cglm/struct/color.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglms_colors_h 9 | #define cglms_colors_h 10 | 11 | #include "../common.h" 12 | #include "../types-struct.h" 13 | #include "../color.h" 14 | #include "vec3.h" 15 | 16 | /*! 17 | * @brief averages the color channels into one value 18 | * 19 | * @param[in] rgb RGB color 20 | */ 21 | CGLM_INLINE 22 | float 23 | glms_luminance(vec3s rgb) { 24 | return glm_luminance(rgb.raw); 25 | } 26 | 27 | #endif /* cglms_colors_h */ 28 | -------------------------------------------------------------------------------- /source/external/cglm/struct/curve.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglms_curves_h 9 | #define cglms_curves_h 10 | 11 | #include "../common.h" 12 | #include "../types-struct.h" 13 | #include "../curve.h" 14 | #include "vec4.h" 15 | #include "mat4.h" 16 | 17 | /*! 18 | * @brief helper function to calculate S*M*C multiplication for curves 19 | * 20 | * This function does not encourage you to use SMC, 21 | * instead it is a helper if you use SMC. 22 | * 23 | * if you want to specify S as vector then use more generic glm_mat4_rmc() func. 24 | * 25 | * Example usage: 26 | * B(s) = glm_smc(s, GLM_BEZIER_MAT, (vec4){p0, c0, c1, p1}) 27 | * 28 | * @param[in] s parameter between 0 and 1 (this will be [s3, s2, s, 1]) 29 | * @param[in] m basis matrix 30 | * @param[in] c position/control vector 31 | * 32 | * @return B(s) 33 | */ 34 | CGLM_INLINE 35 | float 36 | glms_smc(float s, mat4s m, vec4s c) { 37 | return glm_smc(s, m.raw, c.raw); 38 | } 39 | 40 | #endif /* cglms_curves_h */ 41 | -------------------------------------------------------------------------------- /source/external/cglm/struct/plane.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglms_planes_h 9 | #define cglms_planes_h 10 | 11 | #include "../common.h" 12 | #include "../types-struct.h" 13 | #include "../plane.h" 14 | #include "vec4.h" 15 | 16 | /* 17 | Plane equation: Ax + By + Cz + D = 0; 18 | 19 | It stored in vec4 as [A, B, C, D]. (A, B, C) is normal and D is distance 20 | */ 21 | 22 | /* 23 | Functions: 24 | CGLM_INLINE vec4s glms_plane_normalize(vec4s plane); 25 | */ 26 | 27 | /*! 28 | * @brief normalizes a plane 29 | * 30 | * @param[in] plane plane to normalize 31 | * @returns normalized plane 32 | */ 33 | CGLM_INLINE 34 | vec4s 35 | glms_plane_normalize(vec4s plane) { 36 | glm_plane_normalize(plane.raw); 37 | return plane; 38 | } 39 | 40 | #endif /* cglms_planes_h */ 41 | -------------------------------------------------------------------------------- /source/external/cglm/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_version_h 9 | #define cglm_version_h 10 | 11 | #define CGLM_VERSION_MAJOR 0 12 | #define CGLM_VERSION_MINOR 9 13 | #define CGLM_VERSION_PATCH 2 14 | 15 | #endif /* cglm_version_h */ 16 | -------------------------------------------------------------------------------- /source/external/googletest/cmake/Config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | include(CMakeFindDependencyMacro) 3 | if (@GTEST_HAS_PTHREAD@) 4 | set(THREADS_PREFER_PTHREAD_FLAG @THREADS_PREFER_PTHREAD_FLAG@) 5 | find_dependency(Threads) 6 | endif() 7 | 8 | include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake") 9 | check_required_components("@project_name@") 10 | -------------------------------------------------------------------------------- /source/external/googletest/cmake/gtest.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gtest 5 | Description: GoogleTest (without main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Libs: -L${libdir} -lgtest @CMAKE_THREAD_LIBS_INIT@ 9 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 10 | -------------------------------------------------------------------------------- /source/external/googletest/cmake/gtest_main.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gtest_main 5 | Description: GoogleTest (with main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Requires: gtest = @PROJECT_VERSION@ 9 | Libs: -L${libdir} -lgtest_main @CMAKE_THREAD_LIBS_INIT@ 10 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 11 | -------------------------------------------------------------------------------- /source/external/googletest/cmake/libgtest.la.in: -------------------------------------------------------------------------------- 1 | # libgtest.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.6 3 | 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Names of this library. 8 | library_names='libgtest.so' 9 | 10 | # Is this an already installed library? 11 | installed=yes 12 | 13 | # Should we warn about portability when linking against -modules? 14 | shouldnotlink=no 15 | 16 | # Files to dlopen/dlpreopen 17 | dlopen='' 18 | dlpreopen='' 19 | 20 | # Directory that this library needs to be installed in: 21 | libdir='@CMAKE_INSTALL_FULL_LIBDIR@' 22 | -------------------------------------------------------------------------------- /source/external/googletest/docs/README.md: -------------------------------------------------------------------------------- 1 | # Content Moved 2 | 3 | We are working on updates to the GoogleTest documentation, which has moved to 4 | the top-level [docs](../../docs) directory. 5 | -------------------------------------------------------------------------------- /source/external/googletest/include/gtest/internal/custom/README.md: -------------------------------------------------------------------------------- 1 | # Customization Points 2 | 3 | The custom directory is an injection point for custom user configurations. 4 | 5 | ## Header `gtest.h` 6 | 7 | ### The following macros can be defined: 8 | 9 | * `GTEST_OS_STACK_TRACE_GETTER_` - The name of an implementation of 10 | `OsStackTraceGetterInterface`. 11 | * `GTEST_CUSTOM_TEMPDIR_FUNCTION_` - An override for `testing::TempDir()`. See 12 | `testing::TempDir` for semantics and signature. 13 | 14 | ## Header `gtest-port.h` 15 | 16 | The following macros can be defined: 17 | 18 | ### Logging: 19 | 20 | * `GTEST_LOG_(severity)` 21 | * `GTEST_CHECK_(condition)` 22 | * Functions `LogToStderr()` and `FlushInfoLog()` have to be provided too. 23 | 24 | ### Threading: 25 | 26 | * `GTEST_HAS_NOTIFICATION_` - Enabled if Notification is already provided. 27 | * `GTEST_HAS_MUTEX_AND_THREAD_LOCAL_` - Enabled if `Mutex` and `ThreadLocal` 28 | are already provided. Must also provide `GTEST_DECLARE_STATIC_MUTEX_(mutex)` 29 | and `GTEST_DEFINE_STATIC_MUTEX_(mutex)` 30 | * `GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)` 31 | * `GTEST_LOCK_EXCLUDED_(locks)` 32 | 33 | ### Underlying library support features 34 | 35 | * `GTEST_HAS_CXXABI_H_` 36 | 37 | ### Exporting API symbols: 38 | 39 | * `GTEST_API_` - Specifier for exported symbols. 40 | 41 | ## Header `gtest-printers.h` 42 | 43 | * See documentation at `gtest/gtest-printers.h` for details on how to define a 44 | custom printer. 45 | -------------------------------------------------------------------------------- /source/external/googletest/include/gtest/internal/custom/gtest-port.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 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 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Injection point for custom user configurations. See README for details 31 | // 32 | // ** Custom implementation starts here ** 33 | 34 | #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ 35 | #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ 36 | 37 | #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ 38 | -------------------------------------------------------------------------------- /source/external/googletest/include/gtest/internal/custom/gtest.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 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 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Injection point for custom user configurations. See README for details 31 | // 32 | // ** Custom implementation starts here ** 33 | 34 | #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 35 | #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 36 | 37 | #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 38 | -------------------------------------------------------------------------------- /source/external/googletest/samples/sample1.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 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 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | 32 | #ifndef GOOGLETEST_SAMPLES_SAMPLE1_H_ 33 | #define GOOGLETEST_SAMPLES_SAMPLE1_H_ 34 | 35 | // Returns n! (the factorial of n). For negative n, n! is defined to be 1. 36 | int Factorial(int n); 37 | 38 | // Returns true if and only if n is a prime number. 39 | bool IsPrime(int n); 40 | 41 | #endif // GOOGLETEST_SAMPLES_SAMPLE1_H_ 42 | -------------------------------------------------------------------------------- /source/external/googletest/test/googletest-uninitialized-test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 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 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include "gtest/gtest.h" 31 | 32 | TEST(DummyTest, Dummy) { 33 | // This test doesn't verify anything. We just need it to create a 34 | // realistic stage for testing the behavior of Google Test when 35 | // RUN_ALL_TESTS() is called without 36 | // testing::InitGoogleTest() being called first. 37 | } 38 | 39 | int main() { return RUN_ALL_TESTS(); } 40 | -------------------------------------------------------------------------------- /source/external/googletest/test/gtest_main_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 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 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include "gtest/gtest.h" 31 | 32 | // Tests that we don't have to define main() when we link to 33 | // gtest_main instead of gtest. 34 | 35 | namespace { 36 | 37 | TEST(GTestMainTest, ShouldSucceed) {} 38 | 39 | } // namespace 40 | 41 | // We are using the main() function defined in gtest_main.cc, so we 42 | // don't define it here. 43 | -------------------------------------------------------------------------------- /source/external/googletest/test/production.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 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 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // This is part of the unit test for gtest_prod.h. 32 | 33 | #include "production.h" 34 | 35 | PrivateCode::PrivateCode() : x_(0) {} 36 | -------------------------------------------------------------------------------- /source/external/imgui/.editorconfig: -------------------------------------------------------------------------------- 1 | # See http://editorconfig.org to read about the EditorConfig format. 2 | # - In theory automatically supported by VS2017+ and most common IDE or text editors. 3 | # - In practice VS2019-VS2022 stills don't trim trailing whitespaces correctly :( 4 | # - Suggest installing this to trim whitespaces: 5 | # GitHub https://github.com/madskristensen/TrailingWhitespace 6 | # VS2019 https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespaceVisualizer 7 | # VS2022 https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespace64 8 | # (in spite of its name doesn't only visualize but also trims) 9 | # - Alternative for older VS2010 to VS2015: https://marketplace.visualstudio.com/items?itemName=EditorConfigTeam.EditorConfig 10 | 11 | # top-most EditorConfig file 12 | root = true 13 | 14 | # Default settings: 15 | # Use 4 spaces as indentation 16 | [*] 17 | indent_style = space 18 | indent_size = 4 19 | insert_final_newline = true 20 | trim_trailing_whitespace = true 21 | 22 | [imstb_*] 23 | indent_size = 3 24 | trim_trailing_whitespace = false 25 | 26 | [Makefile] 27 | indent_style = tab 28 | indent_size = 4 29 | -------------------------------------------------------------------------------- /source/external/imgui/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.c text 4 | *.cpp text 5 | *.h text 6 | *.m text 7 | *.mm text 8 | *.md text 9 | *.txt text 10 | *.html text 11 | *.bat text 12 | *.frag text 13 | *.vert text 14 | *.mkb text 15 | *.icf text 16 | 17 | *.sln text eol=crlf 18 | *.vcxproj text eol=crlf 19 | *.vcxproj.filters text eol=crlf 20 | *.natvis text eol=crlf 21 | 22 | Makefile text eol=lf 23 | *.sh text eol=lf 24 | *.pbxproj text eol=lf 25 | *.storyboard text eol=lf 26 | *.plist text eol=lf 27 | 28 | *.png binary 29 | *.ttf binary 30 | *.lib binary 31 | -------------------------------------------------------------------------------- /source/external/imgui/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['https://github.com/ocornut/imgui/wiki/Sponsors'] 2 | -------------------------------------------------------------------------------- /source/external/imgui/.github/issue_template.md: -------------------------------------------------------------------------------- 1 | (Click "Preview" above ^ to turn URL into clickable links) 2 | 3 | 1. FOR FIRST-TIME USERS ISSUES COMPILING/LINKING/RUNNING or LOADING FONTS, please use [GitHub Discussions](https://github.com/ocornut/imgui/discussions). 4 | 5 | 2. PLEASE CAREFULLY READ: [FAQ](https://github.com/ocornut/imgui/blob/master/docs/FAQ.md) 6 | 7 | 3. PLEASE CAREFULLY READ: [Contributing Guidelines](https://github.com/ocornut/imgui/blob/master/docs/CONTRIBUTING.md) 8 | 9 | 4. PLEASE MAKE SURE that you have: read the FAQ; explored the contents of `ShowDemoWindow()` including the Examples menu; searched among Issues; used your IDE to search for keywords in all sources and text files; and read the links above. 10 | 11 | 5. Be mindful that messages are being sent to the e-mail box of "Watching" users. Try to proof-read your messages before sending them. Edits are not seen by those users. 12 | 13 | 6. Delete points 1-6 and PLEASE FILL THE TEMPLATE BELOW before submitting your issue. 14 | 15 | Thank you! 16 | 17 | ---- 18 | 19 | _(you may also go to Demo>About Window, and click "Config/Build Information" to obtain a bunch of detailed information that you can paste here)_ 20 | 21 | **Version/Branch of Dear ImGui:** 22 | 23 | Version: XXX 24 | Branch: XXX _(master/viewport/docking/etc.)_ 25 | 26 | **Back-end/Renderer/Compiler/OS** 27 | 28 | Back-ends: imgui_impl_XXX.cpp + imgui_impl_XXX.cpp _(or specify if using a custom engine/back-end)_ 29 | Compiler: XXX _(if the question is related to building or platform specific features)_ 30 | Operating System: XXX 31 | 32 | **My Issue/Question:** 33 | 34 | XXX _(please provide as much context as possible)_ 35 | 36 | **Screenshots/Video** 37 | 38 | XXX _(you can drag files here)_ 39 | 40 | **Standalone, minimal, complete and verifiable example:** _(see https://github.com/ocornut/imgui/issues/2261)_ 41 | ``` 42 | // Here's some code anyone can copy and paste to reproduce your issue 43 | ImGui::Begin("Example Bug"); 44 | MoreCodeToExplainMyIssue(); 45 | ImGui::End(); 46 | ``` 47 | -------------------------------------------------------------------------------- /source/external/imgui/.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | (Click "Preview" to turn any http URL into a clickable link) 2 | 3 | 1. PLEASE CAREFULLY READ: [Contributing Guidelines](https://github.com/ocornut/imgui/blob/master/docs/CONTRIBUTING.md) 4 | 5 | 2. Clear this template before submitting your PR. 6 | 7 | -------------------------------------------------------------------------------- /source/external/imgui/.github/workflows/scheduled.yml: -------------------------------------------------------------------------------- 1 | # 2 | # This is a dummy workflow used to trigger scheduled builds. Forked repositories most likely should disable this 3 | # workflow to avoid daily builds of inactive repositories. 4 | # 5 | name: scheduled 6 | 7 | on: 8 | schedule: 9 | - cron: '0 9 * * *' 10 | 11 | jobs: 12 | scheduled: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - run: exit 0 16 | -------------------------------------------------------------------------------- /source/external/imgui/.github/workflows/static-analysis.yml: -------------------------------------------------------------------------------- 1 | name: static-analysis 2 | 3 | on: 4 | workflow_run: 5 | # Perform static analysis together with build workflow. Build triggers of "build" workflow do not need to be repeated here. 6 | workflows: 7 | - build 8 | types: 9 | - requested 10 | 11 | jobs: 12 | PVS-Studio: 13 | runs-on: ubuntu-22.04 14 | steps: 15 | - uses: actions/checkout@v3 16 | with: 17 | fetch-depth: 1 18 | 19 | - name: Install Dependencies 20 | env: 21 | # The Secret variable setup in GitHub must be in format: "name_or_email key", on a single line 22 | PVS_STUDIO_LICENSE: ${{ secrets.PVS_STUDIO_LICENSE }} 23 | run: | 24 | if [[ "$PVS_STUDIO_LICENSE" != "" ]]; 25 | then 26 | wget -q https://files.viva64.com/etc/pubkey.txt 27 | sudo apt-key add pubkey.txt 28 | sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.viva64.com/etc/viva64.list 29 | sudo apt-get update 30 | sudo apt-get install -y pvs-studio 31 | pvs-studio-analyzer credentials -o pvs-studio.lic $PVS_STUDIO_LICENSE 32 | fi 33 | 34 | - name: PVS-Studio static analysis 35 | run: | 36 | if [[ ! -f pvs-studio.lic ]]; 37 | then 38 | echo "PVS Studio license is missing. No analysis will be performed." 39 | echo "If you have a PVS Studio license please create a project secret named PVS_STUDIO_LICENSE with your license." 40 | echo "You may use a free license. More information at https://www.viva64.com/en/b/0457/" 41 | exit 0 42 | fi 43 | cd examples/example_null 44 | pvs-studio-analyzer trace -- make WITH_EXTRA_WARNINGS=1 45 | pvs-studio-analyzer analyze -e ../../imstb_rectpack.h -e ../../imstb_textedit.h -e ../../imstb_truetype.h -l ../../pvs-studio.lic -o pvs-studio.log 46 | plog-converter -a 'GA:1,2;OP:1' -d V1071 -t errorfile -w pvs-studio.log 47 | -------------------------------------------------------------------------------- /source/external/imgui/.gitignore: -------------------------------------------------------------------------------- 1 | ## OSX artifacts 2 | .DS_Store 3 | 4 | ## Dear ImGui artifacts 5 | imgui.ini 6 | 7 | ## General build artifacts 8 | *.o 9 | *.obj 10 | *.exe 11 | examples/*/Debug/* 12 | examples/*/Release/* 13 | examples/*/x64/* 14 | 15 | ## Visual Studio artifacts 16 | .vs 17 | ipch 18 | *.opensdf 19 | *.log 20 | *.pdb 21 | *.ilk 22 | *.user 23 | *.sdf 24 | *.suo 25 | *.VC.db 26 | *.VC.VC.opendb 27 | 28 | ## Getting files created in JSON/Schemas/Catalog/ from a VS2022 update 29 | JSON/ 30 | 31 | ## Commonly used CMake directories 32 | build*/ 33 | 34 | ## Xcode artifacts 35 | project.xcworkspace 36 | xcuserdata 37 | 38 | ## Emscripten artifacts 39 | examples/*.o.tmp 40 | examples/*.out.js 41 | examples/*.out.wasm 42 | examples/example_glfw_opengl3/web/* 43 | examples/example_sdl2_opengl3/web/* 44 | examples/example_emscripten_wgpu/web/* 45 | 46 | ## JetBrains IDE artifacts 47 | .idea 48 | cmake-build-* 49 | 50 | ## Unix executables from our example Makefiles 51 | examples/example_glfw_metal/example_glfw_metal 52 | examples/example_glfw_opengl2/example_glfw_opengl2 53 | examples/example_glfw_opengl3/example_glfw_opengl3 54 | examples/example_glut_opengl2/example_glut_opengl2 55 | examples/example_null/example_null 56 | examples/example_sdl2_metal/example_sdl2_metal 57 | examples/example_sdl2_opengl2/example_sdl2_opengl2 58 | examples/example_sdl2_opengl3/example_sdl2_opengl3 59 | examples/example_sdl2_sdlrenderer/example_sdl2_sdlrenderer 60 | -------------------------------------------------------------------------------- /source/external/imgui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2023 Omar Cornut 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 | -------------------------------------------------------------------------------- /source/external/imgui/backends/imgui_impl_dx10.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX10 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'ID3D10ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 7 | // [X] Renderer: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 8 | 9 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 10 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 11 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 12 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 13 | 14 | #pragma once 15 | #include "imgui.h" // IMGUI_IMPL_API 16 | #ifndef IMGUI_DISABLE 17 | 18 | struct ID3D10Device; 19 | 20 | IMGUI_IMPL_API bool ImGui_ImplDX10_Init(ID3D10Device* device); 21 | IMGUI_IMPL_API void ImGui_ImplDX10_Shutdown(); 22 | IMGUI_IMPL_API void ImGui_ImplDX10_NewFrame(); 23 | IMGUI_IMPL_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data); 24 | 25 | // Use if you want to reset your rendering device without losing Dear ImGui state. 26 | IMGUI_IMPL_API void ImGui_ImplDX10_InvalidateDeviceObjects(); 27 | IMGUI_IMPL_API bool ImGui_ImplDX10_CreateDeviceObjects(); 28 | 29 | #endif // #ifndef IMGUI_DISABLE 30 | -------------------------------------------------------------------------------- /source/external/imgui/backends/imgui_impl_dx11.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX11 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'ID3D11ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 7 | // [X] Renderer: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 8 | 9 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 10 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 11 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 12 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 13 | 14 | #pragma once 15 | #include "imgui.h" // IMGUI_IMPL_API 16 | #ifndef IMGUI_DISABLE 17 | 18 | struct ID3D11Device; 19 | struct ID3D11DeviceContext; 20 | 21 | IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); 22 | IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); 23 | IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); 24 | IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); 25 | 26 | // Use if you want to reset your rendering device without losing Dear ImGui state. 27 | IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); 28 | IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); 29 | 30 | #endif // #ifndef IMGUI_DISABLE 31 | -------------------------------------------------------------------------------- /source/external/imgui/backends/imgui_impl_dx9.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX9 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'LPDIRECT3DTEXTURE9' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 7 | // [X] Renderer: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 8 | 9 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 10 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 11 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 12 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 13 | 14 | #pragma once 15 | #include "imgui.h" // IMGUI_IMPL_API 16 | #ifndef IMGUI_DISABLE 17 | 18 | struct IDirect3DDevice9; 19 | 20 | IMGUI_IMPL_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device); 21 | IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown(); 22 | IMGUI_IMPL_API void ImGui_ImplDX9_NewFrame(); 23 | IMGUI_IMPL_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data); 24 | 25 | // Use if you want to reset your rendering device without losing Dear ImGui state. 26 | IMGUI_IMPL_API bool ImGui_ImplDX9_CreateDeviceObjects(); 27 | IMGUI_IMPL_API void ImGui_ImplDX9_InvalidateDeviceObjects(); 28 | 29 | #endif // #ifndef IMGUI_DISABLE 30 | -------------------------------------------------------------------------------- /source/external/imgui/backends/imgui_impl_sdlrenderer2.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for SDL_Renderer for SDL2 2 | // (Requires: SDL 2.0.17+) 3 | 4 | // Note how SDL_Renderer is an _optional_ component of SDL2. 5 | // For a multi-platform app consider using e.g. SDL+DirectX on Windows and SDL+OpenGL on Linux/OSX. 6 | // If your application will want to render any non trivial amount of graphics other than UI, 7 | // please be aware that SDL_Renderer currently offers a limited graphic API to the end-user and 8 | // it might be difficult to step out of those boundaries. 9 | 10 | // Implemented features: 11 | // [X] Renderer: User texture binding. Use 'SDL_Texture*' as ImTextureID. Read the FAQ about ImTextureID! 12 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 13 | // Missing features: 14 | // [ ] Renderer: Multi-viewport support (multiple windows). 15 | 16 | #pragma once 17 | #ifndef IMGUI_DISABLE 18 | #include "imgui.h" // IMGUI_IMPL_API 19 | 20 | struct SDL_Renderer; 21 | 22 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer2_Init(SDL_Renderer* renderer); 23 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_Shutdown(); 24 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_NewFrame(); 25 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_RenderDrawData(ImDrawData* draw_data); 26 | 27 | // Called by Init/NewFrame/Shutdown 28 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer2_CreateFontsTexture(); 29 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_DestroyFontsTexture(); 30 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer2_CreateDeviceObjects(); 31 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_DestroyDeviceObjects(); 32 | 33 | #endif // #ifndef IMGUI_DISABLE 34 | -------------------------------------------------------------------------------- /source/external/imgui/backends/imgui_impl_sdlrenderer3.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for SDL_Renderer for SDL3 2 | // (Requires: SDL 3.0.0+) 3 | 4 | // Note how SDL_Renderer is an _optional_ component of SDL3. 5 | // For a multi-platform app consider using e.g. SDL+DirectX on Windows and SDL+OpenGL on Linux/OSX. 6 | // If your application will want to render any non trivial amount of graphics other than UI, 7 | // please be aware that SDL_Renderer currently offers a limited graphic API to the end-user and 8 | // it might be difficult to step out of those boundaries. 9 | 10 | // Implemented features: 11 | // [X] Renderer: User texture binding. Use 'SDL_Texture*' as ImTextureID. Read the FAQ about ImTextureID! 12 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 13 | // Missing features: 14 | // [ ] Renderer: Multi-viewport support (multiple windows). 15 | 16 | #pragma once 17 | #include "imgui.h" // IMGUI_IMPL_API 18 | #ifndef IMGUI_DISABLE 19 | 20 | struct SDL_Renderer; 21 | 22 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer3_Init(SDL_Renderer* renderer); 23 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_Shutdown(); 24 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_NewFrame(); 25 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data); 26 | 27 | // Called by Init/NewFrame/Shutdown 28 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer3_CreateFontsTexture(); 29 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_DestroyFontsTexture(); 30 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer3_CreateDeviceObjects(); 31 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_DestroyDeviceObjects(); 32 | 33 | #endif // #ifndef IMGUI_DISABLE 34 | -------------------------------------------------------------------------------- /source/external/imgui/backends/imgui_impl_wgpu.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer for WebGPU 2 | // This needs to be used along with a Platform Binding (e.g. GLFW) 3 | // (Please note that WebGPU is currently experimental, will not run on non-beta browsers, and may break.) 4 | 5 | // Implemented features: 6 | // [X] Renderer: User texture binding. Use 'WGPUTextureView' as ImTextureID. Read the FAQ about ImTextureID! 7 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices. 8 | // Missing features: 9 | // [ ] Renderer: Multi-viewport support (multiple windows). Not meaningful on the web. 10 | 11 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 12 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 13 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 14 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 15 | 16 | #pragma once 17 | #include "imgui.h" // IMGUI_IMPL_API 18 | #ifndef IMGUI_DISABLE 19 | 20 | #include 21 | 22 | IMGUI_IMPL_API bool ImGui_ImplWGPU_Init(WGPUDevice device, int num_frames_in_flight, WGPUTextureFormat rt_format, WGPUTextureFormat depth_format = WGPUTextureFormat_Undefined); 23 | IMGUI_IMPL_API void ImGui_ImplWGPU_Shutdown(); 24 | IMGUI_IMPL_API void ImGui_ImplWGPU_NewFrame(); 25 | IMGUI_IMPL_API void ImGui_ImplWGPU_RenderDrawData(ImDrawData* draw_data, WGPURenderPassEncoder pass_encoder); 26 | 27 | // Use if you want to reset your rendering device without losing Dear ImGui state. 28 | IMGUI_IMPL_API void ImGui_ImplWGPU_InvalidateDeviceObjects(); 29 | IMGUI_IMPL_API bool ImGui_ImplWGPU_CreateDeviceObjects(); 30 | 31 | #endif // #ifndef IMGUI_DISABLE 32 | -------------------------------------------------------------------------------- /source/external/imgui/backends/vulkan/generate_spv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## -V: create SPIR-V binary 3 | ## -x: save binary output as text-based 32-bit hexadecimal numbers 4 | ## -o: output file 5 | glslangValidator -V -x -o glsl_shader.frag.u32 glsl_shader.frag 6 | glslangValidator -V -x -o glsl_shader.vert.u32 glsl_shader.vert 7 | -------------------------------------------------------------------------------- /source/external/imgui/backends/vulkan/glsl_shader.frag: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | layout(location = 0) out vec4 fColor; 3 | 4 | layout(set=0, binding=0) uniform sampler2D sTexture; 5 | 6 | layout(location = 0) in struct { 7 | vec4 Color; 8 | vec2 UV; 9 | } In; 10 | 11 | void main() 12 | { 13 | fColor = In.Color * texture(sTexture, In.UV.st); 14 | } 15 | -------------------------------------------------------------------------------- /source/external/imgui/backends/vulkan/glsl_shader.vert: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | layout(location = 0) in vec2 aPos; 3 | layout(location = 1) in vec2 aUV; 4 | layout(location = 2) in vec4 aColor; 5 | 6 | layout(push_constant) uniform uPushConstant { 7 | vec2 uScale; 8 | vec2 uTranslate; 9 | } pc; 10 | 11 | out gl_PerVertex { 12 | vec4 gl_Position; 13 | }; 14 | 15 | layout(location = 0) out struct { 16 | vec4 Color; 17 | vec2 UV; 18 | } Out; 19 | 20 | void main() 21 | { 22 | Out.Color = aColor; 23 | Out.UV = aUV; 24 | gl_Position = vec4(aPos * pc.uScale + pc.uTranslate, 0, 1); 25 | } 26 | -------------------------------------------------------------------------------- /source/external/imgui/examples/README.txt: -------------------------------------------------------------------------------- 1 | See BACKENDS and EXAMPLES files in the docs/ folder, or on the web at: https://github.com/ocornut/imgui/tree/master/docs 2 | 3 | Backends = Helper code to facilitate integration with platforms/graphics api (used by Examples + should be used by your app). 4 | Examples = Standalone applications showcasing integration with platforms/graphics api. 5 | 6 | Some Examples have extra README files in their respective directory, please check them too! 7 | 8 | Once Dear ImGui is running (in either examples or your own application/game/engine), 9 | run and refer to ImGui::ShowDemoWindow() in imgui_demo.cpp for the end-user API. 10 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_allegro5/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Configuration 3 | 4 | Dear ImGui outputs 16-bit vertex indices by default. 5 | Allegro doesn't support them natively, so we have two solutions: convert the indices manually in imgui_impl_allegro5.cpp, or compile dear imgui with 32-bit indices. 6 | You can either modify imconfig.h that comes with Dear ImGui (easier), or set a C++ preprocessor option IMGUI_USER_CONFIG to find to a filename. 7 | We are providing `imconfig_allegro5.h` that enables 32-bit indices. 8 | Note that the backend supports _BOTH_ 16-bit and 32-bit indices, but 32-bit indices will be slightly faster as they won't require a manual conversion. 9 | 10 | # How to Build 11 | 12 | ### On Ubuntu 14.04+ and macOS 13 | 14 | ```bash 15 | g++ -DIMGUI_USER_CONFIG=\"examples/example_allegro5/imconfig_allegro5.h\" -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_allegro5.cpp ../../imgui*.cpp -lallegro -lallegro_main -lallegro_primitives -o allegro5_example 16 | ``` 17 | 18 | On macOS, install Allegro with homebrew: `brew install allegro`. 19 | 20 | ### On Windows with Visual Studio's CLI 21 | 22 | You may install Allegro using vcpkg: 23 | ``` 24 | git clone https://github.com/Microsoft/vcpkg 25 | cd vcpkg 26 | bootstrap-vcpkg.bat 27 | vcpkg install allegro5 --triplet=x86-windows ; for win32 28 | vcpkg install allegro5 --triplet=x64-windows ; for win64 29 | vcpkg integrate install ; register include / libs in Visual Studio 30 | ``` 31 | 32 | Build: 33 | ``` 34 | set ALLEGRODIR=path_to_your_allegro5_folder 35 | cl /Zi /MD /utf-8 /I %ALLEGRODIR%\include /DIMGUI_USER_CONFIG=\"examples/example_allegro5/imconfig_allegro5.h\" /I .. /I ..\.. /I ..\..\backends main.cpp ..\..\backends\imgui_impl_allegro5.cpp ..\..\imgui*.cpp /link /LIBPATH:%ALLEGRODIR%\lib allegro-5.0.10-monolith-md.lib user32.lib 36 | ``` 37 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_allegro5/imconfig_allegro5.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // COMPILE-TIME OPTIONS FOR DEAR IMGUI ALLEGRO 5 EXAMPLE 3 | // See imconfig.h for the full template 4 | // Because Allegro doesn't support 16-bit vertex indices, we enable the compile-time option of imgui to use 32-bit indices 5 | //----------------------------------------------------------------------------- 6 | 7 | #pragma once 8 | 9 | // Use 32-bit vertex indices because Allegro doesn't support 16-bit ones 10 | // This allows us to avoid converting vertices format at runtime 11 | #define ImDrawIdx int 12 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_android_opengl3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.6) 2 | 3 | project(ImGuiExample) 4 | 5 | set(CMAKE_CXX_STANDARD 11) 6 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 7 | set(CMAKE_CXX_EXTENSIONS OFF) 8 | 9 | add_library(${CMAKE_PROJECT_NAME} SHARED 10 | ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp 11 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui.cpp 12 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui_demo.cpp 13 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui_draw.cpp 14 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui_tables.cpp 15 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui_widgets.cpp 16 | ${CMAKE_CURRENT_SOURCE_DIR}/../../backends/imgui_impl_android.cpp 17 | ${CMAKE_CURRENT_SOURCE_DIR}/../../backends/imgui_impl_opengl3.cpp 18 | ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c 19 | ) 20 | 21 | set(CMAKE_SHARED_LINKER_FLAGS 22 | "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate" 23 | ) 24 | 25 | target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE 26 | IMGUI_IMPL_OPENGL_ES3 27 | ) 28 | 29 | target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE 30 | ${CMAKE_CURRENT_SOURCE_DIR}/../.. 31 | ${CMAKE_CURRENT_SOURCE_DIR}/../../backends 32 | ${ANDROID_NDK}/sources/android/native_app_glue 33 | ) 34 | 35 | target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE 36 | android 37 | EGL 38 | GLESv3 39 | log 40 | ) 41 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_android_opengl3/android/.gitignore: -------------------------------------------------------------------------------- 1 | .cxx 2 | .externalNativeBuild 3 | build/ 4 | *.iml 5 | 6 | .idea 7 | .gradle 8 | local.properties 9 | 10 | # Android Studio puts a Gradle wrapper here, that we don't want: 11 | gradle/ 12 | gradlew* 13 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_android_opengl3/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdkVersion 33 6 | buildToolsVersion "33.0.2" 7 | ndkVersion "25.2.9519653" 8 | 9 | defaultConfig { 10 | applicationId "imgui.example.android" 11 | namespace "imgui.example.android" 12 | minSdkVersion 24 13 | targetSdkVersion 33 14 | versionCode 1 15 | versionName "1.0" 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt') 22 | } 23 | } 24 | 25 | compileOptions { 26 | sourceCompatibility JavaVersion.VERSION_11 27 | targetCompatibility JavaVersion.VERSION_11 28 | } 29 | 30 | kotlinOptions { 31 | jvmTarget="11" 32 | } 33 | 34 | externalNativeBuild { 35 | cmake { 36 | path "../../CMakeLists.txt" 37 | version '3.22.1' 38 | } 39 | } 40 | } 41 | repositories { 42 | mavenCentral() 43 | } 44 | dependencies { 45 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 46 | } 47 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_android_opengl3/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_android_opengl3/android/app/src/main/java/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package imgui.example.android 2 | 3 | import android.app.NativeActivity 4 | import android.os.Bundle 5 | import android.content.Context 6 | import android.view.inputmethod.InputMethodManager 7 | import android.view.KeyEvent 8 | import java.util.concurrent.LinkedBlockingQueue 9 | 10 | class MainActivity : NativeActivity() { 11 | public override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | } 14 | 15 | fun showSoftInput() { 16 | val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager 17 | inputMethodManager.showSoftInput(this.window.decorView, 0) 18 | } 19 | 20 | fun hideSoftInput() { 21 | val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager 22 | inputMethodManager.hideSoftInputFromWindow(this.window.decorView.windowToken, 0) 23 | } 24 | 25 | // Queue for the Unicode characters to be polled from native code (via pollUnicodeChar()) 26 | private var unicodeCharacterQueue: LinkedBlockingQueue = LinkedBlockingQueue() 27 | 28 | // We assume dispatchKeyEvent() of the NativeActivity is actually called for every 29 | // KeyEvent and not consumed by any View before it reaches here 30 | override fun dispatchKeyEvent(event: KeyEvent): Boolean { 31 | if (event.action == KeyEvent.ACTION_DOWN) { 32 | unicodeCharacterQueue.offer(event.getUnicodeChar(event.metaState)) 33 | } 34 | return super.dispatchKeyEvent(event) 35 | } 36 | 37 | fun pollUnicodeChar(): Int { 38 | return unicodeCharacterQueue.poll() ?: 0 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_android_opengl3/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.8.0' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.4.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | mavenCentral() 19 | } 20 | } 21 | 22 | task clean(type: Delete) { 23 | delete rootProject.buildDir 24 | } 25 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_android_opengl3/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_apple_metal/README.md: -------------------------------------------------------------------------------- 1 | # iOS / OSX Metal example 2 | 3 | ## Introduction 4 | 5 | This example shows how to integrate Dear ImGui with Metal. It is based on the "cross-platform" game template provided with Xcode as of Xcode 9. 6 | 7 | Consider basing your work off the example_glfw_metal/ or example_sdl2_metal/ examples. They are better supported and will be portable unlike this one. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_apple_metal/iOS/Info-iOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | imgui 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | metal 29 | 30 | UIRequiresFullScreen 31 | 32 | UIStatusBarHidden 33 | 34 | UISupportedInterfaceOrientations 35 | 36 | UIInterfaceOrientationPortrait 37 | UIInterfaceOrientationLandscapeLeft 38 | UIInterfaceOrientationLandscapeRight 39 | UIInterfaceOrientationPortraitUpsideDown 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_apple_metal/iOS/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_apple_metal/macOS/Info-macOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | imgui 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSMainStoryboardFile 26 | MainMenu 27 | NSPrincipalClass 28 | NSApplication 29 | 30 | 31 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_glfw_metal/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # You will need GLFW (http://www.glfw.org): 3 | # brew install glfw 4 | # 5 | 6 | #CXX = g++ 7 | #CXX = clang++ 8 | 9 | EXE = example_glfw_metal 10 | IMGUI_DIR = ../.. 11 | SOURCES = main.mm 12 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 13 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glfw.cpp $(IMGUI_DIR)/backends/imgui_impl_metal.mm 14 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 15 | 16 | LIBS = -framework Metal -framework MetalKit -framework Cocoa -framework IOKit -framework CoreVideo -framework QuartzCore 17 | LIBS += -L/usr/local/lib -L/opt/homebrew/lib 18 | LIBS += -lglfw 19 | 20 | CXXFLAGS = -std=c++11 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends -I/usr/local/include -I/opt/homebrew/include 21 | CXXFLAGS += -Wall -Wformat 22 | CFLAGS = $(CXXFLAGS) 23 | 24 | %.o:%.cpp 25 | $(CXX) $(CXXFLAGS) -c -o $@ $< 26 | 27 | %.o:$(IMGUI_DIR)/%.cpp 28 | $(CXX) $(CXXFLAGS) -c -o $@ $< 29 | 30 | %.o:$(IMGUI_DIR)/backends/%.cpp 31 | $(CXX) $(CXXFLAGS) -c -o $@ $< 32 | 33 | %.o:%.mm 34 | $(CXX) $(CXXFLAGS) -ObjC++ -fobjc-weak -fobjc-arc -c -o $@ $< 35 | 36 | %.o:$(IMGUI_DIR)/backends/%.mm 37 | $(CXX) $(CXXFLAGS) -ObjC++ -fobjc-weak -fobjc-arc -c -o $@ $< 38 | 39 | all: $(EXE) 40 | @echo Build complete 41 | 42 | $(EXE): $(OBJS) 43 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 44 | 45 | clean: 46 | rm -f $(EXE) $(OBJS) 47 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_glfw_opengl2/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_glfw_opengl2 4 | @set INCLUDES=/I..\.. /I..\..\backends /I..\libs\glfw\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\backends\imgui_impl_glfw.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:..\libs\glfw\lib-vc2010-32 glfw3.lib opengl32.lib gdi32.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_glfw_opengl3/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_glfw_opengl3 4 | @set INCLUDES=/I..\.. /I..\..\backends /I..\libs\glfw\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_glfw.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:..\libs\glfw\lib-vc2010-32 glfw3.lib opengl32.lib gdi32.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_glfw_vulkan/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Example usage: 2 | # mkdir build 3 | # cd build 4 | # cmake -g "Visual Studio 14 2015" .. 5 | 6 | cmake_minimum_required(VERSION 2.8) 7 | project(imgui_example_glfw_vulkan C CXX) 8 | 9 | if(NOT CMAKE_BUILD_TYPE) 10 | set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE) 11 | endif() 12 | 13 | set(CMAKE_CXX_STANDARD 11) 14 | set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVK_PROTOTYPES") 15 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_PROTOTYPES") 16 | 17 | # GLFW 18 | set(GLFW_DIR ../../../glfw) # Set this to point to an up-to-date GLFW repo 19 | option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF) 20 | option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF) 21 | option(GLFW_BUILD_DOCS "Build the GLFW documentation" OFF) 22 | option(GLFW_INSTALL "Generate installation target" OFF) 23 | option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF) 24 | add_subdirectory(${GLFW_DIR} binary_dir EXCLUDE_FROM_ALL) 25 | include_directories(${GLFW_DIR}/include) 26 | 27 | # Dear ImGui 28 | set(IMGUI_DIR ../../) 29 | include_directories(${IMGUI_DIR} ${IMGUI_DIR}/backends ..) 30 | 31 | # Libraries 32 | find_package(Vulkan REQUIRED) 33 | #find_library(VULKAN_LIBRARY 34 | #NAMES vulkan vulkan-1) 35 | #set(LIBRARIES "glfw;${VULKAN_LIBRARY}") 36 | set(LIBRARIES "glfw;Vulkan::Vulkan") 37 | 38 | # Use vulkan headers from glfw: 39 | include_directories(${GLFW_DIR}/deps) 40 | 41 | file(GLOB sources *.cpp) 42 | 43 | add_executable(example_glfw_vulkan ${sources} ${IMGUI_DIR}/backends/imgui_impl_glfw.cpp ${IMGUI_DIR}/backends/imgui_impl_vulkan.cpp ${IMGUI_DIR}/imgui.cpp ${IMGUI_DIR}/imgui_draw.cpp ${IMGUI_DIR}/imgui_demo.cpp ${IMGUI_DIR}/imgui_tables.cpp ${IMGUI_DIR}/imgui_widgets.cpp) 44 | target_link_libraries(example_glfw_vulkan ${LIBRARIES}) 45 | target_compile_definitions(example_glfw_vulkan PUBLIC -DImTextureID=ImU64) 46 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_glfw_vulkan/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | 3 | @set OUT_EXE=example_glfw_vulkan 4 | @set INCLUDES=/I..\.. /I..\..\backends /I..\libs\glfw\include /I %VULKAN_SDK%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\backends\imgui_impl_glfw.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:..\libs\glfw\lib-vc2010-32 /libpath:%VULKAN_SDK%\lib32 glfw3.lib opengl32.lib gdi32.lib shell32.lib vulkan-1.lib 7 | 8 | @set OUT_DIR=Debug 9 | mkdir %OUT_DIR% 10 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D ImTextureID=ImU64 %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 11 | 12 | @set OUT_DIR=Release 13 | mkdir %OUT_DIR% 14 | cl /nologo /Zi /MD /utf-8 /Ox /Oi %INCLUDES% /D ImTextureID=ImU64 %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 15 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_glfw_vulkan/build_win64.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of amd64/vcvars32.bat to setup 64-bit command-line compiler. 2 | 3 | @set INCLUDES=/I..\.. /I..\..\backends /I..\libs\glfw\include /I %VULKAN_SDK%\include 4 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\backends\imgui_impl_glfw.cpp ..\..\imgui*.cpp 5 | @set LIBS=/LIBPATH:..\libs\glfw\lib-vc2010-64 /libpath:%VULKAN_SDK%\lib glfw3.lib opengl32.lib gdi32.lib shell32.lib vulkan-1.lib 6 | 7 | @set OUT_DIR=Debug 8 | mkdir %OUT_DIR% 9 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D ImTextureID=ImU64 %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 10 | 11 | @set OUT_DIR=Release 12 | mkdir %OUT_DIR% 13 | cl /nologo /Zi /MD /utf-8 /Ox /Oi %INCLUDES% /D ImTextureID=ImU64 %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 14 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_null/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /Zi /MD /utf-8 /I ..\.. %* *.cpp ..\..\*.cpp /FeDebug/example_null.exe /FoDebug/ /link gdi32.lib shell32.lib imm32.lib 4 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_null/main.cpp: -------------------------------------------------------------------------------- 1 | // dear imgui: "null" example application 2 | // (compile and link imgui, create context, run headless with NO INPUTS, NO GRAPHICS OUTPUT) 3 | // This is useful to test building, but you cannot interact with anything here! 4 | #include "imgui.h" 5 | #include 6 | 7 | int main(int, char**) 8 | { 9 | IMGUI_CHECKVERSION(); 10 | ImGui::CreateContext(); 11 | ImGuiIO& io = ImGui::GetIO(); 12 | 13 | // Build atlas 14 | unsigned char* tex_pixels = nullptr; 15 | int tex_w, tex_h; 16 | io.Fonts->GetTexDataAsRGBA32(&tex_pixels, &tex_w, &tex_h); 17 | 18 | for (int n = 0; n < 20; n++) 19 | { 20 | printf("NewFrame() %d\n", n); 21 | io.DisplaySize = ImVec2(1920, 1080); 22 | io.DeltaTime = 1.0f / 60.0f; 23 | ImGui::NewFrame(); 24 | 25 | static float f = 0.0f; 26 | ImGui::Text("Hello, world!"); 27 | ImGui::SliderFloat("float", &f, 0.0f, 1.0f); 28 | ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); 29 | ImGui::ShowDemoWindow(nullptr); 30 | 31 | ImGui::Render(); 32 | } 33 | 34 | printf("DestroyContext()\n"); 35 | ImGui::DestroyContext(); 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_sdl2_directx11/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl2_directx11 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I "%DXSDK_DIR%Include" 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_dx11.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib /LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d11.lib d3dcompiler.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_sdl2_metal/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # You will need SDL2 (http://www.libsdl.org): 3 | # brew install sdl2 4 | # 5 | 6 | #CXX = g++ 7 | #CXX = clang++ 8 | 9 | EXE = example_sdl2_metal 10 | IMGUI_DIR = ../.. 11 | SOURCES = main.mm 12 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 13 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_sdl2.cpp $(IMGUI_DIR)/backends/imgui_impl_metal.mm 14 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 15 | 16 | LIBS = -framework Metal -framework MetalKit -framework Cocoa -framework IOKit -framework CoreVideo -framework QuartzCore 17 | LIBS += `sdl2-config --libs` 18 | LIBS += -L/usr/local/lib 19 | 20 | CXXFLAGS = -std=c++11 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends -I/usr/local/include 21 | CXXFLAGS += `sdl2-config --cflags` 22 | CXXFLAGS += -Wall -Wformat 23 | CFLAGS = $(CXXFLAGS) 24 | 25 | %.o:%.cpp 26 | $(CXX) $(CXXFLAGS) -c -o $@ $< 27 | 28 | %.o:$(IMGUI_DIR)/%.cpp 29 | $(CXX) $(CXXFLAGS) -c -o $@ $< 30 | 31 | %.o:$(IMGUI_DIR)/backends/%.cpp 32 | $(CXX) $(CXXFLAGS) -c -o $@ $< 33 | 34 | %.o:%.mm 35 | $(CXX) $(CXXFLAGS) -ObjC++ -fobjc-weak -fobjc-arc -c -o $@ $< 36 | 37 | %.o:$(IMGUI_DIR)/backends/%.mm 38 | $(CXX) $(CXXFLAGS) -ObjC++ -fobjc-weak -fobjc-arc -c -o $@ $< 39 | 40 | all: $(EXE) 41 | @echo Build complete 42 | 43 | $(EXE): $(OBJS) 44 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 45 | 46 | clean: 47 | rm -f $(EXE) $(OBJS) 48 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_sdl2_opengl2/README.md: -------------------------------------------------------------------------------- 1 | 2 | # How to Build 3 | 4 | - On Windows with Visual Studio's IDE 5 | 6 | Use the provided project file (.vcxproj). Add to solution (imgui_examples.sln) if necessary. 7 | 8 | - On Windows with Visual Studio's CLI 9 | 10 | ``` 11 | set SDL2_DIR=path_to_your_sdl2_folder 12 | cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl2_opengl2.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console 13 | # ^^ include paths ^^ source files ^^ output exe ^^ output dir ^^ libraries 14 | # or for 64-bit: 15 | cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl2_opengl2.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x64 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console 16 | ``` 17 | 18 | - On Linux and similar Unixes 19 | 20 | ``` 21 | c++ `sdl2-config --cflags` -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_sdl2.cpp ../../backends/imgui_impl_opengl2.cpp ../../imgui*.cpp `sdl2-config --libs` -lGL 22 | ``` 23 | 24 | - On Mac OS X 25 | 26 | ``` 27 | brew install sdl2 28 | c++ `sdl2-config --cflags` -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_sdl2.cpp ../../backends/imgui_impl_opengl2.cpp ../../imgui*.cpp `sdl2-config --libs` -framework OpenGl 29 | ``` 30 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_sdl2_opengl2/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl2_opengl2 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_sdl2_opengl3/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl2_opengl3 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_sdl2_sdlrenderer2/README.md: -------------------------------------------------------------------------------- 1 | 2 | # How to Build 3 | 4 | - On Windows with Visual Studio's CLI 5 | 6 | ``` 7 | set SDL2_DIR=path_to_your_sdl2_folder 8 | cl /Zi /MD /utf-8 /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_sdlrenderer2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl2_sdlrenderer.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib /subsystem:console 9 | # ^^ include paths ^^ source files ^^ output exe ^^ output dir ^^ libraries 10 | # or for 64-bit: 11 | cl /Zi /MD /utf-8 /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_sdlrenderer2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl2_sdlrenderer.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x64 SDL2.lib SDL2main.lib /subsystem:console 12 | ``` 13 | 14 | - On Linux and similar Unixes 15 | 16 | ``` 17 | c++ `sdl2-config --cflags` -I .. -I ../.. main.cpp ../../backends/imgui_impl_sdl2.cpp ../../backends/imgui_impl_sdlrenderer2.cpp ../../imgui*.cpp `sdl2-config --libs` -lGL 18 | ``` 19 | 20 | - On Mac OS X 21 | 22 | ``` 23 | brew install sdl2 24 | c++ `sdl2-config --cflags` -I .. -I ../.. main.cpp ../../backends/imgui_impl_sdl2.cpp ../../backends/imgui_impl_sdlrenderer2.cpp ../../imgui*.cpp `sdl2-config --libs` -framework OpenGl 25 | ``` 26 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_sdl2_sdlrenderer2/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl2_sdlrenderer_ 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_sdlrenderer2.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_sdl2_vulkan/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | 3 | @set OUT_EXE=example_sdl2_vulkan 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include /I %VULKAN_SDK%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 /libpath:%VULKAN_SDK%\lib32 SDL2.lib SDL2main.lib shell32.lib vulkan-1.lib 7 | 8 | @set OUT_DIR=Debug 9 | mkdir %OUT_DIR% 10 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D ImTextureID=ImU64 %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 11 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_sdl3_opengl3/README.md: -------------------------------------------------------------------------------- 1 | 2 | # How to Build 3 | 4 | ## Windows with Visual Studio's IDE 5 | 6 | Use the provided project file (.vcxproj). Add to solution (imgui_examples.sln) if necessary. 7 | 8 | ## Windows with Visual Studio's CLI 9 | 10 | Use build_win32.bat or directly: 11 | ``` 12 | set SDL2_DIR=path_to_your_sdl3_folder 13 | cl /Zi /MD /utf-8 /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp /FeDebug/example_sdl3_opengl3.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x86 SDL3.lib opengl32.lib /subsystem:console 14 | # ^^ include paths ^^ source files ^^ output exe ^^ output dir ^^ libraries 15 | # or for 64-bit: 16 | cl /Zi /MD /utf-8 /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp /FeDebug/example_sdl3_opengl3.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x64 SDL3.lib SDL2mainopengl32.lib /subsystem:console 17 | ``` 18 | 19 | ## Linux and similar Unixes 20 | 21 | Use our Makefile or directly: 22 | ``` 23 | c++ `sdl3-config --cflags` -I .. -I ../.. -I ../../backends 24 | main.cpp ../../backends/imgui_impl_sdl3.cpp ../../backends/imgui_impl_opengl3.cpp ../../imgui*.cpp 25 | `sdl3-config --libs` -lGL -ldl 26 | ``` 27 | 28 | ## macOS 29 | 30 | Use our Makefile or directly: 31 | ``` 32 | brew install sdl3 33 | c++ `sdl3-config --cflags` -I .. -I ../.. -I ../../backends 34 | main.cpp ../../backends/imgui_impl_sdl3.cpp ../../backends/imgui_impl_opengl3.cpp ../../imgui*.cpp 35 | `sdl3-config --libs` -framework OpenGl -framework CoreFoundation 36 | ``` 37 | 38 | ## Emscripten 39 | 40 | As of 2023-05-30 Emscripten doesn't support SDL3 yet. 41 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_sdl3_opengl3/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl3_opengl3 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL3_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL3_DIR%\lib\x86 SDL3.lib opengl32.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_sdl3_sdlrenderer3/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl3_sdlrenderer3 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL3_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_sdlrenderer3.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL3_DIR%\lib\x86 SDL3.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_win32_directx10/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_directx10 4 | @set INCLUDES=/I..\.. /I..\..\backends /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I "%DXSDK_DIR%Include" 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\backends\imgui_impl_dx10.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d10.lib d3dcompiler.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_win32_directx11/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_directx11 4 | @set INCLUDES=/I..\.. /I..\..\backends /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I "%DXSDK_DIR%Include" 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_dx11.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d11.lib d3dcompiler.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | 10 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_win32_directx12/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @REM Important: to build on 32-bit systems, the DX12 backends needs '#define ImTextureID ImU64', so we pass it here. 3 | @set OUT_DIR=Debug 4 | @set OUT_EXE=example_win32_directx12 5 | @set INCLUDES=/I..\.. /I..\..\backends /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" 6 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_dx12.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\imgui*.cpp 7 | @set LIBS=d3d12.lib d3dcompiler.lib dxgi.lib 8 | mkdir Debug 9 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D ImTextureID=ImU64 /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 10 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_win32_directx9/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_directx9 4 | @set INCLUDES=/I..\.. /I..\..\backends /I "%DXSDK_DIR%/Include" 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_dx9.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d9.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /source/external/imgui/examples/example_win32_opengl3/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_opengl3 4 | @set INCLUDES=/I..\.. /I..\..\backends 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\imgui*.cpp 6 | @set LIBS=opengl32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /source/external/imgui/examples/libs/glfw/COPYING.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | Copyright (c) 2006-2010 Camilla Berglund 3 | 4 | This software is provided 'as-is', without any express or implied 5 | warranty. In no event will the authors be held liable for any damages 6 | arising from the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not 13 | claim that you wrote the original software. If you use this software 14 | in a product, an acknowledgment in the product documentation would 15 | be appreciated but is not required. 16 | 17 | 2. Altered source versions must be plainly marked as such, and must not 18 | be misrepresented as being the original software. 19 | 20 | 3. This notice may not be removed or altered from any source 21 | distribution. 22 | 23 | -------------------------------------------------------------------------------- /source/external/imgui/examples/libs/usynergy/README.txt: -------------------------------------------------------------------------------- 1 | 2 | uSynergy client -- Implementation for the embedded Synergy client library 3 | version 1.0.0, July 7th, 2012 4 | Copyright (c) 2012 Alex Evans 5 | 6 | This is a copy of the files once found at: 7 | https://github.com/symless/synergy-core/tree/790d108a56ada9caad8e56ff777d444485a69da9/src/micro 8 | 9 | -------------------------------------------------------------------------------- /source/external/imgui/misc/README.txt: -------------------------------------------------------------------------------- 1 | 2 | misc/cpp/ 3 | InputText() wrappers for C++ standard library (STL) type: std::string. 4 | This is also an example of how you may wrap your own similar types. 5 | 6 | misc/debuggers/ 7 | Helper files for popular debuggers. 8 | With the .natvis file, types like ImVector<> will be displayed nicely in Visual Studio debugger. 9 | 10 | misc/fonts/ 11 | Fonts loading/merging instructions (e.g. How to handle glyph ranges, how to merge icons fonts). 12 | Command line tool "binary_to_compressed_c" to create compressed arrays to embed data in source code. 13 | Suggested fonts and links. 14 | 15 | misc/freetype/ 16 | Font atlas builder/rasterizer using FreeType instead of stb_truetype. 17 | Benefit from better FreeType rasterization, in particular for small fonts. 18 | 19 | misc/single_file/ 20 | Single-file header stub. 21 | We use this to validate compiling all *.cpp files in a same compilation unit. 22 | Users of that technique (also called "Unity builds") can generally provide this themselves, 23 | so we don't really recommend you use this in your projects. 24 | -------------------------------------------------------------------------------- /source/external/imgui/misc/cpp/README.txt: -------------------------------------------------------------------------------- 1 | 2 | imgui_stdlib.h + imgui_stdlib.cpp 3 | InputText() wrappers for C++ standard library (STL) type: std::string. 4 | This is also an example of how you may wrap your own similar types. 5 | 6 | imgui_scoped.h 7 | [Experimental, not currently in main repository] 8 | Additional header file with some RAII-style wrappers for common Dear ImGui functions. 9 | Try by merging: https://github.com/ocornut/imgui/pull/2197 10 | Discuss at: https://github.com/ocornut/imgui/issues/2096 11 | 12 | See more C++ related extension (fmt, RAII, syntaxis sugar) on Wiki: 13 | https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness 14 | -------------------------------------------------------------------------------- /source/external/imgui/misc/cpp/imgui_stdlib.h: -------------------------------------------------------------------------------- 1 | // dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.) 2 | // This is also an example of how you may wrap your own similar types. 3 | 4 | // Changelog: 5 | // - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string 6 | 7 | // See more C++ related extension (fmt, RAII, syntaxis sugar) on Wiki: 8 | // https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | namespace ImGui 15 | { 16 | // ImGui::InputText() with std::string 17 | // Because text input needs dynamic resizing, we need to setup a callback to grow the capacity 18 | IMGUI_API bool InputText(const char* label, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr); 19 | IMGUI_API bool InputTextMultiline(const char* label, std::string* str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr); 20 | IMGUI_API bool InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr); 21 | } 22 | -------------------------------------------------------------------------------- /source/external/imgui/misc/debuggers/README.txt: -------------------------------------------------------------------------------- 1 | 2 | HELPER FILES FOR POPULAR DEBUGGERS 3 | 4 | imgui.gdb 5 | GDB: disable stepping into trivial functions. 6 | (read comments inside file for details) 7 | 8 | imgui.natstepfilter 9 | Visual Studio Debugger: disable stepping into trivial functions. 10 | (read comments inside file for details) 11 | 12 | imgui.natvis 13 | Visual Studio Debugger: describe Dear ImGui types for better display. 14 | With this, types like ImVector<> will be displayed nicely in the debugger. 15 | (read comments inside file for details) 16 | 17 | -------------------------------------------------------------------------------- /source/external/imgui/misc/debuggers/imgui.gdb: -------------------------------------------------------------------------------- 1 | # GDB configuration to aid debugging experience 2 | 3 | # To enable these customizations edit $HOME/.gdbinit (or ./.gdbinit if local gdbinit is enabled) and add: 4 | # add-auto-load-safe-path /path/to/imgui.gdb 5 | # source /path/to/imgui.gdb 6 | # 7 | # More Information at: 8 | # * https://sourceware.org/gdb/current/onlinedocs/gdb/gdbinit-man.html 9 | # * https://sourceware.org/gdb/current/onlinedocs/gdb/Init-File-in-the-Current-Directory.html#Init-File-in-the-Current-Directory 10 | 11 | # Disable stepping into trivial functions 12 | skip -rfunction Im(Vec2|Vec4|Strv|Vector|Span)::.+ 13 | -------------------------------------------------------------------------------- /source/external/imgui/misc/debuggers/imgui.natstepfilter: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | (ImVec2|ImVec4|ImStrv)::.+ 24 | NoStepInto 25 | 26 | 27 | (ImVector|ImSpan).*::operator.+ 28 | NoStepInto 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /source/external/imgui/misc/fonts/Cousine-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorenJoestar/devgames2024/587d5c80ce631d922d55fae28410ede95b7ee9de/source/external/imgui/misc/fonts/Cousine-Regular.ttf -------------------------------------------------------------------------------- /source/external/imgui/misc/fonts/DroidSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorenJoestar/devgames2024/587d5c80ce631d922d55fae28410ede95b7ee9de/source/external/imgui/misc/fonts/DroidSans.ttf -------------------------------------------------------------------------------- /source/external/imgui/misc/fonts/Karla-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorenJoestar/devgames2024/587d5c80ce631d922d55fae28410ede95b7ee9de/source/external/imgui/misc/fonts/Karla-Regular.ttf -------------------------------------------------------------------------------- /source/external/imgui/misc/fonts/ProggyClean.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorenJoestar/devgames2024/587d5c80ce631d922d55fae28410ede95b7ee9de/source/external/imgui/misc/fonts/ProggyClean.ttf -------------------------------------------------------------------------------- /source/external/imgui/misc/fonts/ProggyTiny.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorenJoestar/devgames2024/587d5c80ce631d922d55fae28410ede95b7ee9de/source/external/imgui/misc/fonts/ProggyTiny.ttf -------------------------------------------------------------------------------- /source/external/imgui/misc/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorenJoestar/devgames2024/587d5c80ce631d922d55fae28410ede95b7ee9de/source/external/imgui/misc/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /source/external/imgui/misc/single_file/imgui_single_file.h: -------------------------------------------------------------------------------- 1 | // dear imgui: single-file wrapper include 2 | // We use this to validate compiling all *.cpp files in a same compilation unit. 3 | // Users of that technique (also called "Unity builds") can generally provide this themselves, 4 | // so we don't really recommend you use this in your projects. 5 | 6 | // Do this: 7 | // #define IMGUI_IMPLEMENTATION 8 | // Before you include this file in *one* C++ file to create the implementation. 9 | // Using this in your project will leak the contents of imgui_internal.h and ImVec2 operators in this compilation unit. 10 | 11 | #ifdef IMGUI_IMPLEMENTATION 12 | #define IMGUI_DEFINE_MATH_OPERATORS 13 | #endif 14 | 15 | #include "../../imgui.h" 16 | #ifdef IMGUI_ENABLE_FREETYPE 17 | #include "../../misc/freetype/imgui_freetype.h" 18 | #endif 19 | 20 | #ifdef IMGUI_IMPLEMENTATION 21 | #include "../../imgui.cpp" 22 | #include "../../imgui_demo.cpp" 23 | #include "../../imgui_draw.cpp" 24 | #include "../../imgui_tables.cpp" 25 | #include "../../imgui_widgets.cpp" 26 | #ifdef IMGUI_ENABLE_FREETYPE 27 | #include "../../misc/freetype/imgui_freetype.cpp" 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /source/idra/application/application.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #include "application/application.hpp" 7 | 8 | namespace idra { 9 | 10 | 11 | void Application::run( const ApplicationConfiguration& configuration ) { 12 | 13 | create( configuration ); 14 | main_loop(); 15 | destroy(); 16 | } 17 | 18 | } // namespace idra -------------------------------------------------------------------------------- /source/idra/application/application.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "kernel/string_view.hpp" 9 | 10 | namespace idra { 11 | 12 | /// 13 | /// @brief Struct used to configure the application. 14 | /// 15 | struct ApplicationConfiguration { 16 | 17 | u32 width = 1; 18 | u32 height = 1; 19 | 20 | StringView name; 21 | 22 | }; // struct ApplicationConfiguration 23 | 24 | /// 25 | /// @brief Application interface. 26 | /// 27 | struct Application { 28 | 29 | // 30 | virtual void create( const ApplicationConfiguration& configuration ) {} 31 | virtual void destroy() {} 32 | virtual bool main_loop() { return false; } 33 | 34 | // Fixed update. Can be called more than once compared to rendering. 35 | virtual void fixed_update( f32 delta ) {} 36 | // Variable time update. Called only once per frame. 37 | virtual void variable_update( f32 delta ) {} 38 | // Rendering with optional interpolation factor. 39 | virtual void render( f32 interpolation ) {} 40 | 41 | // Load/unload resources callback. Type is used as a user-defined way 42 | // to separate which resources are loaded/unloaded. 43 | virtual void load_resource( u32 type ) {} 44 | virtual void unload_resource( u32 type ) {} 45 | 46 | // Per frame begin/end. 47 | virtual void frame_begin() {} 48 | virtual void frame_end() {} 49 | 50 | void run( const ApplicationConfiguration& configuration ); 51 | 52 | }; // struct Application 53 | 54 | } // namespace idra -------------------------------------------------------------------------------- /source/idra/application/game_camera.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "kernel/camera.hpp" 4 | #include "kernel/input.hpp" 5 | 6 | namespace idra { 7 | 8 | // 9 | // 10 | struct GameCamera { 11 | 12 | 13 | void init( bool enabled = true, f32 rotation_speed = 10.f, f32 movement_speed = 10.f, f32 movement_delta = 0.1f ); 14 | void reset(); 15 | 16 | void update( InputSystem* input, u32 window_width, u32 window_height, f32 delta_time ); 17 | void apply_jittering( f32 x, f32 y ); 18 | 19 | Camera camera; 20 | 21 | f32 target_yaw; 22 | f32 target_pitch; 23 | 24 | f32 mouse_sensitivity; 25 | f32 movement_delta; 26 | u32 ignore_dragging_frames; 27 | 28 | vec3s target_movement; 29 | 30 | bool enabled; 31 | bool mouse_dragging; 32 | 33 | f32 rotation_speed; 34 | f32 movement_speed; 35 | }; // struct GameCamera 36 | 37 | } // namespace idra -------------------------------------------------------------------------------- /source/idra/application/window.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "kernel/memory.hpp" 9 | #include "kernel/string_view.hpp" 10 | 11 | namespace idra { 12 | 13 | struct InputSystem; 14 | 15 | /// 16 | /// @brief Struct that handles an OS window. 17 | /// 18 | struct Window { 19 | 20 | void init( u32 width, u32 height, StringView name, Allocator* allocator, InputSystem* input ); 21 | void shutdown(); 22 | 23 | void handle_os_messages(); 24 | 25 | void set_fullscreen( bool value ); 26 | void center_mouse( bool dragging ); 27 | 28 | void* platform_handle = nullptr; 29 | bool is_running = false; 30 | bool resized = false; 31 | bool minimized = false; 32 | u32 width = 0; 33 | u32 height = 0; 34 | f32 display_refresh = 1.0f / 60.0f; 35 | 36 | InputSystem* input; 37 | 38 | }; // struct Window 39 | 40 | } // namespace idra -------------------------------------------------------------------------------- /source/idra/game/ui_render_system.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "graphics/render_system_interface.hpp" 9 | 10 | #include "cglm/struct/vec2.h" 11 | 12 | namespace idra { 13 | 14 | struct FontInfo; 15 | struct FontAsset; 16 | struct SpriteBatch; 17 | struct TextureAsset; 18 | struct UIBlueprint; 19 | 20 | // 21 | // 22 | struct UIRenderSystem : public RenderSystemInterface { 23 | 24 | void init( GpuDevice* gpu_device, Allocator* resident_allocator ) override; 25 | void shutdown() override; 26 | 27 | void update( f32 delta_time ) {} 28 | void render( CommandBuffer* gpu_commands, Camera* camera, u32 phase ) {}; 29 | 30 | void create_resources( AssetManager* asset_manager, AssetCreationPhase::Enum phase ) override; 31 | void destroy_resources( AssetManager* asset_manager, AssetDestructionPhase::Enum phase ) override; 32 | 33 | f32 font_get_height( const FontInfo& font_data ); 34 | 35 | void add_box( SpriteBatch& sprite_batch, const vec2s& position, const vec2s& size ); 36 | void add_text( SpriteBatch& sprite_batch, cstring text, const vec2s& position, bool screen_space ); 37 | 38 | FontAsset* font = nullptr; 39 | UIBlueprint* ui_blueprint = nullptr; 40 | TextureAsset* ui_texture = nullptr; 41 | 42 | GpuDevice* gpu_device = nullptr; 43 | 44 | f32 font_global_scale = 1.f; 45 | 46 | }; // struct UIRenderSystem 47 | 48 | } // namespace idra -------------------------------------------------------------------------------- /source/idra/gpu/gpu_resources.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "gpu_resources.hpp" 3 | 4 | namespace idra { 5 | namespace GpuUtils { 6 | 7 | size_t calculate_texture_size( Texture* texture ) { 8 | size_t texture_size = texture->width * texture->height * texture->depth; 9 | iassert( texture->mip_level_count == 1 ); 10 | 11 | switch ( texture->format ) { 12 | case TextureFormat::R32G32B32A32_FLOAT: 13 | { 14 | texture_size *= sizeof( f32 ) * 4; 15 | } break; 16 | 17 | case TextureFormat::R16G16B16A16_FLOAT: 18 | { 19 | texture_size *= sizeof( u16 ) * 4; 20 | } break; 21 | 22 | case TextureFormat::R8G8B8A8_UNORM: 23 | { 24 | texture_size *= sizeof( u8 ) * 4; 25 | } break; 26 | 27 | case TextureFormat::R8_UNORM: 28 | { 29 | texture_size *= sizeof(u8); 30 | } break; 31 | 32 | default: 33 | { 34 | iassert( !"Not supported" ); 35 | return 0; 36 | } 37 | } 38 | 39 | return texture_size; 40 | } 41 | 42 | } // namespace GpuUtils 43 | } // namespace idra 44 | -------------------------------------------------------------------------------- /source/idra/gpu/idra_imgui.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "kernel/platform.hpp" 9 | #include "gpu/command_buffer.hpp" 10 | 11 | struct ImDrawData; 12 | 13 | namespace idra { 14 | 15 | //struct GpuDevice; 16 | //struct CommandBuffer; 17 | //using TextureHandle = Handle; 18 | 19 | // 20 | // 21 | enum ImGuiStyles { 22 | Default = 0, 23 | GreenBlue, 24 | DarkRed, 25 | DarkGold 26 | }; // enum ImGuiStyles 27 | 28 | // 29 | // 30 | struct ImGuiService { 31 | 32 | void init( GpuDevice* gpu, void* window_handle ); 33 | void shutdown(); 34 | 35 | void new_frame(); 36 | 37 | void render( CommandBuffer& commands ); 38 | 39 | // Removes the Texture from the Cache and destroy the associated Resource List. 40 | void remove_cached_texture( TextureHandle& texture ); 41 | 42 | void set_style( ImGuiStyles style ); 43 | 44 | GpuDevice* gpu; 45 | 46 | }; // ImGuiService 47 | 48 | extern ImGuiService* g_imgui; 49 | 50 | } // namespace idra 51 | 52 | 53 | -------------------------------------------------------------------------------- /source/idra/gpu/vulkan_forward_declarations.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "kernel/platform.hpp" 9 | 10 | // Vulkan forward declarations 11 | #if defined (IDRA_VULKAN) 12 | #define IDRA_VK_DEFINE_HANDLE(object) typedef struct object##_T* object; 13 | 14 | IDRA_VK_DEFINE_HANDLE( VkAccelerationStructureKHR ) 15 | IDRA_VK_DEFINE_HANDLE( VkBuffer ) 16 | IDRA_VK_DEFINE_HANDLE( VkDescriptorSet ) 17 | IDRA_VK_DEFINE_HANDLE( VkDescriptorSetLayout ) 18 | IDRA_VK_DEFINE_HANDLE( VkDeviceMemory ) 19 | IDRA_VK_DEFINE_HANDLE( VkImage ) 20 | IDRA_VK_DEFINE_HANDLE( VkImageView ) 21 | IDRA_VK_DEFINE_HANDLE( VkPipeline ) 22 | IDRA_VK_DEFINE_HANDLE( VkPipelineLayout ) 23 | IDRA_VK_DEFINE_HANDLE( VkSampler ) 24 | IDRA_VK_DEFINE_HANDLE( VkShaderModule ) 25 | IDRA_VK_DEFINE_HANDLE( VmaAllocation ) 26 | 27 | struct VkDescriptorSetLayoutBinding; 28 | struct VkPipelineShaderStageCreateInfo; 29 | struct VkComputePipelineCreateInfo; 30 | struct VkRayTracingShaderGroupCreateInfoKHR; 31 | 32 | typedef uint32_t VkBool32; 33 | typedef uint64_t VkDeviceAddress; 34 | typedef uint64_t VkDeviceSize; 35 | typedef uint32_t VkFlags; 36 | typedef uint32_t VkSampleMask; 37 | 38 | typedef VkFlags VkAccessFlags; 39 | typedef VkFlags VkBufferUsageFlags; 40 | typedef VkFlags VkCullModeFlags; 41 | typedef VkFlags VkImageUsageFlags; 42 | typedef VkFlags VkPipelineStageFlags; 43 | 44 | typedef uint32_t VkOpaqueEnum; 45 | 46 | #endif // IDRA_VULKAN -------------------------------------------------------------------------------- /source/idra/graphics/gpu_debug_print_system.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "gpu/gpu_resources.hpp" 9 | #include "graphics/render_system_interface.hpp" 10 | 11 | namespace idra { 12 | 13 | struct AssetManager; 14 | struct Camera; 15 | struct CommandBuffer; 16 | struct GpuDevice; 17 | struct ShaderAsset; 18 | 19 | struct GpuDebugPrintSystem : public RenderSystemInterface { 20 | 21 | enum RenderPhase { 22 | Dispatch = 0, 23 | Draw, 24 | Count 25 | }; 26 | 27 | void init( GpuDevice* gpu_device, Allocator* resident_allocator ) override; 28 | void shutdown() override; 29 | 30 | void update( f32 delta_time ) {} 31 | void render( CommandBuffer* gpu_commands, Camera* camera, u32 phase ) override; 32 | 33 | void create_resources( AssetManager* asset_manager, AssetCreationPhase::Enum phase ) override; 34 | void destroy_resources( AssetManager* asset_manager, AssetDestructionPhase::Enum phase ) override; 35 | 36 | GpuDevice* gpu_device; 37 | 38 | ShaderAsset* dispatch_shader; 39 | PipelineHandle dispatch_pso; 40 | DescriptorSetLayoutHandle dispatch_dsl; 41 | DescriptorSetHandle dispatch_ds; 42 | 43 | ShaderAsset* draw_shader; 44 | PipelineHandle draw_pso; 45 | DescriptorSetLayoutHandle draw_dsl; 46 | DescriptorSetHandle draw_ds; 47 | 48 | BufferHandle constants_ub; 49 | BufferHandle entries_ub; 50 | BufferHandle dispatches_ub; 51 | BufferHandle indirect_buffer; 52 | 53 | u32 dynamic_draw_offset; 54 | 55 | }; // struct GpuDebugPrintSystem 56 | 57 | } // namespace idra 58 | -------------------------------------------------------------------------------- /source/idra/graphics/render_system_interface.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "kernel/platform.hpp" 9 | 10 | namespace idra { 11 | 12 | struct Allocator; 13 | struct AssetManager; 14 | struct Camera; 15 | struct CommandBuffer; 16 | struct GpuDevice; 17 | 18 | namespace AssetCreationPhase { 19 | enum Enum : u8; 20 | } // namespace AssetCreationPhase 21 | 22 | namespace AssetDestructionPhase { 23 | enum Enum : u8; 24 | } // namespace AssetDestructionPhase 25 | 26 | struct RenderSystemInterface { 27 | 28 | virtual void init( GpuDevice* gpu, Allocator* allocator ) = 0; 29 | virtual void shutdown() = 0; 30 | 31 | virtual void create_resources( AssetManager* asset_manager, AssetCreationPhase::Enum phase ) = 0; 32 | virtual void destroy_resources( AssetManager* asset_manager, AssetDestructionPhase::Enum phase ) = 0; 33 | 34 | // TODO: update context 35 | virtual void update( f32 delta_time ) = 0; 36 | // TODO: render context 37 | virtual void render( CommandBuffer* cb, Camera* camera, u32 phase ) = 0; 38 | 39 | }; // struct RenderSystemInterface 40 | 41 | } // namespace idra 42 | -------------------------------------------------------------------------------- /source/idra/imgui/imgui_helpers.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | 7 | #include "imgui/imgui_helpers.hpp" 8 | 9 | 10 | namespace ImGui { 11 | 12 | bool SliderUint( const char* label, u32* v, u32 v_min, u32 v_max, const char* format, ImGuiSliderFlags flags ) { 13 | return SliderScalar( label, ImGuiDataType_U32, v, &v_min, &v_max, format, flags ); 14 | } 15 | 16 | bool SliderUint2( const char* label, u32 v[ 2 ], u32 v_min, u32 v_max, const char* format, ImGuiSliderFlags flags ) { 17 | return SliderScalarN( label, ImGuiDataType_U32, v, 2, &v_min, &v_max, format, flags ); 18 | } 19 | 20 | bool SliderUint3( const char* label, u32 v[ 3 ], u32 v_min, u32 v_max, const char* format, ImGuiSliderFlags flags ) { 21 | return SliderScalarN( label, ImGuiDataType_U32, v, 3, &v_min, &v_max, format, flags ); 22 | } 23 | 24 | bool SliderUint4( const char* label, u32 v[ 4 ], u32 v_min, u32 v_max, const char* format, ImGuiSliderFlags flags ) { 25 | return SliderScalarN( label, ImGuiDataType_U32, v, 4, &v_min, &v_max, format, flags ); 26 | } 27 | 28 | void Image( idra::TextureHandle& texture, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& tint_col, const ImVec4& border_col ) { 29 | Image( &texture.index, size, uv0, uv1, tint_col, border_col ); 30 | } 31 | 32 | } // namespace ImGui 33 | -------------------------------------------------------------------------------- /source/idra/imgui/imgui_helpers.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "gpu/gpu_resources.hpp" 9 | 10 | #include "external/imgui/imgui.h" 11 | 12 | // Extend ImGui namespace with helpers 13 | namespace ImGui { 14 | 15 | bool SliderUint( const char* label, u32* v, u32 v_min, u32 v_max, const char* format = "%d", ImGuiSliderFlags flags = 0 ); 16 | bool SliderUint2( const char* label, u32 v[ 2 ], u32 v_min, u32 v_max, const char* format = "%d", ImGuiSliderFlags flags = 0 ); 17 | bool SliderUint3( const char* label, u32 v[ 3 ], u32 v_min, u32 v_max, const char* format = "%d", ImGuiSliderFlags flags = 0 ); 18 | bool SliderUint4( const char* label, u32 v[ 4 ], u32 v_min, u32 v_max, const char* format = "%d", ImGuiSliderFlags flags = 0 ); 19 | 20 | // Wrapper to use TextureHandle 21 | void Image( idra::TextureHandle& texture, const ImVec2& size, const ImVec2& uv0 = ImVec2( 0, 0 ), const ImVec2& uv1 = ImVec2( 1, 1 ), const ImVec4& tint_col = ImVec4( 1, 1, 1, 1 ), const ImVec4& border_col = ImVec4( 0, 0, 0, 0 ) ); 22 | 23 | } // namespace ImGui 24 | -------------------------------------------------------------------------------- /source/idra/kernel/assert.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "log.hpp" 9 | 10 | namespace idra { 11 | 12 | #define iassert( condition ) if (!(condition)) { ilog_error(IDRA_FILELINE("FALSE\n")); IDRA_DEBUG_BREAK } 13 | #define IDRA_NOT_IMPLEMENTED_STR __FILE__ ":" __LINE__ " not implemented!" 14 | #define IDRA_NOT_IMPLEMENTED { ilog_error( IDRA_FILELINE("not implemented\n") ); IDRA_DEBUG_BREAK } 15 | 16 | #if defined(_MSC_VER) 17 | #define iassertm( condition, message, ... ) if (!(condition)) { ilog_error(IDRA_FILELINE(message), __VA_ARGS__); IDRA_DEBUG_BREAK } 18 | #else 19 | #define iassertm( condition, message, ... ) if (!(condition)) { ilog_error(IDRA_FILELINE(message), ## __VA_ARGS__); IDRA_DEBUG_BREAK } 20 | #endif 21 | 22 | #define istatic_assert( condition, message ) static_assert( condition, #message ) 23 | 24 | 25 | } // namespace idra -------------------------------------------------------------------------------- /source/idra/kernel/asset.cpp: -------------------------------------------------------------------------------- 1 | #include "kernel/asset.hpp" 2 | #include "kernel/assert.hpp" 3 | 4 | namespace idra { 5 | 6 | static AssetManager s_asset_manager; 7 | static constexpr u32 k_max_path = 64; 8 | 9 | AssetManager* AssetManager::init_system() { 10 | 11 | for ( u32 i = 0; i < 32; ++i ) { 12 | s_asset_manager.loaders[ i ] = nullptr; 13 | } 14 | 15 | s_asset_manager.path_string_pool.init( g_memory->get_resident_allocator(), 128, k_max_path ); 16 | 17 | return &s_asset_manager; 18 | } 19 | 20 | void AssetManager::shutdown_system( AssetManager* instance ) { 21 | 22 | iassert( instance == &s_asset_manager ); 23 | // TODO: check loaders 24 | for ( u32 i = 0; i < 32; ++i ) { 25 | if ( s_asset_manager.loaders[ i ] ) { 26 | s_asset_manager.loaders[ i ]->shutdown(); 27 | } 28 | } 29 | 30 | s_asset_manager.path_string_pool.shutdown(); 31 | } 32 | 33 | void AssetManager::set_loader( u32 index, AssetLoaderBase* loader ) { 34 | 35 | iassert( loaders[ index ] == nullptr ); 36 | 37 | if ( loaders[ index ] == nullptr ) { 38 | loaders[ index ] = loader; 39 | } 40 | } 41 | 42 | AssetPath AssetManager::allocate_path( StringView path ) { 43 | 44 | AssetPath asset_path; 45 | 46 | // TODO: max 64 characters for now. 47 | iassert( path.size < k_max_path ); 48 | // Allocate a string 49 | asset_path.pool_index = path_string_pool.obtain_resource(); 50 | void* string_data = path_string_pool.access_resource( asset_path.pool_index ); 51 | memcpy( string_data, path.data, path.size ); 52 | // Update the path 53 | asset_path.path.data = ( cstring )string_data; 54 | asset_path.path.size = path.size; 55 | 56 | return asset_path; 57 | } 58 | 59 | void AssetManager::free_path( AssetPath& path ) { 60 | 61 | path_string_pool.release_resource( path.pool_index ); 62 | } 63 | 64 | 65 | } // namespace idra -------------------------------------------------------------------------------- /source/idra/kernel/color.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #include "color.hpp" 7 | 8 | namespace idra { 9 | 10 | // 11 | // 64 Distinct Colors. Used for graphs and anything that needs random colors. 12 | // 13 | static const u32 k_distinct_colors[] = { 14 | 0xFF000000, 0xFF00FF00, 0xFFFF0000, 0xFF0000FF, 0xFFFEFF01, 0xFFFEA6FF, 0xFF66DBFF, 0xFF016400, 15 | 0xFF670001, 0xFF3A0095, 0xFFB57D00, 0xFFF600FF, 0xFFE8EEFF, 0xFF004D77, 0xFF92FB90, 0xFFFF7600, 16 | 0xFF00FFD5, 0xFF7E93FF, 0xFF6C826A, 0xFF9D02FF, 0xFF0089FE, 0xFF82477A, 0xFFD22D7E, 0xFF00A985, 17 | 0xFF5600FF, 0xFF0024A4, 0xFF7EAE00, 0xFF3B3D68, 0xFFFFC6BD, 0xFF003426, 0xFF93D3BD, 0xFF17B900, 18 | 0xFF8E009E, 0xFF441500, 0xFF9F8CC2, 0xFFA374FF, 0xFFFFD001, 0xFF544700, 0xFFFE6FE5, 0xFF318278, 19 | 0xFFA14C0E, 0xFFCBD091, 0xFF7099BE, 0xFFE88A96, 0xFF0088BB, 0xFF2C0043, 0xFF74FFDE, 0xFFC6FF00, 20 | 0xFF02E5FF, 0xFF000E62, 0xFF9C8F00, 0xFF52FF98, 0xFFB14475, 0xFFFF00B5, 0xFF78FF00, 0xFF416EFF, 21 | 0xFF395F00, 0xFF82686B, 0xFF4EAD5F, 0xFF4057A7, 0xFFD2FFA5, 0xFF67B1FF, 0xFFFF9B00, 0xFFBE5EE8 22 | }; 23 | 24 | u32 Color::get_distinct_color( u32 index ) { 25 | return k_distinct_colors[ index % 64 ]; 26 | } 27 | 28 | } // namespace idra -------------------------------------------------------------------------------- /source/idra/kernel/color.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "kernel/platform.hpp" 9 | 10 | namespace idra { 11 | 12 | // 13 | // Color class that embeds color in a uint32. 14 | // 15 | struct Color { 16 | 17 | void set( float r, float g, float b, float a ) { abgr = uint8_t( r * 255.f ) | ( uint8_t( g * 255.f ) << 8 ) | ( uint8_t( b * 255.f ) << 16 ) | ( uint8_t( a * 255.f ) << 24 ); } 18 | 19 | f32 r() const { return ( abgr & 0xff ) / 255.f; } 20 | f32 g() const { return ( ( abgr >> 8 ) & 0xff ) / 255.f; } 21 | f32 b() const { return ( ( abgr >> 16 ) & 0xff ) / 255.f; } 22 | f32 a() const { return ( ( abgr >> 24 ) & 0xff ) / 255.f; } 23 | 24 | Color operator=( const u32 color ) { abgr = color; return *this; } 25 | 26 | static u32 from_u8( u8 r, u8 g, u8 b, u8 a ) { return ( r | ( g << 8 ) | ( b << 16 ) | ( a << 24 ) ); } 27 | 28 | static u32 get_distinct_color( u32 index ); 29 | 30 | static const Color red() { return { 0xff0000ff }; } 31 | static const Color green() { return { 0xff00ff00 }; } 32 | static const Color blue() { return { 0xffff0000 }; } 33 | static const Color yellow() { return { 0xff00ffff }; } 34 | static const Color black() { return { 0xff000000 }; } 35 | static const Color white() { return { 0xffffffff }; } 36 | static const Color transparent() { return { 0x00000000 }; } 37 | 38 | u32 abgr; 39 | 40 | }; // struct Color 41 | 42 | } // namespace idra -------------------------------------------------------------------------------- /source/idra/kernel/memory_hooks.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JorenJoestar/devgames2024/587d5c80ce631d922d55fae28410ede95b7ee9de/source/idra/kernel/memory_hooks.cpp -------------------------------------------------------------------------------- /source/idra/kernel/memory_hooks.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "kernel/memory.hpp" 9 | 10 | namespace idra { 11 | namespace memory { 12 | 13 | #define malloc( size ) idra::g_memory->global_malloc( size, 1 ) 14 | #define free( pointer ) idra::g_memory->global_free( pointer ) 15 | #define realloc( pointer, new_size ) idra::g_memory->global_realloc( pointer, new_size ) 16 | 17 | } // namespace memory 18 | } // namespace idra -------------------------------------------------------------------------------- /source/idra/kernel/span.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | #include "kernel/platform.hpp" 11 | 12 | namespace idra { 13 | 14 | // https://threadreaderapp.com/thread/1535253315654762501.html 15 | 16 | template 17 | struct Span { 18 | 19 | constexpr Span() : data( nullptr ), size( 0 ) {} 20 | constexpr Span( Type* data, size_t size ) : data( data ), size( size ) {} 21 | // Note: Span should have const Type to compile. 22 | constexpr Span( std::initializer_list list ) : data( list.begin() ), size( list.size() ) {} 23 | //template Span(Type(&c_array)[N]) : data(c_array), size(ArraySize(c_array)) {} 24 | 25 | constexpr const Type* begin() const { return &data[ 0 ]; } 26 | constexpr Type* begin() { return &data[ 0 ]; } 27 | 28 | constexpr const Type* end() const { return &data[ size ]; } 29 | constexpr Type* end() { return &data[ size ]; } 30 | 31 | constexpr Type& operator[]( const sizet index ) { return data[ index ]; } 32 | constexpr const Type& operator[]( const sizet index ) const { return data[ index ]; } 33 | 34 | 35 | constexpr sizet constexpr_size() { return size; } 36 | 37 | Type* data = nullptr; 38 | size_t size = 0; 39 | 40 | }; // struct Span 41 | 42 | } // namespace idra 43 | -------------------------------------------------------------------------------- /source/idra/kernel/string_view.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "span.hpp" 9 | 10 | #include 11 | 12 | namespace idra { 13 | 14 | struct StringView : public Span { 15 | 16 | constexpr StringView() : Span() {} 17 | StringView( cstring c_string ) : Span( c_string, strlen( c_string ) ) {} 18 | constexpr StringView( cstring data, size_t size ) : Span( data, size ) {} 19 | 20 | }; // struct StringView 21 | 22 | } // namespace idra 23 | -------------------------------------------------------------------------------- /source/idra/kernel/task_manager.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "kernel/platform.hpp" 9 | 10 | namespace idra { 11 | 12 | struct TaskManager { 13 | 14 | using Callback = std::function; 15 | 16 | struct Task { 17 | i32 id; 18 | void* data; 19 | Callback fn; 20 | }; 21 | 22 | void init(); 23 | void shutdown(); 24 | 25 | void run_task( i32 thread_id ); 26 | i32 add_task( Callback& fn, void* data ); 27 | void start_tasks(); 28 | 29 | void wait_for_completion(); 30 | 31 | std::mutex tasks_mtx; 32 | std::atomic_bool tasks_available; 33 | std::condition_variable tasks_available_cv; 34 | 35 | std::condition_variable tasks_completed_cv; 36 | 37 | std::atomic_bool active; 38 | 39 | std::atomic_int tasks_completed_count; 40 | std::atomic_int next_task_indices; 41 | 42 | std::vector task_queue; 43 | std::vector thread_pool; 44 | }; 45 | } // namespace idra 46 | -------------------------------------------------------------------------------- /source/idra/kernel/thread.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "kernel/string_view.hpp" 13 | 14 | namespace idra { 15 | 16 | // First possible implementation of a thread. 17 | // Uses inheritance to execute things. 18 | struct Thread { 19 | 20 | Thread( StringView name ); 21 | ~Thread(); 22 | 23 | Thread() = default; 24 | Thread( Thread const& other ) = delete; 25 | Thread( Thread&& other ) = default; 26 | 27 | Thread& operator=( Thread const& other ) = delete; 28 | Thread& operator=( Thread&& other ) = default; 29 | 30 | virtual void run( std::future const& stop_token ) = 0; 31 | 32 | void start(); 33 | void stop(); 34 | void join(); 35 | 36 | static bool is_stop_requested( std::future const& token ) noexcept; 37 | 38 | std::thread thread; 39 | std::promise stop_request; 40 | StringView name; 41 | 42 | }; // struct Thread 43 | 44 | // 45 | // 46 | struct ThreadLambda { 47 | 48 | ThreadLambda( StringView name ); 49 | ThreadLambda( const ThreadLambda& other ); 50 | ~ThreadLambda(); 51 | 52 | 53 | void start( std::function threadFunc ); 54 | void stop(); 55 | void join(); 56 | 57 | static bool is_stop_requested( std::future const& token ) noexcept; 58 | 59 | std::thread thread; 60 | std::atomic running; 61 | StringView name; 62 | 63 | }; // struct ThreadLambda 64 | 65 | } // namespace idra 66 | -------------------------------------------------------------------------------- /source/idra/kernel/time.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "platform.hpp" 9 | 10 | namespace idra { 11 | 12 | struct TimeTick { 13 | 14 | long long counter; 15 | 16 | }; // struct TimeTick 17 | 18 | // 19 | // 20 | struct TimeService { 21 | 22 | void init(); 23 | void shutdown(); 24 | 25 | TimeTick now(); 26 | TimeTick delta( const TimeTick& a, const TimeTick& b ); 27 | 28 | f64 convert_microseconds( const TimeTick& time ); 29 | f64 convert_milliseconds( const TimeTick& time ); 30 | f64 convert_seconds( const TimeTick& time ); 31 | 32 | }; // struct TimeService 33 | 34 | extern TimeService* g_time; 35 | 36 | } // namespace idra -------------------------------------------------------------------------------- /source/idra/kernel/windows_forward_declarations.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #if defined(_MSC_VER) 9 | 10 | #include "basetsd.h" 11 | 12 | typedef int BOOL; 13 | typedef char CHAR; 14 | typedef unsigned long DWORD; 15 | typedef DWORD* LPDWORD; 16 | typedef unsigned long long DWORD64; 17 | typedef unsigned long long ULONGLONG; 18 | typedef const wchar_t* LPCWSTR; 19 | typedef const char* LPCSTR; 20 | typedef char* LPSTR; 21 | typedef void* HANDLE; 22 | typedef void* PVOID; 23 | typedef void* LPVOID; 24 | typedef UINT_PTR WPARAM; 25 | typedef LONG_PTR LPARAM; 26 | typedef LONG_PTR LRESULT; 27 | 28 | typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES; 29 | 30 | #define FORWARD_DECLARE_HANDLE(name) struct name##__; typedef struct name##__ *name 31 | 32 | FORWARD_DECLARE_HANDLE( HINSTANCE ); 33 | FORWARD_DECLARE_HANDLE( HWND ); 34 | FORWARD_DECLARE_HANDLE( HMONITOR ); 35 | 36 | #define NULL 0 37 | 38 | #endif // _MSC_VER 39 | -------------------------------------------------------------------------------- /source/tools/asset_compiler/asset_compiler.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #pragma once 7 | 8 | #if !defined(IDRA_SC_EXPORT) 9 | #define IDRA_SC_EXPORT /* NOTHING */ 10 | 11 | #if defined(WIN32) || defined(WIN64) 12 | #undef IDRA_SC_EXPORT 13 | #if defined(asset_compiler_EXPORTS) 14 | #define IDRA_SC_EXPORT __declspec(dllexport) 15 | #else 16 | #define IDRA_SC_EXPORT __declspec(dllimport) 17 | #endif // defined(asset_compiler_EXPORTS) 18 | #endif // defined(WIN32) || defined(WIN64) 19 | 20 | #if defined(__GNUC__) || defined(__APPLE__) || defined(LINUX) 21 | #if defined(asset_compiler_EXPORTS) 22 | #undef IDRA_SC_EXPORT 23 | #define IDRA_SC_EXPORT __attribute__((visibility("default"))) 24 | #endif // defined(asset_compiler_EXPORTS) 25 | #endif // defined(__GNUC__) || defined(__APPLE__) || defined(LINUX) 26 | 27 | #endif // !defined(IDRA_SC_EXPORT) 28 | 29 | #include "kernel/string_view.hpp" 30 | #include "kernel/blob.hpp" 31 | 32 | #include "graphics/graphics_blueprints.hpp" 33 | 34 | namespace idra { 35 | 36 | IDRA_SC_EXPORT void asset_compiler_main( StringView source_folder, StringView destination_folder ); 37 | 38 | } // namespace idra 39 | -------------------------------------------------------------------------------- /source/tools/shader_compiler_cli/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024 Gabriel Sassone. All rights reserved. 3 | * License: https://github.com/JorenJoestar/Idra/blob/main/LICENSE 4 | */ 5 | 6 | #include "shader_compiler.hpp" 7 | #include 8 | 9 | #include "kernel/log.hpp" 10 | 11 | int main(int argc, char** argv) { 12 | ilog("Shader compiler CLI hello world!\n"); 13 | return 0; 14 | } 15 | --------------------------------------------------------------------------------