[
  {
    "path": ".clang-format",
    "content": "---\nAccessModifierOffset: -4\nAlignAfterOpenBracket: AlwaysBreak\nAlignTrailingComments: false\nAllowShortFunctionsOnASingleLine: InlineOnly\nAlwaysBreakAfterDefinitionReturnType: None\nAlwaysBreakAfterReturnType: None\nAlwaysBreakTemplateDeclarations: Yes\nAllowAllArgumentsOnNextLine: true\nBreakBeforeBraces: Custom\nBraceWrapping:\n    AfterNamespace: true\n    AfterStruct: true\n    AfterClass: true\n    AfterEnum: true\n    AfterFunction: true\n    SplitEmptyFunction: true\nColumnLimit: 80\nIndentWidth: 4\nIndentPPDirectives: None\nPenaltyReturnTypeOnItsOwnLine: 1000000000\nPointerAlignment: Left\nSpaceAfterTemplateKeyword: false\nStandard: c++11\nTabWidth: 4\nCpp11BracedListStyle: true\nIndentCaseLabels: true\nSortIncludes: true\nIncludeBlocks: Preserve\nFixNamespaceComments: true\n...\n"
  },
  {
    "path": ".cmake-format.yaml",
    "content": "line_width: 80\ntab_size: 2\nenable_sort: True\ndangle_parens: False\ndangle_align: 'prefix'\ncommand_case: 'canonical'\nkeyword_case: 'upper'\nline_ending: 'auto'\nseparate_ctrl_name_with_space: True\n"
  },
  {
    "path": ".gitignore",
    "content": "build*/\nembuild*/\ninstall/\nimgui.ini\n*.bin\n.vscode/\n"
  },
  {
    "path": "CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.24)\n\noption(SUPERBUILD \"Perform a superbuild (or not)\" OFF)\n\nproject(sdl-bgfx-imgui-starter LANGUAGES CXX)\n\nif (SUPERBUILD)\n  if (EMSCRIPTEN)\n    set(THIRD_PARTY_BUILD_DIR_NAME embuild)\n  else ()\n    set(THIRD_PARTY_BUILD_DIR_NAME build)\n  endif ()\n  include(third-party/CMakeLists.txt)\n  include(cmake/superbuild.cmake)\n  return()\nendif ()\n\nfind_package(SDL2 REQUIRED CONFIG CMAKE_FIND_ROOT_PATH_BOTH)\nfind_package(bgfx REQUIRED CONFIG CMAKE_FIND_ROOT_PATH_BOTH)\nfind_package(imgui.cmake REQUIRED CONFIG CMAKE_FIND_ROOT_PATH_BOTH)\n\nadd_executable(${PROJECT_NAME})\ntarget_sources(${PROJECT_NAME} PRIVATE main.cpp sdl-imgui/imgui_impl_sdl2.cpp\n                                       bgfx-imgui/imgui_impl_bgfx.cpp)\ntarget_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)\ntarget_link_libraries(\n  ${PROJECT_NAME} PRIVATE SDL2::SDL2-static SDL2::SDL2main bgfx::bgfx bgfx::bx\n                          imgui.cmake::imgui.cmake)\ntarget_link_options(\n  ${PROJECT_NAME} PRIVATE $<$<BOOL:${EMSCRIPTEN}>:-sMAX_WEBGL_VERSION=2\n  -sALLOW_MEMORY_GROWTH=1 --preload-file=shader/embuild/v_simple.bin\n  --preload-file=shader/embuild/f_simple.bin>)\ntarget_compile_definitions(\n  ${PROJECT_NAME} PRIVATE $<$<BOOL:${EMSCRIPTEN}>:USE_SDL=2>)\n\nif (EMSCRIPTEN)\n  set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX \".html\")\n  add_custom_command(\n    TARGET ${PROJECT_NAME}\n    PRE_BUILD\n    COMMAND ${CMAKE_COMMAND} -E make_directory\n            $<TARGET_FILE_DIR:${PROJECT_NAME}>/shader/embuild\n    COMMAND\n      ${CMAKE_COMMAND} -E copy_if_different\n      ${CMAKE_CURRENT_SOURCE_DIR}/shader/embuild/v_simple.bin\n      $<TARGET_FILE_DIR:${PROJECT_NAME}>/shader/embuild\n    COMMAND\n      ${CMAKE_COMMAND} -E copy_if_different\n      ${CMAKE_CURRENT_SOURCE_DIR}/shader/embuild/f_simple.bin\n      $<TARGET_FILE_DIR:${PROJECT_NAME}>/shader/embuild\n    VERBATIM)\nelse ()\n  add_custom_command(\n    TARGET ${PROJECT_NAME}\n    POST_BUILD\n    COMMAND\n      ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/shader/build\n      $<TARGET_FILE_DIR:${PROJECT_NAME}>/shader/build\n    VERBATIM)\nendif ()\n\nset_target_properties(\n  ${PROJECT_NAME}\n  # required for project when using visual studio generator\n  PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/$<CONFIG>)\n\nif (WIN32)\n  # copy the SDL2.dll to the same folder as the executable\n  add_custom_command(\n    TARGET ${PROJECT_NAME}\n    POST_BUILD\n    COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:SDL2::SDL2>\n            $<TARGET_FILE_DIR:${PROJECT_NAME}>\n    VERBATIM)\nendif ()\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2022 Tom Hulton-Harrop\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# sdl-bgfx-imgui-starter\n\n![starter](starter.png)\n\nThe idea behind this repo is for it to be used as a minimal starting point for development of a game, demo or prototype.\n\nIt utilizes [SDL2](https://www.libsdl.org/index.php) for the windowing system, [bgfx](https://github.com/bkaradzic/bgfx) (by [@bkaradzic](https://twitter.com/bkaradzic)) for the graphics library and [Dear ImGui](https://github.com/ocornut/imgui) (by [@ocornut](https://twitter.com/ocornut)) for the user interface.\n\nThe code in `main.cpp` is derived from two excellent `bgfx` tutorials ([hello-bgfx](https://dev.to/pperon/hello-bgfx-4dka) by [Phil Peron](https://twitter.com/pperon) and [bgfx-ubuntu](https://www.sandeepnambiar.com/getting-started-with-bgfx/) by [Sandeep Nambiar](https://twitter.com/_sandeepnambiar)). I highly recommend checking them out.\n\nThis repo does not directly include any of these dependencies. Instead, CMake is used to download and install them so this project can use them. This is handled through the use of a _superbuild_.\n\n## Prerequisites\n\nTo begin with create a directory to hold the repo:\n\n```bat\nmkdir sdl-bgfx-imgui-starter\ncd sdl-bgfx-imgui-starter\n```\n\nThen clone the repo:\n\n```bash\ngit clone https://github.com/pr0g/sdl-bgfx-imgui-starter.git .\n```\n\nThis project comes with a _superbuild_ CMake script which will build all third party dependencies and the main application in one step. The third party dependencies are built and installed to a separate build folder in the third party directory. To achieve this CMake must be installed on your system (the repo has most recently been tested with CMake version `3.24`).\n\n> __Note__: It is possible to build the third party dependencies separately, but the configure scripts described below now default to use `-DSUPERBUILD=ON` (as this is the simplest and most common workflow). If you do wish to build the third party dependencies separately, please see the third party [__README__](third-party/README.md) for full instructions on how to do this.\n>\n> __Note__: When building the dependencies, the libraries are by default self contained in the repo and are not installed to the system.\n\n## Build Instructions\n\n### All\n\nShaders for `bgfx` must be compiled to be loaded by the application (the starter has an incredibly simple shader supporting vertex colours). See `compile-shaders-<platform>.sh/bat` for details. `shaderc` is built as part of `bgfx` when first building the repo and is used to compile the shaders.\n\n> __Note__: A number of `configure-<generator>.bat/sh` files are provided to run the CMake configure commands. `Ninja` is preferred as it's consistent across _macOS_, _Linux_ and _Windows_ (and it's very fast), any generator should work though. For example there's a `configure-vs-19/22.bat` for generating a Visual Studio 2019 or 2022 solution.\n\n### Windows\n\n- Run `configure-vs-19.bat`, `configure-vs-22.bat` or `configure-ninja.bat` located in the root directory to generate the build files required for the project.\n- Run `cmake --build build\\debug-ninja` and/or `cmake --build build\\release-ninja` to compile the project using Ninja or `cmake --build build\\vs<year> --config Debug` and/or `cmake --build build\\vs<year> --config Release` if using the Visual Studio generator.\n- Run `compile-shaders-win.bat` located in the root directory to build the shaders.\n- Launch the application by running `build\\debug-ninja\\sdl-bgfx-imgui-starter.exe` or `build\\release-ninja\\sdl-bgfx-imgui-starter.exe` if using Ninja or `build\\vs<year>\\Debug\\sdl-bgfx-imgui-starter.exe` or `build\\vs<year>\\Release\\sdl-bgfx-imgui-starter.exe` if using Visual Studio.\n\n### macOS\n\n- Run `./configure-make.sh` or `./configure-ninja.sh` located in the root directory to generate the build files required for the project (prefer Ninja if possible as it's much faster).\n- Run `cmake --build build/debug-<generator>` and/or `cmake --build build/release-<generator>` to compile the project.\n- Run `./compile-shaders-macos.sh` located in the root directory to build the shaders.\n- Launch the application by running `./build/debug-<generator>/sdl-bgfx-imgui-starter` or `./build/release-<generator>/sdl-bgfx-imgui-starter`.\n\n### Linux\n\n- Check the [prerequisites](third-party/README.md#linux) when first starting out on Linux to ensure you have all the fundamentals (e.g. X11, OpenGL, Ninja etc...).\n- Run `./configure-make.sh` or `./configure-ninja.sh` located in the root directory to generate the build files required for the project (prefer Ninja if possible as it's much faster).\n- Run `cmake --build build/debug-<generator>` and/or `cmake --build build/release-<generator>` to compile the project.\n- Run `./compile-shaders-linux.sh` located in the root directory to build the shaders.\n- Launch the application by running `./build/debug-<generator>/sdl-bgfx-imgui-starter` or `./build/release-<generator>/sdl-bgfx-imgui-starter`.\n\n### Emscripten (Windows/macOS/Linux)\n\n> __Note__: Emscripten is built in a separate build folder called `embuild`, not `build`. This is to prevent Emscripten from overwriting native builds when built separately.\n>\n> __Note__: On Windows it may be necessary to run the command-line/terminal as Administrator when building Emscripten.\n\n- Ensure you have [Python](https://www.python.org/downloads) installed on your system.\n- Follow the install steps to setup Emscripten [here](https://emscripten.org/docs/getting_started/downloads.html) (This is required to be able to use the `emcmake` command in the various configure scripts).\n- Run `./configure-emscripten.<bat/sh>` from the root directory.\n  - Ensure `emsdk_env.bat` or `source ./emsdk_env.sh` have been run before attempting this so `emcmake` is added to the path (see Emscripten instructions above for more details).\n- Run `./compile-shaders-emscripten.<bat/sh>` located in the root directory. (_Note: In order to invoke_ `shaderc`, _the third party dependencies (specifically_  `bgfx`_) will have to have been built for the target platform as well as Emscripten, so the shaders can be compiled_). The build step for Emscripten copies the built shaders to the build folder (`embuild`), so compiling the shaders should happen before the main Emscripten build.\n- Run `cmake --build embuild/debug-emscripten` and/or `cmake --build embuild/release-emscripten`.\n- Start a local server (the easiest way to do this is with `python3 -m http.server`).\n- Go to `localhost:8000` in a browser and open `embuild/<debug/release>-emscripten/sdl-bgfx-imgui-starter.html`.\n\n## Resources\n\nWhile getting this project setup I discovered a number of excellent resources. I'd highly recommend checking them out to learn more about `bgfx` and `Dear ImGui`.\n\n- [bgfx](https://github.com/bkaradzic/bgfx) - `bgfx` main repo.\n- [bgfx docs](https://bkaradzic.github.io/bgfx/index.html) - extensive docs covering much of `bgfx`'s API.\n- [bkaradzic/bgfx.cmake](https://github.com/bkaradzic/bgfx.cmake) (originally [widberg/bgfx.cmake](https://github.com/widberg/bgfx.cmake)) - a complimentary repo to add CMake support to `bgfx` (used by this repo).\n- [hello-bgfx (tutorial)](https://dev.to/pperon/hello-bgfx-4dka) - a great intro to `bgfx` and covers most of the code in the `main.cpp` of this repo.\n- [bgfx-ubuntu(tutorial)](https://www.sandeepnambiar.com/getting-started-with-bgfx/) - another great tutorial on `bgfx` (showing how to get setup on Ubuntu).\n- [minimal-bgfx](https://github.com/jpcy/bgfx-minimal-example) - a similar repo to this one only using `premake` and git submodules instead of CMake and with no `Dear ImGui`.\n- [dear-imgui](https://github.com/ocornut/imgui) - `Dear ImGui` main repo - lots of documentation and examples are available there.\n- [cmakefied](https://github.com/tamaskenez/cmakefied) - a complimentary repo to add CMake support to `imgui` (originally used by this repo but now replaced with a simpler repo called [imgui.cmake](https://github.com/pr0g/imgui.cmake), similar in design to [bgfx.cmake](https://github.com/bkaradzic/bgfx.cmake) mentioned above).\n\n## Special Thanks\n\n- [Бранимир Караџић (@bkaradzic)](https://twitter.com/bkaradzic) for the excellent [bgfx](https://github.com/bkaradzic/bgfx)\n- [Omar Cornut (@ocornut)](https://twitter.com/ocornut) for the brilliant [Dear ImGui](https://github.com/ocornut/imgui)\n- [Widberg/MissingBitStudios](https://github.com/widberg) for the `bgfx` CMake support\n- [Tamas Kenez](https://github.com/tamaskenez) for the `Dear ImGui` CMake support\n- [Richard Gale (@richardg4)](https://twitter.com/richardg4) for the `bgfx` implementation for `Dear ImGui`\n- [Phil Peron (@pperon)](https://twitter.com/pperon) and [Sandeep Nambiar (@_sandeepnambiar)](https://twitter.com/_sandeepnambiar) for the great `bgfx` setup tutorials.\n- [sudo-carson](https://github.com/sudo-carson) for laying the ground work for integrating Emscripten into the project. See [this PR](https://github.com/pr0g/sdl-bgfx-imgui-starter/pull/8) for all the details.\n"
  },
  {
    "path": "bgfx-imgui/README.md",
    "content": "# bgfx-imgui\n\nThis code is a port of a [Gist](https://gist.github.com/RichardGale/6e2b74bc42b3005e08397236e4be0fd0) by Richard Gale.\n\nIt remains mostly intact other than a few fixes to build with the latest release of `bgfx` and all input handling has been removed so that `imgui_impl_sdl.h/cpp` implementations may be used instead.\n\n`vs_ocornut_imgui.bin.h` and `fs_ocornut_imgui.bin.h` are copied from the [examples/common/imgui](https://github.com/bkaradzic/bgfx/tree/master/examples/common/imgui) of the [bgfx](https://github.com/bkaradzic/bgfx) repo (to make the use of `bgfx::EmbeddedShader` easier).\n"
  },
  {
    "path": "bgfx-imgui/fs_ocornut_imgui.bin.h",
    "content": "static const uint8_t fs_ocornut_imgui_glsl[189] =\n{\n\t0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x73, // FSH............s\n\t0x5f, 0x74, 0x65, 0x78, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9a, 0x00, // _tex............\n\t0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, // ..varying vec4 v\n\t0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, // _color0;.varying\n\t0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, //  vec2 v_texcoord\n\t0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, // 0;.uniform sampl\n\t0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, // er2D s_tex;.void\n\t0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, //  main ().{.  gl_\n\t0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x65, 0x78, // FragColor = (tex\n\t0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x76, // ture2D (s_tex, v\n\t0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x76, 0x5f, // _texcoord0) * v_\n\t0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                   // color0);.}...\n};\nstatic const uint8_t fs_ocornut_imgui_essl[246] =\n{\n\t0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x73, // FSH............s\n\t0x5f, 0x74, 0x65, 0x78, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x00, // _tex............\n\t0x00, 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // ..varying highp\n\t0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, // vec4 v_color0;.v\n\t0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // arying highp vec\n\t0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, // 2 v_texcoord0;.u\n\t0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, // niform sampler2D\n\t0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, //  s_tex;.void mai\n\t0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, // n ().{.  lowp ve\n\t0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, // c4 tmpvar_1;.  t\n\t0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // mpvar_1 = textur\n\t0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, // e2D (s_tex, v_te\n\t0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // xcoord0);.  gl_F\n\t0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, // ragColor = (tmpv\n\t0x61, 0x72, 0x5f, 0x31, 0x20, 0x2a, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x29, // ar_1 * v_color0)\n\t0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                                                             // ;.}...\n};\nstatic const uint8_t fs_ocornut_imgui_spv[910] =\n{\n\t0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x73, // FSH............s\n\t0x5f, 0x74, 0x65, 0x78, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1a, 0x00, 0x68, 0x03, // _tex0.........h.\n\t0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x97, 0x00, // ....#...........\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, // ................\n\t0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, // ......GLSL.std.4\n\t0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // 50..............\n\t0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma\n\t0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x55, 0x00, // in....N...Q...U.\n\t0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, // ..b.............\n\t0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, // ................\n\t0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ......main......\n\t0x06, 0x00, 0x23, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, // ..#...s_texSampl\n\t0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x26, 0x00, 0x00, 0x00, 0x73, 0x5f, // er........&...s_\n\t0x74, 0x65, 0x78, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // texTexture......\n\t0x06, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6f, // ..N...gl_FragCoo\n\t0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x51, 0x00, 0x00, 0x00, 0x76, 0x5f, // rd........Q...v_\n\t0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x55, 0x00, // color0........U.\n\t0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, // ..v_texcoord0...\n\t0x06, 0x00, 0x62, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, // ..b...bgfx_FragD\n\t0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, // ata0..G...#...\".\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x21, 0x00, // ......G...#...!.\n\t0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x22, 0x00, // ......G...&...\".\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, 0x00, // ......G...&...!.\n\t0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x0b, 0x00, // ......G...N.....\n\t0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G...Q.....\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x55, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G...U.....\n\t0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x62, 0x00, 0x00, 0x00, 0x1e, 0x00, // ......G...b.....\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, // ..............!.\n\t0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, // ................\n\t0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, // .......... .....\n\t0x09, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................\n\t0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, // ................\n\t0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, // ................\n\t0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // .. ...\".........\n\t0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, // ..;...\"...#.....\n\t0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, // .. ...%.........\n\t0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, // ..;...%...&.....\n\t0x00, 0x00, 0x1b, 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, // ......2....... .\n\t0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..M...........;.\n\t0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..M...N.......;.\n\t0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // ..M...Q....... .\n\t0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..T...........;.\n\t0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // ..T...U....... .\n\t0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..a...........;.\n\t0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, // ..a...b.......6.\n\t0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ................\n\t0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, // ..........=.....\n\t0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, // ..$...#...=.....\n\t0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, // ..'...&...=.....\n\t0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, // ..R...Q...=.....\n\t0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x32, 0x00, // ..V...U...V...2.\n\t0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x57, 0x00, // ......'...$...W.\n\t0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x56, 0x00, // ..............V.\n\t0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x96, 0x00, // ................\n\t0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x62, 0x00, 0x00, 0x00, 0x86, 0x00, // ..R...>...b.....\n\t0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,             // ......8.......\n};\nstatic const uint8_t fs_ocornut_imgui_dx9[239] =\n{\n\t0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x73, // FSH............s\n\t0x5f, 0x74, 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x00, // _tex0...........\n\t0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0xff, 0x1f, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ..........CTAB..\n\t0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, // ..O.............\n\t0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00, // ......H...0.....\n\t0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x5f, // ......8.......s_\n\t0x74, 0x65, 0x78, 0x00, 0xab, 0xab, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // tex.............\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, // ......ps_3_0.Mic\n\t0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, // rosoft (R) HLSL\n\t0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, // Shader Compiler\n\t0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, 0x00, // 10.1............\n\t0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x01, 0x00, 0x03, 0x90, 0x1f, 0x00, // ................\n\t0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x00, 0x08, 0x0f, 0xa0, 0x42, 0x00, 0x00, 0x03, 0x00, 0x00, // ..........B.....\n\t0x0f, 0x80, 0x01, 0x00, 0xe4, 0x90, 0x00, 0x08, 0xe4, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x00, 0x08, // ................\n\t0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00,       // ...............\n};\nstatic const uint8_t fs_ocornut_imgui_dx11[422] =\n{\n\t0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x05, 0x73, // FSH............s\n\t0x5f, 0x74, 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, // _tex0..........s\n\t0x5f, 0x74, 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x01, // _tex0.........p.\n\t0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xbe, 0x78, 0xe7, 0xa5, 0x19, 0x0c, 0x70, 0xeb, 0x4c, 0xb1, // ..DXBC.x....p.L.\n\t0xac, 0x1f, 0x16, 0x84, 0xe9, 0x97, 0x01, 0x00, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x03, 0x00, // ..........p.....\n\t0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...........IS\n\t0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, // GNl...........P.\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................\n\t0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................\n\t0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, // ..............b.\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ................\n\t0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, // ......SV_POSITIO\n\t0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, // N.COLOR.TEXCOORD\n\t0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGN,.........\n\t0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // .. .............\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, // ..........SV_TAR\n\t0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x94, 0x00, 0x00, 0x00, 0x40, 0x00, // GET...SHDR....@.\n\t0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, // ..%...Z....`....\n\t0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, // ..X....p......UU\n\t0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, // ..b...........b.\n\t0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, // ..2.......e....\n\t0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, // ......h.......E.\n\t0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, // ..........F.....\n\t0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, // ..F~.......`....\n\t0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..8.... ......F.\n\t0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, // ......F.......>.\n\t0x00, 0x01, 0x00, 0x00, 0x00, 0x00,                                                             // ......\n};\nstatic const uint8_t fs_ocornut_imgui_mtl[609] =\n{\n\t0x46, 0x53, 0x48, 0x0b, 0x01, 0x83, 0xf2, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0c, 0x73, // FSH............s\n\t0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x11, 0x01, 0xff, 0xff, 0x01, // _texSampler.....\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x54, 0x65, 0x78, 0x74, 0x75, // ......s_texTextu\n\t0x72, 0x65, 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, // re...........s_t\n\t0x65, 0x78, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x02, 0x00, 0x00, // ex..............\n\t0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, // #include <metal_\n\t0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, // stdlib>.#include\n\t0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, //  <simd/simd.h>..\n\t0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, // using namespace\n\t0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, // metal;..struct x\n\t0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, // latMtlMain_out.{\n\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, // .    float4 bgfx\n\t0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, // _FragData0 [[col\n\t0x6f, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, // or(0)]];.};..str\n\t0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, // uct xlatMtlMain_\n\t0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // in.{.    float4\n\t0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, // v_color0 [[user(\n\t0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // locn0)]];.    fl\n\t0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // oat2 v_texcoord0\n\t0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, 0x5d, //  [[user(locn1)]]\n\t0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, // ;.};..fragment x\n\t0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, // latMtlMain_out x\n\t0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, // latMtlMain(xlatM\n\t0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, // tlMain_in in [[s\n\t0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, // tage_in]], textu\n\t0x72, 0x65, 0x32, 0x64, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, // re2d<float> s_te\n\t0x78, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, // x [[texture(0)]]\n\t0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, // , sampler s_texS\n\t0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // ampler [[sampler\n\t0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, // (0)]]).{.    xla\n\t0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, // tMtlMain_out out\n\t0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, //  = {};.    out.b\n\t0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, // gfx_FragData0 =\n\t0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, // s_tex.sample(s_t\n\t0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, // exSampler, in.v_\n\t0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, // texcoord0) * in.\n\t0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, // v_color0;.    re\n\t0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x20, // turn out;.}....\n\t0x00,                                                                                           // .\n};\nextern const uint8_t* fs_ocornut_imgui_pssl;\nextern const uint32_t fs_ocornut_imgui_pssl_size;\n"
  },
  {
    "path": "bgfx-imgui/imgui_impl_bgfx.cpp",
    "content": "// Derived from this Gist by Richard Gale:\n//     https://gist.github.com/RichardGale/6e2b74bc42b3005e08397236e4be0fd0\n\n// ImGui BFFX binding\n// In this binding, ImTextureID is used to store an OpenGL 'GLuint' texture\n// identifier. Read the FAQ about ImTextureID in imgui.cpp.\n\n// You can copy and use unmodified imgui_impl_* files in your project. See\n// main.cpp for an example of using this. If you use this binding you'll need to\n// call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(),\n// ImGui::Render() and ImGui_ImplXXXX_Shutdown(). If you are new to ImGui, see\n// examples/README.txt and documentation at the top of imgui.cpp.\n// https://github.com/ocornut/imgui\n\n#include \"imgui_impl_bgfx.h\"\n#include \"imgui.h\"\n\n// BGFX/BX\n#include \"bgfx/bgfx.h\"\n#include \"bgfx/embedded_shader.h\"\n#include \"bx/math.h\"\n#include \"bx/timer.h\"\n\n// Data\nstatic uint8_t g_View = 255;\nstatic bgfx::TextureHandle g_FontTexture = BGFX_INVALID_HANDLE;\nstatic bgfx::ProgramHandle g_ShaderHandle = BGFX_INVALID_HANDLE;\nstatic bgfx::UniformHandle g_AttribLocationTex = BGFX_INVALID_HANDLE;\nstatic bgfx::VertexLayout g_VertexLayout;\n\n// This is the main rendering function that you have to implement and call after\n// ImGui::Render(). Pass ImGui::GetDrawData() to this function.\n// Note: If text or lines are blurry when integrating ImGui into your engine,\n// in your Render function, try translating your projection matrix by\n// (0.5f,0.5f) or (0.375f,0.375f)\nvoid ImGui_Implbgfx_RenderDrawLists(ImDrawData* draw_data)\n{\n    // Avoid rendering when minimized, scale coordinates for retina displays\n    // (screen coordinates != framebuffer coordinates)\n    ImGuiIO& io = ImGui::GetIO();\n    int fb_width = (int)(io.DisplaySize.x * io.DisplayFramebufferScale.x);\n    int fb_height = (int)(io.DisplaySize.y * io.DisplayFramebufferScale.y);\n    if (fb_width == 0 || fb_height == 0) {\n        return;\n    }\n\n    draw_data->ScaleClipRects(io.DisplayFramebufferScale);\n\n    // Setup render state: alpha-blending enabled, no face culling,\n    // no depth testing, scissor enabled\n    uint64_t state =\n        BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A | BGFX_STATE_MSAA |\n        BGFX_STATE_BLEND_FUNC(\n            BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA);\n\n    const bgfx::Caps* caps = bgfx::getCaps();\n\n    // Setup viewport, orthographic projection matrix\n    float ortho[16];\n    bx::mtxOrtho(\n        ortho, 0.0f, io.DisplaySize.x, io.DisplaySize.y, 0.0f, 0.0f, 1000.0f,\n        0.0f, caps->homogeneousDepth);\n    bgfx::setViewTransform(g_View, NULL, ortho);\n    bgfx::setViewRect(g_View, 0, 0, (uint16_t)fb_width, (uint16_t)fb_height);\n\n    // Render command lists\n    for (int n = 0; n < draw_data->CmdListsCount; n++) {\n        const ImDrawList* cmd_list = draw_data->CmdLists[n];\n\n        bgfx::TransientVertexBuffer tvb;\n        bgfx::TransientIndexBuffer tib;\n\n        uint32_t numVertices = (uint32_t)cmd_list->VtxBuffer.size();\n        uint32_t numIndices = (uint32_t)cmd_list->IdxBuffer.size();\n\n        if ((numVertices != bgfx::getAvailTransientVertexBuffer(\n                                numVertices, g_VertexLayout)) ||\n            (numIndices != bgfx::getAvailTransientIndexBuffer(numIndices))) {\n            // not enough space in transient buffer, quit drawing the rest...\n            break;\n        }\n\n        bgfx::allocTransientVertexBuffer(&tvb, numVertices, g_VertexLayout);\n        bgfx::allocTransientIndexBuffer(&tib, numIndices);\n\n        ImDrawVert* verts = (ImDrawVert*)tvb.data;\n        memcpy(\n            verts, cmd_list->VtxBuffer.begin(),\n            numVertices * sizeof(ImDrawVert));\n\n        ImDrawIdx* indices = (ImDrawIdx*)tib.data;\n        memcpy(\n            indices, cmd_list->IdxBuffer.begin(),\n            numIndices * sizeof(ImDrawIdx));\n\n        for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++) {\n            const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];\n\n            if (pcmd->UserCallback) {\n                pcmd->UserCallback(cmd_list, pcmd);\n            } else {\n                const uint16_t xx = (uint16_t)bx::max(pcmd->ClipRect.x, 0.0f);\n                const uint16_t yy = (uint16_t)bx::max(pcmd->ClipRect.y, 0.0f);\n                bgfx::setScissor(\n                    xx, yy, (uint16_t)bx::min(pcmd->ClipRect.z, 65535.0f) - xx,\n                    (uint16_t)bx::min(pcmd->ClipRect.w, 65535.0f) - yy);\n\n                bgfx::setState(state);\n                bgfx::TextureHandle texture = {\n                    (uint16_t)((intptr_t)pcmd->TextureId & 0xffff)};\n                bgfx::setTexture(0, g_AttribLocationTex, texture);\n                bgfx::setVertexBuffer(0, &tvb, 0, numVertices);\n                bgfx::setIndexBuffer(&tib, pcmd->IdxOffset, pcmd->ElemCount);\n                bgfx::submit(g_View, g_ShaderHandle);\n            }\n        }\n    }\n}\n\nbool ImGui_Implbgfx_CreateFontsTexture()\n{\n    // Build texture atlas\n    ImGuiIO& io = ImGui::GetIO();\n    unsigned char* pixels;\n    int width, height;\n    io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);\n\n    // Upload texture to graphics system\n    g_FontTexture = bgfx::createTexture2D(\n        (uint16_t)width, (uint16_t)height, false, 1, bgfx::TextureFormat::BGRA8,\n        0, bgfx::copy(pixels, width * height * 4));\n\n    // Store our identifier\n    io.Fonts->TexID = (void*)(intptr_t)g_FontTexture.idx;\n\n    return true;\n}\n\n#include \"fs_ocornut_imgui.bin.h\"\n#include \"vs_ocornut_imgui.bin.h\"\n\nstatic const bgfx::EmbeddedShader s_embeddedShaders[] = {\n    BGFX_EMBEDDED_SHADER(vs_ocornut_imgui),\n    BGFX_EMBEDDED_SHADER(fs_ocornut_imgui), BGFX_EMBEDDED_SHADER_END()};\n\nbool ImGui_Implbgfx_CreateDeviceObjects()\n{\n    bgfx::RendererType::Enum type = bgfx::getRendererType();\n    g_ShaderHandle = bgfx::createProgram(\n        bgfx::createEmbeddedShader(s_embeddedShaders, type, \"vs_ocornut_imgui\"),\n        bgfx::createEmbeddedShader(s_embeddedShaders, type, \"fs_ocornut_imgui\"),\n        true);\n\n    g_VertexLayout.begin()\n        .add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float)\n        .add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)\n        .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true)\n        .end();\n\n    g_AttribLocationTex =\n        bgfx::createUniform(\"g_AttribLocationTex\", bgfx::UniformType::Sampler);\n\n    ImGui_Implbgfx_CreateFontsTexture();\n\n    return true;\n}\n\nvoid ImGui_Implbgfx_InvalidateDeviceObjects()\n{\n    bgfx::destroy(g_AttribLocationTex);\n    bgfx::destroy(g_ShaderHandle);\n\n    if (isValid(g_FontTexture)) {\n        bgfx::destroy(g_FontTexture);\n        ImGui::GetIO().Fonts->TexID = 0;\n        g_FontTexture.idx = bgfx::kInvalidHandle;\n    }\n}\n\nvoid ImGui_Implbgfx_Init(int view)\n{\n    g_View = (uint8_t)(view & 0xff);\n}\n\nvoid ImGui_Implbgfx_Shutdown()\n{\n    ImGui_Implbgfx_InvalidateDeviceObjects();\n}\n\nvoid ImGui_Implbgfx_NewFrame()\n{\n    if (!isValid(g_FontTexture)) {\n        ImGui_Implbgfx_CreateDeviceObjects();\n    }\n}\n"
  },
  {
    "path": "bgfx-imgui/imgui_impl_bgfx.h",
    "content": "// Derived from this Gist by Richard Gale:\n//     https://gist.github.com/RichardGale/6e2b74bc42b3005e08397236e4be0fd0\n\n// ImGui BGFX binding\n\n// You can copy and use unmodified imgui_impl_* files in your project. See\n// main.cpp for an example of using this. If you use this binding you'll need to\n// call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(),\n// ImGui::Render() and ImGui_ImplXXXX_Shutdown(). If you are new to ImGui, see\n// examples/README.txt and documentation at the top of imgui.cpp.\n// https://github.com/ocornut/imgui\n\nvoid ImGui_Implbgfx_Init(int view);\nvoid ImGui_Implbgfx_Shutdown();\nvoid ImGui_Implbgfx_NewFrame();\nvoid ImGui_Implbgfx_RenderDrawLists(struct ImDrawData* draw_data);\n\n// Use if you want to reset your rendering device without losing ImGui state.\nvoid ImGui_Implbgfx_InvalidateDeviceObjects();\nbool ImGui_Implbgfx_CreateDeviceObjects();\n"
  },
  {
    "path": "bgfx-imgui/vs_ocornut_imgui.bin.h",
    "content": "static const uint8_t vs_ocornut_imgui_glsl[460] =\n{\n\t0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, // VSH............u\n\t0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewProj.......\n\t0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // .......attribute\n\t0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, //  vec4 a_color0;.\n\t0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, // attribute vec2 a\n\t0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, // _position;.attri\n\t0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, // bute vec2 a_texc\n\t0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, // oord0;.varying v\n\t0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, // ec4 v_color0;.va\n\t0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, // rying vec2 v_tex\n\t0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, // coord0;.uniform\n\t0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, // mat4 u_viewProj;\n\t0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, // .void main ().{.\n\t0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, //   vec4 tmpvar_1;\n\t0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, // .  tmpvar_1.zw =\n\t0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, //  vec2(0.0, 1.0);\n\t0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, // .  tmpvar_1.xy =\n\t0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x76, //  a_position;.  v\n\t0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, // ec4 tmpvar_2;.\n\t0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, // tmpvar_2.zw = ve\n\t0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, // c2(0.0, 1.0);.\n\t0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x75, // tmpvar_2.xy = (u\n\t0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // _viewProj * tmpv\n\t0x61, 0x72, 0x5f, 0x31, 0x29, 0x2e, 0x78, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, // ar_1).xy;.  gl_P\n\t0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // osition = tmpvar\n\t0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // _2;.  v_texcoord\n\t0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, // 0 = a_texcoord0;\n\t0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, // .  v_color0 = a_\n\t0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                         // color0;.}...\n};\nstatic const uint8_t vs_ocornut_imgui_essl[508] =\n{\n\t0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, // VSH............u\n\t0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewProj.......\n\t0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // .......attribute\n\t0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, //  highp vec4 a_co\n\t0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, // lor0;.attribute\n\t0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, // highp vec2 a_pos\n\t0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // ition;.attribute\n\t0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, //  highp vec2 a_te\n\t0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, // xcoord0;.varying\n\t0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x5f, 0x63, 0x6f, //  highp vec4 v_co\n\t0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, // lor0;.varying hi\n\t0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // ghp vec2 v_texco\n\t0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, // ord0;.uniform hi\n\t0x67, 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, // ghp mat4 u_viewP\n\t0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, // roj;.void main (\n\t0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // ).{.  highp vec4\n\t0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, //  tmpvar_1;.  tmp\n\t0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, // var_1.zw = vec2(\n\t0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // 0.0, 1.0);.  tmp\n\t0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, // var_1.xy = a_pos\n\t0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // ition;.  highp v\n\t0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, // ec4 tmpvar_2;.\n\t0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, // tmpvar_2.zw = ve\n\t0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, // c2(0.0, 1.0);.\n\t0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x75, // tmpvar_2.xy = (u\n\t0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // _viewProj * tmpv\n\t0x61, 0x72, 0x5f, 0x31, 0x29, 0x2e, 0x78, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, // ar_1).xy;.  gl_P\n\t0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // osition = tmpvar\n\t0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // _2;.  v_texcoord\n\t0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, // 0 = a_texcoord0;\n\t0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, // .  v_color0 = a_\n\t0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00,                         // color0;.}...\n};\nstatic const uint8_t vs_ocornut_imgui_spv[1293] =\n{\n\t0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, // VSH............u\n\t0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj.......\n\t0x00, 0x00, 0x00, 0xdc, 0x04, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, // .........#......\n\t0x00, 0x08, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, // ...|............\n\t0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, // ...........GLSL.\n\t0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, // std.450.........\n\t0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, // ................\n\t0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x42, // ...main....>...B\n\t0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x57, // ...E...P...S...W\n\t0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, // ................\n\t0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, // .......main.....\n\t0x00, 0x06, 0x00, 0x23, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, // ...#...UniformBl\n\t0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, // ock........#....\n\t0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x00, 0x05, // ...u_viewProj...\n\t0x00, 0x03, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x3e, // ...%...........>\n\t0x00, 0x00, 0x00, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x00, 0x00, 0x00, 0x00, 0x05, // ...a_color0.....\n\t0x00, 0x05, 0x00, 0x42, 0x00, 0x00, 0x00, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // ...B...a_positio\n\t0x6e, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x45, 0x00, 0x00, 0x00, 0x61, 0x5f, 0x74, 0x65, 0x78, // n......E...a_tex\n\t0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x50, 0x00, 0x00, 0x00, 0x40, // coord0.....P...@\n\t0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, // entryPointOutput\n\t0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x05, // .gl_Position....\n\t0x00, 0x09, 0x00, 0x53, 0x00, 0x00, 0x00, 0x40, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, // ...S...@entryPoi\n\t0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // ntOutput.v_color\n\t0x30, 0x00, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x57, 0x00, 0x00, 0x00, 0x40, 0x65, 0x6e, 0x74, 0x72, // 0......W...@entr\n\t0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x76, 0x5f, 0x74, // yPointOutput.v_t\n\t0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x23, // excoord0...H...#\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x23, // ...........H...#\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, // .......#.......H\n\t0x00, 0x05, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, // ...#............\n\t0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, // ...G...#.......G\n\t0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...%...\".......G\n\t0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...%...!.......G\n\t0x00, 0x04, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...>...........G\n\t0x00, 0x04, 0x00, 0x42, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, // ...B...........G\n\t0x00, 0x04, 0x00, 0x45, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, // ...E...........G\n\t0x00, 0x04, 0x00, 0x50, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...P...........G\n\t0x00, 0x04, 0x00, 0x53, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, // ...S...........G\n\t0x00, 0x04, 0x00, 0x57, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x13, // ...W............\n\t0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, // .......!........\n\t0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, // ........... ....\n\t0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x17, // ................\n\t0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, // ................\n\t0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, // ....... .......+\n\t0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2b, // ..............?+\n\t0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, // ................\n\t0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1e, // ...\"............\n\t0x00, 0x03, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x24, // ...#...\"... ...$\n\t0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x24, // .......#...;...$\n\t0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x14, // ...%.......+....\n\t0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x27, // ...&....... ...'\n\t0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x3d, // .......\"... ...=\n\t0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x3d, // ...........;...=\n\t0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x41, // ...>....... ...A\n\t0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x41, // ...........;...A\n\t0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x41, // ...B.......;...A\n\t0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4f, // ...E....... ...O\n\t0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4f, // ...........;...O\n\t0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4f, // ...P.......;...O\n\t0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x56, // ...S....... ...V\n\t0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x56, // ...........;...V\n\t0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, // ...W.......6....\n\t0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, // ................\n\t0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3f, // .......=.......?\n\t0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x43, // ...>...=.......C\n\t0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, // ...B...=.......F\n\t0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x71, // ...E...Q.......q\n\t0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, // ...C.......Q....\n\t0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, // ...r...C.......P\n\t0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x72, // .......s...q...r\n\t0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x27, // ...........A...'\n\t0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3d, // ...t...%...&...=\n\t0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x90, // ...\"...u...t....\n\t0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x75, // .......v...s...u\n\t0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x76, // ...Q.......x...v\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x7a, // .......Q.......z\n\t0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x07, // ...v.......P....\n\t0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x17, // ...{...x...z....\n\t0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x50, 0x00, 0x00, 0x00, 0x7b, // .......>...P...{\n\t0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x53, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3e, // ...>...S...?...>\n\t0x00, 0x03, 0x00, 0x57, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, // ...W...F.......8\n\t0x00, 0x01, 0x00, 0x00, 0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00,                   // ...........@.\n};\nstatic const uint8_t vs_ocornut_imgui_dx9[364] =\n{\n\t0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, // VSH............u\n\t0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj.......\n\t0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x20, 0x00, 0x43, // ...D......... .C\n\t0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x01, // TAB....S........\n\t0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, // ...........L...0\n\t0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, // ...........<....\n\t0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0xab, 0x03, // ...u_viewProj...\n\t0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, // ...............v\n\t0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, // s_3_0.Microsoft\n\t0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, // (R) HLSL Shader\n\t0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2e, 0x31, 0x00, 0xab, 0x51, // Compiler 10.1..Q\n\t0x00, 0x00, 0x05, 0x04, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, // ..............?.\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x00, // ................\n\t0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, // ................\n\t0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, // ................\n\t0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x80, 0x01, // ................\n\t0x00, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x80, 0x02, 0x00, 0x03, 0xe0, 0x05, // ................\n\t0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, // .............U..\n\t0x00, 0x00, 0x04, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, // ................\n\t0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0xe4, 0x80, 0x03, // ................\n\t0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, 0xe0, 0x04, 0x00, 0x44, 0xa0, 0x01, // .............D..\n\t0x00, 0x00, 0x02, 0x01, 0x00, 0x0f, 0xe0, 0x00, 0x00, 0xe4, 0x90, 0x01, 0x00, 0x00, 0x02, 0x02, // ................\n\t0x00, 0x03, 0xe0, 0x02, 0x00, 0xe4, 0x90, 0xff, 0xff, 0x00, 0x00, 0x00,                         // ............\n};\nstatic const uint8_t vs_ocornut_imgui_dx11[617] =\n{\n\t0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, // VSH............u\n\t0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj.......\n\t0x00, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xa9, 0x5b, 0xb0, 0xfb, 0xae, // ...8...DXBC.[...\n\t0x5e, 0xc6, 0x4a, 0xef, 0x25, 0x0b, 0x81, 0x23, 0x55, 0x3d, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, // ^.J.%..#U=.....8\n\t0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x10, // .......,........\n\t0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, // ...ISGNh........\n\t0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...P............\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x00, // ...........V....\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, // ................\n\t0x03, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ..._............\n\t0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, // ...........COLOR\n\t0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, // .POSITION.TEXCOO\n\t0x52, 0x44, 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, // RD.OSGNl........\n\t0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, // ...P............\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, // ................\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, // ................\n\t0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...b............\n\t0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, // ...........SV_PO\n\t0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, // SITION.COLOR.TEX\n\t0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, 0x20, 0x01, 0x00, 0x00, 0x40, // COORD..SHDR ...@\n\t0x00, 0x01, 0x00, 0x48, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, // ...H...Y...F. ..\n\t0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x00, // ......._........\n\t0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, // ..._...2......._\n\t0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, // ...2.......g....\n\t0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, //  ..........e....\n\t0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x02, //  ......e...2 ...\n\t0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x32, // ...h.......8...2\n\t0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // .......V.......F\n\t0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x32, // . .........2...2\n\t0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......F. ......\n\t0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, // ...........F....\n\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x32, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......2 ......F\n\t0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // .......F. ......\n\t0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xc2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // ...6.... .......\n\t0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // @...............\n\t0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, // ..?6.... ......F\n\t0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, 0x02, // .......6...2 ...\n\t0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, // ...F.......>....\n\t0x03, 0x05, 0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00,                                           // .......@.\n};\nstatic const uint8_t vs_ocornut_imgui_mtl[855] =\n{\n\t0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x01, 0x83, 0xf2, 0xe1, 0x01, 0x00, 0x0a, 0x75, // VSH............u\n\t0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, // _viewProj.......\n\t0x00, 0x00, 0x00, 0x26, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, // ...&...#include\n\t0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a, 0x23, // <metal_stdlib>.#\n\t0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, // include <simd/si\n\t0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, // md.h>..using nam\n\t0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, // espace metal;..s\n\t0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x0a, 0x7b, 0x0a, // truct _Global.{.\n\t0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x76, //     float4x4 u_v\n\t0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, // iewProj;.};..str\n\t0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, // uct xlatMtlMain_\n\t0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // out.{.    float4\n\t0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, //  _entryPointOutp\n\t0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, // ut_v_color0 [[us\n\t0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, // er(locn0)]];.\n\t0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, //  float2 _entryPo\n\t0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // intOutput_v_texc\n\t0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, // oord0 [[user(loc\n\t0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // n1)]];.    float\n\t0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, // 4 gl_Position [[\n\t0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, // position]];.};..\n\t0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // struct xlatMtlMa\n\t0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // in_in.{.    floa\n\t0x74, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, // t4 a_color0 [[at\n\t0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, // tribute(0)]];.\n\t0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, //   float2 a_posit\n\t0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, // ion [[attribute(\n\t0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, // 1)]];.    float2\n\t0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x61, //  a_texcoord0 [[a\n\t0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x32, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, // ttribute(2)]];.}\n\t0x3b, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // ;..vertex xlatMt\n\t0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // lMain_out xlatMt\n\t0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // lMain(xlatMtlMai\n\t0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, // n_in in [[stage_\n\t0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, // in]], constant _\n\t0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, // Global& _mtl_u [\n\t0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, // [buffer(0)]]).{.\n\t0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, //     xlatMtlMain_\n\t0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, // out out = {};.\n\t0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, //   out.gl_Positio\n\t0x6e, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, // n = float4((_mtl\n\t0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, // _u.u_viewProj *\n\t0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // float4(in.a_posi\n\t0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, // tion, 0.0, 1.0))\n\t0x2e, 0x78, 0x79, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, // .xy, 0.0, 1.0);.\n\t0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, //     out._entryPo\n\t0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, // intOutput_v_colo\n\t0x72, 0x30, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, // r0 = in.a_color0\n\t0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, // ;.    out._entry\n\t0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x74, 0x65, // PointOutput_v_te\n\t0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x74, // xcoord0 = in.a_t\n\t0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, // excoord0;.    re\n\t0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x03, 0x05, // turn out;.}.....\n\t0x00, 0x01, 0x00, 0x10, 0x00, 0x40, 0x00,                                                       // .....@.\n};\nextern const uint8_t* vs_ocornut_imgui_pssl;\nextern const uint32_t vs_ocornut_imgui_pssl_size;\n"
  },
  {
    "path": "cmake/superbuild.cmake",
    "content": "list(APPEND THIRD_PARTY_DEPENDENCIES bgfx imgui.cmake)\nif (NOT EMSCRIPTEN)\n  list(APPEND THIRD_PARTY_DEPENDENCIES SDL2)\nendif ()\n\nExternalProject_Add(\n  ${CMAKE_PROJECT_NAME}_superbuild\n  DEPENDS ${THIRD_PARTY_DEPENDENCIES}\n  SOURCE_DIR ${PROJECT_SOURCE_DIR}\n  BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}\n  INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}\n  CMAKE_ARGS\n    -DCMAKE_PREFIX_PATH=${CMAKE_CURRENT_SOURCE_DIR}/third-party/${THIRD_PARTY_BUILD_DIR_NAME}\n    -DSUPERBUILD=OFF\n    ${build_type_arg}\n    -DCMAKE_EXPORT_COMPILE_COMMANDS=ON\n  BUILD_COMMAND cmake --build <BINARY_DIR> ${build_config_arg}\n  INSTALL_COMMAND \"\")\n"
  },
  {
    "path": "compile-shaders-emscripten.bat",
    "content": "@echo off\n\nREM compile shaders\n\nif not exist shader\\embuild mkdir shader\\embuild\n\nREM simple shader\nthird-party\\build\\bin\\shaderc.exe ^\n-f shader\\v_simple.sc -o shader\\embuild\\v_simple.bin ^\n--platform asmjs --type vertex --verbose -i ./\n\nthird-party\\build\\bin\\shaderc.exe ^\n-f shader\\f_simple.sc -o shader\\embuild\\f_simple.bin ^\n--platform asmjs --type fragment --verbose -i ./\n"
  },
  {
    "path": "compile-shaders-emscripten.sh",
    "content": "#!/bin/bash\n\n# compile shaders\n\nmkdir -p shader/embuild\n\n# simple shader\n./third-party/build/bin/shaderc \\\n-f shader/v_simple.sc -o shader/embuild/v_simple.bin \\\n--platform asmjs --type vertex --verbose -i ./\n\n./third-party/build/bin/shaderc \\\n-f shader/f_simple.sc -o shader/embuild/f_simple.bin \\\n--platform asmjs --type fragment --verbose -i ./\n"
  },
  {
    "path": "compile-shaders-linux.sh",
    "content": "#!/bin/bash\n\n# compile shaders\n\nmkdir -p shader/build\n\n# simple shader\n./third-party/build/bin/shaderc \\\n-f shader/v_simple.sc -o shader/build/v_simple.bin \\\n--platform linux --type vertex --verbose -i ./ -p spirv\n\n./third-party/build/bin/shaderc \\\n-f shader/f_simple.sc -o shader/build/f_simple.bin \\\n--platform linux --type fragment --verbose -i ./ -p spirv\n"
  },
  {
    "path": "compile-shaders-macos.sh",
    "content": "#!/bin/bash\n\n# compile shaders\n\nmkdir -p shader/build\n\n# simple shader\n./third-party/build/bin/shaderc \\\n-f shader/v_simple.sc -o shader/build/v_simple.bin \\\n--platform osx --type vertex --verbose -i ./ -p metal\n\n./third-party/build/bin/shaderc \\\n-f shader/f_simple.sc -o shader/build/f_simple.bin \\\n--platform osx --type fragment --verbose -i ./ -p metal\n"
  },
  {
    "path": "compile-shaders-win.bat",
    "content": "@echo off\n\nREM compile shaders\n\nif not exist shader\\build mkdir shader\\build\n\nREM simple shader\nthird-party\\build\\bin\\shaderc.exe ^\n-f shader\\v_simple.sc -o shader\\build\\v_simple.bin ^\n--platform windows --type vertex --verbose -i ./ -p s_5_0\n\nthird-party\\build\\bin\\shaderc.exe ^\n-f shader\\f_simple.sc -o shader\\build\\f_simple.bin ^\n--platform windows --type fragment --verbose -i ./ -p s_5_0\n"
  },
  {
    "path": "configure-emscripten.bat",
    "content": "@echo off\n\nREM Commands to configure this repo and dependencies for building\n\ncall emcmake cmake -B embuild/debug-emscripten -G Ninja ^\n-DCMAKE_BUILD_TYPE=Debug -DSUPERBUILD=ON\n\ncall emcmake cmake -B embuild/release-emscripten -G Ninja ^\n-DCMAKE_BUILD_TYPE=Release -DSUPERBUILD=ON\n"
  },
  {
    "path": "configure-emscripten.sh",
    "content": "#!/bin/bash\n\n# Commands to configure this repo and dependencies for building\n\nemcmake cmake -B embuild/debug-emscripten -G Ninja \\\n-DCMAKE_BUILD_TYPE=Debug -DSUPERBUILD=ON\n\nemcmake cmake -B embuild/release-emscripten -G Ninja \\\n-DCMAKE_BUILD_TYPE=Release -DSUPERBUILD=ON\n"
  },
  {
    "path": "configure-make.sh",
    "content": "#!/bin/bash\n\n# Commands to configure this repo and dependencies for building\n\ncmake -B build/debug-make -G \"Unix Makefiles\" \\\n-DCMAKE_BUILD_TYPE=Debug -DSUPERBUILD=ON\n\ncmake -B build/release-make -G \"Unix Makefiles\" \\\n-DCMAKE_BUILD_TYPE=Release -DSUPERBUILD=ON\n"
  },
  {
    "path": "configure-ninja.bat",
    "content": "@echo off\n\nREM Commands to configure this repo and dependencies for building\n\ncmake -B build/debug-ninja -G Ninja -DCMAKE_BUILD_TYPE=Debug -DSUPERBUILD=ON\n\ncmake -B build/release-ninja -G Ninja -DCMAKE_BUILD_TYPE=Release -DSUPERBUILD=ON\n"
  },
  {
    "path": "configure-ninja.sh",
    "content": "#!/bin/bash\n\n# Commands to configure this repo and dependencies for building\n\ncmake -B build/debug-ninja -G Ninja -DCMAKE_BUILD_TYPE=Debug -DSUPERBUILD=ON\n\ncmake -B build/release-ninja -G Ninja -DCMAKE_BUILD_TYPE=Release -DSUPERBUILD=ON\n"
  },
  {
    "path": "configure-vs-19.bat",
    "content": "@echo off\n\nREM Commands to configure this repo and dependencies for building using the\nREM Visual Studio 2019 generator\n\ncmake -B build/vs2019 -G \"Visual Studio 16 2019\" -A x64 -DSUPERBUILD=ON\n"
  },
  {
    "path": "configure-vs-22.bat",
    "content": "@echo off\n\nREM Commands to configure this repo and dependencies for building using the\nREM Visual Studio 2022 generator\n\ncmake -B build/vs2022 -G \"Visual Studio 17 2022\" -A x64 -DSUPERBUILD=ON\n"
  },
  {
    "path": "file-ops.h",
    "content": "#pragma once\n\n#include <fstream>\n#include <iostream>\n\n// stream string operations derived from:\n// Optimized C++ by Kurt Guntheroth (O’Reilly).\n// Copyright 2016 Kurt Guntheroth, 978-1-491-92206-4\n\nnamespace fileops\n{\n\ninline std::streamoff stream_size(std::istream& file)\n{\n    std::istream::pos_type current_pos = file.tellg();\n    if (current_pos == std::istream::pos_type(-1)) {\n        return -1;\n    }\n    file.seekg(0, std::istream::end);\n    std::istream::pos_type end_pos = file.tellg();\n    file.seekg(current_pos);\n    return end_pos - current_pos;\n}\n\ninline bool stream_read_string(std::istream& file, std::string& fileContents)\n{\n    std::streamoff len = stream_size(file);\n    if (len == -1) {\n        return false;\n    }\n\n    fileContents.resize(static_cast<std::string::size_type>(len));\n\n    file.read(&fileContents[0], fileContents.length());\n    return true;\n}\n\ninline bool read_file(const std::string& filename, std::string& fileContents)\n{\n    std::ifstream file(filename, std::ios::binary);\n\n    if (!file.is_open()) {\n        return false;\n    }\n\n    const bool success = stream_read_string(file, fileContents);\n\n    file.close();\n\n    return success;\n}\n\n} // namespace fileops\n"
  },
  {
    "path": "main.cpp",
    "content": "#include <bgfx/bgfx.h>\n#include <bgfx/platform.h>\n#include <bx/math.h>\n\n#include <SDL.h>\n#include <SDL_syswm.h>\n\n#include \"bgfx-imgui/imgui_impl_bgfx.h\"\n#include \"file-ops.h\"\n#include \"imgui.h\"\n#include \"sdl-imgui/imgui_impl_sdl2.h\"\n\n#if BX_PLATFORM_EMSCRIPTEN\n#include \"emscripten.h\"\n#endif // BX_PLATFORM_EMSCRIPTEN\n\nstruct PosColorVertex\n{\n    float x;\n    float y;\n    float z;\n    uint32_t abgr;\n};\n\nstatic PosColorVertex cube_vertices[] = {\n    {-1.0f, 1.0f, 1.0f, 0xff000000},   {1.0f, 1.0f, 1.0f, 0xff0000ff},\n    {-1.0f, -1.0f, 1.0f, 0xff00ff00},  {1.0f, -1.0f, 1.0f, 0xff00ffff},\n    {-1.0f, 1.0f, -1.0f, 0xffff0000},  {1.0f, 1.0f, -1.0f, 0xffff00ff},\n    {-1.0f, -1.0f, -1.0f, 0xffffff00}, {1.0f, -1.0f, -1.0f, 0xffffffff},\n};\n\nstatic const uint16_t cube_tri_list[] = {\n    0, 1, 2, 1, 3, 2, 4, 6, 5, 5, 6, 7, 0, 2, 4, 4, 2, 6,\n    1, 5, 3, 5, 7, 3, 0, 4, 1, 4, 5, 1, 2, 3, 6, 6, 3, 7,\n};\n\nstatic bgfx::ShaderHandle create_shader(\n    const std::string& shader, const char* name)\n{\n    const bgfx::Memory* mem = bgfx::copy(shader.data(), shader.size());\n    const bgfx::ShaderHandle handle = bgfx::createShader(mem);\n    bgfx::setName(handle, name);\n    return handle;\n}\n\nstruct context_t\n{\n    SDL_Window* window = nullptr;\n    bgfx::ProgramHandle program = BGFX_INVALID_HANDLE;\n    bgfx::VertexBufferHandle vbh = BGFX_INVALID_HANDLE;\n    bgfx::IndexBufferHandle ibh = BGFX_INVALID_HANDLE;\n\n    float cam_pitch = 0.0f;\n    float cam_yaw = 0.0f;\n    float rot_scale = 0.01f;\n\n    int prev_mouse_x = 0;\n    int prev_mouse_y = 0;\n\n    int width = 0;\n    int height = 0;\n\n    bool quit = false;\n};\n\nvoid main_loop(void* data)\n{\n    auto context = static_cast<context_t*>(data);\n\n    for (SDL_Event current_event; SDL_PollEvent(&current_event) != 0;) {\n        ImGui_ImplSDL2_ProcessEvent(&current_event);\n        if (current_event.type == SDL_QUIT) {\n            context->quit = true;\n            break;\n        }\n    }\n\n    ImGui_Implbgfx_NewFrame();\n    ImGui_ImplSDL2_NewFrame();\n\n    ImGui::NewFrame();\n    ImGui::ShowDemoWindow(); // your drawing here\n    ImGui::Render();\n    ImGui_Implbgfx_RenderDrawLists(ImGui::GetDrawData());\n\n    if (!ImGui::GetIO().WantCaptureMouse) {\n        // simple input code for orbit camera\n        int mouse_x, mouse_y;\n        const int buttons = SDL_GetMouseState(&mouse_x, &mouse_y);\n        if ((buttons & SDL_BUTTON(SDL_BUTTON_LEFT)) != 0) {\n            int delta_x = mouse_x - context->prev_mouse_x;\n            int delta_y = mouse_y - context->prev_mouse_y;\n            context->cam_yaw += float(-delta_x) * context->rot_scale;\n            context->cam_pitch += float(-delta_y) * context->rot_scale;\n        }\n        context->prev_mouse_x = mouse_x;\n        context->prev_mouse_y = mouse_y;\n    }\n\n    float cam_rotation[16];\n    bx::mtxRotateXYZ(cam_rotation, context->cam_pitch, context->cam_yaw, 0.0f);\n\n    float cam_translation[16];\n    bx::mtxTranslate(cam_translation, 0.0f, 0.0f, -5.0f);\n\n    float cam_transform[16];\n    bx::mtxMul(cam_transform, cam_translation, cam_rotation);\n\n    float view[16];\n    bx::mtxInverse(view, cam_transform);\n\n    float proj[16];\n    bx::mtxProj(\n        proj, 60.0f, float(context->width) / float(context->height), 0.1f,\n        100.0f, bgfx::getCaps()->homogeneousDepth);\n\n    bgfx::setViewTransform(0, view, proj);\n\n    float model[16];\n    bx::mtxIdentity(model);\n    bgfx::setTransform(model);\n\n    bgfx::setVertexBuffer(0, context->vbh);\n    bgfx::setIndexBuffer(context->ibh);\n\n    bgfx::submit(0, context->program);\n\n    bgfx::frame();\n\n#if BX_PLATFORM_EMSCRIPTEN\n    if (context->quit) {\n        emscripten_cancel_main_loop();\n    }\n#endif\n}\n\nint main(int argc, char** argv)\n{\n    if (SDL_Init(SDL_INIT_VIDEO) < 0) {\n        printf(\"SDL could not initialize. SDL_Error: %s\\n\", SDL_GetError());\n        return 1;\n    }\n\n    const int width = 800;\n    const int height = 600;\n    SDL_Window* window = SDL_CreateWindow(\n        argv[0], SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width,\n        height, SDL_WINDOW_SHOWN);\n\n    if (window == nullptr) {\n        printf(\"Window could not be created. SDL_Error: %s\\n\", SDL_GetError());\n        return 1;\n    }\n\n#if !BX_PLATFORM_EMSCRIPTEN\n    SDL_SysWMinfo wmi;\n    SDL_VERSION(&wmi.version);\n    if (!SDL_GetWindowWMInfo(window, &wmi)) {\n        printf(\n            \"SDL_SysWMinfo could not be retrieved. SDL_Error: %s\\n\",\n            SDL_GetError());\n        return 1;\n    }\n    bgfx::renderFrame(); // single threaded mode\n#endif // !BX_PLATFORM_EMSCRIPTEN\n\n    bgfx::PlatformData pd{};\n#if BX_PLATFORM_WINDOWS\n    pd.nwh = wmi.info.win.window;\n#elif BX_PLATFORM_OSX\n    pd.nwh = wmi.info.cocoa.window;\n#elif BX_PLATFORM_LINUX\n    pd.ndt = wmi.info.x11.display;\n    pd.nwh = (void*)(uintptr_t)wmi.info.x11.window;\n#elif BX_PLATFORM_EMSCRIPTEN\n    pd.nwh = (void*)\"#canvas\";\n#endif // BX_PLATFORM_WINDOWS ? BX_PLATFORM_OSX ? BX_PLATFORM_LINUX ?\n       // BX_PLATFORM_EMSCRIPTEN\n\n    bgfx::Init bgfx_init;\n    bgfx_init.type = bgfx::RendererType::Count; // auto choose renderer\n    bgfx_init.resolution.width = width;\n    bgfx_init.resolution.height = height;\n    bgfx_init.resolution.reset = BGFX_RESET_VSYNC;\n    bgfx_init.platformData = pd;\n    bgfx::init(bgfx_init);\n\n    bgfx::setViewClear(\n        0, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x6495EDFF, 1.0f, 0);\n    bgfx::setViewRect(0, 0, 0, width, height);\n\n    ImGui::CreateContext();\n\n    ImGui_Implbgfx_Init(255);\n#if BX_PLATFORM_WINDOWS\n    ImGui_ImplSDL2_InitForD3D(window);\n#elif BX_PLATFORM_OSX\n    ImGui_ImplSDL2_InitForMetal(window);\n#elif BX_PLATFORM_LINUX || BX_PLATFORM_EMSCRIPTEN\n    ImGui_ImplSDL2_InitForOpenGL(window, nullptr);\n#endif // BX_PLATFORM_WINDOWS ? BX_PLATFORM_OSX ? BX_PLATFORM_LINUX ?\n       // BX_PLATFORM_EMSCRIPTEN\n\n    bgfx::VertexLayout pos_col_vert_layout;\n    pos_col_vert_layout.begin()\n        .add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float)\n        .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true)\n        .end();\n    bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer(\n        bgfx::makeRef(cube_vertices, sizeof(cube_vertices)),\n        pos_col_vert_layout);\n    bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(\n        bgfx::makeRef(cube_tri_list, sizeof(cube_tri_list)));\n\n    const std::string shader_root =\n#if BX_PLATFORM_EMSCRIPTEN\n        \"shader/embuild/\";\n#else\n        \"shader/build/\";\n#endif // BX_PLATFORM_EMSCRIPTEN\n\n    std::string vshader;\n    if (!fileops::read_file(shader_root + \"v_simple.bin\", vshader)) {\n        printf(\"Could not find shader vertex shader (ensure shaders have been \"\n               \"compiled).\\n\"\n               \"Run compile-shaders-<platform>.sh/bat\\n\");\n        return 1;\n    }\n\n    std::string fshader;\n    if (!fileops::read_file(shader_root + \"f_simple.bin\", fshader)) {\n        printf(\"Could not find shader fragment shader (ensure shaders have \"\n               \"been compiled).\\n\"\n               \"Run compile-shaders-<platform>.sh/bat\\n\");\n        return 1;\n    }\n\n    bgfx::ShaderHandle vsh = create_shader(vshader, \"vshader\");\n    bgfx::ShaderHandle fsh = create_shader(fshader, \"fshader\");\n    bgfx::ProgramHandle program = bgfx::createProgram(vsh, fsh, true);\n\n    context_t context;\n    context.width = width;\n    context.height = height;\n    context.program = program;\n    context.window = window;\n    context.vbh = vbh;\n    context.ibh = ibh;\n\n#if BX_PLATFORM_EMSCRIPTEN\n    emscripten_set_main_loop_arg(main_loop, &context, -1, 1);\n#else\n    while (!context.quit) {\n        main_loop(&context);\n    }\n#endif // BX_PLATFORM_EMSCRIPTEN\n\n    bgfx::destroy(vbh);\n    bgfx::destroy(ibh);\n    bgfx::destroy(program);\n\n    ImGui_ImplSDL2_Shutdown();\n    ImGui_Implbgfx_Shutdown();\n\n    ImGui::DestroyContext();\n    bgfx::shutdown();\n\n    SDL_DestroyWindow(window);\n    SDL_Quit();\n\n    return 0;\n}\n"
  },
  {
    "path": "run-clang-format.bat",
    "content": "@echo off\n\nfd -0 -e h -e cpp -a -E \"sdl-imgui\" | xargs -0 clang-format -i\n"
  },
  {
    "path": "sdl-imgui/README.md",
    "content": "# sdl-imgui\n\nThese two files are direct copies of [imgui_impl_sdl.h](https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_sdl.h) and [imgui_impl_sdl.cpp](https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_sdl.cpp) from [Dear ImGui](https://github.com/ocornut/imgui) (commit [c6cab1f](https://github.com/ocornut/imgui/commit/c6cab1f352bbf80e51439be8311a84f7fc9acbbb)).\n"
  },
  {
    "path": "sdl-imgui/imgui_impl_sdl2.cpp",
    "content": "// dear imgui: Platform Backend for SDL2\n// This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..)\n// (Info: SDL2 is a cross-platform general purpose library for handling windows, inputs, graphics context creation, etc.)\n// (Prefer SDL 2.0.5+ for full feature support.)\n\n// Implemented features:\n//  [X] Platform: Clipboard support.\n//  [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen.\n//  [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 SDL_SCANCODE_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set]\n//  [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.\n//  [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.\n//  [X] Platform: Basic IME support. App needs to call 'SDL_SetHint(SDL_HINT_IME_SHOW_UI, \"1\");' before SDL_CreateWindow()!.\n\n// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.\n// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.\n// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.\n// Read online: https://github.com/ocornut/imgui/tree/master/docs\n\n// CHANGELOG\n// (minor and older changes stripped away, please see git history for details)\n//  2023-04-04: Inputs: Added support for io.AddMouseSourceEvent() to discriminate ImGuiMouseSource_Mouse/ImGuiMouseSource_TouchScreen. (#2702)\n//  2023-02-23: Accept SDL_GetPerformanceCounter() not returning a monotonically increasing value. (#6189, #6114, #3644)\n//  2023-02-07: Implement IME handler (io.SetPlatformImeDataFn will call SDL_SetTextInputRect()/SDL_StartTextInput()).\n//  2023-02-07: *BREAKING CHANGE* Renamed this backend file from imgui_impl_sdl.cpp/.h to imgui_impl_sdl2.cpp/.h in prevision for the future release of SDL3.\n//  2023-02-02: Avoid calling SDL_SetCursor() when cursor has not changed, as the function is surprisingly costly on Mac with latest SDL (may be fixed in next SDL version).\n//  2023-02-02: Added support for SDL 2.0.18+ preciseX/preciseY mouse wheel data for smooth scrolling + Scaling X value on Emscripten (bug?). (#4019, #6096)\n//  2023-02-02: Removed SDL_MOUSEWHEEL value clamping, as values seem correct in latest Emscripten. (#4019)\n//  2023-02-01: Flipping SDL_MOUSEWHEEL 'wheel.x' value to match other backends and offer consistent horizontal scrolling direction. (#4019, #6096, #1463)\n//  2022-10-11: Using 'nullptr' instead of 'NULL' as per our switch to C++11.\n//  2022-09-26: Inputs: Disable SDL 2.0.22 new \"auto capture\" (SDL_HINT_MOUSE_AUTO_CAPTURE) which prevents drag and drop across windows for multi-viewport support + don't capture when drag and dropping. (#5710)\n//  2022-09-26: Inputs: Renamed ImGuiKey_ModXXX introduced in 1.87 to ImGuiMod_XXX (old names still supported).\n//  2022-03-22: Inputs: Fix mouse position issues when dragging outside of boundaries. SDL_CaptureMouse() erroneously still gives out LEAVE events when hovering OS decorations.\n//  2022-03-22: Inputs: Added support for extra mouse buttons (SDL_BUTTON_X1/SDL_BUTTON_X2).\n//  2022-02-04: Added SDL_Renderer* parameter to ImGui_ImplSDL2_InitForSDLRenderer(), so we can use SDL_GetRendererOutputSize() instead of SDL_GL_GetDrawableSize() when bound to a SDL_Renderer.\n//  2022-01-26: Inputs: replaced short-lived io.AddKeyModsEvent() (added two weeks ago) with io.AddKeyEvent() using ImGuiKey_ModXXX flags. Sorry for the confusion.\n//  2021-01-20: Inputs: calling new io.AddKeyAnalogEvent() for gamepad support, instead of writing directly to io.NavInputs[].\n//  2022-01-17: Inputs: calling new io.AddMousePosEvent(), io.AddMouseButtonEvent(), io.AddMouseWheelEvent() API (1.87+).\n//  2022-01-17: Inputs: always update key mods next and before key event (not in NewFrame) to fix input queue with very low framerates.\n//  2022-01-12: Update mouse inputs using SDL_MOUSEMOTION/SDL_WINDOWEVENT_LEAVE + fallback to provide it when focused but not hovered/captured. More standard and will allow us to pass it to future input queue API.\n//  2022-01-12: Maintain our own copy of MouseButtonsDown mask instead of using ImGui::IsAnyMouseDown() which will be obsoleted.\n//  2022-01-10: Inputs: calling new io.AddKeyEvent(), io.AddKeyModsEvent() + io.SetKeyEventNativeData() API (1.87+). Support for full ImGuiKey range.\n//  2021-08-17: Calling io.AddFocusEvent() on SDL_WINDOWEVENT_FOCUS_GAINED/SDL_WINDOWEVENT_FOCUS_LOST.\n//  2021-07-29: Inputs: MousePos is correctly reported when the host platform window is hovered but not focused (using SDL_GetMouseFocus() + SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, requires SDL 2.0.5+)\n//  2021-06-29: *BREAKING CHANGE* Removed 'SDL_Window* window' parameter to ImGui_ImplSDL2_NewFrame() which was unnecessary.\n//  2021-06-29: Reorganized backend to pull data from a single structure to facilitate usage with multiple-contexts (all g_XXXX access changed to bd->XXXX).\n//  2021-03-22: Rework global mouse pos availability check listing supported platforms explicitly, effectively fixing mouse access on Raspberry Pi. (#2837, #3950)\n//  2020-05-25: Misc: Report a zero display-size when window is minimized, to be consistent with other backends.\n//  2020-02-20: Inputs: Fixed mapping for ImGuiKey_KeyPadEnter (using SDL_SCANCODE_KP_ENTER instead of SDL_SCANCODE_RETURN2).\n//  2019-12-17: Inputs: On Wayland, use SDL_GetMouseState (because there is no global mouse state).\n//  2019-12-05: Inputs: Added support for ImGuiMouseCursor_NotAllowed mouse cursor.\n//  2019-07-21: Inputs: Added mapping for ImGuiKey_KeyPadEnter.\n//  2019-04-23: Inputs: Added support for SDL_GameController (if ImGuiConfigFlags_NavEnableGamepad is set by user application).\n//  2019-03-12: Misc: Preserve DisplayFramebufferScale when main window is minimized.\n//  2018-12-21: Inputs: Workaround for Android/iOS which don't seem to handle focus related calls.\n//  2018-11-30: Misc: Setting up io.BackendPlatformName so it can be displayed in the About Window.\n//  2018-11-14: Changed the signature of ImGui_ImplSDL2_ProcessEvent() to take a 'const SDL_Event*'.\n//  2018-08-01: Inputs: Workaround for Emscripten which doesn't seem to handle focus related calls.\n//  2018-06-29: Inputs: Added support for the ImGuiMouseCursor_Hand cursor.\n//  2018-06-08: Misc: Extracted imgui_impl_sdl.cpp/.h away from the old combined SDL2+OpenGL/Vulkan examples.\n//  2018-06-08: Misc: ImGui_ImplSDL2_InitForOpenGL() now takes a SDL_GLContext parameter.\n//  2018-05-09: Misc: Fixed clipboard paste memory leak (we didn't call SDL_FreeMemory on the data returned by SDL_GetClipboardText).\n//  2018-03-20: Misc: Setup io.BackendFlags ImGuiBackendFlags_HasMouseCursors flag + honor ImGuiConfigFlags_NoMouseCursorChange flag.\n//  2018-02-16: Inputs: Added support for mouse cursors, honoring ImGui::GetMouseCursor() value.\n//  2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.\n//  2018-02-06: Inputs: Added mapping for ImGuiKey_Space.\n//  2018-02-05: Misc: Using SDL_GetPerformanceCounter() instead of SDL_GetTicks() to be able to handle very high framerate (1000+ FPS).\n//  2018-02-05: Inputs: Keyboard mapping is using scancodes everywhere instead of a confusing mixture of keycodes and scancodes.\n//  2018-01-20: Inputs: Added Horizontal Mouse Wheel support.\n//  2018-01-19: Inputs: When available (SDL 2.0.4+) using SDL_CaptureMouse() to retrieve coordinates outside of client area when dragging. Otherwise (SDL 2.0.3 and before) testing for SDL_WINDOW_INPUT_FOCUS instead of SDL_WINDOW_MOUSE_FOCUS.\n//  2018-01-18: Inputs: Added mapping for ImGuiKey_Insert.\n//  2017-08-25: Inputs: MousePos set to -FLT_MAX,-FLT_MAX when mouse is unavailable/missing (instead of -1,-1).\n//  2016-10-15: Misc: Added a void* user_data parameter to Clipboard function handlers.\n\n#include \"imgui.h\"\n#include \"imgui_impl_sdl2.h\"\n\n// Clang warnings with -Weverything\n#if defined(__clang__)\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wimplicit-int-float-conversion\"  // warning: implicit conversion from 'xxx' to 'float' may lose precision\n#endif\n\n// SDL\n#include <SDL.h>\n#include <SDL_syswm.h>\n#if defined(__APPLE__)\n#include <TargetConditionals.h>\n#endif\n\n#if SDL_VERSION_ATLEAST(2,0,4) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__) && !(defined(__APPLE__) && TARGET_OS_IOS) && !defined(__amigaos4__)\n#define SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE    1\n#else\n#define SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE    0\n#endif\n#define SDL_HAS_VULKAN                      SDL_VERSION_ATLEAST(2,0,6)\n\n// SDL Data\nstruct ImGui_ImplSDL2_Data\n{\n    SDL_Window*     Window;\n    SDL_Renderer*   Renderer;\n    Uint64          Time;\n    Uint32          MouseWindowID;\n    int             MouseButtonsDown;\n    SDL_Cursor*     MouseCursors[ImGuiMouseCursor_COUNT];\n    SDL_Cursor*     LastMouseCursor;\n    int             PendingMouseLeaveFrame;\n    char*           ClipboardTextData;\n    bool            MouseCanUseGlobalState;\n\n    ImGui_ImplSDL2_Data()   { memset((void*)this, 0, sizeof(*this)); }\n};\n\n// Backend data stored in io.BackendPlatformUserData to allow support for multiple Dear ImGui contexts\n// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.\n// FIXME: multi-context support is not well tested and probably dysfunctional in this backend.\n// FIXME: some shared resources (mouse cursor shape, gamepad) are mishandled when using multi-context.\nstatic ImGui_ImplSDL2_Data* ImGui_ImplSDL2_GetBackendData()\n{\n    return ImGui::GetCurrentContext() ? (ImGui_ImplSDL2_Data*)ImGui::GetIO().BackendPlatformUserData : nullptr;\n}\n\n// Functions\nstatic const char* ImGui_ImplSDL2_GetClipboardText(void*)\n{\n    ImGui_ImplSDL2_Data* bd = ImGui_ImplSDL2_GetBackendData();\n    if (bd->ClipboardTextData)\n        SDL_free(bd->ClipboardTextData);\n    bd->ClipboardTextData = SDL_GetClipboardText();\n    return bd->ClipboardTextData;\n}\n\nstatic void ImGui_ImplSDL2_SetClipboardText(void*, const char* text)\n{\n    SDL_SetClipboardText(text);\n}\n\n// Note: native IME will only display if user calls SDL_SetHint(SDL_HINT_IME_SHOW_UI, \"1\") _before_ SDL_CreateWindow().\nstatic void ImGui_ImplSDL2_SetPlatformImeData(ImGuiViewport*, ImGuiPlatformImeData* data)\n{\n    if (data->WantVisible)\n    {\n        SDL_Rect r;\n        r.x = (int)data->InputPos.x;\n        r.y = (int)data->InputPos.y;\n        r.w = 1;\n        r.h = (int)data->InputLineHeight;\n        SDL_SetTextInputRect(&r);\n        SDL_StartTextInput();\n    }\n    else\n    {\n        SDL_StopTextInput();\n    }\n}\n\nstatic ImGuiKey ImGui_ImplSDL2_KeycodeToImGuiKey(int keycode)\n{\n    switch (keycode)\n    {\n        case SDLK_TAB: return ImGuiKey_Tab;\n        case SDLK_LEFT: return ImGuiKey_LeftArrow;\n        case SDLK_RIGHT: return ImGuiKey_RightArrow;\n        case SDLK_UP: return ImGuiKey_UpArrow;\n        case SDLK_DOWN: return ImGuiKey_DownArrow;\n        case SDLK_PAGEUP: return ImGuiKey_PageUp;\n        case SDLK_PAGEDOWN: return ImGuiKey_PageDown;\n        case SDLK_HOME: return ImGuiKey_Home;\n        case SDLK_END: return ImGuiKey_End;\n        case SDLK_INSERT: return ImGuiKey_Insert;\n        case SDLK_DELETE: return ImGuiKey_Delete;\n        case SDLK_BACKSPACE: return ImGuiKey_Backspace;\n        case SDLK_SPACE: return ImGuiKey_Space;\n        case SDLK_RETURN: return ImGuiKey_Enter;\n        case SDLK_ESCAPE: return ImGuiKey_Escape;\n        case SDLK_QUOTE: return ImGuiKey_Apostrophe;\n        case SDLK_COMMA: return ImGuiKey_Comma;\n        case SDLK_MINUS: return ImGuiKey_Minus;\n        case SDLK_PERIOD: return ImGuiKey_Period;\n        case SDLK_SLASH: return ImGuiKey_Slash;\n        case SDLK_SEMICOLON: return ImGuiKey_Semicolon;\n        case SDLK_EQUALS: return ImGuiKey_Equal;\n        case SDLK_LEFTBRACKET: return ImGuiKey_LeftBracket;\n        case SDLK_BACKSLASH: return ImGuiKey_Backslash;\n        case SDLK_RIGHTBRACKET: return ImGuiKey_RightBracket;\n        case SDLK_BACKQUOTE: return ImGuiKey_GraveAccent;\n        case SDLK_CAPSLOCK: return ImGuiKey_CapsLock;\n        case SDLK_SCROLLLOCK: return ImGuiKey_ScrollLock;\n        case SDLK_NUMLOCKCLEAR: return ImGuiKey_NumLock;\n        case SDLK_PRINTSCREEN: return ImGuiKey_PrintScreen;\n        case SDLK_PAUSE: return ImGuiKey_Pause;\n        case SDLK_KP_0: return ImGuiKey_Keypad0;\n        case SDLK_KP_1: return ImGuiKey_Keypad1;\n        case SDLK_KP_2: return ImGuiKey_Keypad2;\n        case SDLK_KP_3: return ImGuiKey_Keypad3;\n        case SDLK_KP_4: return ImGuiKey_Keypad4;\n        case SDLK_KP_5: return ImGuiKey_Keypad5;\n        case SDLK_KP_6: return ImGuiKey_Keypad6;\n        case SDLK_KP_7: return ImGuiKey_Keypad7;\n        case SDLK_KP_8: return ImGuiKey_Keypad8;\n        case SDLK_KP_9: return ImGuiKey_Keypad9;\n        case SDLK_KP_PERIOD: return ImGuiKey_KeypadDecimal;\n        case SDLK_KP_DIVIDE: return ImGuiKey_KeypadDivide;\n        case SDLK_KP_MULTIPLY: return ImGuiKey_KeypadMultiply;\n        case SDLK_KP_MINUS: return ImGuiKey_KeypadSubtract;\n        case SDLK_KP_PLUS: return ImGuiKey_KeypadAdd;\n        case SDLK_KP_ENTER: return ImGuiKey_KeypadEnter;\n        case SDLK_KP_EQUALS: return ImGuiKey_KeypadEqual;\n        case SDLK_LCTRL: return ImGuiKey_LeftCtrl;\n        case SDLK_LSHIFT: return ImGuiKey_LeftShift;\n        case SDLK_LALT: return ImGuiKey_LeftAlt;\n        case SDLK_LGUI: return ImGuiKey_LeftSuper;\n        case SDLK_RCTRL: return ImGuiKey_RightCtrl;\n        case SDLK_RSHIFT: return ImGuiKey_RightShift;\n        case SDLK_RALT: return ImGuiKey_RightAlt;\n        case SDLK_RGUI: return ImGuiKey_RightSuper;\n        case SDLK_APPLICATION: return ImGuiKey_Menu;\n        case SDLK_0: return ImGuiKey_0;\n        case SDLK_1: return ImGuiKey_1;\n        case SDLK_2: return ImGuiKey_2;\n        case SDLK_3: return ImGuiKey_3;\n        case SDLK_4: return ImGuiKey_4;\n        case SDLK_5: return ImGuiKey_5;\n        case SDLK_6: return ImGuiKey_6;\n        case SDLK_7: return ImGuiKey_7;\n        case SDLK_8: return ImGuiKey_8;\n        case SDLK_9: return ImGuiKey_9;\n        case SDLK_a: return ImGuiKey_A;\n        case SDLK_b: return ImGuiKey_B;\n        case SDLK_c: return ImGuiKey_C;\n        case SDLK_d: return ImGuiKey_D;\n        case SDLK_e: return ImGuiKey_E;\n        case SDLK_f: return ImGuiKey_F;\n        case SDLK_g: return ImGuiKey_G;\n        case SDLK_h: return ImGuiKey_H;\n        case SDLK_i: return ImGuiKey_I;\n        case SDLK_j: return ImGuiKey_J;\n        case SDLK_k: return ImGuiKey_K;\n        case SDLK_l: return ImGuiKey_L;\n        case SDLK_m: return ImGuiKey_M;\n        case SDLK_n: return ImGuiKey_N;\n        case SDLK_o: return ImGuiKey_O;\n        case SDLK_p: return ImGuiKey_P;\n        case SDLK_q: return ImGuiKey_Q;\n        case SDLK_r: return ImGuiKey_R;\n        case SDLK_s: return ImGuiKey_S;\n        case SDLK_t: return ImGuiKey_T;\n        case SDLK_u: return ImGuiKey_U;\n        case SDLK_v: return ImGuiKey_V;\n        case SDLK_w: return ImGuiKey_W;\n        case SDLK_x: return ImGuiKey_X;\n        case SDLK_y: return ImGuiKey_Y;\n        case SDLK_z: return ImGuiKey_Z;\n        case SDLK_F1: return ImGuiKey_F1;\n        case SDLK_F2: return ImGuiKey_F2;\n        case SDLK_F3: return ImGuiKey_F3;\n        case SDLK_F4: return ImGuiKey_F4;\n        case SDLK_F5: return ImGuiKey_F5;\n        case SDLK_F6: return ImGuiKey_F6;\n        case SDLK_F7: return ImGuiKey_F7;\n        case SDLK_F8: return ImGuiKey_F8;\n        case SDLK_F9: return ImGuiKey_F9;\n        case SDLK_F10: return ImGuiKey_F10;\n        case SDLK_F11: return ImGuiKey_F11;\n        case SDLK_F12: return ImGuiKey_F12;\n    }\n    return ImGuiKey_None;\n}\n\nstatic void ImGui_ImplSDL2_UpdateKeyModifiers(SDL_Keymod sdl_key_mods)\n{\n    ImGuiIO& io = ImGui::GetIO();\n    io.AddKeyEvent(ImGuiMod_Ctrl, (sdl_key_mods & KMOD_CTRL) != 0);\n    io.AddKeyEvent(ImGuiMod_Shift, (sdl_key_mods & KMOD_SHIFT) != 0);\n    io.AddKeyEvent(ImGuiMod_Alt, (sdl_key_mods & KMOD_ALT) != 0);\n    io.AddKeyEvent(ImGuiMod_Super, (sdl_key_mods & KMOD_GUI) != 0);\n}\n\n// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.\n// - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application, or clear/overwrite your copy of the mouse data.\n// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application, or clear/overwrite your copy of the keyboard data.\n// Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.\n// If you have multiple SDL events and some of them are not meant to be used by dear imgui, you may need to filter events based on their windowID field.\nbool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event)\n{\n    ImGuiIO& io = ImGui::GetIO();\n    ImGui_ImplSDL2_Data* bd = ImGui_ImplSDL2_GetBackendData();\n\n    switch (event->type)\n    {\n        case SDL_MOUSEMOTION:\n        {\n            ImVec2 mouse_pos((float)event->motion.x, (float)event->motion.y);\n            io.AddMouseSourceEvent(event->motion.which == SDL_TOUCH_MOUSEID ? ImGuiMouseSource_TouchScreen : ImGuiMouseSource_Mouse);\n            io.AddMousePosEvent(mouse_pos.x, mouse_pos.y);\n            return true;\n        }\n        case SDL_MOUSEWHEEL:\n        {\n            //IMGUI_DEBUG_LOG(\"wheel %.2f %.2f, precise %.2f %.2f\\n\", (float)event->wheel.x, (float)event->wheel.y, event->wheel.preciseX, event->wheel.preciseY);\n#if SDL_VERSION_ATLEAST(2,0,18) // If this fails to compile on Emscripten: update to latest Emscripten!\n            float wheel_x = -event->wheel.preciseX;\n            float wheel_y = event->wheel.preciseY;\n#else\n            float wheel_x = -(float)event->wheel.x;\n            float wheel_y = (float)event->wheel.y;\n#endif\n#ifdef __EMSCRIPTEN__\n            wheel_x /= 100.0f;\n#endif\n            io.AddMouseSourceEvent(event->wheel.which == SDL_TOUCH_MOUSEID ? ImGuiMouseSource_TouchScreen : ImGuiMouseSource_Mouse);\n            io.AddMouseWheelEvent(wheel_x, wheel_y);\n            return true;\n        }\n        case SDL_MOUSEBUTTONDOWN:\n        case SDL_MOUSEBUTTONUP:\n        {\n            int mouse_button = -1;\n            if (event->button.button == SDL_BUTTON_LEFT) { mouse_button = 0; }\n            if (event->button.button == SDL_BUTTON_RIGHT) { mouse_button = 1; }\n            if (event->button.button == SDL_BUTTON_MIDDLE) { mouse_button = 2; }\n            if (event->button.button == SDL_BUTTON_X1) { mouse_button = 3; }\n            if (event->button.button == SDL_BUTTON_X2) { mouse_button = 4; }\n            if (mouse_button == -1)\n                break;\n            io.AddMouseSourceEvent(event->button.which == SDL_TOUCH_MOUSEID ? ImGuiMouseSource_TouchScreen : ImGuiMouseSource_Mouse);\n            io.AddMouseButtonEvent(mouse_button, (event->type == SDL_MOUSEBUTTONDOWN));\n            bd->MouseButtonsDown = (event->type == SDL_MOUSEBUTTONDOWN) ? (bd->MouseButtonsDown | (1 << mouse_button)) : (bd->MouseButtonsDown & ~(1 << mouse_button));\n            return true;\n        }\n        case SDL_TEXTINPUT:\n        {\n            io.AddInputCharactersUTF8(event->text.text);\n            return true;\n        }\n        case SDL_KEYDOWN:\n        case SDL_KEYUP:\n        {\n            ImGui_ImplSDL2_UpdateKeyModifiers((SDL_Keymod)event->key.keysym.mod);\n            ImGuiKey key = ImGui_ImplSDL2_KeycodeToImGuiKey(event->key.keysym.sym);\n            io.AddKeyEvent(key, (event->type == SDL_KEYDOWN));\n            io.SetKeyEventNativeData(key, event->key.keysym.sym, event->key.keysym.scancode, event->key.keysym.scancode); // To support legacy indexing (<1.87 user code). Legacy backend uses SDLK_*** as indices to IsKeyXXX() functions.\n            return true;\n        }\n        case SDL_WINDOWEVENT:\n        {\n            // - When capturing mouse, SDL will send a bunch of conflicting LEAVE/ENTER event on every mouse move, but the final ENTER tends to be right.\n            // - However we won't get a correct LEAVE event for a captured window.\n            // - In some cases, when detaching a window from main viewport SDL may send SDL_WINDOWEVENT_ENTER one frame too late,\n            //   causing SDL_WINDOWEVENT_LEAVE on previous frame to interrupt drag operation by clear mouse position. This is why\n            //   we delay process the SDL_WINDOWEVENT_LEAVE events by one frame. See issue #5012 for details.\n            Uint8 window_event = event->window.event;\n            if (window_event == SDL_WINDOWEVENT_ENTER)\n            {\n                bd->MouseWindowID = event->window.windowID;\n                bd->PendingMouseLeaveFrame = 0;\n            }\n            if (window_event == SDL_WINDOWEVENT_LEAVE)\n                bd->PendingMouseLeaveFrame = ImGui::GetFrameCount() + 1;\n            if (window_event == SDL_WINDOWEVENT_FOCUS_GAINED)\n                io.AddFocusEvent(true);\n            else if (event->window.event == SDL_WINDOWEVENT_FOCUS_LOST)\n                io.AddFocusEvent(false);\n            return true;\n        }\n    }\n    return false;\n}\n\nstatic bool ImGui_ImplSDL2_Init(SDL_Window* window, SDL_Renderer* renderer)\n{\n    ImGuiIO& io = ImGui::GetIO();\n    IM_ASSERT(io.BackendPlatformUserData == nullptr && \"Already initialized a platform backend!\");\n\n    // Check and store if we are on a SDL backend that supports global mouse position\n    // (\"wayland\" and \"rpi\" don't support it, but we chose to use a white-list instead of a black-list)\n    bool mouse_can_use_global_state = false;\n#if SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE\n    const char* sdl_backend = SDL_GetCurrentVideoDriver();\n    const char* global_mouse_whitelist[] = { \"windows\", \"cocoa\", \"x11\", \"DIVE\", \"VMAN\" };\n    for (int n = 0; n < IM_ARRAYSIZE(global_mouse_whitelist); n++)\n        if (strncmp(sdl_backend, global_mouse_whitelist[n], strlen(global_mouse_whitelist[n])) == 0)\n            mouse_can_use_global_state = true;\n#endif\n\n    // Setup backend capabilities flags\n    ImGui_ImplSDL2_Data* bd = IM_NEW(ImGui_ImplSDL2_Data)();\n    io.BackendPlatformUserData = (void*)bd;\n    io.BackendPlatformName = \"imgui_impl_sdl2\";\n    io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors;       // We can honor GetMouseCursor() values (optional)\n    io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos;        // We can honor io.WantSetMousePos requests (optional, rarely used)\n\n    bd->Window = window;\n    bd->Renderer = renderer;\n    bd->MouseCanUseGlobalState = mouse_can_use_global_state;\n\n    io.SetClipboardTextFn = ImGui_ImplSDL2_SetClipboardText;\n    io.GetClipboardTextFn = ImGui_ImplSDL2_GetClipboardText;\n    io.ClipboardUserData = nullptr;\n    io.SetPlatformImeDataFn = ImGui_ImplSDL2_SetPlatformImeData;\n\n    // Load mouse cursors\n    bd->MouseCursors[ImGuiMouseCursor_Arrow] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW);\n    bd->MouseCursors[ImGuiMouseCursor_TextInput] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_IBEAM);\n    bd->MouseCursors[ImGuiMouseCursor_ResizeAll] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZEALL);\n    bd->MouseCursors[ImGuiMouseCursor_ResizeNS] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENS);\n    bd->MouseCursors[ImGuiMouseCursor_ResizeEW] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZEWE);\n    bd->MouseCursors[ImGuiMouseCursor_ResizeNESW] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENESW);\n    bd->MouseCursors[ImGuiMouseCursor_ResizeNWSE] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENWSE);\n    bd->MouseCursors[ImGuiMouseCursor_Hand] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_HAND);\n    bd->MouseCursors[ImGuiMouseCursor_NotAllowed] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_NO);\n\n    // Set platform dependent data in viewport\n    // Our mouse update function expect PlatformHandle to be filled for the main viewport\n    ImGuiViewport* main_viewport = ImGui::GetMainViewport();\n    main_viewport->PlatformHandleRaw = nullptr;\n    SDL_SysWMinfo info;\n    SDL_VERSION(&info.version);\n    if (SDL_GetWindowWMInfo(window, &info))\n    {\n#if defined(SDL_VIDEO_DRIVER_WINDOWS)\n        main_viewport->PlatformHandleRaw = (void*)info.info.win.window;\n#elif defined(__APPLE__) && defined(SDL_VIDEO_DRIVER_COCOA)\n        main_viewport->PlatformHandleRaw = (void*)info.info.cocoa.window;\n#endif\n    }\n\n    // From 2.0.5: Set SDL hint to receive mouse click events on window focus, otherwise SDL doesn't emit the event.\n    // Without this, when clicking to gain focus, our widgets wouldn't activate even though they showed as hovered.\n    // (This is unfortunately a global SDL setting, so enabling it might have a side-effect on your application.\n    // It is unlikely to make a difference, but if your app absolutely needs to ignore the initial on-focus click:\n    // you can ignore SDL_MOUSEBUTTONDOWN events coming right after a SDL_WINDOWEVENT_FOCUS_GAINED)\n#ifdef SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH\n    SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, \"1\");\n#endif\n\n    // From 2.0.18: Enable native IME.\n    // IMPORTANT: This is used at the time of SDL_CreateWindow() so this will only affects secondary windows, if any.\n    // For the main window to be affected, your application needs to call this manually before calling SDL_CreateWindow().\n#ifdef SDL_HINT_IME_SHOW_UI\n    SDL_SetHint(SDL_HINT_IME_SHOW_UI, \"1\");\n#endif\n\n    // From 2.0.22: Disable auto-capture, this is preventing drag and drop across multiple windows (see #5710)\n#ifdef SDL_HINT_MOUSE_AUTO_CAPTURE\n    SDL_SetHint(SDL_HINT_MOUSE_AUTO_CAPTURE, \"0\");\n#endif\n\n    return true;\n}\n\nbool ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window, void* sdl_gl_context)\n{\n    IM_UNUSED(sdl_gl_context); // Viewport branch will need this.\n    return ImGui_ImplSDL2_Init(window, nullptr);\n}\n\nbool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window)\n{\n#if !SDL_HAS_VULKAN\n    IM_ASSERT(0 && \"Unsupported\");\n#endif\n    return ImGui_ImplSDL2_Init(window, nullptr);\n}\n\nbool ImGui_ImplSDL2_InitForD3D(SDL_Window* window)\n{\n#if !defined(_WIN32)\n    IM_ASSERT(0 && \"Unsupported\");\n#endif\n    return ImGui_ImplSDL2_Init(window, nullptr);\n}\n\nbool ImGui_ImplSDL2_InitForMetal(SDL_Window* window)\n{\n    return ImGui_ImplSDL2_Init(window, nullptr);\n}\n\nbool ImGui_ImplSDL2_InitForSDLRenderer(SDL_Window* window, SDL_Renderer* renderer)\n{\n    return ImGui_ImplSDL2_Init(window, renderer);\n}\n\nvoid ImGui_ImplSDL2_Shutdown()\n{\n    ImGui_ImplSDL2_Data* bd = ImGui_ImplSDL2_GetBackendData();\n    IM_ASSERT(bd != nullptr && \"No platform backend to shutdown, or already shutdown?\");\n    ImGuiIO& io = ImGui::GetIO();\n\n    if (bd->ClipboardTextData)\n        SDL_free(bd->ClipboardTextData);\n    for (ImGuiMouseCursor cursor_n = 0; cursor_n < ImGuiMouseCursor_COUNT; cursor_n++)\n        SDL_FreeCursor(bd->MouseCursors[cursor_n]);\n    bd->LastMouseCursor = NULL;\n\n    io.BackendPlatformName = nullptr;\n    io.BackendPlatformUserData = nullptr;\n    IM_DELETE(bd);\n}\n\nstatic void ImGui_ImplSDL2_UpdateMouseData()\n{\n    ImGui_ImplSDL2_Data* bd = ImGui_ImplSDL2_GetBackendData();\n    ImGuiIO& io = ImGui::GetIO();\n\n    // We forward mouse input when hovered or captured (via SDL_MOUSEMOTION) or when focused (below)\n#if SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE\n    // SDL_CaptureMouse() let the OS know e.g. that our imgui drag outside the SDL window boundaries shouldn't e.g. trigger other operations outside\n    SDL_CaptureMouse((bd->MouseButtonsDown != 0) ? SDL_TRUE : SDL_FALSE);\n    SDL_Window* focused_window = SDL_GetKeyboardFocus();\n    const bool is_app_focused = (bd->Window == focused_window);\n#else\n    const bool is_app_focused = (SDL_GetWindowFlags(bd->Window) & SDL_WINDOW_INPUT_FOCUS) != 0; // SDL 2.0.3 and non-windowed systems: single-viewport only\n#endif\n    if (is_app_focused)\n    {\n        // (Optional) Set OS mouse position from Dear ImGui if requested (rarely used, only when ImGuiConfigFlags_NavEnableSetMousePos is enabled by user)\n        if (io.WantSetMousePos)\n            SDL_WarpMouseInWindow(bd->Window, (int)io.MousePos.x, (int)io.MousePos.y);\n\n        // (Optional) Fallback to provide mouse position when focused (SDL_MOUSEMOTION already provides this when hovered or captured)\n        if (bd->MouseCanUseGlobalState && bd->MouseButtonsDown == 0)\n        {\n            int window_x, window_y, mouse_x_global, mouse_y_global;\n            SDL_GetGlobalMouseState(&mouse_x_global, &mouse_y_global);\n            SDL_GetWindowPosition(bd->Window, &window_x, &window_y);\n            io.AddMousePosEvent((float)(mouse_x_global - window_x), (float)(mouse_y_global - window_y));\n        }\n    }\n}\n\nstatic void ImGui_ImplSDL2_UpdateMouseCursor()\n{\n    ImGuiIO& io = ImGui::GetIO();\n    if (io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange)\n        return;\n    ImGui_ImplSDL2_Data* bd = ImGui_ImplSDL2_GetBackendData();\n\n    ImGuiMouseCursor imgui_cursor = ImGui::GetMouseCursor();\n    if (io.MouseDrawCursor || imgui_cursor == ImGuiMouseCursor_None)\n    {\n        // Hide OS mouse cursor if imgui is drawing it or if it wants no cursor\n        SDL_ShowCursor(SDL_FALSE);\n    }\n    else\n    {\n        // Show OS mouse cursor\n        SDL_Cursor* expected_cursor = bd->MouseCursors[imgui_cursor] ? bd->MouseCursors[imgui_cursor] : bd->MouseCursors[ImGuiMouseCursor_Arrow];\n        if (bd->LastMouseCursor != expected_cursor)\n        {\n            SDL_SetCursor(expected_cursor); // SDL function doesn't have an early out (see #6113)\n            bd->LastMouseCursor = expected_cursor;\n        }\n        SDL_ShowCursor(SDL_TRUE);\n    }\n}\n\nstatic void ImGui_ImplSDL2_UpdateGamepads()\n{\n    ImGuiIO& io = ImGui::GetIO();\n    if ((io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) == 0) // FIXME: Technically feeding gamepad shouldn't depend on this now that they are regular inputs.\n        return;\n\n    // Get gamepad\n    io.BackendFlags &= ~ImGuiBackendFlags_HasGamepad;\n    SDL_GameController* game_controller = SDL_GameControllerOpen(0);\n    if (!game_controller)\n        return;\n    io.BackendFlags |= ImGuiBackendFlags_HasGamepad;\n\n    // Update gamepad inputs\n    #define IM_SATURATE(V)                      (V < 0.0f ? 0.0f : V > 1.0f ? 1.0f : V)\n    #define MAP_BUTTON(KEY_NO, BUTTON_NO)       { io.AddKeyEvent(KEY_NO, SDL_GameControllerGetButton(game_controller, BUTTON_NO) != 0); }\n    #define MAP_ANALOG(KEY_NO, AXIS_NO, V0, V1) { float vn = (float)(SDL_GameControllerGetAxis(game_controller, AXIS_NO) - V0) / (float)(V1 - V0); vn = IM_SATURATE(vn); io.AddKeyAnalogEvent(KEY_NO, vn > 0.1f, vn); }\n    const int thumb_dead_zone = 8000;           // SDL_gamecontroller.h suggests using this value.\n    MAP_BUTTON(ImGuiKey_GamepadStart,           SDL_CONTROLLER_BUTTON_START);\n    MAP_BUTTON(ImGuiKey_GamepadBack,            SDL_CONTROLLER_BUTTON_BACK);\n    MAP_BUTTON(ImGuiKey_GamepadFaceLeft,        SDL_CONTROLLER_BUTTON_X);              // Xbox X, PS Square\n    MAP_BUTTON(ImGuiKey_GamepadFaceRight,       SDL_CONTROLLER_BUTTON_B);              // Xbox B, PS Circle\n    MAP_BUTTON(ImGuiKey_GamepadFaceUp,          SDL_CONTROLLER_BUTTON_Y);              // Xbox Y, PS Triangle\n    MAP_BUTTON(ImGuiKey_GamepadFaceDown,        SDL_CONTROLLER_BUTTON_A);              // Xbox A, PS Cross\n    MAP_BUTTON(ImGuiKey_GamepadDpadLeft,        SDL_CONTROLLER_BUTTON_DPAD_LEFT);\n    MAP_BUTTON(ImGuiKey_GamepadDpadRight,       SDL_CONTROLLER_BUTTON_DPAD_RIGHT);\n    MAP_BUTTON(ImGuiKey_GamepadDpadUp,          SDL_CONTROLLER_BUTTON_DPAD_UP);\n    MAP_BUTTON(ImGuiKey_GamepadDpadDown,        SDL_CONTROLLER_BUTTON_DPAD_DOWN);\n    MAP_BUTTON(ImGuiKey_GamepadL1,              SDL_CONTROLLER_BUTTON_LEFTSHOULDER);\n    MAP_BUTTON(ImGuiKey_GamepadR1,              SDL_CONTROLLER_BUTTON_RIGHTSHOULDER);\n    MAP_ANALOG(ImGuiKey_GamepadL2,              SDL_CONTROLLER_AXIS_TRIGGERLEFT,  0.0f, 32767);\n    MAP_ANALOG(ImGuiKey_GamepadR2,              SDL_CONTROLLER_AXIS_TRIGGERRIGHT, 0.0f, 32767);\n    MAP_BUTTON(ImGuiKey_GamepadL3,              SDL_CONTROLLER_BUTTON_LEFTSTICK);\n    MAP_BUTTON(ImGuiKey_GamepadR3,              SDL_CONTROLLER_BUTTON_RIGHTSTICK);\n    MAP_ANALOG(ImGuiKey_GamepadLStickLeft,      SDL_CONTROLLER_AXIS_LEFTX,  -thumb_dead_zone, -32768);\n    MAP_ANALOG(ImGuiKey_GamepadLStickRight,     SDL_CONTROLLER_AXIS_LEFTX,  +thumb_dead_zone, +32767);\n    MAP_ANALOG(ImGuiKey_GamepadLStickUp,        SDL_CONTROLLER_AXIS_LEFTY,  -thumb_dead_zone, -32768);\n    MAP_ANALOG(ImGuiKey_GamepadLStickDown,      SDL_CONTROLLER_AXIS_LEFTY,  +thumb_dead_zone, +32767);\n    MAP_ANALOG(ImGuiKey_GamepadRStickLeft,      SDL_CONTROLLER_AXIS_RIGHTX, -thumb_dead_zone, -32768);\n    MAP_ANALOG(ImGuiKey_GamepadRStickRight,     SDL_CONTROLLER_AXIS_RIGHTX, +thumb_dead_zone, +32767);\n    MAP_ANALOG(ImGuiKey_GamepadRStickUp,        SDL_CONTROLLER_AXIS_RIGHTY, -thumb_dead_zone, -32768);\n    MAP_ANALOG(ImGuiKey_GamepadRStickDown,      SDL_CONTROLLER_AXIS_RIGHTY, +thumb_dead_zone, +32767);\n    #undef MAP_BUTTON\n    #undef MAP_ANALOG\n}\n\nvoid ImGui_ImplSDL2_NewFrame()\n{\n    ImGui_ImplSDL2_Data* bd = ImGui_ImplSDL2_GetBackendData();\n    IM_ASSERT(bd != nullptr && \"Did you call ImGui_ImplSDL2_Init()?\");\n    ImGuiIO& io = ImGui::GetIO();\n\n    // Setup display size (every frame to accommodate for window resizing)\n    int w, h;\n    int display_w, display_h;\n    SDL_GetWindowSize(bd->Window, &w, &h);\n    if (SDL_GetWindowFlags(bd->Window) & SDL_WINDOW_MINIMIZED)\n        w = h = 0;\n    if (bd->Renderer != nullptr)\n        SDL_GetRendererOutputSize(bd->Renderer, &display_w, &display_h);\n    else\n        SDL_GL_GetDrawableSize(bd->Window, &display_w, &display_h);\n    io.DisplaySize = ImVec2((float)w, (float)h);\n    if (w > 0 && h > 0)\n        io.DisplayFramebufferScale = ImVec2((float)display_w / w, (float)display_h / h);\n\n    // Setup time step (we don't use SDL_GetTicks() because it is using millisecond resolution)\n    // (Accept SDL_GetPerformanceCounter() not returning a monotonically increasing value. Happens in VMs and Emscripten, see #6189, #6114, #3644)\n    static Uint64 frequency = SDL_GetPerformanceFrequency();\n    Uint64 current_time = SDL_GetPerformanceCounter();\n    if (current_time <= bd->Time)\n        current_time = bd->Time + 1;\n    io.DeltaTime = bd->Time > 0 ? (float)((double)(current_time - bd->Time) / frequency) : (float)(1.0f / 60.0f);\n    bd->Time = current_time;\n\n    if (bd->PendingMouseLeaveFrame && bd->PendingMouseLeaveFrame >= ImGui::GetFrameCount() && bd->MouseButtonsDown == 0)\n    {\n        bd->MouseWindowID = 0;\n        bd->PendingMouseLeaveFrame = 0;\n        io.AddMousePosEvent(-FLT_MAX, -FLT_MAX);\n    }\n\n    ImGui_ImplSDL2_UpdateMouseData();\n    ImGui_ImplSDL2_UpdateMouseCursor();\n\n    // Update game controllers (if enabled and available)\n    ImGui_ImplSDL2_UpdateGamepads();\n}\n\n#if defined(__clang__)\n#pragma clang diagnostic pop\n#endif\n"
  },
  {
    "path": "sdl-imgui/imgui_impl_sdl2.h",
    "content": "// dear imgui: Platform Backend for SDL2\n// This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..)\n// (Info: SDL2 is a cross-platform general purpose library for handling windows, inputs, graphics context creation, etc.)\n\n// Implemented features:\n//  [X] Platform: Clipboard support.\n//  [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen.\n//  [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 SDL_SCANCODE_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set]\n//  [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.\n//  [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.\n//  [X] Platform: Basic IME support. App needs to call 'SDL_SetHint(SDL_HINT_IME_SHOW_UI, \"1\");' before SDL_CreateWindow()!.\n\n// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.\n// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.\n// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.\n// Read online: https://github.com/ocornut/imgui/tree/master/docs\n\n#pragma once\n#include \"imgui.h\"      // IMGUI_IMPL_API\n\nstruct SDL_Window;\nstruct SDL_Renderer;\ntypedef union SDL_Event SDL_Event;\n\nIMGUI_IMPL_API bool     ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window, void* sdl_gl_context);\nIMGUI_IMPL_API bool     ImGui_ImplSDL2_InitForVulkan(SDL_Window* window);\nIMGUI_IMPL_API bool     ImGui_ImplSDL2_InitForD3D(SDL_Window* window);\nIMGUI_IMPL_API bool     ImGui_ImplSDL2_InitForMetal(SDL_Window* window);\nIMGUI_IMPL_API bool     ImGui_ImplSDL2_InitForSDLRenderer(SDL_Window* window, SDL_Renderer* renderer);\nIMGUI_IMPL_API void     ImGui_ImplSDL2_Shutdown();\nIMGUI_IMPL_API void     ImGui_ImplSDL2_NewFrame();\nIMGUI_IMPL_API bool     ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event);\n\n#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS\nstatic inline void ImGui_ImplSDL2_NewFrame(SDL_Window*) { ImGui_ImplSDL2_NewFrame(); } // 1.84: removed unnecessary parameter\n#endif\n"
  },
  {
    "path": "shader/bgfx_shader.sh",
    "content": "/*\n * Copyright 2011-2020 Branimir Karadzic. All rights reserved.\n * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n */\n\n#ifndef BGFX_SHADER_H_HEADER_GUARD\n#define BGFX_SHADER_H_HEADER_GUARD\n\n#if !defined(BGFX_CONFIG_MAX_BONES)\n#\tdefine BGFX_CONFIG_MAX_BONES 32\n#endif // !defined(BGFX_CONFIG_MAX_BONES)\n\n#ifndef __cplusplus\n\n#if BGFX_SHADER_LANGUAGE_HLSL > 3\n#\tdefine BRANCH [branch]\n#\tdefine LOOP   [loop]\n#\tdefine UNROLL [unroll]\n#else\n#\tdefine BRANCH\n#\tdefine LOOP\n#\tdefine UNROLL\n#endif // BGFX_SHADER_LANGUAGE_HLSL > 3\n\n#if BGFX_SHADER_LANGUAGE_HLSL > 3 && BGFX_SHADER_TYPE_FRAGMENT\n#\tdefine EARLY_DEPTH_STENCIL [earlydepthstencil]\n#else\n#\tdefine EARLY_DEPTH_STENCIL\n#endif // BGFX_SHADER_LANGUAGE_HLSL > 3 && BGFX_SHADER_TYPE_FRAGMENT\n\n#if BGFX_SHADER_LANGUAGE_GLSL\n#\tdefine ARRAY_BEGIN(_type, _name, _count) _type _name[_count] = _type[](\n#\tdefine ARRAY_END() )\n#else\n#\tdefine ARRAY_BEGIN(_type, _name, _count) _type _name[_count] = {\n#\tdefine ARRAY_END() }\n#endif // BGFX_SHADER_LANGUAGE_GLSL\n\n#if BGFX_SHADER_LANGUAGE_HLSL \\\n || BGFX_SHADER_LANGUAGE_PSSL \\\n || BGFX_SHADER_LANGUAGE_SPIRV \\\n || BGFX_SHADER_LANGUAGE_METAL\n#\tdefine CONST(_x) static const _x\n#\tdefine dFdx(_x) ddx(_x)\n#\tdefine dFdy(_y) ddy(-_y)\n#\tdefine inversesqrt(_x) rsqrt(_x)\n#\tdefine fract(_x) frac(_x)\n\n#\tdefine bvec2 bool2\n#\tdefine bvec3 bool3\n#\tdefine bvec4 bool4\n\n\n#\tif BGFX_SHADER_LANGUAGE_HLSL > 4\n#\t\tdefine REGISTER(_type, _reg) register(_type[_reg])\n#\telse\n#\t\tdefine REGISTER(_type, _reg) register(_type ## _reg)\n#\tendif // BGFX_SHADER_LANGUAGE_HLSL\n\n#\tif BGFX_SHADER_LANGUAGE_HLSL > 3 || BGFX_SHADER_LANGUAGE_PSSL || BGFX_SHADER_LANGUAGE_SPIRV || BGFX_SHADER_LANGUAGE_METAL\n#\t\tif BGFX_SHADER_LANGUAGE_HLSL > 4 || BGFX_SHADER_LANGUAGE_PSSL || BGFX_SHADER_LANGUAGE_SPIRV || BGFX_SHADER_LANGUAGE_METAL\n#\t\t\tdefine dFdxCoarse(_x) ddx_coarse(_x)\n#\t\t\tdefine dFdxFine(_x)   ddx_fine(_x)\n#\t\t\tdefine dFdyCoarse(_y) ddy_coarse(-_y)\n#\t\t\tdefine dFdyFine(_y)   ddy_fine(-_y)\n#\t\tendif // BGFX_SHADER_LANGUAGE_HLSL > 4\n\n#\t\tif BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_SPIRV || BGFX_SHADER_LANGUAGE_METAL\nfloat intBitsToFloat(int   _x) { return asfloat(_x); }\nvec2  intBitsToFloat(uint2 _x) { return asfloat(_x); }\nvec3  intBitsToFloat(uint3 _x) { return asfloat(_x); }\nvec4  intBitsToFloat(uint4 _x) { return asfloat(_x); }\n#\t\tendif // BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_SPIRV || BGFX_SHADER_LANGUAGE_METAL\n\nfloat uintBitsToFloat(uint  _x) { return asfloat(_x); }\nvec2  uintBitsToFloat(uint2 _x) { return asfloat(_x); }\nvec3  uintBitsToFloat(uint3 _x) { return asfloat(_x); }\nvec4  uintBitsToFloat(uint4 _x) { return asfloat(_x); }\n\nuint  floatBitsToUint(float _x) { return asuint(_x); }\nuvec2 floatBitsToUint(vec2  _x) { return asuint(_x); }\nuvec3 floatBitsToUint(vec3  _x) { return asuint(_x); }\nuvec4 floatBitsToUint(vec4  _x) { return asuint(_x); }\n\nint   floatBitsToInt(float _x) { return asint(_x); }\nivec2 floatBitsToInt(vec2  _x) { return asint(_x); }\nivec3 floatBitsToInt(vec3  _x) { return asint(_x); }\nivec4 floatBitsToInt(vec4  _x) { return asint(_x); }\n\nuint  bitfieldReverse(uint  _x) { return reversebits(_x); }\nuint2 bitfieldReverse(uint2 _x) { return reversebits(_x); }\nuint3 bitfieldReverse(uint3 _x) { return reversebits(_x); }\nuint4 bitfieldReverse(uint4 _x) { return reversebits(_x); }\n\n#\t\tif !BGFX_SHADER_LANGUAGE_SPIRV\nuint packHalf2x16(vec2 _x)\n{\n\treturn (f32tof16(_x.y)<<16) | f32tof16(_x.x);\n}\n\nvec2 unpackHalf2x16(uint _x)\n{\n\treturn vec2(f16tof32(_x & 0xffff), f16tof32(_x >> 16) );\n}\n#\t\tendif // !BGFX_SHADER_LANGUAGE_SPIRV\n\nstruct BgfxSampler2D\n{\n\tSamplerState m_sampler;\n\tTexture2D m_texture;\n};\n\nstruct BgfxISampler2D\n{\n\tTexture2D<ivec4> m_texture;\n};\n\nstruct BgfxUSampler2D\n{\n\tTexture2D<uvec4> m_texture;\n};\n\nstruct BgfxSampler2DArray\n{\n\tSamplerState m_sampler;\n\tTexture2DArray m_texture;\n};\n\nstruct BgfxSampler2DShadow\n{\n\tSamplerComparisonState m_sampler;\n\tTexture2D m_texture;\n};\n\nstruct BgfxSampler2DArrayShadow\n{\n\tSamplerComparisonState m_sampler;\n\tTexture2DArray m_texture;\n};\n\nstruct BgfxSampler3D\n{\n\tSamplerState m_sampler;\n\tTexture3D m_texture;\n};\n\nstruct BgfxISampler3D\n{\n\tTexture3D<ivec4> m_texture;\n};\n\nstruct BgfxUSampler3D\n{\n\tTexture3D<uvec4> m_texture;\n};\n\nstruct BgfxSamplerCube\n{\n\tSamplerState m_sampler;\n\tTextureCube m_texture;\n};\n\nstruct BgfxSamplerCubeShadow\n{\n\tSamplerComparisonState m_sampler;\n\tTextureCube m_texture;\n};\n\nstruct BgfxSampler2DMS\n{\n\tTexture2DMS<vec4> m_texture;\n};\n\nvec4 bgfxTexture2D(BgfxSampler2D _sampler, vec2 _coord)\n{\n\treturn _sampler.m_texture.Sample(_sampler.m_sampler, _coord);\n}\n\nvec4 bgfxTexture2DBias(BgfxSampler2D _sampler, vec2 _coord, float _bias)\n{\n\treturn _sampler.m_texture.SampleBias(_sampler.m_sampler, _coord, _bias);\n}\n\nvec4 bgfxTexture2DLod(BgfxSampler2D _sampler, vec2 _coord, float _level)\n{\n\treturn _sampler.m_texture.SampleLevel(_sampler.m_sampler, _coord, _level);\n}\n\nvec4 bgfxTexture2DLodOffset(BgfxSampler2D _sampler, vec2 _coord, float _level, ivec2 _offset)\n{\n\treturn _sampler.m_texture.SampleLevel(_sampler.m_sampler, _coord, _level, _offset);\n}\n\nvec4 bgfxTexture2DProj(BgfxSampler2D _sampler, vec3 _coord)\n{\n\tvec2 coord = _coord.xy * rcp(_coord.z);\n\treturn _sampler.m_texture.Sample(_sampler.m_sampler, coord);\n}\n\nvec4 bgfxTexture2DProj(BgfxSampler2D _sampler, vec4 _coord)\n{\n\tvec2 coord = _coord.xy * rcp(_coord.w);\n\treturn _sampler.m_texture.Sample(_sampler.m_sampler, coord);\n}\n\nvec4 bgfxTexture2DGrad(BgfxSampler2D _sampler, vec2 _coord, vec2 _dPdx, vec2 _dPdy)\n{\n\treturn _sampler.m_texture.SampleGrad(_sampler.m_sampler, _coord, _dPdx, _dPdy);\n}\n\nvec4 bgfxTexture2DArray(BgfxSampler2DArray _sampler, vec3 _coord)\n{\n\treturn _sampler.m_texture.Sample(_sampler.m_sampler, _coord);\n}\n\nvec4 bgfxTexture2DArrayLod(BgfxSampler2DArray _sampler, vec3 _coord, float _lod)\n{\n\treturn _sampler.m_texture.SampleLevel(_sampler.m_sampler, _coord, _lod);\n}\n\nvec4 bgfxTexture2DArrayLodOffset(BgfxSampler2DArray _sampler, vec3 _coord, float _level, ivec2 _offset)\n{\n\treturn _sampler.m_texture.SampleLevel(_sampler.m_sampler, _coord, _level, _offset);\n}\n\nfloat bgfxShadow2D(BgfxSampler2DShadow _sampler, vec3 _coord)\n{\n\treturn _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, _coord.xy, _coord.z);\n}\n\nfloat bgfxShadow2DProj(BgfxSampler2DShadow _sampler, vec4 _coord)\n{\n\tvec3 coord = _coord.xyz * rcp(_coord.w);\n\treturn _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, coord.xy, coord.z);\n}\n\nvec4 bgfxShadow2DArray(BgfxSampler2DArrayShadow _sampler, vec4 _coord)\n{\n\treturn _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, _coord.xyz, _coord.w);\n}\n\nvec4 bgfxTexture3D(BgfxSampler3D _sampler, vec3 _coord)\n{\n\treturn _sampler.m_texture.Sample(_sampler.m_sampler, _coord);\n}\n\nvec4 bgfxTexture3DLod(BgfxSampler3D _sampler, vec3 _coord, float _level)\n{\n\treturn _sampler.m_texture.SampleLevel(_sampler.m_sampler, _coord, _level);\n}\n\nivec4 bgfxTexture3D(BgfxISampler3D _sampler, vec3 _coord)\n{\n\tuvec3 size;\n\t_sampler.m_texture.GetDimensions(size.x, size.y, size.z);\n\treturn _sampler.m_texture.Load(ivec4(_coord * size, 0) );\n}\n\nuvec4 bgfxTexture3D(BgfxUSampler3D _sampler, vec3 _coord)\n{\n\tuvec3 size;\n\t_sampler.m_texture.GetDimensions(size.x, size.y, size.z);\n\treturn _sampler.m_texture.Load(ivec4(_coord * size, 0) );\n}\n\nvec4 bgfxTextureCube(BgfxSamplerCube _sampler, vec3 _coord)\n{\n\treturn _sampler.m_texture.Sample(_sampler.m_sampler, _coord);\n}\n\nvec4 bgfxTextureCubeBias(BgfxSamplerCube _sampler, vec3 _coord, float _bias)\n{\n\treturn _sampler.m_texture.SampleBias(_sampler.m_sampler, _coord, _bias);\n}\n\nvec4 bgfxTextureCubeLod(BgfxSamplerCube _sampler, vec3 _coord, float _level)\n{\n\treturn _sampler.m_texture.SampleLevel(_sampler.m_sampler, _coord, _level);\n}\n\nfloat bgfxShadowCube(BgfxSamplerCubeShadow _sampler, vec4 _coord)\n{\n\treturn _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, _coord.xyz, _coord.w);\n}\n\nvec4 bgfxTexelFetch(BgfxSampler2D _sampler, ivec2 _coord, int _lod)\n{\n\treturn _sampler.m_texture.Load(ivec3(_coord, _lod) );\n}\n\nvec4 bgfxTexelFetchOffset(BgfxSampler2D _sampler, ivec2 _coord, int _lod, ivec2 _offset)\n{\n\treturn _sampler.m_texture.Load(ivec3(_coord, _lod), _offset );\n}\n\nvec2 bgfxTextureSize(BgfxSampler2D _sampler, int _lod)\n{\n\tvec2 result;\n\t_sampler.m_texture.GetDimensions(result.x, result.y);\n\treturn result;\n}\n\nvec4 bgfxTextureGather(BgfxSampler2D _sampler, vec2 _coord)\n{\n\treturn _sampler.m_texture.GatherRed(_sampler.m_sampler, _coord );\n}\nvec4 bgfxTextureGatherOffset(BgfxSampler2D _sampler, vec2 _coord, ivec2 _offset)\n{\n\treturn _sampler.m_texture.GatherRed(_sampler.m_sampler, _coord, _offset );\n}\nvec4 bgfxTextureGather(BgfxSampler2DArray _sampler, vec3 _coord)\n{\n\treturn _sampler.m_texture.GatherRed(_sampler.m_sampler, _coord );\n}\n\nivec4 bgfxTexelFetch(BgfxISampler2D _sampler, ivec2 _coord, int _lod)\n{\n\treturn _sampler.m_texture.Load(ivec3(_coord, _lod) );\n}\n\nuvec4 bgfxTexelFetch(BgfxUSampler2D _sampler, ivec2 _coord, int _lod)\n{\n\treturn _sampler.m_texture.Load(ivec3(_coord, _lod) );\n}\n\nvec4 bgfxTexelFetch(BgfxSampler2DMS _sampler, ivec2 _coord, int _sampleIdx)\n{\n\treturn _sampler.m_texture.Load(_coord, _sampleIdx);\n}\n\nvec4 bgfxTexelFetch(BgfxSampler2DArray _sampler, ivec3 _coord, int _lod)\n{\n\treturn _sampler.m_texture.Load(ivec4(_coord, _lod) );\n}\n\nvec4 bgfxTexelFetch(BgfxSampler3D _sampler, ivec3 _coord, int _lod)\n{\n\treturn _sampler.m_texture.Load(ivec4(_coord, _lod) );\n}\n\nvec3 bgfxTextureSize(BgfxSampler3D _sampler, int _lod)\n{\n\tvec3 result;\n\t_sampler.m_texture.GetDimensions(result.x, result.y, result.z);\n\treturn result;\n}\n\n#\t\tdefine SAMPLER2D(_name, _reg) \\\n\t\t\tuniform SamplerState _name ## Sampler : REGISTER(s, _reg); \\\n\t\t\tuniform Texture2D _name ## Texture : REGISTER(t, _reg); \\\n\t\t\tstatic BgfxSampler2D _name = { _name ## Sampler, _name ## Texture }\n#\t\tdefine ISAMPLER2D(_name, _reg) \\\n\t\t\tuniform Texture2D<ivec4> _name ## Texture : REGISTER(t, _reg); \\\n\t\t\tstatic BgfxISampler2D _name = { _name ## Texture }\n#\t\tdefine USAMPLER2D(_name, _reg) \\\n\t\t\tuniform Texture2D<uvec4> _name ## Texture : REGISTER(t, _reg); \\\n\t\t\tstatic BgfxUSampler2D _name = { _name ## Texture }\n#\t\tdefine sampler2D BgfxSampler2D\n#\t\tdefine texture2D(_sampler, _coord) bgfxTexture2D(_sampler, _coord)\n#\t\tdefine texture2DBias(_sampler, _coord, _bias) bgfxTexture2DBias(_sampler, _coord, _bias)\n#\t\tdefine texture2DLod(_sampler, _coord, _level) bgfxTexture2DLod(_sampler, _coord, _level)\n#\t\tdefine texture2DLodOffset(_sampler, _coord, _level, _offset) bgfxTexture2DLodOffset(_sampler, _coord, _level, _offset)\n#\t\tdefine texture2DProj(_sampler, _coord) bgfxTexture2DProj(_sampler, _coord)\n#\t\tdefine texture2DGrad(_sampler, _coord, _dPdx, _dPdy) bgfxTexture2DGrad(_sampler, _coord, _dPdx, _dPdy)\n\n#\t\tdefine SAMPLER2DARRAY(_name, _reg) \\\n\t\t\tuniform SamplerState _name ## Sampler : REGISTER(s, _reg); \\\n\t\t\tuniform Texture2DArray _name ## Texture : REGISTER(t, _reg); \\\n\t\t\tstatic BgfxSampler2DArray _name = { _name ## Sampler, _name ## Texture }\n#\t\tdefine sampler2DArray BgfxSampler2DArray\n#\t\tdefine texture2DArray(_sampler, _coord) bgfxTexture2DArray(_sampler, _coord)\n#\t\tdefine texture2DArrayLod(_sampler, _coord, _lod) bgfxTexture2DArrayLod(_sampler, _coord, _lod)\n#\t\tdefine texture2DArrayLodOffset(_sampler, _coord, _level, _offset) bgfxTexture2DArrayLodOffset(_sampler, _coord, _level, _offset)\n\n#\t\tdefine SAMPLER2DMS(_name, _reg) \\\n\t\t\tuniform Texture2DMS<vec4> _name ## Texture : REGISTER(t, _reg); \\\n\t\t\tstatic BgfxSampler2DMS _name = { _name ## Texture }\n#\t\tdefine sampler2DMS BgfxSampler2DMS\n\n#\t\tdefine SAMPLER2DSHADOW(_name, _reg) \\\n\t\t\tuniform SamplerComparisonState _name ## SamplerComparison : REGISTER(s, _reg); \\\n\t\t\tuniform Texture2D _name ## Texture : REGISTER(t, _reg); \\\n\t\t\tstatic BgfxSampler2DShadow _name = { _name ## SamplerComparison, _name ## Texture }\n#\t\tdefine sampler2DShadow BgfxSampler2DShadow\n#\t\tdefine shadow2D(_sampler, _coord) bgfxShadow2D(_sampler, _coord)\n#\t\tdefine shadow2DProj(_sampler, _coord) bgfxShadow2DProj(_sampler, _coord)\n\n#\t\tdefine SAMPLER2DARRAYSHADOW(_name, _reg) \\\n\t\t\tuniform SamplerComparisonState _name ## SamplerComparison : REGISTER(s, _reg); \\\n\t\t\tuniform Texture2DArray _name ## Texture : REGISTER(t, _reg); \\\n\t\t\tstatic BgfxSampler2DArrayShadow _name = { _name ## SamplerComparison, _name ## Texture }\n#\t\tdefine sampler2DArrayShadow BgfxSampler2DArrayShadow\n#\t\tdefine shadow2DArray(_sampler, _coord) bgfxShadow2DArray(_sampler, _coord)\n\n#\t\tdefine SAMPLER3D(_name, _reg) \\\n\t\t\tuniform SamplerState _name ## Sampler : REGISTER(s, _reg); \\\n\t\t\tuniform Texture3D _name ## Texture : REGISTER(t, _reg); \\\n\t\t\tstatic BgfxSampler3D _name = { _name ## Sampler, _name ## Texture }\n#\t\tdefine ISAMPLER3D(_name, _reg) \\\n\t\t\tuniform Texture3D<ivec4> _name ## Texture : REGISTER(t, _reg); \\\n\t\t\tstatic BgfxISampler3D _name = { _name ## Texture }\n#\t\tdefine USAMPLER3D(_name, _reg) \\\n\t\t\tuniform Texture3D<uvec4> _name ## Texture : REGISTER(t, _reg); \\\n\t\t\tstatic BgfxUSampler3D _name = { _name ## Texture }\n#\t\tdefine sampler3D BgfxSampler3D\n#\t\tdefine texture3D(_sampler, _coord) bgfxTexture3D(_sampler, _coord)\n#\t\tdefine texture3DLod(_sampler, _coord, _level) bgfxTexture3DLod(_sampler, _coord, _level)\n\n#\t\tdefine SAMPLERCUBE(_name, _reg) \\\n\t\t\tuniform SamplerState _name ## Sampler : REGISTER(s, _reg); \\\n\t\t\tuniform TextureCube _name ## Texture : REGISTER(t, _reg); \\\n\t\t\tstatic BgfxSamplerCube _name = { _name ## Sampler, _name ## Texture }\n#\t\tdefine samplerCube BgfxSamplerCube\n#\t\tdefine textureCube(_sampler, _coord) bgfxTextureCube(_sampler, _coord)\n#\t\tdefine textureCubeBias(_sampler, _coord, _bias) bgfxTextureCubeBias(_sampler, _coord, _bias)\n#\t\tdefine textureCubeLod(_sampler, _coord, _level) bgfxTextureCubeLod(_sampler, _coord, _level)\n\n#\t\tdefine SAMPLERCUBESHADOW(_name, _reg) \\\n\t\t\tuniform SamplerComparisonState _name ## SamplerComparison : REGISTER(s, _reg); \\\n\t\t\tuniform TextureCube _name ## Texture : REGISTER(t, _reg); \\\n\t\t\tstatic BgfxSamplerCubeShadow _name = { _name ## SamplerComparison, _name ## Texture }\n#\t\tdefine samplerCubeShadow BgfxSamplerCubeShadow\n#\t\tdefine shadowCube(_sampler, _coord) bgfxShadowCube(_sampler, _coord)\n\n#\t\tdefine texelFetch(_sampler, _coord, _lod) bgfxTexelFetch(_sampler, _coord, _lod)\n#\t\tdefine texelFetchOffset(_sampler, _coord, _lod, _offset) bgfxTexelFetchOffset(_sampler, _coord, _lod, _offset)\n#\t\tdefine textureSize(_sampler, _lod) bgfxTextureSize(_sampler, _lod)\n#\t\tdefine textureGather(_sampler, _coord) bgfxTextureGather(_sampler, _coord)\n#\t\tdefine textureGatherOffset(_sampler, _coord, _offset) bgfxTextureGatherOffset(_sampler, _coord, _offset)\n#\telse\n\n#\t\tdefine sampler2DShadow sampler2D\n\nvec4 bgfxTexture2DProj(sampler2D _sampler, vec3 _coord)\n{\n\treturn tex2Dproj(_sampler, vec4(_coord.xy, 0.0, _coord.z) );\n}\n\nvec4 bgfxTexture2DProj(sampler2D _sampler, vec4 _coord)\n{\n\treturn tex2Dproj(_sampler, _coord);\n}\n\nfloat bgfxShadow2D(sampler2DShadow _sampler, vec3 _coord)\n{\n#if 0\n\tfloat occluder = tex2D(_sampler, _coord.xy).x;\n\treturn step(_coord.z, occluder);\n#else\n\treturn tex2Dproj(_sampler, vec4(_coord.xy, _coord.z, 1.0) ).x;\n#endif // 0\n}\n\nfloat bgfxShadow2DProj(sampler2DShadow _sampler, vec4 _coord)\n{\n#if 0\n\tvec3 coord = _coord.xyz * rcp(_coord.w);\n\tfloat occluder = tex2D(_sampler, coord.xy).x;\n\treturn step(coord.z, occluder);\n#else\n\treturn tex2Dproj(_sampler, _coord).x;\n#endif // 0\n}\n\n#\t\tdefine SAMPLER2D(_name, _reg) uniform sampler2D _name : REGISTER(s, _reg)\n#\t\tdefine SAMPLER2DMS(_name, _reg) uniform sampler2DMS _name : REGISTER(s, _reg)\n#\t\tdefine texture2D(_sampler, _coord) tex2D(_sampler, _coord)\n#\t\tdefine texture2DProj(_sampler, _coord) bgfxTexture2DProj(_sampler, _coord)\n\n#\t\tdefine SAMPLER2DARRAY(_name, _reg) SAMPLER2D(_name, _reg)\n#\t\tdefine texture2DArray(_sampler, _coord) texture2D(_sampler, (_coord).xy)\n#\t\tdefine texture2DArrayLod(_sampler, _coord, _lod) texture2DLod(_sampler, _coord, _lod)\n\n#\t\tdefine SAMPLER2DSHADOW(_name, _reg) uniform sampler2DShadow _name : REGISTER(s, _reg)\n#\t\tdefine shadow2D(_sampler, _coord) bgfxShadow2D(_sampler, _coord)\n#\t\tdefine shadow2DProj(_sampler, _coord) bgfxShadow2DProj(_sampler, _coord)\n\n#\t\tdefine SAMPLER3D(_name, _reg) uniform sampler3D _name : REGISTER(s, _reg)\n#\t\tdefine texture3D(_sampler, _coord) tex3D(_sampler, _coord)\n\n#\t\tdefine SAMPLERCUBE(_name, _reg) uniform samplerCUBE _name : REGISTER(s, _reg)\n#\t\tdefine textureCube(_sampler, _coord) texCUBE(_sampler, _coord)\n\n#\t\tif BGFX_SHADER_LANGUAGE_HLSL == 2\n#\t\t\tdefine texture2DLod(_sampler, _coord, _level) tex2D(_sampler, (_coord).xy)\n#\t\t\tdefine texture2DGrad(_sampler, _coord, _dPdx, _dPdy) tex2D(_sampler, _coord)\n#\t\t\tdefine texture3DLod(_sampler, _coord, _level) tex3D(_sampler, (_coord).xyz)\n#\t\t\tdefine textureCubeLod(_sampler, _coord, _level) texCUBE(_sampler, (_coord).xyz)\n#\t\telse\n#\t\t\tdefine texture2DLod(_sampler, _coord, _level) tex2Dlod(_sampler, vec4( (_coord).xy, 0.0, _level) )\n#\t\t\tdefine texture2DGrad(_sampler, _coord, _dPdx, _dPdy) tex2Dgrad(_sampler, _coord, _dPdx, _dPdy)\n#\t\t\tdefine texture3DLod(_sampler, _coord, _level) tex3Dlod(_sampler, vec4( (_coord).xyz, _level) )\n#\t\t\tdefine textureCubeLod(_sampler, _coord, _level) texCUBElod(_sampler, vec4( (_coord).xyz, _level) )\n#\t\tendif // BGFX_SHADER_LANGUAGE_HLSL == 2\n\n#\tendif // BGFX_SHADER_LANGUAGE_HLSL > 3\n\n#\tdefine SAMPLEREXTERNAL(_name, _reg) SAMPLER2D(_name, _reg)\n\nvec3 instMul(vec3 _vec, mat3 _mtx) { return mul(_mtx, _vec); }\nvec3 instMul(mat3 _mtx, vec3 _vec) { return mul(_vec, _mtx); }\nvec4 instMul(vec4 _vec, mat4 _mtx) { return mul(_mtx, _vec); }\nvec4 instMul(mat4 _mtx, vec4 _vec) { return mul(_vec, _mtx); }\n\nbvec2 lessThan(vec2 _a, vec2 _b) { return _a < _b; }\nbvec3 lessThan(vec3 _a, vec3 _b) { return _a < _b; }\nbvec4 lessThan(vec4 _a, vec4 _b) { return _a < _b; }\n\nbvec2 lessThanEqual(vec2 _a, vec2 _b) { return _a <= _b; }\nbvec3 lessThanEqual(vec3 _a, vec3 _b) { return _a <= _b; }\nbvec4 lessThanEqual(vec4 _a, vec4 _b) { return _a <= _b; }\n\nbvec2 greaterThan(vec2 _a, vec2 _b) { return _a > _b; }\nbvec3 greaterThan(vec3 _a, vec3 _b) { return _a > _b; }\nbvec4 greaterThan(vec4 _a, vec4 _b) { return _a > _b; }\n\nbvec2 greaterThanEqual(vec2 _a, vec2 _b) { return _a >= _b; }\nbvec3 greaterThanEqual(vec3 _a, vec3 _b) { return _a >= _b; }\nbvec4 greaterThanEqual(vec4 _a, vec4 _b) { return _a >= _b; }\n\nbvec2 notEqual(vec2 _a, vec2 _b) { return _a != _b; }\nbvec3 notEqual(vec3 _a, vec3 _b) { return _a != _b; }\nbvec4 notEqual(vec4 _a, vec4 _b) { return _a != _b; }\n\nbvec2 equal(vec2 _a, vec2 _b) { return _a == _b; }\nbvec3 equal(vec3 _a, vec3 _b) { return _a == _b; }\nbvec4 equal(vec4 _a, vec4 _b) { return _a == _b; }\n\nfloat mix(float _a, float _b, float _t) { return lerp(_a, _b, _t); }\nvec2  mix(vec2  _a, vec2  _b, vec2  _t) { return lerp(_a, _b, _t); }\nvec3  mix(vec3  _a, vec3  _b, vec3  _t) { return lerp(_a, _b, _t); }\nvec4  mix(vec4  _a, vec4  _b, vec4  _t) { return lerp(_a, _b, _t); }\n\nfloat mod(float _a, float _b) { return _a - _b * floor(_a / _b); }\nvec2  mod(vec2  _a, vec2  _b) { return _a - _b * floor(_a / _b); }\nvec3  mod(vec3  _a, vec3  _b) { return _a - _b * floor(_a / _b); }\nvec4  mod(vec4  _a, vec4  _b) { return _a - _b * floor(_a / _b); }\n\n#else\n#\tdefine CONST(_x) const _x\n#\tdefine atan2(_x, _y) atan(_x, _y)\n#\tdefine mul(_a, _b) ( (_a) * (_b) )\n#\tdefine saturate(_x) clamp(_x, 0.0, 1.0)\n#\tdefine SAMPLER2D(_name, _reg)       uniform sampler2D _name\n#\tdefine SAMPLER2DMS(_name, _reg)     uniform sampler2DMS _name\n#\tdefine SAMPLER3D(_name, _reg)       uniform sampler3D _name\n#\tdefine SAMPLERCUBE(_name, _reg)     uniform samplerCube _name\n#\tdefine SAMPLER2DSHADOW(_name, _reg) uniform sampler2DShadow _name\n\n#\tdefine SAMPLER2DARRAY(_name, _reg)       uniform sampler2DArray _name\n#\tdefine SAMPLER2DMSARRAY(_name, _reg)     uniform sampler2DMSArray _name\n#\tdefine SAMPLERCUBEARRAY(_name, _reg)     uniform samplerCubeArray _name\n#\tdefine SAMPLER2DARRAYSHADOW(_name, _reg) uniform sampler2DArrayShadow _name\n\n#\tdefine ISAMPLER2D(_name, _reg) uniform isampler2D _name\n#\tdefine USAMPLER2D(_name, _reg) uniform usampler2D _name\n#\tdefine ISAMPLER3D(_name, _reg) uniform isampler3D _name\n#\tdefine USAMPLER3D(_name, _reg) uniform usampler3D _name\n\n#\tif BGFX_SHADER_LANGUAGE_GLSL == 1\n#\t\tdefine SAMPLEREXTERNAL(_name, _reg) uniform samplerExternalOES _name\n#\telse\n#\t\tdefine SAMPLEREXTERNAL(_name, _reg) SAMPLER2D(_name, _req)\n#\tendif\n\n#\tdefine texture2DBias(_sampler, _coord, _bias)      texture2D(_sampler, _coord, _bias)\n#\tdefine textureCubeBias(_sampler, _coord, _bias)    textureCube(_sampler, _coord, _bias)\n\n#\tif BGFX_SHADER_LANGUAGE_GLSL >= 130\n#\t\tdefine texture2D(_sampler, _coord)      texture(_sampler, _coord)\n#\t\tdefine texture2DArray(_sampler, _coord) texture(_sampler, _coord)\n#\t\tdefine texture3D(_sampler, _coord)      texture(_sampler, _coord)\n#\tendif // BGFX_SHADER_LANGUAGE_GLSL >= 130\n\nvec3 instMul(vec3 _vec, mat3 _mtx) { return mul(_vec, _mtx); }\nvec3 instMul(mat3 _mtx, vec3 _vec) { return mul(_mtx, _vec); }\nvec4 instMul(vec4 _vec, mat4 _mtx) { return mul(_vec, _mtx); }\nvec4 instMul(mat4 _mtx, vec4 _vec) { return mul(_mtx, _vec); }\n\nfloat rcp(float _a) { return 1.0/_a; }\nvec2  rcp(vec2  _a) { return vec2(1.0)/_a; }\nvec3  rcp(vec3  _a) { return vec3(1.0)/_a; }\nvec4  rcp(vec4  _a) { return vec4(1.0)/_a; }\n#endif // BGFX_SHADER_LANGUAGE_*\n\nvec2 vec2_splat(float _x) { return vec2(_x, _x); }\nvec3 vec3_splat(float _x) { return vec3(_x, _x, _x); }\nvec4 vec4_splat(float _x) { return vec4(_x, _x, _x, _x); }\n\n#if BGFX_SHADER_LANGUAGE_GLSL >= 130 || BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_PSSL || BGFX_SHADER_LANGUAGE_SPIRV || BGFX_SHADER_LANGUAGE_METAL\nuvec2 uvec2_splat(uint _x) { return uvec2(_x, _x); }\nuvec3 uvec3_splat(uint _x) { return uvec3(_x, _x, _x); }\nuvec4 uvec4_splat(uint _x) { return uvec4(_x, _x, _x, _x); }\n#endif // BGFX_SHADER_LANGUAGE_GLSL >= 130 || BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_PSSL || BGFX_SHADER_LANGUAGE_SPIRV || BGFX_SHADER_LANGUAGE_METAL\n\nmat4 mtxFromRows(vec4 _0, vec4 _1, vec4 _2, vec4 _3)\n{\n#if BGFX_SHADER_LANGUAGE_GLSL\n\treturn transpose(mat4(_0, _1, _2, _3) );\n#else\n\treturn mat4(_0, _1, _2, _3);\n#endif // BGFX_SHADER_LANGUAGE_GLSL\n}\nmat4 mtxFromCols(vec4 _0, vec4 _1, vec4 _2, vec4 _3)\n{\n#if BGFX_SHADER_LANGUAGE_GLSL\n\treturn mat4(_0, _1, _2, _3);\n#else\n\treturn transpose(mat4(_0, _1, _2, _3) );\n#endif // BGFX_SHADER_LANGUAGE_GLSL\n}\nmat3 mtxFromRows(vec3 _0, vec3 _1, vec3 _2)\n{\n#if BGFX_SHADER_LANGUAGE_GLSL\n\treturn transpose(mat3(_0, _1, _2) );\n#else\n\treturn mat3(_0, _1, _2);\n#endif // BGFX_SHADER_LANGUAGE_GLSL\n}\nmat3 mtxFromCols(vec3 _0, vec3 _1, vec3 _2)\n{\n#if BGFX_SHADER_LANGUAGE_GLSL\n\treturn mat3(_0, _1, _2);\n#else\n\treturn transpose(mat3(_0, _1, _2) );\n#endif // BGFX_SHADER_LANGUAGE_GLSL\n}\n\n#if BGFX_SHADER_LANGUAGE_GLSL\n#define mtxFromRows3(_0, _1, _2)     transpose(mat3(_0, _1, _2) )\n#define mtxFromRows4(_0, _1, _2, _3) transpose(mat4(_0, _1, _2, _3) )\n#define mtxFromCols3(_0, _1, _2)               mat3(_0, _1, _2)\n#define mtxFromCols4(_0, _1, _2, _3)           mat4(_0, _1, _2, _3)\n#else\n#define mtxFromRows3(_0, _1, _2)               mat3(_0, _1, _2)\n#define mtxFromRows4(_0, _1, _2, _3)           mat4(_0, _1, _2, _3)\n#define mtxFromCols3(_0, _1, _2)     transpose(mat3(_0, _1, _2) )\n#define mtxFromCols4(_0, _1, _2, _3) transpose(mat4(_0, _1, _2, _3) )\n#endif // BGFX_SHADER_LANGUAGE_GLSL\n\nuniform vec4  u_viewRect;\nuniform vec4  u_viewTexel;\nuniform mat4  u_view;\nuniform mat4  u_invView;\nuniform mat4  u_proj;\nuniform mat4  u_invProj;\nuniform mat4  u_viewProj;\nuniform mat4  u_invViewProj;\nuniform mat4  u_model[BGFX_CONFIG_MAX_BONES];\nuniform mat4  u_modelView;\nuniform mat4  u_modelViewProj;\nuniform vec4  u_alphaRef4;\n#define u_alphaRef u_alphaRef4.x\n\n#endif // __cplusplus\n\n#endif // BGFX_SHADER_H_HEADER_GUARD\n"
  },
  {
    "path": "shader/f_simple.sc",
    "content": "$input v_color0\n\n#include <bgfx_shader.sh>\n\nvoid main() {\n    gl_FragColor = v_color0;\n}\n"
  },
  {
    "path": "shader/v_simple.sc",
    "content": "$input a_position, a_color0\n$output v_color0\n\n#include <bgfx_shader.sh>\n\nvoid main() {\n    gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0));\n    v_color0 = a_color0;\n}\n"
  },
  {
    "path": "shader/varying.def.sc",
    "content": "vec4 v_color0 : COLOR0;\n\nvec3 a_position : POSITION;\nvec4 a_color0 : COLOR0;\n"
  },
  {
    "path": "third-party/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.24)\n\nif (NOT SUPERBUILD)\n  project(third-party)\nendif ()\n\ninclude(ExternalProject)\n\nget_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)\nif (NOT isMultiConfig)\n  if (NOT CMAKE_BUILD_TYPE)\n    set(CMAKE_BUILD_TYPE\n        Debug\n        CACHE STRING \"\" FORCE)\n  endif ()\n  set(build_type_dir ${CMAKE_BUILD_TYPE})\n  set(build_type_arg -DCMAKE_BUILD_TYPE=$<CONFIG>)\nelse ()\n  set(build_config_arg --config=$<CONFIG>)\nendif ()\n\nif (${CMAKE_SYSTEM_NAME} STREQUAL \"Emscripten\")\n  set(THIRD_PARTY_CMAKE_COMMAND emcmake cmake)\nelse ()\n  set(THIRD_PARTY_CMAKE_COMMAND ${CMAKE_COMMAND})\nendif ()\n\nif (SUPERBUILD)\n  set(PREFIX_DIR\n      ${CMAKE_CURRENT_SOURCE_DIR}/third-party/${THIRD_PARTY_BUILD_DIR_NAME})\nelse ()\n  set(PREFIX_DIR ${CMAKE_CURRENT_BINARY_DIR})\nendif ()\n\nif (NOT EMSCRIPTEN)\n  ExternalProject_Add(\n    SDL2\n    GIT_REPOSITORY https://github.com/libsdl-org/SDL.git\n    GIT_TAG release-2.28.4\n    PREFIX ${PREFIX_DIR}\n    BINARY_DIR ${PREFIX_DIR}/src/SDL2-build/${build_type_dir}\n    CMAKE_COMMAND ${THIRD_PARTY_CMAKE_COMMAND}\n    CMAKE_ARGS ${build_type_arg} -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>\n    BUILD_COMMAND cmake --build <BINARY_DIR> ${build_config_arg}\n    INSTALL_COMMAND cmake --build <BINARY_DIR> --target install\n                    ${build_config_arg})\nendif ()\n\nExternalProject_Add(\n  bgfx\n  GIT_REPOSITORY https://github.com/pr0g/bgfx.cmake.git\n  GIT_TAG bde3f94ce75ffd184e9a3bdfe947a3bec69233eb\n  PREFIX ${PREFIX_DIR}\n  BINARY_DIR ${PREFIX_DIR}/src/bgfx-build/${build_type_dir}\n  CMAKE_COMMAND ${THIRD_PARTY_CMAKE_COMMAND}\n  CMAKE_ARGS ${build_type_arg}\n             -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>\n             \"$<$<CONFIG:Debug>:-DCMAKE_DEBUG_POSTFIX=d>\"\n             \"$<$<PLATFORM_ID:Emscripten>:-DBGFX_CONFIG_MULTITHREADED=OFF>\"\n             -DBGFX_BUILD_EXAMPLES=OFF\n  BUILD_COMMAND cmake --build <BINARY_DIR> ${build_config_arg}\n  INSTALL_COMMAND cmake --build <BINARY_DIR> --target install\n                  ${build_config_arg})\n\nExternalProject_Add(\n  imgui.cmake\n  GIT_REPOSITORY https://github.com/pr0g/imgui.cmake.git\n  GIT_TAG 20e7d1a627690526c98b0b48c346e384ab87c5a6\n  PREFIX ${PREFIX_DIR}\n  BINARY_DIR ${PREFIX_DIR}/src/imgui.cmake-build/${build_type_dir}\n  CMAKE_COMMAND ${THIRD_PARTY_CMAKE_COMMAND}\n  CMAKE_ARGS ${build_type_arg} -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>\n             \"$<$<CONFIG:Debug>:-DCMAKE_DEBUG_POSTFIX=d>\"\n             -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=ON\n  BUILD_COMMAND cmake --build <BINARY_DIR> ${build_config_arg}\n  INSTALL_COMMAND cmake --build <BINARY_DIR> --target install\n                  ${build_config_arg})\n"
  },
  {
    "path": "third-party/README.md",
    "content": "# Third Party Setup\n\n> __Note__: _Nearly_ all steps listed here are now optional and are not required thanks to the new _superbuild_ CMake script and option (`-DSUPERBUILD=ON`) supported by the repository.\n>\n>All third party dependencies will be automatically downloaded and built as part of the normal configuration process (see instructions in the main [__README__](/README.md) and accompanying configure scripts for details).\n\n## Setup\n\n### Windows\n\n- First run `VsDevCmd.bat` from a terminal of your choice.\n  - Most likely to be located here (year and version may differ).\n    - `\"C:\\Program Files\\Microsoft Visual Studio\\<year>\\Community\\Common7\\Tools\\VsDevCmd.bat\" -arch=x64 -host_arch=x64`\n    - e.g. `\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\VsDevCmd.bat\" -arch=x64 -host_arch=x64`\n    - _Note:_ `-arch=x64 -host_arch=x64` are required for `x86_64` otherwise `x86` (32bit) is used as the default.\n- This is to ensure both the compiler (`cl.exe`) and Ninja are added to your path and can be found by CMake.\n\n### macOS\n\n- You may need to add `-DCMAKE_C_COMPILER=<path/to/c/compiler> -DCMAKE_CXX_COMPILER=<path/to/c++/compiler>` when running the CMake commands if a valid compiler cannot be found by CMake.\n  - Most likely locations include: `/usr/bin/clang`, `/usr/bin/clang++`, `/usr/local/bin/gcc`, `/usr/local/bin/g++` etc...\n\n### Linux\n\n- You may need to install a few libraries before the third party dependencies can be built (most notably OpenGL and X11 if they're not already on your system). You'll likely get CMake configure errors if you're missing them.\n\n```bash\n# suggested command\n\nsudo apt-get install libx11-dev libglu1-mesa-dev libgl1-mesa-glx libxext-dev ninja-build\n```\n\n- ... to get X11, OpenGL, GLX and Ninja\n\n## Install\n\nOn either Windows, macOS or Linux, `cd` to the `third-party` folder and run:\n\n```cmake\ncmake -B build\n```\n\nIt's fine not to specify a generator, any should work (and the `CMakeLists.txt` file should handle either single or multi-config generators).\n\n> Note: For single-config generators the above will configure the libraries to build in `Debug`. To build them in `Release` (after performing the step listed below to build the libraries in `Debug`), run `cmake -B build -DCMAKE_BUILD_TYPE=Release`, and then invoke `cmake --build build` again.\n\nThen run:\n\n```cmake\ncmake --build build\n```\n\n> Note: For single-config generators (`Make`, `Ninja`) this will build the configuration provided by `-DCMAKE_BUILD_TYPE` (`Debug` by default if omitted). For multi-config generators (e.g. Visual Studio) `cmake --build build` will by default build the `Debug` configuration. To build `Release`, use `cmake --build build --config Release`.\n\nIt might take a little while but behind the scenes CMake will go away and download, configure, build and install `SDL`, `bgfx` and `Dear ImGui`.\n\nOnce everything is complete you should be able to continue with the instructions in the main [README](README.md).\n\n## Emscripten\n\nIt's possible to build the third party dependencies for use with Emscripten. To do this run the same commands as before, only prefix the configure step with `emcmake`. It's recommended to use `embuild` as the build folder to stop Emscripten overwriting the native build that may already exist.\n\n```bash\n# install emsdk (instructions: https://emscripten.org/docs/getting_started/downloads.html)\n# setup Emscripten environment variables\nsource <emsdk>/emsdk_env.sh # on macOS/Linux\n# or\n<emsdk>/emsdk_env.bat # on Windows\n#\nemcmake cmake -B embuild # configure for Emscripten\ncmake --build embuild # build libraries for Emscripten\n```\n\n## Wrap-Up\n\nIf you plan to create several projects you could install these dependencies to a shared location and use `CMAKE_PREFIX_PATH` to point to that location when building.\n\nAll dependencies make use of `CMAKE_DEBUG_POSTFIX` which means all built debug libraries get a '`d`' suffix (the convention) appended, so both Debug and Release libraries are installed to the same location.\n"
  }
]