├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── LICENSE ├── README.md ├── cache └── imgui.ini ├── ext ├── dds_reader.hpp ├── json.hpp ├── sokol │ ├── CMakeLists.txt │ ├── ext │ │ ├── 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.vert │ │ │ ├── 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 │ │ │ │ │ ├── lib-vc2010-32 │ │ │ │ │ │ └── glfw3.lib │ │ │ │ │ └── lib-vc2010-64 │ │ │ │ │ │ └── glfw3.lib │ │ │ │ │ └── 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 │ │ └── sokol │ │ │ ├── .editorconfig │ │ │ ├── .github │ │ │ └── workflows │ │ │ │ ├── gen_bindings.yml │ │ │ │ └── main.yml │ │ │ ├── .gitignore │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── bindgen │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── gen_all.py │ │ │ ├── gen_ir.py │ │ │ ├── gen_nim.py │ │ │ ├── gen_odin.py │ │ │ ├── gen_rust.py │ │ │ ├── gen_util.py │ │ │ └── gen_zig.py │ │ │ ├── fips.yml │ │ │ ├── sokol_app.h │ │ │ ├── sokol_args.h │ │ │ ├── sokol_audio.h │ │ │ ├── sokol_fetch.h │ │ │ ├── sokol_gfx.h │ │ │ ├── sokol_glue.h │ │ │ ├── sokol_log.h │ │ │ ├── sokol_time.h │ │ │ ├── tests │ │ │ ├── .gitignore │ │ │ ├── CMakeLists.txt │ │ │ ├── CMakePresets.json │ │ │ ├── analyze_ios.sh │ │ │ ├── analyze_linux.sh │ │ │ ├── analyze_macos.sh │ │ │ ├── analyze_win.cmd │ │ │ ├── compile │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── sokol_app.c │ │ │ │ ├── sokol_app.cc │ │ │ │ ├── sokol_args.c │ │ │ │ ├── sokol_args.cc │ │ │ │ ├── sokol_audio.c │ │ │ │ ├── sokol_audio.cc │ │ │ │ ├── sokol_color.c │ │ │ │ ├── sokol_color.cc │ │ │ │ ├── sokol_debugtext.c │ │ │ │ ├── sokol_debugtext.cc │ │ │ │ ├── sokol_fetch.c │ │ │ │ ├── sokol_fetch.cc │ │ │ │ ├── sokol_fontstash.c │ │ │ │ ├── sokol_fontstash.cc │ │ │ │ ├── sokol_gfx.c │ │ │ │ ├── sokol_gfx.cc │ │ │ │ ├── sokol_gfx_imgui.c │ │ │ │ ├── sokol_gfx_imgui.cc │ │ │ │ ├── sokol_gl.c │ │ │ │ ├── sokol_gl.cc │ │ │ │ ├── sokol_glue.c │ │ │ │ ├── sokol_glue.cc │ │ │ │ ├── sokol_imgui.c │ │ │ │ ├── sokol_imgui.cc │ │ │ │ ├── sokol_log.c │ │ │ │ ├── sokol_log.cc │ │ │ │ ├── sokol_main.c │ │ │ │ ├── sokol_main.cc │ │ │ │ ├── sokol_nuklear.c │ │ │ │ ├── sokol_shape.c │ │ │ │ ├── sokol_shape.cc │ │ │ │ ├── sokol_spine.c │ │ │ │ ├── sokol_spine.cc │ │ │ │ ├── sokol_time.c │ │ │ │ └── sokol_time.cc │ │ │ ├── ext │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── fontstash.h │ │ │ │ ├── nuklear.c │ │ │ │ ├── nuklear.h │ │ │ │ └── stb_truetype.h │ │ │ ├── functional │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── README.txt │ │ │ │ ├── assets │ │ │ │ │ ├── comsi.s3m │ │ │ │ │ └── readme.txt │ │ │ │ ├── force_dummy_backend.h │ │ │ │ ├── sokol_args_test.c │ │ │ │ ├── sokol_audio_test.c │ │ │ │ ├── sokol_color_test.c │ │ │ │ ├── sokol_debugtext_test.c │ │ │ │ ├── sokol_fetch_test.c │ │ │ │ ├── sokol_gfx_test.c │ │ │ │ ├── sokol_gl_test.c │ │ │ │ ├── sokol_shape_test.c │ │ │ │ ├── sokol_spine_test.c │ │ │ │ ├── sokol_test.c │ │ │ │ └── utest.h │ │ │ ├── test_android.sh │ │ │ ├── test_common.sh │ │ │ ├── test_emscripten.sh │ │ │ ├── test_ios.sh │ │ │ ├── test_linux.sh │ │ │ ├── test_macos.sh │ │ │ └── test_win.cmd │ │ │ └── util │ │ │ ├── gen_sokol_color.py │ │ │ ├── sokol_color.h │ │ │ ├── sokol_debugtext.h │ │ │ ├── sokol_fontstash.h │ │ │ ├── sokol_gfx_imgui.h │ │ │ ├── sokol_gl.h │ │ │ ├── sokol_imgui.h │ │ │ ├── sokol_memtrack.h │ │ │ ├── sokol_nuklear.h │ │ │ ├── sokol_shape.h │ │ │ └── sokol_spine.h │ ├── inc │ │ └── sokol_wrapper.hpp │ ├── src │ │ └── main.cpp │ └── tools │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bin │ │ ├── linux │ │ │ ├── readme.txt │ │ │ └── sokol-shdc │ │ ├── osx │ │ │ ├── readme.txt │ │ │ └── sokol-shdc │ │ ├── osx_arm64 │ │ │ └── sokol-shdc │ │ └── win32 │ │ │ ├── readme.txt │ │ │ └── sokol-shdc.exe │ │ └── fips-files │ │ ├── generators │ │ └── SokolShader.py │ │ └── include.cmake └── stb_image.h └── src ├── animation.cpp ├── animation.hpp ├── animation_flags.hpp ├── animation_graph.cpp ├── animation_graph.hpp ├── build_shader.js ├── character.cpp ├── character.hpp ├── character_animation.cpp ├── character_animation.hpp ├── clip_property_data.cpp ├── clip_property_data.hpp ├── icon.hpp ├── main.cpp ├── managed_image.cpp ├── managed_image.hpp ├── shaders ├── animated_mesh.glsl ├── animated_mesh.hpp └── types.glsl ├── simple_input.cpp ├── simple_input.hpp ├── skeleton.cpp ├── skeleton.hpp ├── skin.cpp ├── skin.hpp ├── types.hpp ├── ui.cpp └── ui.hpp /.gitignore: -------------------------------------------------------------------------------- 1 | cache/champions.json 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ext/leaguelib"] 2 | path = ext/leaguelib 3 | url = https://github.com/Querijn/LeagueLib.git 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Querijn Heijmans 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 | # LeagueModel 2 | An application to display League of Legends models on Windows. 3 | 4 | ## How do I use it? 5 | 6 | Simply download one of the releases, found [here](https://github.com/Querijn/LeagueModel/releases). If you've installed League of Legends in its default location (`C:\Riot Games\League of Legends\`), you can just run it from anywhere. If you haven't, you need to put the binary inside the League of Legends folder, or you need to supply the League of Legends path as the first argument. 7 | 8 | Make sure that you have write access to the folder you're running it from, since it will create a `cache` folder with the cache files it needs to keep track of. 9 | 10 | ## How do I compile it? 11 | 12 | For PC: 13 | - Get CMake, and run the GUI. The Visual Studio 2022 generators work, tested for x64. 14 | - Run it, generate it, and open the project. 15 | - Compile and run it. 16 | 17 | ### Special thanks 18 | 19 | - Honux from Teemo.GG, for inspiring me to put even more work in this. 20 | - The CDragon people (Stelar7, Le Poussin), for helping me out decyphering these files. 21 | - Literally [this video](https://www.youtube.com/watch?v=F-kcaonjHf8) for fixing my animations. Thanks, ThinMatrix. 22 | - Everyone that had a model viewer for me to compare my output against. 23 | -------------------------------------------------------------------------------- /cache/imgui.ini: -------------------------------------------------------------------------------- 1 | [Window][DockSpaceViewport_11111111] 2 | Pos=0,19 3 | Size=800,581 4 | Collapsed=0 5 | 6 | [Window][Debug##Default] 7 | Pos=60,60 8 | Size=400,400 9 | Collapsed=0 10 | 11 | [Window][Skins] 12 | Pos=0,19 13 | Size=263,581 14 | Collapsed=0 15 | DockId=0x00000001,0 16 | 17 | [Window][Animations] 18 | Pos=0,19 19 | Size=263,581 20 | Collapsed=0 21 | DockId=0x00000001,1 22 | 23 | [Docking][Data] 24 | DockSpace ID=0x8B93E3BD Window=0xA787BDB4 Pos=0,19 Size=800,581 Split=X 25 | DockNode ID=0x00000001 Parent=0x8B93E3BD SizeRef=263,581 Selected=0x1A77F0B7 26 | DockNode ID=0x00000002 Parent=0x8B93E3BD SizeRef=535,581 CentralNode=1 27 | 28 | -------------------------------------------------------------------------------- /ext/dds_reader.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Querijn/LeagueModel/0287d6b11fd29b26985f98b49a5999ce981bc532/ext/dds_reader.hpp -------------------------------------------------------------------------------- /ext/sokol/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.17) 2 | project(Sokol) 3 | 4 | set(SOKOL_SOURCES "" CACHE INTERNAL "Sokol source files") 5 | 6 | ADD_SRC(SOKOL_SOURCES "Sokol" "ext/sokol/sokol_app.h" "") 7 | ADD_SRC(SOKOL_SOURCES "Sokol" "ext/sokol/sokol_audio.h" "") 8 | ADD_SRC(SOKOL_SOURCES "Sokol" "ext/sokol/sokol_gfx.h" "") 9 | ADD_SRC(SOKOL_SOURCES "Sokol" "ext/sokol/util/sokol_gl.h" "") 10 | ADD_SRC(SOKOL_SOURCES "Sokol" "ext/sokol/sokol_glue.h" "") 11 | ADD_SRC(SOKOL_SOURCES "Sokol" "inc/sokol_wrapper.hpp" "") 12 | ADD_SRC(SOKOL_SOURCES "Sokol" "src/main.cpp" "") 13 | 14 | ADD_SRC(SOKOL_SOURCES "ImGui" "ext/imgui/imgui.h" "ext/imgui/imgui.cpp") 15 | ADD_SRC(SOKOL_SOURCES "ImGui" "" "ext/imgui/imgui_demo.cpp") 16 | ADD_SRC(SOKOL_SOURCES "ImGui" "" "ext/imgui/imgui_draw.cpp") 17 | ADD_SRC(SOKOL_SOURCES "ImGui" "" "ext/imgui/imgui_internal.h") 18 | ADD_SRC(SOKOL_SOURCES "ImGui" "" "ext/imgui/imgui_tables.cpp") 19 | ADD_SRC(SOKOL_SOURCES "ImGui" "" "ext/imgui/imgui_widgets.cpp") 20 | ADD_SRC(SOKOL_SOURCES "ImGui" "" "ext/imgui/imstb_rectpack.h") 21 | ADD_SRC(SOKOL_SOURCES "ImGui" "" "ext/imgui/imstb_textedit.h") 22 | ADD_SRC(SOKOL_SOURCES "ImGui" "" "ext/imgui/imstb_truetype.h") 23 | 24 | add_library(Sokol ${SOKOL_SOURCES}) 25 | 26 | target_include_directories(Sokol PUBLIC "inc") 27 | target_include_directories(Sokol PUBLIC "ext/sokol") 28 | target_include_directories(Sokol PUBLIC "ext/sokol/util") 29 | target_include_directories(Sokol PUBLIC "ext/imgui") 30 | 31 | if (WIN32) 32 | target_compile_definitions(Sokol PUBLIC SOKOL_GLCORE33) 33 | else (EMSCRIPTEN) 34 | target_compile_definitions(Sokol PUBLIC SOKOL_GLES2) 35 | endif () 36 | 37 | if (EMSCRIPTEN) 38 | set(SOKOL_FLAGS "" CACHE INTERNAL "Sokol LINK FLAGS") 39 | if (CMAKE_BUILD_TYPE EQUAL "DEBUG") 40 | set(${SOKOL_FLAGS} ${SOKOL_FLAGS} "-g4-s SAFE_HEAP=1 -s WARN_UNALIGNED=1 -fsanitize=undefined") 41 | else () 42 | set(${SOKOL_FLAGS} ${SOKOL_FLAGS} "-O2 --closure 1") 43 | endif () 44 | set_target_properties(Sokol PROPERTIES LINK_FLAGS ${SOKOL_FLAGS} "-s FULL_ES2=1 -s DISABLE_EXCEPTION_CATCHING=2 -s MINIMAL_RUNTIME -lwebgl.js -s ALLOW_MEMORY_GROWTH=1 -std=c++17") 45 | endif () 46 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['https://github.com/ocornut/imgui/wiki/Sponsors'] 2 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/.github/issue_template.md: -------------------------------------------------------------------------------- 1 | (Click "Preview" above ^ to turn URL into clickable links) 2 | 3 | 1. FOR FIRST-TIME USERS PROBLEMS COMPILING/LINKING/RUNNING or LOADING FONTS, please use [GitHub Discussions](https://github.com/ocornut/imgui/discussions). EVERYTHING ELSE CAN BE POSTED HERE! 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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/backends/imgui_impl_allegro5.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer + Platform Backend for Allegro 5 2 | // (Info: Allegro 5 is a cross-platform general purpose library for handling windows, inputs, graphics, etc.) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'ALLEGRO_BITMAP*' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy ALLEGRO_KEY_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 7 | // [X] Platform: Clipboard support (from Allegro 5.1.12) 8 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 9 | // Missing features: 10 | // [ ] Renderer: Multi-viewport support (multiple windows).. 11 | // [ ] Renderer: The renderer is suboptimal as we need to unindex our buffers and convert vertices manually. 12 | // [ ] Platform: Missing gamepad support. 13 | 14 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 15 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 16 | // Learn about Dear ImGui: 17 | // - FAQ https://dearimgui.com/faq 18 | // - Getting Started https://dearimgui.com/getting-started 19 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 20 | // - Introduction, links and more at the top of imgui.cpp 21 | 22 | #pragma once 23 | #include "imgui.h" // IMGUI_IMPL_API 24 | #ifndef IMGUI_DISABLE 25 | 26 | struct ALLEGRO_DISPLAY; 27 | union ALLEGRO_EVENT; 28 | 29 | IMGUI_IMPL_API bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display); 30 | IMGUI_IMPL_API void ImGui_ImplAllegro5_Shutdown(); 31 | IMGUI_IMPL_API void ImGui_ImplAllegro5_NewFrame(); 32 | IMGUI_IMPL_API void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data); 33 | IMGUI_IMPL_API bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* event); 34 | 35 | // Use if you want to reset your rendering device without losing Dear ImGui state. 36 | IMGUI_IMPL_API bool ImGui_ImplAllegro5_CreateDeviceObjects(); 37 | IMGUI_IMPL_API void ImGui_ImplAllegro5_InvalidateDeviceObjects(); 38 | 39 | #endif // #ifndef IMGUI_DISABLE 40 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/backends/imgui_impl_android.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Binding for Android native app 2 | // This needs to be used along with the OpenGL 3 Renderer (imgui_impl_opengl3) 3 | 4 | // Implemented features: 5 | // [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy AKEYCODE_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 6 | // [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen/Pen. 7 | // Missing features: 8 | // [ ] Platform: Clipboard support. 9 | // [ ] Platform: Gamepad support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 10 | // [ ] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. FIXME: Check if this is even possible with Android. 11 | // [ ] Platform: Multi-viewport support (multiple windows). Not meaningful on Android. 12 | // Important: 13 | // - Consider using SDL or GLFW backend on Android, which will be more full-featured than this. 14 | // - FIXME: On-screen keyboard currently needs to be enabled by the application (see examples/ and issue #3446) 15 | // - FIXME: Unicode character inputs needs to be passed by Dear ImGui by the application (see examples/ and issue #3446) 16 | 17 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 18 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 19 | // Learn about Dear ImGui: 20 | // - FAQ https://dearimgui.com/faq 21 | // - Getting Started https://dearimgui.com/getting-started 22 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 23 | // - Introduction, links and more at the top of imgui.cpp 24 | 25 | #pragma once 26 | #include "imgui.h" // IMGUI_IMPL_API 27 | #ifndef IMGUI_DISABLE 28 | 29 | struct ANativeWindow; 30 | struct AInputEvent; 31 | 32 | IMGUI_IMPL_API bool ImGui_ImplAndroid_Init(ANativeWindow* window); 33 | IMGUI_IMPL_API int32_t ImGui_ImplAndroid_HandleInputEvent(const AInputEvent* input_event); 34 | IMGUI_IMPL_API void ImGui_ImplAndroid_Shutdown(); 35 | IMGUI_IMPL_API void ImGui_ImplAndroid_NewFrame(); 36 | 37 | #endif // #ifndef IMGUI_DISABLE 38 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | // Learn about Dear ImGui: 12 | // - FAQ https://dearimgui.com/faq 13 | // - Getting Started https://dearimgui.com/getting-started 14 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 15 | // - Introduction, links and more at the top of imgui.cpp 16 | 17 | #pragma once 18 | #include "imgui.h" // IMGUI_IMPL_API 19 | #ifndef IMGUI_DISABLE 20 | 21 | struct ID3D10Device; 22 | 23 | IMGUI_IMPL_API bool ImGui_ImplDX10_Init(ID3D10Device* device); 24 | IMGUI_IMPL_API void ImGui_ImplDX10_Shutdown(); 25 | IMGUI_IMPL_API void ImGui_ImplDX10_NewFrame(); 26 | IMGUI_IMPL_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data); 27 | 28 | // Use if you want to reset your rendering device without losing Dear ImGui state. 29 | IMGUI_IMPL_API void ImGui_ImplDX10_InvalidateDeviceObjects(); 30 | IMGUI_IMPL_API bool ImGui_ImplDX10_CreateDeviceObjects(); 31 | 32 | #endif // #ifndef IMGUI_DISABLE 33 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | // Learn about Dear ImGui: 12 | // - FAQ https://dearimgui.com/faq 13 | // - Getting Started https://dearimgui.com/getting-started 14 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 15 | // - Introduction, links and more at the top of imgui.cpp 16 | 17 | #pragma once 18 | #include "imgui.h" // IMGUI_IMPL_API 19 | #ifndef IMGUI_DISABLE 20 | 21 | struct ID3D11Device; 22 | struct ID3D11DeviceContext; 23 | 24 | IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); 25 | IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); 26 | IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); 27 | IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); 28 | 29 | // Use if you want to reset your rendering device without losing Dear ImGui state. 30 | IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); 31 | IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); 32 | 33 | #endif // #ifndef IMGUI_DISABLE 34 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | // Learn about Dear ImGui: 12 | // - FAQ https://dearimgui.com/faq 13 | // - Getting Started https://dearimgui.com/getting-started 14 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 15 | // - Introduction, links and more at the top of imgui.cpp 16 | 17 | #pragma once 18 | #include "imgui.h" // IMGUI_IMPL_API 19 | #ifndef IMGUI_DISABLE 20 | 21 | struct IDirect3DDevice9; 22 | 23 | IMGUI_IMPL_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device); 24 | IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown(); 25 | IMGUI_IMPL_API void ImGui_ImplDX9_NewFrame(); 26 | IMGUI_IMPL_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data); 27 | 28 | // Use if you want to reset your rendering device without losing Dear ImGui state. 29 | IMGUI_IMPL_API bool ImGui_ImplDX9_CreateDeviceObjects(); 30 | IMGUI_IMPL_API void ImGui_ImplDX9_InvalidateDeviceObjects(); 31 | 32 | #endif // #ifndef IMGUI_DISABLE 33 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/backends/imgui_impl_opengl2.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for OpenGL2 (legacy OpenGL, fixed pipeline) 2 | // This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 7 | 8 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 9 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 10 | // Learn about Dear ImGui: 11 | // - FAQ https://dearimgui.com/faq 12 | // - Getting Started https://dearimgui.com/getting-started 13 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 14 | // - Introduction, links and more at the top of imgui.cpp 15 | 16 | // **DO NOT USE THIS CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)** 17 | // **Prefer using the code in imgui_impl_opengl3.cpp** 18 | // This code is mostly provided as a reference to learn how ImGui integration works, because it is shorter to read. 19 | // If your code is using GL3+ context or any semi modern OpenGL calls, using this is likely to make everything more 20 | // complicated, will require your code to reset every single OpenGL attributes to their initial state, and might 21 | // confuse your GPU driver. 22 | // The GL2 code is unable to reset attributes or even call e.g. "glUseProgram(0)" because they don't exist in that API. 23 | 24 | #pragma once 25 | #include "imgui.h" // IMGUI_IMPL_API 26 | #ifndef IMGUI_DISABLE 27 | 28 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_Init(); 29 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_Shutdown(); 30 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_NewFrame(); 31 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data); 32 | 33 | // Called by Init/NewFrame/Shutdown 34 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_CreateFontsTexture(); 35 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_DestroyFontsTexture(); 36 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_CreateDeviceObjects(); 37 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_DestroyDeviceObjects(); 38 | 39 | #endif // #ifndef IMGUI_DISABLE 40 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/backends/imgui_impl_osx.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for OSX / Cocoa 2 | // This needs to be used along with a Renderer (e.g. OpenGL2, OpenGL3, Vulkan, Metal..) 3 | // - Not well tested. If you want a portable application, prefer using the GLFW or SDL platform Backends on Mac. 4 | // - Requires linking with the GameController framework ("-framework GameController"). 5 | 6 | // Implemented features: 7 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 8 | // [X] Platform: Mouse support. Can discriminate Mouse/Pen. 9 | // [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy kVK_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 10 | // [X] Platform: OSX clipboard is supported within core Dear ImGui (no specific code in this backend). 11 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 12 | // [X] Platform: IME support. 13 | // [X] Platform: Multi-viewport / platform windows. 14 | 15 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 16 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 17 | // Learn about Dear ImGui: 18 | // - FAQ https://dearimgui.com/faq 19 | // - Getting Started https://dearimgui.com/getting-started 20 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 21 | // - Introduction, links and more at the top of imgui.cpp 22 | 23 | #include "imgui.h" // IMGUI_IMPL_API 24 | #ifndef IMGUI_DISABLE 25 | 26 | #ifdef __OBJC__ 27 | 28 | @class NSEvent; 29 | @class NSView; 30 | 31 | IMGUI_IMPL_API bool ImGui_ImplOSX_Init(NSView* _Nonnull view); 32 | IMGUI_IMPL_API void ImGui_ImplOSX_Shutdown(); 33 | IMGUI_IMPL_API void ImGui_ImplOSX_NewFrame(NSView* _Nullable view); 34 | 35 | #endif 36 | 37 | //----------------------------------------------------------------------------- 38 | // C++ API 39 | //----------------------------------------------------------------------------- 40 | 41 | #ifdef IMGUI_IMPL_METAL_CPP_EXTENSIONS 42 | // #include 43 | #ifndef __OBJC__ 44 | 45 | IMGUI_IMPL_API bool ImGui_ImplOSX_Init(void* _Nonnull view); 46 | IMGUI_IMPL_API void ImGui_ImplOSX_Shutdown(); 47 | IMGUI_IMPL_API void ImGui_ImplOSX_NewFrame(void* _Nullable view); 48 | 49 | #endif 50 | #endif 51 | 52 | #endif // #ifndef IMGUI_DISABLE 53 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 17 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 18 | // Learn about Dear ImGui: 19 | // - FAQ https://dearimgui.com/faq 20 | // - Getting Started https://dearimgui.com/getting-started 21 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 22 | // - Introduction, links and more at the top of imgui.cpp 23 | 24 | #pragma once 25 | #ifndef IMGUI_DISABLE 26 | #include "imgui.h" // IMGUI_IMPL_API 27 | 28 | struct SDL_Renderer; 29 | 30 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer2_Init(SDL_Renderer* renderer); 31 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_Shutdown(); 32 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_NewFrame(); 33 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_RenderDrawData(ImDrawData* draw_data); 34 | 35 | // Called by Init/NewFrame/Shutdown 36 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer2_CreateFontsTexture(); 37 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_DestroyFontsTexture(); 38 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer2_CreateDeviceObjects(); 39 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_DestroyDeviceObjects(); 40 | 41 | #endif // #ifndef IMGUI_DISABLE 42 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | // You can copy and use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 17 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 18 | // Learn about Dear ImGui: 19 | // - FAQ https://dearimgui.com/faq 20 | // - Getting Started https://dearimgui.com/getting-started 21 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 22 | // - Introduction, links and more at the top of imgui.cpp 23 | 24 | #pragma once 25 | #include "imgui.h" // IMGUI_IMPL_API 26 | #ifndef IMGUI_DISABLE 27 | 28 | struct SDL_Renderer; 29 | 30 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer3_Init(SDL_Renderer* renderer); 31 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_Shutdown(); 32 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_NewFrame(); 33 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data); 34 | 35 | // Called by Init/NewFrame/Shutdown 36 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer3_CreateFontsTexture(); 37 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_DestroyFontsTexture(); 38 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer3_CreateDeviceObjects(); 39 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer3_DestroyDeviceObjects(); 40 | 41 | #endif // #ifndef IMGUI_DISABLE 42 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | // Learn about Dear ImGui: 14 | // - FAQ https://dearimgui.com/faq 15 | // - Getting Started https://dearimgui.com/getting-started 16 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 17 | // - Introduction, links and more at the top of imgui.cpp 18 | 19 | #pragma once 20 | #include "imgui.h" // IMGUI_IMPL_API 21 | #ifndef IMGUI_DISABLE 22 | 23 | #include 24 | 25 | IMGUI_IMPL_API bool ImGui_ImplWGPU_Init(WGPUDevice device, int num_frames_in_flight, WGPUTextureFormat rt_format, WGPUTextureFormat depth_format = WGPUTextureFormat_Undefined); 26 | IMGUI_IMPL_API void ImGui_ImplWGPU_Shutdown(); 27 | IMGUI_IMPL_API void ImGui_ImplWGPU_NewFrame(); 28 | IMGUI_IMPL_API void ImGui_ImplWGPU_RenderDrawData(ImDrawData* draw_data, WGPURenderPassEncoder pass_encoder); 29 | 30 | // Use if you want to reset your rendering device without losing Dear ImGui state. 31 | IMGUI_IMPL_API void ImGui_ImplWGPU_InvalidateDeviceObjects(); 32 | IMGUI_IMPL_API bool ImGui_ImplWGPU_CreateDeviceObjects(); 33 | 34 | #endif // #ifndef IMGUI_DISABLE 35 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_allegro5/example_allegro5.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | imgui 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | sources 27 | 28 | 29 | sources 30 | 31 | 32 | imgui 33 | 34 | 35 | imgui 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | 53 | 54 | 55 | imgui 56 | 57 | 58 | imgui 59 | 60 | 61 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_android_opengl3/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_emscripten_wgpu/README.md: -------------------------------------------------------------------------------- 1 | ## How to Build 2 | 3 | - You need to install Emscripten from https://emscripten.org/docs/getting_started/downloads.html, and have the environment variables set, as described in https://emscripten.org/docs/getting_started/downloads.html#installation-instructions 4 | 5 | - Depending on your configuration, in Windows you may need to run `emsdk/emsdk_env.bat` in your console to access the Emscripten command-line tools. 6 | 7 | - You may also refer to our [Continuous Integration setup](https://github.com/ocornut/imgui/tree/master/.github/workflows) for Emscripten setup. 8 | 9 | - Then build using `make` while in the `example_emscripten_wgpu/` directory. 10 | 11 | - Requires recent Emscripten as WGPU is still a work-in-progress API. 12 | 13 | ## How to Run 14 | 15 | To run on a local machine: 16 | - Make sure your browse supports WGPU and it is enabled. WGPU is still WIP not enabled by default in most browser. 17 | - `make serve` will use Python3 to spawn a local webserver, you can then browse http://localhost:8000 to access your build. 18 | - Otherwise, generally you will need a local webserver: 19 | - Quoting [https://emscripten.org/docs/getting_started](https://emscripten.org/docs/getting_started/Tutorial.html#generating-html):
20 | _"Unfortunately several browsers (including Chrome, Safari, and Internet Explorer) do not support file:// [XHR](https://emscripten.org/docs/site/glossary.html#term-xhr) requests, and can’t load extra files needed by the HTML (like a .wasm file, or packaged file data as mentioned lower down). For these browsers you’ll need to serve the files using a [local webserver](https://emscripten.org/docs/getting_started/FAQ.html#faq-local-webserver) and then open http://localhost:8000/hello.html."_ 21 | - Emscripten SDK has a handy `emrun` command: `emrun web/example_emscripten_opengl3.html --browser firefox` which will spawn a temporary local webserver (in Firefox). See https://emscripten.org/docs/compiling/Running-html-files-with-emrun.html for details. 22 | - You may use Python 3 builtin webserver: `python -m http.server -d web` (this is what `make serve` uses). 23 | - You may use Python 2 builtin webserver: `cd web && python -m SimpleHTTPServer`. 24 | - If you are accessing the files over a network, certain browsers, such as Firefox, will restrict Gamepad API access to secure contexts only (e.g. https only). 25 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_glfw_opengl2/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # You will need GLFW (http://www.glfw.org): 6 | # Linux: 7 | # apt-get install libglfw-dev 8 | # Mac OS X: 9 | # brew install glfw 10 | # MSYS2: 11 | # pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-glfw 12 | # 13 | 14 | #CXX = g++ 15 | #CXX = clang++ 16 | 17 | EXE = example_glfw_opengl2 18 | IMGUI_DIR = ../.. 19 | SOURCES = main.cpp 20 | 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 21 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glfw.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl2.cpp 22 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 23 | UNAME_S := $(shell uname -s) 24 | 25 | CXXFLAGS = -std=c++11 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 26 | CXXFLAGS += -g -Wall -Wformat 27 | LIBS = 28 | 29 | ##--------------------------------------------------------------------- 30 | ## BUILD FLAGS PER PLATFORM 31 | ##--------------------------------------------------------------------- 32 | 33 | ifeq ($(UNAME_S), Linux) #LINUX 34 | ECHO_MESSAGE = "Linux" 35 | LIBS += -lGL `pkg-config --static --libs glfw3` 36 | 37 | CXXFLAGS += `pkg-config --cflags glfw3` 38 | CFLAGS = $(CXXFLAGS) 39 | endif 40 | 41 | ifeq ($(UNAME_S), Darwin) #APPLE 42 | ECHO_MESSAGE = "Mac OS X" 43 | LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo 44 | LIBS += -L/usr/local/lib -L/opt/local/lib -L/opt/homebrew/lib 45 | #LIBS += -lglfw3 46 | LIBS += -lglfw 47 | 48 | CXXFLAGS += -I/usr/local/include -I/opt/local/include -I/opt/homebrew/include 49 | CFLAGS = $(CXXFLAGS) 50 | endif 51 | 52 | ifeq ($(OS), Windows_NT) 53 | ECHO_MESSAGE = "MinGW" 54 | LIBS += -lglfw3 -lgdi32 -lopengl32 -limm32 55 | 56 | CXXFLAGS += `pkg-config --cflags glfw3` 57 | CFLAGS = $(CXXFLAGS) 58 | endif 59 | 60 | ##--------------------------------------------------------------------- 61 | ## BUILD RULES 62 | ##--------------------------------------------------------------------- 63 | 64 | %.o:%.cpp 65 | $(CXX) $(CXXFLAGS) -c -o $@ $< 66 | 67 | %.o:$(IMGUI_DIR)/%.cpp 68 | $(CXX) $(CXXFLAGS) -c -o $@ $< 69 | 70 | %.o:$(IMGUI_DIR)/backends/%.cpp 71 | $(CXX) $(CXXFLAGS) -c -o $@ $< 72 | 73 | all: $(EXE) 74 | @echo Build complete for $(ECHO_MESSAGE) 75 | 76 | $(EXE): $(OBJS) 77 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 78 | 79 | clean: 80 | rm -f $(EXE) $(OBJS) 81 | 82 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {c336cfe3-f0c4-464c-9ef0-a9e17a7ff222} 6 | 7 | 8 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | imgui 24 | 25 | 26 | imgui 27 | 28 | 29 | imgui 30 | 31 | 32 | sources 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | imgui 59 | 60 | 61 | imgui 62 | 63 | 64 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | imgui 24 | 25 | 26 | imgui 27 | 28 | 29 | imgui 30 | 31 | 32 | sources 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | sources 56 | 57 | 58 | 59 | 60 | 61 | imgui 62 | 63 | 64 | imgui 65 | 66 | 67 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | imgui 24 | 25 | 26 | imgui 27 | 28 | 29 | imgui 30 | 31 | 32 | sources 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | imgui 59 | 60 | 61 | imgui 62 | 63 | 64 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_glut_opengl2/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # Linux: 6 | # apt-get install freeglut3-dev 7 | # 8 | 9 | #CXX = g++ 10 | #CXX = clang++ 11 | 12 | EXE = example_glut_opengl2 13 | IMGUI_DIR = ../.. 14 | SOURCES = main.cpp 15 | 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 16 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glut.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl2.cpp 17 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 18 | UNAME_S := $(shell uname -s) 19 | 20 | CXXFLAGS = -std=c++11 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 21 | CXXFLAGS += -g -Wall -Wformat 22 | LIBS = 23 | 24 | ##--------------------------------------------------------------------- 25 | ## BUILD FLAGS PER PLATFORM 26 | ##--------------------------------------------------------------------- 27 | 28 | ifeq ($(UNAME_S), Linux) #LINUX 29 | ECHO_MESSAGE = "Linux" 30 | LIBS += -lGL -lglut 31 | CFLAGS = $(CXXFLAGS) 32 | endif 33 | 34 | ifeq ($(UNAME_S), Darwin) #APPLE 35 | ECHO_MESSAGE = "Mac OS X" 36 | LIBS += -framework OpenGL -framework GLUT 37 | LIBS += -L/usr/local/lib -L/opt/local/lib 38 | 39 | CXXFLAGS += -I/usr/local/include -I/opt/local/include 40 | CFLAGS = $(CXXFLAGS) 41 | endif 42 | 43 | ifeq ($(OS), Windows_NT) 44 | ECHO_MESSAGE = "MinGW" 45 | LIBS += -lgdi32 -lopengl32 -limm32 46 | ifeq ($(shell pkg-config freeglut --exists 2> /dev/null && echo yes || echo no),yes) 47 | CXXFLAGS += $(shell pkg-config freeglut --cflags) 48 | LIBS += $(shell pkg-config freeglut --libs) 49 | else 50 | LIBS += -lglut 51 | endif 52 | CFLAGS = $(CXXFLAGS) 53 | endif 54 | 55 | ##--------------------------------------------------------------------- 56 | ## BUILD RULES 57 | ##--------------------------------------------------------------------- 58 | 59 | %.o:%.cpp 60 | $(CXX) $(CXXFLAGS) -c -o $@ $< 61 | 62 | %.o:$(IMGUI_DIR)/%.cpp 63 | $(CXX) $(CXXFLAGS) -c -o $@ $< 64 | 65 | %.o:$(IMGUI_DIR)/backends/%.cpp 66 | $(CXX) $(CXXFLAGS) -c -o $@ $< 67 | 68 | all: $(EXE) 69 | @echo Build complete for $(ECHO_MESSAGE) 70 | 71 | $(EXE): $(OBJS) 72 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 73 | 74 | clean: 75 | rm -f $(EXE) $(OBJS) 76 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_glut_opengl2/example_glut_opengl2.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {c336cfe3-f0c4-464c-9ef0-a9e17a7ff222} 6 | 7 | 8 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | imgui 24 | 25 | 26 | imgui 27 | 28 | 29 | imgui 30 | 31 | 32 | sources 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | imgui 59 | 60 | 61 | imgui 62 | 63 | 64 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_sdl2_directx11/example_sdl2_directx11.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {0587d7a3-f2ce-4d56-b84f-a0005d3bfce6} 6 | 7 | 8 | {08e36723-ce4f-4cff-9662-c40801cf1acf} 9 | 10 | 11 | 12 | 13 | imgui 14 | 15 | 16 | imgui 17 | 18 | 19 | imgui 20 | 21 | 22 | sources 23 | 24 | 25 | sources 26 | 27 | 28 | 29 | 30 | imgui 31 | 32 | 33 | sources 34 | 35 | 36 | imgui 37 | 38 | 39 | imgui 40 | 41 | 42 | imgui 43 | 44 | 45 | imgui 46 | 47 | 48 | sources 49 | 50 | 51 | sources 52 | 53 | 54 | 55 | 56 | 57 | imgui 58 | 59 | 60 | imgui 61 | 62 | 63 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_sdl2_opengl2/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # You will need SDL2 (http://www.libsdl.org): 6 | # Linux: 7 | # apt-get install libsdl2-dev 8 | # Mac OS X: 9 | # brew install sdl2 10 | # MSYS2: 11 | # pacman -S mingw-w64-i686-SDL2 12 | # 13 | 14 | #CXX = g++ 15 | #CXX = clang++ 16 | 17 | EXE = example_sdl2_opengl2 18 | IMGUI_DIR = ../.. 19 | SOURCES = main.cpp 20 | 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 21 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_sdl2.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl2.cpp 22 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 23 | UNAME_S := $(shell uname -s) 24 | 25 | CXXFLAGS = -std=c++11 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 26 | CXXFLAGS += -g -Wall -Wformat 27 | LIBS = 28 | 29 | ##--------------------------------------------------------------------- 30 | ## BUILD FLAGS PER PLATFORM 31 | ##--------------------------------------------------------------------- 32 | 33 | ifeq ($(UNAME_S), Linux) #LINUX 34 | ECHO_MESSAGE = "Linux" 35 | LIBS += -lGL -ldl `sdl2-config --libs` 36 | 37 | CXXFLAGS += `sdl2-config --cflags` 38 | CFLAGS = $(CXXFLAGS) 39 | endif 40 | 41 | ifeq ($(UNAME_S), Darwin) #APPLE 42 | ECHO_MESSAGE = "Mac OS X" 43 | LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo `sdl2-config --libs` 44 | LIBS += -L/usr/local/lib -L/opt/local/lib 45 | 46 | CXXFLAGS += `sdl2-config --cflags` 47 | CXXFLAGS += -I/usr/local/include -I/opt/local/include 48 | CFLAGS = $(CXXFLAGS) 49 | endif 50 | 51 | ifeq ($(OS), Windows_NT) 52 | ECHO_MESSAGE = "MinGW" 53 | LIBS += -lgdi32 -lopengl32 -limm32 `pkg-config --static --libs sdl2` 54 | 55 | CXXFLAGS += `pkg-config --cflags sdl2` 56 | CFLAGS = $(CXXFLAGS) 57 | endif 58 | 59 | ##--------------------------------------------------------------------- 60 | ## BUILD RULES 61 | ##--------------------------------------------------------------------- 62 | 63 | %.o:%.cpp 64 | $(CXX) $(CXXFLAGS) -c -o $@ $< 65 | 66 | %.o:$(IMGUI_DIR)/%.cpp 67 | $(CXX) $(CXXFLAGS) -c -o $@ $< 68 | 69 | %.o:$(IMGUI_DIR)/backends/%.cpp 70 | $(CXX) $(CXXFLAGS) -c -o $@ $< 71 | 72 | all: $(EXE) 73 | @echo Build complete for $(ECHO_MESSAGE) 74 | 75 | $(EXE): $(OBJS) 76 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 77 | 78 | clean: 79 | rm -f $(EXE) $(OBJS) 80 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_sdl2_opengl2/example_sdl2_opengl2.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | imgui 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | imgui 27 | 28 | 29 | imgui 30 | 31 | 32 | sources 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | imgui 59 | 60 | 61 | imgui 62 | 63 | 64 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_sdl2_opengl3/example_sdl2_opengl3.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | imgui 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | sources 27 | 28 | 29 | sources 30 | 31 | 32 | imgui 33 | 34 | 35 | imgui 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | sources 56 | 57 | 58 | 59 | 60 | 61 | imgui 62 | 63 | 64 | imgui 65 | 66 | 67 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_sdl2_sdlrenderer2/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # You will need SDL2 (http://www.libsdl.org): 6 | # Linux: 7 | # apt-get install libsdl2-dev 8 | # Mac OS X: 9 | # brew install sdl2 10 | # MSYS2: 11 | # pacman -S mingw-w64-i686-SDL2 12 | # 13 | 14 | #CXX = g++ 15 | #CXX = clang++ 16 | 17 | EXE = example_sdl2_sdlrenderer2 18 | IMGUI_DIR = ../.. 19 | SOURCES = main.cpp 20 | 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 21 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_sdl2.cpp $(IMGUI_DIR)/backends/imgui_impl_sdlrenderer2.cpp 22 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 23 | UNAME_S := $(shell uname -s) 24 | 25 | CXXFLAGS = -std=c++11 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 26 | CXXFLAGS += -g -Wall -Wformat 27 | LIBS = 28 | 29 | ##--------------------------------------------------------------------- 30 | ## BUILD FLAGS PER PLATFORM 31 | ##--------------------------------------------------------------------- 32 | 33 | ifeq ($(UNAME_S), Linux) #LINUX 34 | ECHO_MESSAGE = "Linux" 35 | LIBS += -lGL -ldl `sdl2-config --libs` 36 | 37 | CXXFLAGS += `sdl2-config --cflags` 38 | CFLAGS = $(CXXFLAGS) 39 | endif 40 | 41 | ifeq ($(UNAME_S), Darwin) #APPLE 42 | ECHO_MESSAGE = "Mac OS X" 43 | LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo `sdl2-config --libs` 44 | LIBS += -L/usr/local/lib -L/opt/local/lib 45 | 46 | CXXFLAGS += `sdl2-config --cflags` 47 | CXXFLAGS += -I/usr/local/include -I/opt/local/include 48 | CFLAGS = $(CXXFLAGS) 49 | endif 50 | 51 | ifeq ($(OS), Windows_NT) 52 | ECHO_MESSAGE = "MinGW" 53 | LIBS += -lgdi32 -lopengl32 -limm32 `pkg-config --static --libs sdl2` 54 | 55 | CXXFLAGS += `pkg-config --cflags sdl2` 56 | CFLAGS = $(CXXFLAGS) 57 | endif 58 | 59 | ##--------------------------------------------------------------------- 60 | ## BUILD RULES 61 | ##--------------------------------------------------------------------- 62 | 63 | %.o:%.cpp 64 | $(CXX) $(CXXFLAGS) -c -o $@ $< 65 | 66 | %.o:$(IMGUI_DIR)/%.cpp 67 | $(CXX) $(CXXFLAGS) -c -o $@ $< 68 | 69 | %.o:$(IMGUI_DIR)/backends/%.cpp 70 | $(CXX) $(CXXFLAGS) -c -o $@ $< 71 | 72 | all: $(EXE) 73 | @echo Build complete for $(ECHO_MESSAGE) 74 | 75 | $(EXE): $(OBJS) 76 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 77 | 78 | clean: 79 | rm -f $(EXE) $(OBJS) 80 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_sdl2_sdlrenderer2/example_sdl2_sdlrenderer2.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | imgui 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | imgui 27 | 28 | 29 | imgui 30 | 31 | 32 | sources 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | imgui 59 | 60 | 61 | imgui 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_sdl2_vulkan/example_sdl2_vulkan.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | imgui 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | sources 27 | 28 | 29 | sources 30 | 31 | 32 | imgui 33 | 34 | 35 | imgui 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | imgui 59 | 60 | 61 | imgui 62 | 63 | 64 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_sdl3_opengl3/example_sdl3_opengl3.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | imgui 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | sources 27 | 28 | 29 | sources 30 | 31 | 32 | imgui 33 | 34 | 35 | imgui 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | sources 56 | 57 | 58 | 59 | 60 | 61 | imgui 62 | 63 | 64 | imgui 65 | 66 | 67 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_sdl3_sdlrenderer3/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # You will need SDL3 (http://www.libsdl.org) which is still unreleased/unpackaged. 6 | 7 | #CXX = g++ 8 | #CXX = clang++ 9 | 10 | EXE = example_sdl3_sdlrenderer3 11 | IMGUI_DIR = ../.. 12 | SOURCES = main.cpp 13 | 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 14 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_sdl3.cpp $(IMGUI_DIR)/backends/imgui_impl_sdlrenderer3.cpp 15 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 16 | UNAME_S := $(shell uname -s) 17 | LINUX_GL_LIBS = -lGL 18 | 19 | CXXFLAGS = -std=c++11 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 20 | CXXFLAGS += -g -Wall -Wformat 21 | LIBS = 22 | 23 | ##--------------------------------------------------------------------- 24 | ## BUILD FLAGS PER PLATFORM 25 | ##--------------------------------------------------------------------- 26 | 27 | ifeq ($(UNAME_S), Linux) #LINUX 28 | ECHO_MESSAGE = "Linux" 29 | LIBS += -ldl `sdl3-config --libs` 30 | 31 | CXXFLAGS += `sdl3-config --cflags` 32 | CFLAGS = $(CXXFLAGS) 33 | endif 34 | 35 | ifeq ($(UNAME_S), Darwin) #APPLE 36 | ECHO_MESSAGE = "Mac OS X" 37 | LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo `sdl3-config --libs` 38 | LIBS += -L/usr/local/lib -L/opt/local/lib 39 | 40 | CXXFLAGS += `sdl3-config --cflags` 41 | CXXFLAGS += -I/usr/local/include -I/opt/local/include 42 | CFLAGS = $(CXXFLAGS) 43 | endif 44 | 45 | ifeq ($(OS), Windows_NT) 46 | ECHO_MESSAGE = "MinGW" 47 | LIBS += -lgdi32 -lopengl32 -limm32 `pkg-config --static --libs sdl3` 48 | 49 | CXXFLAGS += `pkg-config --cflags sdl3` 50 | CFLAGS = $(CXXFLAGS) 51 | endif 52 | 53 | ##--------------------------------------------------------------------- 54 | ## BUILD RULES 55 | ##--------------------------------------------------------------------- 56 | 57 | %.o:%.cpp 58 | $(CXX) $(CXXFLAGS) -c -o $@ $< 59 | 60 | %.o:$(IMGUI_DIR)/%.cpp 61 | $(CXX) $(CXXFLAGS) -c -o $@ $< 62 | 63 | %.o:$(IMGUI_DIR)/backends/%.cpp 64 | $(CXX) $(CXXFLAGS) -c -o $@ $< 65 | 66 | all: $(EXE) 67 | @echo Build complete for $(ECHO_MESSAGE) 68 | 69 | $(EXE): $(OBJS) 70 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 71 | 72 | clean: 73 | rm -f $(EXE) $(OBJS) 74 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_sdl3_sdlrenderer3/example_sdl3_sdlrenderer3.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | imgui 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | sources 27 | 28 | 29 | imgui 30 | 31 | 32 | imgui 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | imgui 59 | 60 | 61 | imgui 62 | 63 | 64 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_win32_directx10/example_win32_directx10.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {0587d7a3-f2ce-4d56-b84f-a0005d3bfce6} 6 | 7 | 8 | {08e36723-ce4f-4cff-9662-c40801cf1acf} 9 | 10 | 11 | 12 | 13 | imgui 14 | 15 | 16 | imgui 17 | 18 | 19 | imgui 20 | 21 | 22 | sources 23 | 24 | 25 | sources 26 | 27 | 28 | 29 | 30 | imgui 31 | 32 | 33 | sources 34 | 35 | 36 | imgui 37 | 38 | 39 | imgui 40 | 41 | 42 | sources 43 | 44 | 45 | sources 46 | 47 | 48 | imgui 49 | 50 | 51 | imgui 52 | 53 | 54 | 55 | 56 | 57 | imgui 58 | 59 | 60 | imgui 61 | 62 | 63 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_win32_directx11/example_win32_directx11.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {0587d7a3-f2ce-4d56-b84f-a0005d3bfce6} 6 | 7 | 8 | {08e36723-ce4f-4cff-9662-c40801cf1acf} 9 | 10 | 11 | 12 | 13 | imgui 14 | 15 | 16 | imgui 17 | 18 | 19 | imgui 20 | 21 | 22 | sources 23 | 24 | 25 | sources 26 | 27 | 28 | 29 | 30 | imgui 31 | 32 | 33 | sources 34 | 35 | 36 | imgui 37 | 38 | 39 | imgui 40 | 41 | 42 | imgui 43 | 44 | 45 | sources 46 | 47 | 48 | sources 49 | 50 | 51 | imgui 52 | 53 | 54 | 55 | 56 | 57 | imgui 58 | 59 | 60 | imgui 61 | 62 | 63 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_win32_directx12/example_win32_directx12.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {fb3d294f-51ec-478e-a627-25831c80fefd} 6 | 7 | 8 | {4f33ddea-9910-456d-b868-4267eb3c2b19} 9 | 10 | 11 | 12 | 13 | imgui 14 | 15 | 16 | imgui 17 | 18 | 19 | imgui 20 | 21 | 22 | sources 23 | 24 | 25 | sources 26 | 27 | 28 | 29 | 30 | imgui 31 | 32 | 33 | sources 34 | 35 | 36 | imgui 37 | 38 | 39 | imgui 40 | 41 | 42 | sources 43 | 44 | 45 | sources 46 | 47 | 48 | imgui 49 | 50 | 51 | imgui 52 | 53 | 54 | 55 | 56 | 57 | imgui 58 | 59 | 60 | 61 | 62 | imgui 63 | 64 | 65 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_win32_directx9/example_win32_directx9.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {a82cba23-9de0-45c2-b1e3-2eb1666702de} 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | imgui 24 | 25 | 26 | sources 27 | 28 | 29 | sources 30 | 31 | 32 | imgui 33 | 34 | 35 | imgui 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | imgui 59 | 60 | 61 | imgui 62 | 63 | 64 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/example_win32_opengl3/example_win32_opengl3.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {a82cba23-9de0-45c2-b1e3-2eb1666702de} 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | imgui 24 | 25 | 26 | imgui 27 | 28 | 29 | sources 30 | 31 | 32 | imgui 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | sources 56 | 57 | 58 | 59 | 60 | 61 | sources 62 | 63 | 64 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/libs/emscripten/emscripten_mainloop_stub.h: -------------------------------------------------------------------------------- 1 | // What does this file solves? 2 | // - Since Dear ImGui 1.00 we took pride that most of our examples applications had their entire 3 | // main-loop inside the main() function. That's because: 4 | // - It makes the examples easier to read, keeping the code sequential. 5 | // - It permit the use of local variables, making it easier to try things and perform quick 6 | // changes when someone needs to quickly test something (vs having to structure the example 7 | // in order to pass data around). This is very important because people use those examples 8 | // to craft easy-to-past repro when they want to discuss features or report issues. 9 | // - It conveys at a glance that this is a no-BS framework, it won't take your main loop away from you. 10 | // - It is generally nice and elegant. 11 | // - However, comes Emscripten... it is a wonderful and magical tech but it requires a "main loop" function. 12 | // - Only some of our examples would run on Emscripten. Typically the ones rendering with GL or WGPU ones. 13 | // - I tried to refactor those examples but felt it was problematic that other examples didn't follow the 14 | // same layout. Why would the SDL+GL example be structured one way and the SGL+DX11 be structured differently? 15 | // Especially as we are trying hard to convey that using a Dear ImGui backend in an *existing application* 16 | // should requires only a few dozens lines of code, and this should be consistent and symmetrical for all backends. 17 | // - So the next logical step was to refactor all examples to follow that layout of using a "main loop" function. 18 | // This worked, but it made us lose all the nice things we had... 19 | 20 | // Since only about 3 examples really need to run with Emscripten, here's our solution: 21 | // - Use some weird macros and capturing lambda to turn a loop in main() into a function. 22 | // - Hide all that crap in this file so it doesn't make our examples unusually ugly. 23 | // As a stance and principle of Dear ImGui development we don't use C++ headers and we don't 24 | // want to suggest to the newcomer that we would ever use C++ headers as this would affect 25 | // the initial judgment of many of our target audience. 26 | // - Technique is based on this idea: https://github.com/ocornut/imgui/pull/2492/ 27 | #ifdef __EMSCRIPTEN__ 28 | #include 29 | #include 30 | static std::function MainLoopForEmscriptenP; 31 | static void MainLoopForEmscripten() { MainLoopForEmscriptenP(); } 32 | #define EMSCRIPTEN_MAINLOOP_BEGIN MainLoopForEmscriptenP = [&]() 33 | #define EMSCRIPTEN_MAINLOOP_END ; emscripten_set_main_loop(MainLoopForEmscripten, 0, true) 34 | #else 35 | #define EMSCRIPTEN_MAINLOOP_BEGIN 36 | #define EMSCRIPTEN_MAINLOOP_END 37 | #endif 38 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/libs/emscripten/shell_minimal.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dear ImGui Emscripten example 7 | 30 | 31 | 32 | 33 | 63 | {{{ SCRIPT }}} 64 | 65 | 66 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/libs/glfw/lib-vc2010-32/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Querijn/LeagueModel/0287d6b11fd29b26985f98b49a5999ce981bc532/ext/sokol/ext/imgui/examples/libs/glfw/lib-vc2010-32/glfw3.lib -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/examples/libs/glfw/lib-vc2010-64/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Querijn/LeagueModel/0287d6b11fd29b26985f98b49a5999ce981bc532/ext/sokol/ext/imgui/examples/libs/glfw/lib-vc2010-64/glfw3.lib -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/misc/debuggers/imgui.natvis: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | {{Size={Size} Capacity={Capacity}}} 18 | 19 | 20 | Size 21 | Data 22 | 23 | 24 | 25 | 26 | 27 | {{Size={DataEnd-Data} }} 28 | 29 | 30 | DataEnd-Data 31 | Data 32 | 33 | 34 | 35 | 36 | 37 | {{x={x,g} y={y,g}}} 38 | 39 | 40 | 41 | {{x={x,g} y={y,g} z={z,g} w={w,g}}} 42 | 43 | 44 | 45 | {{Min=({Min.x,g} {Min.y,g}) Max=({Max.x,g} {Max.y,g}) Size=({Max.x-Min.x,g} {Max.y-Min.y,g})}} 46 | 47 | Min 48 | Max 49 | Max.x - Min.x 50 | Max.y - Min.y 51 | 52 | 53 | 54 | 55 | {{Name {Name,s} Active {(Active||WasActive)?1:0,d} Child {(Flags & 0x01000000)?1:0,d} Popup {(Flags & 0x04000000)?1:0,d} Hidden {(Hidden)?1:0,d}} 56 | 57 | 58 | 59 | {{ID {ID,x} Pos=({Pos.x,g} {Pos.y,g}) Size=({Size.x,g} {Size.y,g}) Parent {(ParentNode==0)?0:ParentNode->ID,x} Childs {(ChildNodes[0] != 0)+(ChildNodes[1] != 0)} Windows {Windows.Size} } 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/misc/fonts/Cousine-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Querijn/LeagueModel/0287d6b11fd29b26985f98b49a5999ce981bc532/ext/sokol/ext/imgui/misc/fonts/Cousine-Regular.ttf -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/misc/fonts/DroidSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Querijn/LeagueModel/0287d6b11fd29b26985f98b49a5999ce981bc532/ext/sokol/ext/imgui/misc/fonts/DroidSans.ttf -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/misc/fonts/Karla-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Querijn/LeagueModel/0287d6b11fd29b26985f98b49a5999ce981bc532/ext/sokol/ext/imgui/misc/fonts/Karla-Regular.ttf -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/misc/fonts/ProggyClean.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Querijn/LeagueModel/0287d6b11fd29b26985f98b49a5999ce981bc532/ext/sokol/ext/imgui/misc/fonts/ProggyClean.ttf -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/misc/fonts/ProggyTiny.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Querijn/LeagueModel/0287d6b11fd29b26985f98b49a5999ce981bc532/ext/sokol/ext/imgui/misc/fonts/ProggyTiny.ttf -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/misc/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Querijn/LeagueModel/0287d6b11fd29b26985f98b49a5999ce981bc532/ext/sokol/ext/imgui/misc/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /ext/sokol/ext/imgui/misc/freetype/README.md: -------------------------------------------------------------------------------- 1 | # imgui_freetype 2 | 3 | Build font atlases using FreeType instead of stb_truetype (which is the default font rasterizer). 4 |
by @vuhdo, @mikesart, @ocornut. 5 | 6 | ### Usage 7 | 8 | 1. Get latest FreeType binaries or build yourself (under Windows you may use vcpkg with `vcpkg install freetype --triplet=x64-windows`, `vcpkg integrate install`). 9 | 2. Add imgui_freetype.h/cpp alongside your project files. 10 | 3. Add `#define IMGUI_ENABLE_FREETYPE` in your [imconfig.h](https://github.com/ocornut/imgui/blob/master/imconfig.h) file 11 | 12 | ### About Gamma Correct Blending 13 | 14 | FreeType assumes blending in linear space rather than gamma space. 15 | See FreeType note for [FT_Render_Glyph](https://freetype.org/freetype2/docs/reference/ft2-glyph_retrieval.html#ft_render_glyph). 16 | For correct results you need to be using sRGB and convert to linear space in the pixel shader output. 17 | The default Dear ImGui styles will be impacted by this change (alpha values will need tweaking). 18 | 19 | ### Testbed for toying with settings (for developers) 20 | 21 | See https://gist.github.com/ocornut/b3a9ecf13502fd818799a452969649ad 22 | 23 | ### Known issues 24 | 25 | - Oversampling settings are ignored but also not so much necessary with the higher quality rendering. 26 | 27 | ### Comparison 28 | 29 | Small, thin anti-aliased fonts typically benefit a lot from FreeType's hinting: 30 | ![comparing_font_rasterizers](https://user-images.githubusercontent.com/8225057/107550178-fef87f00-6bd0-11eb-8d09-e2edb2f0ccfc.gif) 31 | 32 | ### Colorful glyphs/emojis 33 | 34 | You can use the `ImGuiFreeTypeBuilderFlags_LoadColor` flag to load certain colorful glyphs. See the 35 | ["Using Colorful Glyphs/Emojis"](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md#using-colorful-glyphsemojis) section of FONTS.md. 36 | 37 | ![colored glyphs](https://user-images.githubusercontent.com/8225057/106171241-9dc4ba80-6191-11eb-8a69-ca1467b206d1.png) 38 | 39 | ### Using OpenType SVG fonts (SVGinOT) 40 | - *SVG in Open Type* is a standard by Adobe and Mozilla for color OpenType and Open Font Format fonts. It allows font creators to embed complete SVG files within a font enabling full color and even animations. 41 | - Popular fonts such as [twemoji](https://github.com/13rac1/twemoji-color-font) and fonts made with [scfbuild](https://github.com/13rac1/scfbuild) is SVGinOT 42 | - Requires: [lunasvg](https://github.com/sammycage/lunasvg) v2.3.2 and above 43 | 1. Add `#define IMGUI_ENABLE_FREETYPE_LUNASVG` in your `imconfig.h`. 44 | 2. Get latest lunasvg binaries or build yourself. Under Windows you may use vcpkg with: `vcpkg install lunasvg --triplet=x64-windows`. 45 | -------------------------------------------------------------------------------- /ext/sokol/ext/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 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/.editorconfig: -------------------------------------------------------------------------------- 1 | root=true 2 | [**] 3 | indent_style=space 4 | indent_size=4 5 | trim_trailing_whitespace=true 6 | insert_final_newline=true 7 | 8 | [*.yml] 9 | indent_size=2 10 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: "Build & Test" 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | windows: 7 | runs-on: windows-latest 8 | steps: 9 | - uses: actions/checkout@v4 10 | - name: test_win 11 | run: | 12 | cd tests 13 | test_win.cmd 14 | shell: cmd 15 | mac: 16 | runs-on: macos-latest 17 | steps: 18 | - uses: actions/checkout@v4 19 | - uses: seanmiddleditch/gha-setup-ninja@master 20 | - name: test_macos 21 | run: | 22 | cd tests 23 | ./test_macos.sh 24 | ios: 25 | runs-on: macos-latest 26 | steps: 27 | - uses: actions/checkout@v4 28 | - name: test_ios 29 | run: | 30 | cd tests 31 | ./test_ios.sh 32 | linux: 33 | runs-on: ubuntu-latest 34 | steps: 35 | - uses: actions/checkout@v4 36 | - uses: seanmiddleditch/gha-setup-ninja@master 37 | - name: prepare 38 | run: | 39 | sudo apt-get update 40 | sudo apt-get install libgl1-mesa-dev libegl1-mesa-dev mesa-common-dev xorg-dev libasound-dev 41 | - name: test_linux 42 | run: | 43 | cd tests 44 | ./test_linux.sh 45 | emscripten: 46 | runs-on: ubuntu-latest 47 | steps: 48 | - uses: actions/checkout@v4 49 | - uses: seanmiddleditch/gha-setup-ninja@master 50 | - name: test_emscripten 51 | run: | 52 | cd tests 53 | ./test_emscripten.sh 54 | android: 55 | runs-on: ubuntu-latest 56 | steps: 57 | - uses: actions/checkout@v4 58 | - uses: seanmiddleditch/gha-setup-ninja@master 59 | - uses: actions/setup-java@v1 60 | with: 61 | java-version: '8' 62 | - name: test_android 63 | run: | 64 | cd tests 65 | ./test_android.sh 66 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | build/ 3 | #>fips 4 | # this area is managed by fips, do not edit 5 | .fips-* 6 | *.pyc 7 | # REMINDER: we can pass `-fparse-all-comments` to the clang ast-dump command line which adds the following node types to the ast-dump.json: FullComment, ParagraphComment, TextComment. This might allow us to preserve comments in the language bindings (might be useful as part of a bigger change to make sokol header comments autodoc and Intellisense-friendly) 4 | 5 | ### Zig 6 | 7 | First make sure that clang and python3 are in the path: 8 | 9 | ``` 10 | > clang --version 11 | > python3 --version 12 | ``` 13 | 14 | ...on Windows I simply install those with scoop: 15 | 16 | ``` 17 | > scoop install llvm 18 | > scoop install python 19 | ``` 20 | 21 | To update the Zig bindings: 22 | 23 | ``` 24 | > cd sokol/bindgen 25 | > git clone https://github.com/floooh/sokol-zig 26 | > git clone https://github.com/floooh/sokol-nim 27 | > git clone https://github.com/floooh/sokol-odin 28 | > git clone https://github.com/floooh/sokol-rust 29 | > python3 gen_all.py 30 | ``` 31 | 32 | Test and run samples: 33 | 34 | ``` 35 | > cd sokol/bindgen/sokol-zig 36 | > zig build run-clear 37 | > zig build run-triangle 38 | > zig build run-cube 39 | ... 40 | ``` 41 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/bindgen/gen_all.py: -------------------------------------------------------------------------------- 1 | import os, gen_nim, gen_zig, gen_odin, gen_rust 2 | 3 | tasks = [ 4 | [ '../sokol_log.h', 'slog_', [] ], 5 | [ '../sokol_gfx.h', 'sg_', [] ], 6 | [ '../sokol_app.h', 'sapp_', [] ], 7 | [ '../sokol_glue.h', 'sapp_sg', ['sg_'] ], 8 | [ '../sokol_time.h', 'stm_', [] ], 9 | [ '../sokol_audio.h', 'saudio_', [] ], 10 | [ '../util/sokol_gl.h', 'sgl_', ['sg_'] ], 11 | [ '../util/sokol_debugtext.h', 'sdtx_', ['sg_'] ], 12 | [ '../util/sokol_shape.h', 'sshape_', ['sg_'] ], 13 | ] 14 | 15 | # Odin 16 | gen_odin.prepare() 17 | for task in tasks: 18 | [c_header_path, main_prefix, dep_prefixes] = task 19 | gen_odin.gen(c_header_path, main_prefix, dep_prefixes) 20 | 21 | # Nim 22 | gen_nim.prepare() 23 | for task in tasks: 24 | [c_header_path, main_prefix, dep_prefixes] = task 25 | gen_nim.gen(c_header_path, main_prefix, dep_prefixes) 26 | 27 | # Zig 28 | gen_zig.prepare() 29 | for task in tasks: 30 | [c_header_path, main_prefix, dep_prefixes] = task 31 | gen_zig.gen(c_header_path, main_prefix, dep_prefixes) 32 | 33 | # Rust 34 | gen_rust.prepare() 35 | for task in tasks: 36 | [c_header_path, main_prefix, dep_prefixes] = task 37 | gen_rust.gen(c_header_path, main_prefix, dep_prefixes) 38 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/bindgen/gen_util.py: -------------------------------------------------------------------------------- 1 | # common utility functions for all bindings generators 2 | import re 3 | 4 | re_1d_array = re.compile("^(?:const )?\w*\s*\*?\[\d*\]$") 5 | re_2d_array = re.compile("^(?:const )?\w*\s*\*?\[\d*\]\[\d*\]$") 6 | 7 | def is_1d_array_type(s): 8 | return re_1d_array.match(s) is not None 9 | 10 | def is_2d_array_type(s): 11 | return re_2d_array.match(s) is not None 12 | 13 | def is_array_type(s): 14 | return is_1d_array_type(s) or is_2d_array_type(s) 15 | 16 | def extract_array_type(s): 17 | return s[:s.index('[')].strip() 18 | 19 | def extract_array_sizes(s): 20 | return s[s.index('['):].replace('[', ' ').replace(']', ' ').split() 21 | 22 | def is_string_ptr(s): 23 | return s == "const char *" 24 | 25 | def is_const_void_ptr(s): 26 | return s == "const void *" 27 | 28 | def is_void_ptr(s): 29 | return s == "void *" 30 | 31 | def is_func_ptr(s): 32 | return '(*)' in s 33 | 34 | def extract_ptr_type(s): 35 | tokens = s.split() 36 | if tokens[0] == 'const': 37 | return tokens[1] 38 | else: 39 | return tokens[0] 40 | 41 | # PREFIX_BLA_BLUB to bla_blub 42 | def as_lower_snake_case(s, prefix): 43 | outp = s.lower() 44 | if outp.startswith(prefix): 45 | outp = outp[len(prefix):] 46 | return outp 47 | 48 | # prefix_bla_blub => blaBlub, PREFIX_BLA_BLUB => blaBlub 49 | def as_lower_camel_case(s, prefix): 50 | outp = s.lower() 51 | if outp.startswith(prefix): 52 | outp = outp[len(prefix):] 53 | parts = outp.split('_') 54 | outp = parts[0] 55 | for part in parts[1:]: 56 | outp += part.capitalize() 57 | return outp 58 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/fips.yml: -------------------------------------------------------------------------------- 1 | exports: 2 | header-dirs: [ ".", "util" ] 3 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/analyze_ios.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | source test_common.sh 3 | build ios_gl_analyze ios_gl_analyze 4 | build ios_metal_analyze ios_metal_analyze 5 | build ios_arc_gl_analyze ios_arc_gl_analyze 6 | build ios_arc_metal_analyze ios_arc_metal_analyze 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/analyze_linux.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | source test_common.sh 4 | 5 | build linux_gl_analyze linux_gl_analyze 6 | build linux_gles3_analyze linux_gles3_analyze 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/analyze_macos.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | source test_common.sh 3 | 4 | build macos_gl_analyze macos_gl_analyze 5 | build macos_metal_analyze macos_metal_analyze 6 | 7 | build macos_arc_gl_analyze macos_arc_gl_analyze 8 | build macos_arc_metal_analyze macos_arc_metal_analyze 9 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/analyze_win.cmd: -------------------------------------------------------------------------------- 1 | cmake --preset win_gl_analyze || exit /b 10 2 | cmake --build --preset win_gl_analyze || exit /b 10 3 | cmake --preset win_d3d11_analyze || exit /b 10 4 | cmake --build --preset win_d3d11_analyze || exit /b 10 5 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(c_sources 2 | sokol_app.c 3 | sokol_glue.c 4 | sokol_gfx.c 5 | sokol_time.c 6 | sokol_args.c 7 | sokol_audio.c 8 | sokol_debugtext.c 9 | sokol_gl.c 10 | sokol_fontstash.c 11 | sokol_imgui.c 12 | sokol_gfx_imgui.c 13 | sokol_shape.c 14 | sokol_nuklear.c 15 | sokol_color.c 16 | sokol_spine.c 17 | sokol_log.c 18 | sokol_main.c) 19 | if (NOT ANDROID) 20 | set(c_sources ${c_sources} sokol_fetch.c) 21 | endif() 22 | 23 | set(cxx_sources 24 | sokol_app.cc 25 | sokol_glue.cc 26 | sokol_gfx.cc 27 | sokol_time.cc 28 | sokol_args.cc 29 | sokol_audio.cc 30 | sokol_debugtext.cc 31 | sokol_gl.cc 32 | sokol_fontstash.cc 33 | sokol_imgui.cc 34 | sokol_gfx_imgui.cc 35 | sokol_shape.cc 36 | sokol_color.cc 37 | sokol_spine.cc 38 | sokol_log.cc 39 | sokol_main.cc) 40 | if (NOT ANDROID) 41 | set(cxx_sources ${cxx_sources} sokol_fetch.cc) 42 | endif() 43 | 44 | if (ANDROID) 45 | add_library(sokol-compiletest-c SHARED ${c_sources}) 46 | else() 47 | add_executable(sokol-compiletest-c ${exe_type} sokol_app.c sokol_glue.c ${c_sources}) 48 | endif() 49 | target_link_libraries(sokol-compiletest-c PUBLIC cimgui nuklear spine) 50 | configure_c(sokol-compiletest-c) 51 | 52 | if (ANDROID) 53 | add_library(sokol-compiletest-cxx SHARED ${cxx_sources}) 54 | else() 55 | add_executable(sokol-compiletest-cxx ${exe_type} ${cxx_sources}) 56 | endif() 57 | target_link_libraries(sokol-compiletest-cxx PUBLIC imgui nuklear spine) 58 | configure_cxx(sokol-compiletest-cxx) 59 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_app.c: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | #include "sokol_app.h" 3 | 4 | void use_app_impl(void) { 5 | sapp_run(&(sapp_desc){0}); 6 | } 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_app.cc: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | #include "sokol_app.h" 3 | 4 | void use_app_impl() { 5 | sapp_run({ }); 6 | } 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_args.c: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | #include "sokol_args.h" 3 | 4 | void use_args_impl(void) { 5 | sargs_setup(&(sargs_desc){0}); 6 | } 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_args.cc: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | #include "sokol_args.h" 3 | 4 | void use_args_impl() { 5 | sargs_setup({}); 6 | } 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_audio.c: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | #include "sokol_audio.h" 3 | 4 | void use_audio_impl(void) { 5 | saudio_setup(&(saudio_desc){0}); 6 | } 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_audio.cc: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | #include "sokol_audio.h" 3 | 4 | void use_audio_impl() { 5 | saudio_setup({}); 6 | } 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_color.c: -------------------------------------------------------------------------------- 1 | #include "sokol_gfx.h" 2 | #define SOKOL_IMPL 3 | #include "sokol_color.h" 4 | 5 | void use_color_impl(void) { 6 | sg_color c = sg_make_color_4b(255, 0, 0, 255); 7 | (void)c; 8 | } 9 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_color.cc: -------------------------------------------------------------------------------- 1 | #include "sokol_gfx.h" 2 | #define SOKOL_IMPL 3 | #include "sokol_color.h" 4 | 5 | void use_color_impl(void) { 6 | sg_color c = sg_make_color(255, 0, 0, 255); 7 | (void)c; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_debugtext.c: -------------------------------------------------------------------------------- 1 | #include "sokol_gfx.h" 2 | #define SOKOL_IMPL 3 | #include "sokol_debugtext.h" 4 | 5 | void use_debugtext_impl(void) { 6 | sdtx_setup(&(sdtx_desc_t){0}); 7 | } 8 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_debugtext.cc: -------------------------------------------------------------------------------- 1 | #include "sokol_gfx.h" 2 | #define SOKOL_IMPL 3 | #include "sokol_debugtext.h" 4 | 5 | void use_debugtext_impl() { 6 | sdtx_setup({}); 7 | } 8 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_fetch.c: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | #include "sokol_fetch.h" 3 | 4 | void use_fetch_impl(void) { 5 | sfetch_setup(&(sfetch_desc_t){0}); 6 | } 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_fetch.cc: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | #include "sokol_fetch.h" 3 | 4 | void use_fetch_impl() { 5 | sfetch_setup({}); 6 | } 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_fontstash.c: -------------------------------------------------------------------------------- 1 | #include "sokol_gfx.h" 2 | #include "sokol_gl.h" 3 | 4 | #define FONTSTASH_IMPLEMENTATION 5 | #if defined(_MSC_VER ) 6 | #pragma warning(disable:4996) // strncpy use in fontstash.h 7 | #endif 8 | #if defined(__GNUC__) || defined(__clang__) 9 | #pragma GCC diagnostic push 10 | #pragma GCC diagnostic ignored "-Wunused-function" 11 | #pragma GCC diagnostic ignored "-Wsign-conversion" 12 | #endif 13 | #include // malloc/free 14 | #include "fontstash.h" 15 | #define SOKOL_IMPL 16 | #include "sokol_fontstash.h" 17 | 18 | void use_fontstash_impl(void) { 19 | FONScontext* ctx = sfons_create(&(sfons_desc_t){ 0 }); 20 | sfons_destroy(ctx); 21 | } 22 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_fontstash.cc: -------------------------------------------------------------------------------- 1 | #include "sokol_gfx.h" 2 | #include "sokol_gl.h" 3 | 4 | #define FONTSTASH_IMPLEMENTATION 5 | #if defined(_MSC_VER ) 6 | #pragma warning(disable:4996) // strncpy use in fontstash.h 7 | #pragma warning(disable:4505) // unreferenced local function has been removed 8 | #pragma warning(disable:4100) // unreferenced formal parameter 9 | #endif 10 | #if defined(__GNUC__) || defined(__clang__) 11 | #pragma GCC diagnostic ignored "-Wunused-function" 12 | #pragma GCC diagnostic ignored "-Wsign-conversion" 13 | #endif 14 | #include // malloc/free 15 | #include "fontstash.h" 16 | #define SOKOL_IMPL 17 | #include "sokol_fontstash.h" 18 | 19 | void use_fontstash_impl() { 20 | const sfons_desc_t desc = { }; 21 | FONScontext* ctx = sfons_create(&desc); 22 | sfons_destroy(ctx); 23 | } 24 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_gfx.c: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | #include "sokol_gfx.h" 3 | 4 | void use_gfx_impl(void) { 5 | sg_setup(&(sg_desc){0}); 6 | } 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_gfx.cc: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | #include "sokol_gfx.h" 3 | 4 | void use_gfx_impl() { 5 | sg_setup({}); 6 | } 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_gfx_imgui.c: -------------------------------------------------------------------------------- 1 | #include "sokol_app.h" 2 | #include "sokol_gfx.h" 3 | #define CIMGUI_DEFINE_ENUMS_AND_STRUCTS 4 | #if defined(_MSC_VER ) 5 | #pragma warning(disable:4201) // nonstandard extension used: nameless struct/union 6 | #pragma warning(disable:4214) // nonstandard extension used: bit field types other than int 7 | #endif 8 | #include "cimgui/cimgui.h" 9 | #include "sokol_imgui.h" 10 | #define SOKOL_IMPL 11 | #include "sokol_gfx_imgui.h" 12 | 13 | void use_gfx_imgui_impl(void) { 14 | sg_imgui_t ctx = {0}; 15 | sg_imgui_init(&ctx, &(sg_imgui_desc_t){0}); 16 | sg_imgui_discard(&ctx); 17 | } 18 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_gfx_imgui.cc: -------------------------------------------------------------------------------- 1 | #include "sokol_app.h" 2 | #include "sokol_gfx.h" 3 | #include "imgui.h" 4 | #include "sokol_imgui.h" 5 | #define SOKOL_IMPL 6 | #include "sokol_gfx_imgui.h" 7 | 8 | void use_gfx_imgui_impl() { 9 | sg_imgui_t ctx = {}; 10 | sg_imgui_init(&ctx, { }); 11 | sg_imgui_discard(&ctx); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_gl.c: -------------------------------------------------------------------------------- 1 | #include "sokol_gfx.h" 2 | #define SOKOL_IMPL 3 | #include "sokol_gl.h" 4 | 5 | void use_gl_impl(void) { 6 | sgl_setup(&(sgl_desc_t){0}); 7 | } 8 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_gl.cc: -------------------------------------------------------------------------------- 1 | #include "sokol_gfx.h" 2 | #define SOKOL_IMPL 3 | #include "sokol_gl.h" 4 | 5 | void use_gl_impl() { 6 | sgl_setup({}); 7 | } 8 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_glue.c: -------------------------------------------------------------------------------- 1 | #include "sokol_app.h" 2 | #include "sokol_gfx.h" 3 | #define SOKOL_IMPL 4 | #include "sokol_glue.h" 5 | 6 | void use_glue_impl(void) { 7 | const sg_context_desc ctx = sapp_sgcontext(); 8 | (void)ctx; 9 | } 10 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_glue.cc: -------------------------------------------------------------------------------- 1 | #include "sokol_app.h" 2 | #include "sokol_gfx.h" 3 | #define SOKOL_IMPL 4 | #include "sokol_glue.h" 5 | 6 | void use_glue_impl() { 7 | const sg_context_desc ctx = sapp_sgcontext(); 8 | (void)ctx; 9 | } 10 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_imgui.c: -------------------------------------------------------------------------------- 1 | #include "sokol_app.h" 2 | #include "sokol_gfx.h" 3 | #define CIMGUI_DEFINE_ENUMS_AND_STRUCTS 4 | #if defined(_MSC_VER ) 5 | #pragma warning(disable:4201) // nonstandard extension used: nameless struct/union 6 | #pragma warning(disable:4214) // nonstandard extension used: bit field types other than int 7 | #endif 8 | #include "cimgui/cimgui.h" 9 | #define SOKOL_IMPL 10 | #if defined(SOKOL_DUMMY_BACKEND) 11 | #define SOKOL_IMGUI_NO_SOKOL_APP 12 | #endif 13 | #include "sokol_imgui.h" 14 | 15 | void use_imgui_impl(void) { 16 | simgui_setup(&(simgui_desc_t){0}); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_imgui.cc: -------------------------------------------------------------------------------- 1 | #include "sokol_app.h" 2 | #include "sokol_gfx.h" 3 | #include "imgui.h" 4 | #define SOKOL_IMPL 5 | #if defined(SOKOL_DUMMY_BACKEND) 6 | #define SOKOL_IMGUI_NO_SOKOL_APP 7 | #endif 8 | #include "sokol_imgui.h" 9 | 10 | void use_imgui_impl() { 11 | simgui_setup({}); 12 | } 13 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_log.c: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | #include "sokol_log.h" 3 | 4 | void use_sokol_log(void) { 5 | slog_func("bla", 1, 123, "123", 42, "bla.c", 0); 6 | } 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_log.cc: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | #include "sokol_log.h" 3 | 4 | void use_sokol_log(void) { 5 | slog_func("bla", 1, 123, "123", 42, "bla.c", 0); 6 | } 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_main.c: -------------------------------------------------------------------------------- 1 | #include "sokol_app.h" 2 | 3 | #if defined(SOKOL_DUMMY_BACKEND) 4 | int main() { 5 | return 0; 6 | } 7 | #else 8 | sapp_desc sokol_main(int argc, char* argv[]) { 9 | (void)argc; 10 | (void)argv; 11 | return (sapp_desc){0}; 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_main.cc: -------------------------------------------------------------------------------- 1 | #include "sokol_app.h" 2 | 3 | sapp_desc sokol_main(int argc, char* argv[]) { 4 | (void)argc; 5 | (void)argv; 6 | return { }; 7 | } 8 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_nuklear.c: -------------------------------------------------------------------------------- 1 | #include "sokol_app.h" 2 | #include "sokol_gfx.h" 3 | 4 | // include nuklear.h before the sokol_nuklear.h implementation 5 | #define NK_INCLUDE_FIXED_TYPES 6 | #define NK_INCLUDE_STANDARD_IO 7 | #define NK_INCLUDE_DEFAULT_ALLOCATOR 8 | #define NK_INCLUDE_VERTEX_BUFFER_OUTPUT 9 | #define NK_INCLUDE_FONT_BAKING 10 | #define NK_INCLUDE_DEFAULT_FONT 11 | #define NK_INCLUDE_STANDARD_VARARGS 12 | #include "nuklear.h" 13 | 14 | #define SOKOL_IMPL 15 | #if defined(SOKOL_DUMMY_BACKEND) 16 | #define SOKOL_NUKLEAR_NO_SOKOL_APP 17 | #endif 18 | #include "sokol_nuklear.h" 19 | 20 | void use_nuklear_impl(void) { 21 | snk_setup(&(snk_desc_t){0}); 22 | } 23 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_shape.c: -------------------------------------------------------------------------------- 1 | #include "sokol_gfx.h" 2 | #define SOKOL_IMPL 3 | #include "sokol_shape.h" 4 | 5 | void use_shape_impl(void) { 6 | sshape_plane_sizes(10); 7 | } 8 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_shape.cc: -------------------------------------------------------------------------------- 1 | #include "sokol_gfx.h" 2 | #define SOKOL_IMPL 3 | #include "sokol_shape.h" 4 | 5 | void use_shape_impl() { 6 | sshape_plane_sizes(10); 7 | } 8 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_spine.c: -------------------------------------------------------------------------------- 1 | #include "sokol_gfx.h" 2 | #define SOKOL_IMPL 3 | #include "spine/spine.h" 4 | #include "sokol_spine.h" 5 | 6 | void use_sspine_impl(void) { 7 | sspine_setup(&(sspine_desc){0}); 8 | } 9 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_spine.cc: -------------------------------------------------------------------------------- 1 | #include "sokol_gfx.h" 2 | #define SOKOL_IMPL 3 | #include "spine/spine.h" 4 | #include "sokol_spine.h" 5 | 6 | void use_sspine_impl(void) { 7 | const sspine_desc desc = {}; 8 | sspine_setup(&desc); 9 | } 10 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_time.c: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | #include "sokol_time.h" 3 | 4 | void use_time_impl(void) { 5 | stm_setup(); 6 | } 7 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/compile/sokol_time.cc: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | #include "sokol_time.h" 3 | 4 | void use_time_impl() { 5 | stm_setup(); 6 | } 7 | 8 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/ext/nuklear.c: -------------------------------------------------------------------------------- 1 | // include nuklear.h before the sokol_nuklear.h implementation 2 | #define NK_INCLUDE_FIXED_TYPES 3 | #define NK_INCLUDE_STANDARD_IO 4 | #define NK_INCLUDE_DEFAULT_ALLOCATOR 5 | #define NK_INCLUDE_VERTEX_BUFFER_OUTPUT 6 | #define NK_INCLUDE_FONT_BAKING 7 | #define NK_INCLUDE_DEFAULT_FONT 8 | #define NK_INCLUDE_STANDARD_VARARGS 9 | #define NK_IMPLEMENTATION 10 | 11 | #if defined(__clang__) 12 | #pragma GCC diagnostic ignored "-Wunknown-warning-option" 13 | #pragma GCC diagnostic ignored "-Wunused-parameter" 14 | #pragma GCC diagnostic ignored "-Wsign-conversion" 15 | #pragma GCC diagnostic ignored "-Wnull-pointer-subtraction" 16 | #pragma GCC diagnostic ignored "-Wunused-but-set-variable" 17 | #endif 18 | #if defined(__GNUC__) && !defined(__clang__) 19 | #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" 20 | #pragma GCC diagnostic ignored "-Wsign-conversion" 21 | #pragma GCC diagnostic ignored "-Wunused-parameter" 22 | #endif 23 | #if defined(_MSC_VER) 24 | #pragma warning(push) 25 | #pragma warning(disable:4996) // sprintf,fopen,localtime: This function or variable may be unsafe 26 | #pragma warning(disable:4127) // conditional expression is constant 27 | #pragma warning(disable:4100) // unreferenced formal parameter 28 | #pragma warning(disable:4701) // potentially uninitialized local variable used 29 | #endif 30 | #include "nuklear.h" 31 | #if defined(_MSC_VER) 32 | #pragma warning(pop) 33 | #endif 34 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/functional/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT ANDROID) 2 | 3 | file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/assets/comsi.s3m DESTINATION ${CMAKE_BINARY_DIR}) 4 | file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/assets/comsi.s3m DESTINATION ${CMAKE_BINARY_DIR}/Debug) 5 | 6 | set(c_sources 7 | sokol_args_test.c 8 | sokol_audio_test.c 9 | sokol_debugtext_test.c 10 | sokol_fetch_test.c 11 | sokol_gfx_test.c 12 | sokol_gl_test.c 13 | sokol_shape_test.c 14 | sokol_color_test.c 15 | sokol_spine_test.c 16 | sokol_test.c 17 | ) 18 | add_executable(sokol-test ${c_sources}) 19 | target_link_libraries(sokol-test PUBLIC spine) 20 | configure_c(sokol-test) 21 | 22 | endif() 23 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/functional/README.txt: -------------------------------------------------------------------------------- 1 | Test the public API behaviour with dummy backends. 2 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/functional/assets/comsi.s3m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Querijn/LeagueModel/0287d6b11fd29b26985f98b49a5999ce981bc532/ext/sokol/ext/sokol/tests/functional/assets/comsi.s3m -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/functional/assets/readme.txt: -------------------------------------------------------------------------------- 1 | Spine examples taken from: 2 | 3 | https://github.com/EsotericSoftware/spine-runtimes/tree/4.1/examples 4 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/functional/force_dummy_backend.h: -------------------------------------------------------------------------------- 1 | #if defined(SOKOL_GLES3) 2 | #undef SOKOL_GLES3 3 | #endif 4 | #if defined(SOKOL_GLCORE33) 5 | #undef SOKOL_GLCORE33 6 | #endif 7 | #if defined(SOKOL_METAL) 8 | #undef SOKOL_METAL 9 | #endif 10 | #if defined(SOKOL_D3D11) 11 | #undef SOKOL_D3D11 12 | #endif 13 | #if defined(SOKOL_WGPU) 14 | #undef SOKOL_WGPU 15 | #endif 16 | #ifndef SOKOL_DUMMY_BACKEND 17 | #define SOKOL_DUMMY_BACKEND 18 | #endif 19 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/functional/sokol_color_test.c: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // sokol_color_test.c 3 | //------------------------------------------------------------------------------ 4 | #include "sokol_gfx.h" 5 | #define SOKOL_COLOR_IMPL 6 | #include "sokol_color.h" 7 | #include "utest.h" 8 | #include 9 | 10 | #define T(b) EXPECT_TRUE(b) 11 | #define TFLT(f0,f1,epsilon) {T(fabs((f0)-(f1))<=(epsilon));} 12 | 13 | UTEST(sokol_color, make_color) { 14 | const sg_color c0 = sg_make_color_4b(255, 127, 0, 255); 15 | TFLT(c0.r, 1.0f, 0.01f); 16 | TFLT(c0.g, 0.5f, 0.01f); 17 | TFLT(c0.b, 0.0f, 0.01f); 18 | TFLT(c0.a, 1.0f, 0.01f); 19 | const sg_color c1 = sg_make_color_1i(SG_BLACK_RGBA32); 20 | TFLT(c1.r, 0.0f, 0.01f); 21 | TFLT(c1.g, 0.0f, 0.01f); 22 | TFLT(c1.b, 0.0f, 0.01f); 23 | TFLT(c1.a, 1.0f, 0.01f); 24 | const sg_color c2 = sg_make_color_1i(SG_GREEN_RGBA32); 25 | TFLT(c2.r, 0.0f, 0.01f); 26 | TFLT(c2.g, 1.0f, 0.01f); 27 | TFLT(c2.b, 0.0f, 0.01f); 28 | TFLT(c2.a, 1.0f, 0.01f); 29 | const sg_color c3 = sg_make_color_1i(SG_RED_RGBA32); 30 | TFLT(c3.r, 1.0f, 0.01f); 31 | TFLT(c3.g, 0.0f, 0.01f); 32 | TFLT(c3.b, 0.0f, 0.01f); 33 | TFLT(c3.a, 1.0f, 0.01f); 34 | const sg_color c4 = sg_make_color_1i(SG_BLUE_RGBA32); 35 | TFLT(c4.r, 0.0f, 0.01f); 36 | TFLT(c4.g, 0.0f, 0.01f); 37 | TFLT(c4.b, 1.0f, 0.01f); 38 | TFLT(c4.a, 1.0f, 0.01f); 39 | } 40 | 41 | UTEST(sokol_color, lerp) { 42 | const sg_color c0 = sg_color_lerp(&sg_red, &sg_green, 0.5f); 43 | TFLT(c0.r, 0.5f, 0.001f); 44 | TFLT(c0.g, 0.5f, 0.001f); 45 | TFLT(c0.b, 0.0f, 0.001f); 46 | TFLT(c0.a, 1.0f, 0.001f); 47 | const sg_color c1 = sg_color_lerp_precise(&sg_red, &sg_green, 0.5f); 48 | TFLT(c1.r, 0.5f, 0.001f); 49 | TFLT(c1.g, 0.5f, 0.001f); 50 | TFLT(c1.b, 0.0f, 0.001f); 51 | TFLT(c1.a, 1.0f, 0.001f); 52 | } 53 | 54 | UTEST(sokol_color, multiply) { 55 | const sg_color c0 = sg_color_multiply(&sg_red, 0.5f); 56 | TFLT(c0.r, 0.5f, 0.001f); 57 | TFLT(c0.g, 0.0f, 0.001f); 58 | TFLT(c0.b, 0.0f, 0.001f); 59 | TFLT(c0.a, 0.5f, 0.001f); 60 | const sg_color c1 = sg_color_multiply(&sg_green, 0.5f); 61 | TFLT(c1.r, 0.0f, 0.001f); 62 | TFLT(c1.g, 0.5f, 0.001f); 63 | TFLT(c1.b, 0.0f, 0.001f); 64 | TFLT(c1.a, 0.5f, 0.001f); 65 | const sg_color c2 = sg_color_multiply(&sg_blue, 0.5f); 66 | TFLT(c2.r, 0.0f, 0.001f); 67 | TFLT(c2.g, 0.0f, 0.001f); 68 | TFLT(c2.b, 0.5f, 0.001f); 69 | TFLT(c2.a, 0.5f, 0.001f); 70 | } 71 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/functional/sokol_test.c: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // sokol-test.c 3 | // Sokol headers main test source. 4 | //------------------------------------------------------------------------------ 5 | #include "utest.h" 6 | 7 | UTEST_MAIN(); 8 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/test_android.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | source test_common.sh 4 | setup_android 5 | build android_debug android_debug 6 | build android_release android_release 7 | build android_sles_debug android_sles_debug 8 | build android_sles_release android_sles_release 9 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/test_common.sh: -------------------------------------------------------------------------------- 1 | setup_emsdk() { 2 | if [ ! -d "build/emsdk" ] ; then 3 | mkdir -p build && cd build 4 | git clone https://github.com/emscripten-core/emsdk.git 5 | cd emsdk 6 | ./emsdk install latest 7 | ./emsdk activate latest 8 | cd ../.. 9 | fi 10 | source build/emsdk/emsdk_env.sh 11 | } 12 | 13 | setup_android() { 14 | if [ ! -d "build/android_sdk" ] ; then 15 | mkdir -p build/android_sdk && cd build/android_sdk 16 | sdk_file="sdk-tools-linux-3859397.zip" 17 | wget --no-verbose https://dl.google.com/android/repository/$sdk_file 18 | unzip -q $sdk_file 19 | cd tools/bin 20 | yes | ./sdkmanager "platforms;android-28" >/dev/null 21 | yes | ./sdkmanager "build-tools;29.0.3" >/dev/null 22 | yes | ./sdkmanager "platform-tools" >/dev/null 23 | yes | ./sdkmanager "ndk-bundle" >/dev/null 24 | cd ../../../.. 25 | fi 26 | } 27 | 28 | build() { 29 | gen_preset=$1 30 | build_preset=$2 31 | cmake --preset $gen_preset 32 | cmake --build --preset $build_preset 33 | } 34 | 35 | analyze() { 36 | cfg=$1 37 | backend=$2 38 | mode=$3 39 | mkdir -p build/$cfg && cd build/$cfg 40 | cmake -GNinja -DSOKOL_BACKEND=$backend -DCMAKE_BUILD_TYPE=$mode -DUSE_ANALYZER=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../.. 41 | cmake --build . 42 | cd ../.. 43 | } 44 | 45 | runtest() { 46 | cfg=$1 47 | cd build/$cfg 48 | ./sokol-test 49 | cd ../../.. 50 | } 51 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/test_emscripten.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | source test_common.sh 4 | setup_emsdk 5 | build emsc_webgl2_debug emsc_webgl2_debug 6 | build emsc_webgl2_release emsc_webgl2_release 7 | build emsc_wgpu_debug emsc_wgpu_debug 8 | build emsc_wgpu_release emsc_wgpu_release 9 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/test_ios.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | source test_common.sh 3 | build ios_gl ios_gl_debug 4 | build ios_gl ios_gl_release 5 | build ios_metal ios_metal_debug 6 | build ios_metal ios_metal_release 7 | build ios_arc_gl ios_arc_gl_debug 8 | build ios_arc_gl ios_arc_gl_release 9 | build ios_arc_metal ios_arc_metal_debug 10 | build ios_arc_metal ios_arc_metal_release 11 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/test_linux.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | source test_common.sh 4 | build linux_gl_debug linux_gl_debug 5 | build linux_gl_release linux_gl_release 6 | build linux_gles3_debug linux_gles3_debug 7 | build linux_gles3_release linux_gles3_release 8 | build linux_gl_egl_debug linux_gl_egl_debug 9 | build linux_gl_egl_release linux_gl_egl_release 10 | runtest linux_gl_debug 11 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/test_macos.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | source test_common.sh 3 | build macos_gl_debug macos_gl_debug 4 | build macos_gl_release macos_gl_release 5 | build macos_metal_debug macos_metal_debug 6 | build macos_metal_release macos_metal_release 7 | build macos_arc_gl_debug macos_arc_gl_debug 8 | build macos_arc_gl_release macos_arc_gl_release 9 | build macos_arc_metal_debug macos_arc_metal_debug 10 | build macos_arc_metal_release macos_arc_metal_release 11 | runtest macos_gl_debug 12 | -------------------------------------------------------------------------------- /ext/sokol/ext/sokol/tests/test_win.cmd: -------------------------------------------------------------------------------- 1 | cmake --preset win_gl || exit /b 10 2 | cmake --build --preset win_gl_debug || exit /b 10 3 | cmake --build --preset win_gl_release || exit /b 10 4 | 5 | cmake --preset win_d3d11 || exit /b 10 6 | cmake --build --preset win_d3d11_debug || exit /b 10 7 | cmake --build --preset win_d3d11_release || exit /b 10 8 | 9 | cd build\win_d3d11\Debug 10 | sokol-test.exe || exit /b 10 11 | cd ..\..\.. 12 | -------------------------------------------------------------------------------- /ext/sokol/inc/sokol_wrapper.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sokol_app.h" 4 | #include "sokol_gfx.h" 5 | #include "sokol_audio.h" 6 | #include "sokol_glue.h" 7 | #include "sokol_log.h" 8 | 9 | #if SOKOL_IMGUI 10 | #include "imgui.h" 11 | #include "sokol_imgui.h" 12 | #endif 13 | -------------------------------------------------------------------------------- /ext/sokol/src/main.cpp: -------------------------------------------------------------------------------- 1 | #define SOKOL_IMPL 2 | 3 | #if SOKOL_IMGUI 4 | #define SOKOL_IMGUI_IMPL 5 | #endif 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /ext/sokol/tools/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | *.pyc 3 | -------------------------------------------------------------------------------- /ext/sokol/tools/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Andre Weissflog 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 | -------------------------------------------------------------------------------- /ext/sokol/tools/README.md: -------------------------------------------------------------------------------- 1 | # sokol-tools-bin 2 | Binaries and fips integration for https://github.com/floooh/sokol-tools 3 | -------------------------------------------------------------------------------- /ext/sokol/tools/bin/linux/readme.txt: -------------------------------------------------------------------------------- 1 | Precompiled binaries for Linux go here (64-bit statically linked). 2 | 3 | -------------------------------------------------------------------------------- /ext/sokol/tools/bin/linux/sokol-shdc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Querijn/LeagueModel/0287d6b11fd29b26985f98b49a5999ce981bc532/ext/sokol/tools/bin/linux/sokol-shdc -------------------------------------------------------------------------------- /ext/sokol/tools/bin/osx/readme.txt: -------------------------------------------------------------------------------- 1 | Precompiled binaries for macOS go here. 2 | 3 | -------------------------------------------------------------------------------- /ext/sokol/tools/bin/osx/sokol-shdc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Querijn/LeagueModel/0287d6b11fd29b26985f98b49a5999ce981bc532/ext/sokol/tools/bin/osx/sokol-shdc -------------------------------------------------------------------------------- /ext/sokol/tools/bin/osx_arm64/sokol-shdc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Querijn/LeagueModel/0287d6b11fd29b26985f98b49a5999ce981bc532/ext/sokol/tools/bin/osx_arm64/sokol-shdc -------------------------------------------------------------------------------- /ext/sokol/tools/bin/win32/readme.txt: -------------------------------------------------------------------------------- 1 | Precompiled binaries for Windows (64-bit) go here. 2 | 3 | -------------------------------------------------------------------------------- /ext/sokol/tools/bin/win32/sokol-shdc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Querijn/LeagueModel/0287d6b11fd29b26985f98b49a5999ce981bc532/ext/sokol/tools/bin/win32/sokol-shdc.exe -------------------------------------------------------------------------------- /ext/sokol/tools/fips-files/generators/SokolShader.py: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------- 2 | # SokolShader.py 3 | # 4 | # Fips code-generator script for invoking sokol-shdc during the build. 5 | # 6 | # Use the cmake macro 'sokol_shader([glsl-file] [shader-dialects])' inside a 7 | # fips target (fips_begin_* / fips_end_*) to hook the code-generation 8 | # build job into the build process. 9 | #------------------------------------------------------------------------------- 10 | 11 | Version = 5 12 | 13 | import os, platform, subprocess 14 | import genutil as util 15 | from mod import log 16 | 17 | #------------------------------------------------------------------------------- 18 | def find_shdc(): 19 | shdc_path = os.path.dirname(os.path.abspath(__file__)) 20 | shdc_path += '/../../bin/' 21 | if platform.system() == 'Windows': 22 | shdc_path += 'win32/' 23 | elif platform.system() == 'Darwin': 24 | if platform.machine() == 'arm64': 25 | shdc_path += 'osx_arm64/' 26 | else: 27 | shdc_path += 'osx/' 28 | elif platform.system() == 'Linux': 29 | if os.uname()[1] == 'raspberrypi': 30 | shdc_path += 'raspi/' 31 | else: 32 | shdc_path += 'linux/' 33 | else: 34 | log.error('Unknown host system {}'.format(platform.system())) 35 | return shdc_path + 'sokol-shdc' 36 | 37 | #------------------------------------------------------------------------------- 38 | def generate(input, out_src, out_hdr, args): 39 | errfmt = 'msvc' if args['compiler']=='MSVC' else 'gcc' 40 | if util.isDirty(Version, [input], [out_hdr]): 41 | print('## sokol-shdc: {} {} {}'.format(input, out_hdr, str(args))) 42 | cmd = [find_shdc(), 43 | '--input', input, 44 | '--output', out_hdr, 45 | '--slang', args['slang'], 46 | '--genver', str(Version), 47 | '--errfmt', errfmt, 48 | '--format', 'sokol', 49 | '--bytecode'] 50 | if 'defines' in args: 51 | cmd.extend(['--defines', args['defines']]) 52 | if 'module' in args: 53 | cmd.extend(['--module', args['module']]) 54 | if 'reflection' in args: 55 | if args['reflection']: 56 | cmd.extend(['--reflection']) 57 | res = subprocess.call(cmd) 58 | if res != 0: 59 | log.error('sokol-shdc returned with error code {}'.format(res)) 60 | -------------------------------------------------------------------------------- /ext/sokol/tools/fips-files/include.cmake: -------------------------------------------------------------------------------- 1 | macro(sokol_shader shd slang) 2 | set(args "{slang: '${slang}', compiler: '${CMAKE_C_COMPILER_ID}' }") 3 | fips_generate(TYPE SokolShader FROM ${shd} HEADER ${shd}.h OUT_OF_SOURCE ARGS ${args}) 4 | endmacro() 5 | 6 | macro(sokol_shader_variant shd slang module defines) 7 | set(args "{slang: '${slang}', compiler: '${CMAKE_C_COMPILER_ID}', defines: '${defines}', module: '${module}' }") 8 | fips_generate(TYPE SokolShader FROM ${shd} HEADER ${shd}.${module}.h OUT_OF_SOURCE ARGS ${args}) 9 | endmacro() 10 | 11 | macro(sokol_shader_with_reflection shd slang) 12 | set(args "{slang: '${slang}', compiler: '${CMAKE_C_COMPILER_ID}', reflection: true }") 13 | fips_generate(TYPE SokolShader FROM ${shd} HEADER ${shd}.h OUT_OF_SOURCE ARGS ${args}) 14 | endmacro() 15 | 16 | macro(sokol_shader_variant_with_reflection shd slang module defines) 17 | set(args "{slang: '${slang}', compiler: '${CMAKE_C_COMPILER_ID}', defines: '${defines}', module: '${module}', reflection: true }") 18 | fips_generate(TYPE SokolShader FROM ${shd} HEADER ${shd}.${module}.h OUT_OF_SOURCE ARGS ${args}) 19 | endmacro() 20 | -------------------------------------------------------------------------------- /src/animation.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "types.hpp" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #define GLM_ENABLE_EXPERIMENTAL 10 | #include 11 | #include 12 | 13 | namespace LeagueModel 14 | { 15 | struct Animation 16 | { 17 | struct Bone 18 | { 19 | template 20 | struct Frame 21 | { 22 | Frame(float inTime = 0, T inFrameData = T()) : 23 | time(inTime), frameData(inFrameData) 24 | { 25 | } 26 | 27 | float time; 28 | T frameData; 29 | }; 30 | using TranslationFrame = Frame; 31 | using RotationFrame = Frame; 32 | using ScaleFrame = Frame; 33 | 34 | u32 hash = 0; 35 | 36 | std::vector translation; 37 | std::vector rotation; 38 | std::vector scale; 39 | }; 40 | 41 | using OnLoadFunction = std::function; 42 | void Load(const std::string& inFilePath, OnLoadFunction inOnLoadFunction = nullptr); 43 | const Bone* GetBone(u32 hash) const; 44 | 45 | Spek::File::LoadState loadState = Spek::File::LoadState::NotLoaded; 46 | float fps, duration; 47 | std::vector bones; 48 | std::string name; 49 | 50 | private: 51 | Spek::File::Handle file; 52 | Spek::File::LoadState LoadVersion1(Spek::File::Handle inFile, size_t& inOffset); 53 | Spek::File::LoadState LoadVersion3(Spek::File::Handle inFile, size_t& inOffset); 54 | Spek::File::LoadState LoadVersion4(Spek::File::Handle inFile, size_t& inOffset); 55 | Spek::File::LoadState LoadVersion5(Spek::File::Handle inFile, size_t& inOffset); 56 | }; 57 | } -------------------------------------------------------------------------------- /src/animation_graph.cpp: -------------------------------------------------------------------------------- 1 | #include "animation_graph.hpp" 2 | #include "animation.hpp" 3 | 4 | namespace LeagueModel 5 | { 6 | using namespace Spek; 7 | 8 | AnimationClipBaseData* AnimationGraph::GetClip(u32 inHash) const 9 | { 10 | auto index = clips.find(inHash); 11 | if (index == clips.end()) 12 | return nullptr; 13 | 14 | return index->second.get(); 15 | } 16 | 17 | void AnimationGraph::AddBlendData(const Clip& inFromClip, const Clip& inToClip, f32 inTime, Clip* inBlendClip) 18 | { 19 | blendData[{ &inFromClip, & inToClip }] = { inTime, inBlendClip }; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/animation_graph.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "league_lib/util/enum_bitfield.hpp" 4 | #include "animation_flags.hpp" 5 | #include "character_animation.hpp" 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #define GLM_ENABLE_EXPERIMENTAL 13 | #include 14 | #include 15 | 16 | namespace LeagueModel 17 | { 18 | class Skeleton; 19 | 20 | struct BlendData 21 | { 22 | f32 time; 23 | AnimationClipBaseData* clip; 24 | }; 25 | 26 | class AnimationGraph 27 | { 28 | public: 29 | class Track {}; 30 | 31 | using Clip = AnimationClipBaseData; 32 | using ClipRefPair = std::pair; 33 | 34 | std::map> clips; 35 | std::map blendData; 36 | 37 | Clip* GetClip(u32 inHash) const; 38 | void AddBlendData(const Clip& inFromClip, const Clip& inToClip, f32 inTime, Clip* inBlendClip); 39 | }; 40 | } -------------------------------------------------------------------------------- /src/character.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "skin.hpp" 4 | #include "skeleton.hpp" 5 | #include "animation.hpp" 6 | #include "animation_graph.hpp" 7 | #include "character_animation.hpp" 8 | 9 | #include 10 | #include 11 | 12 | struct AnimatedMeshParametersVS_t; 13 | 14 | namespace LeagueModel 15 | { 16 | struct ManagedImage; 17 | 18 | enum CharacterLoadState : u64 19 | { 20 | NotLoaded = 0b000000000000, 21 | InitFailed = 0b000000000001, 22 | InfoLoadCompleted = 0b000000000010, 23 | MeshGenCompleted = 0b000000000100, 24 | CallbackCompleted = 0b000000001000, 25 | SkinLoaded = 0b000000010000, 26 | GraphLoaded = 0b000000100000, 27 | SkeletonLoaded = 0b000001000000, 28 | SkeletonApplied = 0b000010000000, 29 | MaterialApplied = 0b000100000000, 30 | SkinFailed = 0b001000000000, 31 | GraphFailed = 0b010000000000, 32 | SkeletonFailed = 0b100000000000, 33 | 34 | FailedBitSet = InitFailed | SkinFailed | GraphFailed | SkeletonFailed, 35 | Loaded = InfoLoadCompleted | MeshGenCompleted | CallbackCompleted | SkinLoaded | GraphLoaded | SkeletonLoaded | SkeletonApplied | MaterialApplied, 36 | }; 37 | 38 | struct SokolMesh 39 | { 40 | ~SokolMesh(); 41 | 42 | sg_bindings bindings = {}; 43 | u32 indexCount = 0; 44 | bool shouldRender = false; 45 | }; 46 | 47 | struct Character 48 | { 49 | ~Character(); 50 | 51 | using BoundingBox = Skin::BoundingBox; 52 | struct BoneFrameIndexCache 53 | { 54 | size_t translation = 0; 55 | size_t rotation = 0; 56 | size_t scale = 0; 57 | }; 58 | 59 | LeagueModel::CharacterLoadState loadState; 60 | std::shared_ptr globalTexture; 61 | std::unordered_map> textures; 62 | 63 | LeagueLib::Bin info; 64 | Skin skin; 65 | Skeleton skeleton; 66 | BoundingBox box; 67 | AnimationGraph graph; 68 | f32 lastFrame = -1; 69 | f32 currentTime = 0; 70 | 71 | std::vector meshes; 72 | std::unordered_map meshMap; 73 | sg_pipeline pipeline; 74 | 75 | std::map> animations; 76 | std::unordered_map clipMap; 77 | Animation* currentAnimation = nullptr; 78 | 79 | std::vector currentFrameCache; 80 | glm::vec3 center = glm::vec3(0, 0, 0); 81 | u32 loadedSkinBinHash; 82 | 83 | using OnMeshLoadFunction = std::function; 84 | void Load(const char* inModelName, u8 inSkinIndex, OnMeshLoadFunction inFunction = nullptr); 85 | void Reset(); 86 | 87 | void PlayAnimation(const char* animationName); 88 | void PlayAnimation(const Animation& animation); 89 | 90 | void Update(AnimatedMeshParametersVS_t& args); 91 | 92 | private: 93 | Spek::File::Handle file; 94 | }; 95 | } 96 | -------------------------------------------------------------------------------- /src/clip_property_data.cpp: -------------------------------------------------------------------------------- 1 | namespace LeagueModel 2 | { 3 | } 4 | -------------------------------------------------------------------------------- /src/managed_image.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace LeagueModel 8 | { 9 | struct ManagedImage 10 | { 11 | using OnLoadFunction = std::function; 12 | ManagedImage(const char* path, OnLoadFunction onImageLoaded = nullptr); 13 | ~ManagedImage(); 14 | 15 | sg_image image = {}; 16 | Spek::File::LoadState loadState = Spek::File::LoadState::NotLoaded; 17 | 18 | private: 19 | Spek::File::Handle file = nullptr; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /src/shaders/animated_mesh.glsl: -------------------------------------------------------------------------------- 1 | @include types.glsl 2 | @vs AnimatedMeshVS 3 | 4 | const int MAX_BONES = 255; 5 | 6 | uniform AnimatedMeshParametersVS 7 | { 8 | mat4 mvp; 9 | mat4 bones[MAX_BONES]; 10 | }; 11 | 12 | in vec3 pos; 13 | in vec2 uvs; 14 | in vec3 normals; 15 | in vec4 boneIndices; 16 | in vec4 boneWeights; 17 | 18 | out vec2 outUv; 19 | 20 | void main() 21 | { 22 | mat4 boneTransform = bones[int(boneIndices[0])] * boneWeights[0]; 23 | boneTransform += bones[int(boneIndices[1])] * boneWeights[1]; 24 | boneTransform += bones[int(boneIndices[2])] * boneWeights[2]; 25 | boneTransform += bones[int(boneIndices[3])] * boneWeights[3]; 26 | 27 | gl_Position = mvp * boneTransform * vec4(pos, 1.0); 28 | outUv = uvs; 29 | } 30 | 31 | @end 32 | 33 | @fs AnimatedMeshFS 34 | 35 | in vec2 outUv; 36 | 37 | out vec4 frag_color; 38 | 39 | uniform texture2D diffuseTexture; 40 | uniform sampler diffuseSampler; 41 | 42 | void main() 43 | { 44 | frag_color = texture(sampler2D(diffuseTexture, diffuseSampler), outUv); 45 | } 46 | 47 | @end 48 | 49 | @program AnimatedMesh AnimatedMeshVS AnimatedMeshFS 50 | 51 | -------------------------------------------------------------------------------- /src/shaders/types.glsl: -------------------------------------------------------------------------------- 1 | @ctype mat4 glm::mat4 2 | @ctype vec2 glm::vec2 3 | @ctype vec3 glm::vec3 4 | @ctype vec4 glm::vec4 -------------------------------------------------------------------------------- /src/simple_input.cpp: -------------------------------------------------------------------------------- 1 | #include "types.hpp" 2 | #include "simple_input.hpp" 3 | 4 | #include 5 | 6 | namespace LeagueModel 7 | { 8 | namespace Input 9 | { 10 | static bool g_initialised = false; 11 | 12 | static bool g_keyDown[(size_t)KeyboardKey::KeyMax] = { false }; 13 | static bool g_keyWasDown[(size_t)KeyboardKey::KeyMax] = { false }; 14 | static bool g_keyPressed[(size_t)KeyboardKey::KeyMax] = { false }; 15 | 16 | static bool g_mouseDown[16] = { false }; 17 | static bool g_mouseWasDown[16] = { false }; 18 | static bool g_mousePressed[16] = { false }; 19 | static f32 g_mouseScroll = 0; 20 | static glm::ivec2 g_mousePosition = glm::ivec2(-1); 21 | 22 | void OnKeyDown(u32 virtualKey) 23 | { 24 | if (virtualKey < (size_t)KeyboardKey::KeyMax) 25 | g_keyDown[(int)virtualKey] = true; 26 | } 27 | 28 | void OnKeyUp(u32 virtualKey) 29 | { 30 | if (virtualKey < (size_t)KeyboardKey::KeyMax) 31 | g_keyDown[(int)virtualKey] = false; 32 | } 33 | 34 | void OnMouseDown(u32 button) 35 | { 36 | if (button < 16) 37 | g_mouseDown[(int)button] = true; 38 | } 39 | 40 | void OnMouseUp(u32 button) 41 | { 42 | if (button < 16) 43 | g_mouseDown[(int)button] = false; 44 | } 45 | 46 | void OnMouseScroll(f32 scrollDelta) 47 | { 48 | g_mouseScroll += scrollDelta; 49 | } 50 | 51 | bool IsKeyDown(KeyboardKey inKey) 52 | { 53 | return g_keyDown[(int)inKey]; 54 | } 55 | 56 | bool IsMouseButtonDown(MouseButton inButton) 57 | { 58 | return g_mouseDown[(int)inButton]; 59 | } 60 | 61 | bool IsKeyPressed(KeyboardKey inKey) 62 | { 63 | return g_keyPressed[(int)inKey]; 64 | } 65 | 66 | bool IsMouseButtonPressed(MouseButton inButton) 67 | { 68 | return g_mousePressed[(int)inButton]; 69 | } 70 | 71 | bool HasScrolled() 72 | { 73 | return abs(g_mouseScroll) > 0.0001f; 74 | } 75 | 76 | f32 ScrollDelta() 77 | { 78 | f32 scroll = g_mouseScroll; 79 | g_mouseScroll = 0.0f; 80 | return scroll; 81 | } 82 | 83 | const glm::ivec2& GetMousePosition() 84 | { 85 | return g_mousePosition; 86 | } 87 | 88 | void Update() 89 | { 90 | for (int i = 0; i < 16; i++) 91 | g_mousePressed[i] = g_mouseDown[i] == false && g_mouseWasDown[i] == true; 92 | 93 | for (int i = 0; i < (size_t)KeyboardKey::KeyMax; i++) 94 | g_keyPressed[i] = g_keyDown[i] == false && g_keyWasDown[i] == true; 95 | 96 | memcpy(g_mouseWasDown, g_mouseDown, sizeof(bool) * 16); 97 | memcpy(g_keyWasDown, g_keyDown, sizeof(bool) * (size_t)KeyboardKey::KeyMax); 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/simple_input.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "types.hpp" 4 | 5 | #include 6 | 7 | namespace LeagueModel 8 | { 9 | namespace Input 10 | { 11 | enum MouseButton 12 | { 13 | Left = 0, 14 | Right = 1, 15 | None = -1, 16 | }; 17 | 18 | enum KeyboardKey 19 | { 20 | KeyNone = 0, 21 | KeyQ = 'Q', 22 | KeyW = 'W', 23 | KeyE = 'E', 24 | KeyR = 'R', 25 | KeyT = 'T', 26 | KeyY = 'Y', 27 | KeyU = 'U', 28 | KeyI = 'I', 29 | KeyO = 'O', 30 | KeyP = 'P', 31 | KeyA = 'A', 32 | KeyS = 'S', 33 | KeyD = 'D', 34 | KeyF = 'F', 35 | KeyG = 'G', 36 | KeyH = 'H', 37 | KeyJ = 'J', 38 | KeyK = 'K', 39 | KeyL = 'L', 40 | KeyZ = 'Z', 41 | KeyX = 'X', 42 | KeyC = 'C', 43 | KeyV = 'V', 44 | KeyB = 'B', 45 | KeyN = 'N', 46 | KeyM = 'M', 47 | Key0 = '0', 48 | Key1 = '1', 49 | Key2 = '2', 50 | Key3 = '3', 51 | Key4 = '4', 52 | Key5 = '5', 53 | Key6 = '6', 54 | Key7 = '7', 55 | Key8 = '8', 56 | Key9 = '9', 57 | 58 | KeyF1 = 0x70, 59 | KeyF2 = 0x71, 60 | KeyF3 = 0x72, 61 | KeyF4 = 0x73, 62 | KeyF5 = 0x74, 63 | KeyF6 = 0x75, 64 | KeyF7 = 0x76, 65 | KeyF8 = 0x77, 66 | KeyF9 = 0x78, 67 | KeyF10 = 0x79, 68 | KeyF11 = 0x7A, 69 | KeyF12 = 0x7B, 70 | 71 | KeyCtrl = 0xA2, // VK for Left Control 72 | KeyShift = 0xA0, // VK for Left Shift 73 | KeyEscape = 0x1B, // VK for Escape 74 | 75 | KeyMax = 0xFF, 76 | }; 77 | 78 | bool IsKeyDown(KeyboardKey inKey); 79 | bool IsMouseButtonDown(MouseButton inButton); 80 | bool IsKeyPressed(KeyboardKey inKey); 81 | bool IsMouseButtonPressed(MouseButton inButton); 82 | bool HasScrolled(); 83 | f32 ScrollDelta(); 84 | 85 | const glm::ivec2& GetMousePosition(); 86 | 87 | void Update(); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/skeleton.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "types.hpp" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | namespace LeagueModel 10 | { 11 | struct Skeleton 12 | { 13 | struct Bone 14 | { 15 | std::string name; 16 | uint32_t hash; 17 | 18 | int16_t id; 19 | int16_t parentID; 20 | 21 | glm::mat4 global; 22 | glm::mat4 local; 23 | glm::mat4 inverseGlobal; 24 | 25 | Bone* parent; 26 | std::vector children; 27 | }; 28 | 29 | enum class Type : u32 30 | { 31 | Unknown = 0x0, 32 | Classic = 0x746C6B73, 33 | Version2 = 0x22FD4FC3 34 | }; 35 | 36 | Spek::File::LoadState state = Spek::File::LoadState::NotLoaded; 37 | Type type; 38 | uint32_t version; 39 | std::vector bones; 40 | std::vector boneIndices; 41 | 42 | using OnLoadFunction = std::function; 43 | void Load(const std::string& inFilePath, OnLoadFunction inOnLoadFunction = nullptr); 44 | 45 | const Skeleton::Bone* GetBone(u32 inNameHash) const; 46 | 47 | private: 48 | Spek::File::Handle file; 49 | Spek::File::LoadState ReadClassic(Spek::File::Handle inFile, size_t& inOffset); 50 | Spek::File::LoadState ReadVersion2(Spek::File::Handle inFile, size_t& inOffset); 51 | }; 52 | } -------------------------------------------------------------------------------- /src/skin.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "types.hpp" 4 | 5 | #include 6 | #include 7 | 8 | namespace LeagueModel 9 | { 10 | struct Skeleton; 11 | struct Skin 12 | { 13 | struct Vertex 14 | { 15 | glm::vec3 position; 16 | glm::vec2 uv; 17 | glm::vec3 normal; 18 | glm::vec4 boneIndices; 19 | glm::vec4 weights; 20 | }; 21 | 22 | struct Mesh 23 | { 24 | Mesh(const std::string& inName); 25 | 26 | std::string name; 27 | uint32_t hash; 28 | 29 | Vertex* vertices = nullptr; 30 | size_t vertexCount = 0; 31 | 32 | u16* indices = nullptr; 33 | size_t indexCount = 0; 34 | 35 | bool initialVisibility = false; 36 | }; 37 | 38 | struct BoundingBox 39 | { 40 | glm::vec3 min; 41 | glm::vec3 max; 42 | }; 43 | 44 | using OnLoadFunction = std::function; 45 | void Load(const std::string& inFilePath, OnLoadFunction inOnLoadFunction = nullptr); 46 | 47 | Spek::File::LoadState loadState = Spek::File::LoadState::NotLoaded; 48 | 49 | u16 majorVersion; 50 | u16 minorVersion; 51 | 52 | BoundingBox boundingBox; 53 | std::vector vertices; 54 | std::vector indices; 55 | 56 | std::vector meshes; 57 | 58 | private: 59 | Spek::File::Handle file; 60 | }; 61 | } -------------------------------------------------------------------------------- /src/types.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | using i8 = signed char; 4 | using i16 = signed short; 5 | using i32 = signed int; 6 | using i64 = long long; 7 | 8 | using u8 = unsigned char; 9 | using u16 = unsigned short; 10 | using u32 = unsigned int; 11 | using u64 = unsigned long long; 12 | 13 | using f32 = float; 14 | using f64 = double; 15 | 16 | using Address = u64; // Assuming x64 17 | 18 | #define DerivedFrom(B, A) typename = std::enable_if::value == false && std::is_base_of::value> 19 | 20 | static_assert(sizeof(i8) == 1, "i8 seems to not match the correct size!"); 21 | static_assert(sizeof(i16) == 2, "i16 seems to not match the correct size!"); 22 | static_assert(sizeof(i32) == 4, "i32 seems to not match the correct size!"); 23 | static_assert(sizeof(i64) == 8, "i64 seems to not match the correct size!"); 24 | 25 | static_assert(sizeof(u8) == 1, "u8 seems to not match the correct size!"); 26 | static_assert(sizeof(u16) == 2, "u16 seems to not match the correct size!"); 27 | static_assert(sizeof(u32) == 4, "u32 seems to not match the correct size!"); 28 | static_assert(sizeof(u64) == 8, "u64 seems to not match the correct size!"); 29 | 30 | static_assert(sizeof(f32) == 4, "f32 seems to not match the correct size!"); 31 | static_assert(sizeof(f64) == 8, "f64 seems to not match the correct size!"); 32 | -------------------------------------------------------------------------------- /src/ui.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace LeagueModel 4 | { 5 | struct Character; 6 | void RenderUI(Character& character); 7 | } --------------------------------------------------------------------------------