├── appicon.rc ├── koala.ico ├── screenshot.png ├── examples ├── newPlugin │ ├── imgui │ │ ├── examples │ │ │ ├── example_android_opengl3 │ │ │ │ ├── android │ │ │ │ │ ├── settings.gradle │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── build.gradle │ │ │ │ │ └── app │ │ │ │ │ │ ├── build.gradle │ │ │ │ │ │ └── src │ │ │ │ │ │ └── main │ │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ │ └── java │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── CMakeLists.txt │ │ │ ├── example_null │ │ │ │ ├── build_win32.bat │ │ │ │ ├── main.cpp │ │ │ │ └── Makefile │ │ │ ├── libs │ │ │ │ ├── usynergy │ │ │ │ │ └── README.txt │ │ │ │ └── glfw │ │ │ │ │ └── COPYING.txt │ │ │ ├── example_apple_metal │ │ │ │ ├── README.md │ │ │ │ ├── macOS │ │ │ │ │ └── Info-macOS.plist │ │ │ │ └── iOS │ │ │ │ │ ├── Info-iOS.plist │ │ │ │ │ └── LaunchScreen.storyboard │ │ │ ├── example_win32_directx9 │ │ │ │ ├── build_win32.bat │ │ │ │ └── example_win32_directx9.vcxproj.filters │ │ │ ├── example_glfw_opengl2 │ │ │ │ ├── build_win32.bat │ │ │ │ ├── example_glfw_opengl2.vcxproj.filters │ │ │ │ └── Makefile │ │ │ ├── example_glfw_opengl3 │ │ │ │ ├── build_win32.bat │ │ │ │ ├── example_glfw_opengl3.vcxproj.filters │ │ │ │ └── Makefile │ │ │ ├── example_sdl_sdlrenderer │ │ │ │ ├── build_win32.bat │ │ │ │ ├── README.md │ │ │ │ ├── example_sdl_sdlrenderer.vcxproj.filters │ │ │ │ └── Makefile │ │ │ ├── example_sdl_opengl2 │ │ │ │ ├── build_win32.bat │ │ │ │ ├── README.md │ │ │ │ ├── example_sdl_opengl2.vcxproj.filters │ │ │ │ └── Makefile │ │ │ ├── example_sdl_opengl3 │ │ │ │ ├── build_win32.bat │ │ │ │ ├── README.md │ │ │ │ ├── example_sdl_opengl3.vcxproj.filters │ │ │ │ └── Makefile │ │ │ ├── example_allegro5 │ │ │ │ ├── imconfig_allegro5.h │ │ │ │ ├── README.md │ │ │ │ └── example_allegro5.vcxproj.filters │ │ │ ├── README.txt │ │ │ ├── example_win32_directx10 │ │ │ │ ├── build_win32.bat │ │ │ │ └── example_win32_directx10.vcxproj.filters │ │ │ ├── example_win32_directx11 │ │ │ │ ├── build_win32.bat │ │ │ │ └── example_win32_directx11.vcxproj.filters │ │ │ ├── example_sdl_vulkan │ │ │ │ ├── build_win32.bat │ │ │ │ └── example_sdl_vulkan.vcxproj.filters │ │ │ ├── example_sdl_directx11 │ │ │ │ ├── build_win32.bat │ │ │ │ └── example_sdl_directx11.vcxproj.filters │ │ │ ├── example_win32_directx12 │ │ │ │ ├── build_win32.bat │ │ │ │ └── example_win32_directx12.vcxproj.filters │ │ │ ├── example_glfw_vulkan │ │ │ │ ├── build_win64.bat │ │ │ │ ├── build_win32.bat │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── example_glfw_vulkan.vcxproj.filters │ │ │ ├── example_glfw_metal │ │ │ │ └── Makefile │ │ │ ├── example_sdl_metal │ │ │ │ └── Makefile │ │ │ ├── example_glut_opengl2 │ │ │ │ ├── Makefile │ │ │ │ └── example_glut_opengl2.vcxproj.filters │ │ │ ├── example_emscripten_wgpu │ │ │ │ ├── README.md │ │ │ │ └── Makefile │ │ │ └── example_emscripten_opengl3 │ │ │ │ ├── shell_minimal.html │ │ │ │ ├── README.md │ │ │ │ └── Makefile │ │ ├── .github │ │ │ ├── FUNDING.yml │ │ │ ├── pull_request_template.md │ │ │ ├── workflows │ │ │ │ ├── scheduled.yml │ │ │ │ └── static-analysis.yml │ │ │ └── issue_template.md │ │ ├── misc │ │ │ ├── fonts │ │ │ │ ├── DroidSans.ttf │ │ │ │ ├── ProggyClean.ttf │ │ │ │ ├── ProggyTiny.ttf │ │ │ │ ├── Karla-Regular.ttf │ │ │ │ ├── Roboto-Medium.ttf │ │ │ │ └── Cousine-Regular.ttf │ │ │ ├── debuggers │ │ │ │ ├── README.txt │ │ │ │ ├── imgui.gdb │ │ │ │ ├── imgui.natstepfilter │ │ │ │ └── imgui.natvis │ │ │ ├── cpp │ │ │ │ ├── README.txt │ │ │ │ ├── imgui_stdlib.h │ │ │ │ └── imgui_stdlib.cpp │ │ │ ├── single_file │ │ │ │ └── imgui_single_file.h │ │ │ ├── README.txt │ │ │ └── freetype │ │ │ │ ├── README.md │ │ │ │ └── imgui_freetype.h │ │ ├── backends │ │ │ ├── vulkan │ │ │ │ ├── generate_spv.sh │ │ │ │ ├── glsl_shader.frag │ │ │ │ └── glsl_shader.vert │ │ │ ├── imgui_impl_dx9.h │ │ │ ├── imgui_impl_dx10.h │ │ │ ├── imgui_impl_wgpu.h │ │ │ ├── imgui_impl_dx11.h │ │ │ ├── imgui_impl_sdlrenderer.h │ │ │ ├── imgui_impl_osx.h │ │ │ ├── imgui_impl_android.h │ │ │ ├── imgui_impl_allegro5.h │ │ │ ├── imgui_impl_opengl2.h │ │ │ ├── imgui_impl_dx12.h │ │ │ ├── imgui_impl_sdl.h │ │ │ ├── imgui_impl_glut.h │ │ │ ├── imgui_impl_opengl3.h │ │ │ ├── imgui_impl_win32.h │ │ │ ├── imgui_impl_metal.h │ │ │ └── imgui_impl_glfw.h │ │ ├── .gitattributes │ │ ├── .editorconfig │ │ ├── .gitignore │ │ └── LICENSE.txt │ ├── CMakeLists.txt │ ├── NewPlugin.cpp │ └── framework.hpp ├── newSystem │ ├── CMakeLists.txt │ └── NewSystem.cpp └── example.lua ├── src ├── types │ ├── registerTypes.hpp │ ├── registerkenginemetaGet.cpp │ ├── registerkenginemetaHas.cpp │ ├── registerkenginemetaCopy.cpp │ ├── registerkenginemetaSize.cpp │ ├── registerkenginemetaCount.cpp │ ├── registerkengineLuaComponent.cpp │ ├── registerkenginemetaAttachTo.cpp │ ├── registerkengineNameComponent.cpp │ ├── registerkenginemetaEditImGui.cpp │ ├── registerkengineModelComponent.cpp │ ├── registerkenginemetaAttributes.cpp │ ├── registerkenginemetaDetachFrom.cpp │ ├── registerkenginemetaSaveToJSON.cpp │ ├── registerkenginePythonComponent.cpp │ ├── registerkengineWindowComponent.cpp │ ├── registerkenginemetaMatchString.cpp │ ├── registerkenginefunctionsExecute.cpp │ ├── registerkenginemetaDisplayImGui.cpp │ ├── registerkenginemetaLoadFromJSON.cpp │ ├── registerkengineInstanceComponent.cpp │ ├── registerkengineLuaTableComponent.cpp │ ├── registerkengineSelectedComponent.cpp │ ├── registerkenginemetaForEachEntity.cpp │ ├── registerkengineImGuiToolComponent.cpp │ ├── registerkengineAdjustableComponent.cpp │ ├── registerkengineCommandLineComponent.cpp │ ├── registerkengineTimeModulatorComponent.cpp │ ├── registerkenginemetaForEachEntityWithout.cpp │ └── registerTypes.cpp ├── ImGuiLuaSystem.hpp ├── ImGuiPluginSystem.hpp ├── ImGuiPluginSystem.cpp └── ImGuiLuaSystem.cpp ├── .gitmodules ├── plugins ├── CMakeLists.txt └── controller │ ├── CMakeLists.txt │ └── ControllerSystem.cpp ├── copy.sh ├── .gitignore ├── common └── registerTypes.hpp ├── .github └── workflows │ └── build.yml ├── scripts └── types.json ├── README.md └── CMakeLists.txt /appicon.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "koala.ico" -------------------------------------------------------------------------------- /koala.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phisko/koverlay/HEAD/koala.ico -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phisko/koverlay/HEAD/screenshot.png -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_android_opengl3/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['https://github.com/ocornut/imgui/wiki/Sponsors'] 2 | -------------------------------------------------------------------------------- /src/types/registerTypes.hpp: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | namespace types{ 5 | void registerTypes() noexcept; 6 | } 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "kengine"] 2 | path = kengine 3 | url = https://github.com/phisko/kengine 4 | branch = develop 5 | -------------------------------------------------------------------------------- /src/ImGuiLuaSystem.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "EntityCreator.hpp" 4 | 5 | kengine::EntityCreator * ImGuiLuaSystem() noexcept; 6 | -------------------------------------------------------------------------------- /src/ImGuiPluginSystem.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "EntityCreator.hpp" 4 | 5 | kengine::EntityCreator * ImGuiPluginSystem() noexcept; 6 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/fonts/DroidSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phisko/koverlay/HEAD/examples/newPlugin/imgui/misc/fonts/DroidSans.ttf -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/fonts/ProggyClean.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phisko/koverlay/HEAD/examples/newPlugin/imgui/misc/fonts/ProggyClean.ttf -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/fonts/ProggyTiny.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phisko/koverlay/HEAD/examples/newPlugin/imgui/misc/fonts/ProggyTiny.ttf -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/fonts/Karla-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phisko/koverlay/HEAD/examples/newPlugin/imgui/misc/fonts/Karla-Regular.ttf -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phisko/koverlay/HEAD/examples/newPlugin/imgui/misc/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/fonts/Cousine-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phisko/koverlay/HEAD/examples/newPlugin/imgui/misc/fonts/Cousine-Regular.ttf -------------------------------------------------------------------------------- /plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB children *) 2 | foreach(child ${children}) 3 | if(IS_DIRECTORY ${child}) 4 | add_subdirectory(${child}) 5 | endif() 6 | endforeach() -------------------------------------------------------------------------------- /examples/newPlugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(name MY_PLUGIN) 2 | 3 | file(GLOB src *.cpp *.hpp imgui/*.cpp imgui/*.hpp) 4 | add_library(${name} SHARED MODULE ${src}) 5 | target_include_directories(${name} PRIVATE ${CMAKE_CURRENT_LIST_DIR} imgui) 6 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_android_opengl3/android/.gitignore: -------------------------------------------------------------------------------- 1 | .cxx 2 | .externalNativeBuild 3 | build/ 4 | *.iml 5 | 6 | .idea 7 | .gradle 8 | local.properties 9 | 10 | # Android Studio puts a Gradle wrapper here, that we don't want: 11 | gradle/ 12 | gradlew* 13 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | (Click "Preview" to turn any http URL into a clickable link) 2 | 3 | 1. PLEASE CAREFULLY READ: [Issue Submitting Guidelines](https://github.com/ocornut/imgui/issues/2261) 4 | 5 | 2. Clear this template before submitting your PR. 6 | 7 | -------------------------------------------------------------------------------- /examples/newSystem/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(name MY_SYSTEM) 2 | 3 | file(GLOB src 4 | *.cpp *.hpp) 5 | 6 | add_library(${name} 7 | SHARED MODULE 8 | ${src} 9 | ) 10 | target_link_libraries(${name} kengine) 11 | target_include_directories(${name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}) 12 | -------------------------------------------------------------------------------- /plugins/controller/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(name controller) 2 | 3 | file(GLOB src 4 | *.cpp *.hpp) 5 | 6 | add_library(${name} 7 | SHARED MODULE 8 | ${src} 9 | ) 10 | target_link_libraries(${name} kengine) 11 | target_include_directories(${name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}) 12 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_null/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /Zi /MD /I ..\.. %* *.cpp ..\..\*.cpp /FeDebug/example_null.exe /FoDebug/ /link gdi32.lib shell32.lib imm32.lib 4 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/vulkan/generate_spv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## -V: create SPIR-V binary 3 | ## -x: save binary output as text-based 32-bit hexadecimal numbers 4 | ## -o: output file 5 | glslangValidator -V -x -o glsl_shader.frag.u32 glsl_shader.frag 6 | glslangValidator -V -x -o glsl_shader.vert.u32 glsl_shader.vert 7 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/libs/usynergy/README.txt: -------------------------------------------------------------------------------- 1 | 2 | uSynergy client -- Implementation for the embedded Synergy client library 3 | version 1.0.0, July 7th, 2012 4 | Copyright (c) 2012 Alex Evans 5 | 6 | This is a copy of the files once found at: 7 | https://github.com/symless/synergy-core/tree/790d108a56ada9caad8e56ff777d444485a69da9/src/micro 8 | 9 | -------------------------------------------------------------------------------- /examples/newPlugin/NewPlugin.cpp: -------------------------------------------------------------------------------- 1 | #include "imgui.h" 2 | #include "framework.hpp" 3 | 4 | static const char * getName() { 5 | return "NewPlugin"; 6 | } 7 | 8 | static void imguiFunction() { 9 | // can use g_scale to properly scale child windows and other elements 10 | if (ImGui::Begin("NewPlugin", &PLUGIN_ENABLED)) { 11 | } 12 | ImGui::End(); 13 | } 14 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/vulkan/glsl_shader.frag: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | layout(location = 0) out vec4 fColor; 3 | 4 | layout(set=0, binding=0) uniform sampler2D sTexture; 5 | 6 | layout(location = 0) in struct { 7 | vec4 Color; 8 | vec2 UV; 9 | } In; 10 | 11 | void main() 12 | { 13 | fColor = In.Color * texture(sTexture, In.UV.st); 14 | } 15 | -------------------------------------------------------------------------------- /src/types/registerkenginemetaGet.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/Get.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaGet() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::Get'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginemetaHas.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/Has.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaHas() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::Has'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginemetaCopy.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/Copy.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaCopy() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::Copy'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginemetaSize.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/Size.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaSize() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::Size'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginemetaCount.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/Count.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaCount() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::Count'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkengineLuaComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "data/LuaComponent.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkengineLuaComponent() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::LuaComponent'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginemetaAttachTo.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/AttachTo.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaAttachTo() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::AttachTo'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkengineNameComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "data/NameComponent.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkengineNameComponent() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::NameComponent'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginemetaEditImGui.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/EditImGui.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaEditImGui() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::EditImGui'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkengineModelComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "data/ModelComponent.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkengineModelComponent() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::ModelComponent'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginemetaAttributes.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/Attributes.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaAttributes() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::Attributes'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginemetaDetachFrom.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/DetachFrom.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaDetachFrom() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::DetachFrom'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginemetaSaveToJSON.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/SaveToJSON.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaSaveToJSON() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::SaveToJSON'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginePythonComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "data/PythonComponent.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginePythonComponent() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::PythonComponent'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkengineWindowComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "data/WindowComponent.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkengineWindowComponent() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::WindowComponent'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginemetaMatchString.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/MatchString.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaMatchString() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::MatchString'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginefunctionsExecute.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "functions/Execute.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginefunctionsExecute() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::functions::Execute'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginemetaDisplayImGui.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/DisplayImGui.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaDisplayImGui() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::DisplayImGui'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginemetaLoadFromJSON.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/LoadFromJSON.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaLoadFromJSON() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::LoadFromJSON'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkengineInstanceComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "data/InstanceComponent.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkengineInstanceComponent() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::InstanceComponent'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkengineLuaTableComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "data/LuaTableComponent.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkengineLuaTableComponent() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::LuaTableComponent'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkengineSelectedComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "data/SelectedComponent.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkengineSelectedComponent() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::SelectedComponent'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginemetaForEachEntity.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/ForEachEntity.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaForEachEntity() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::ForEachEntity'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkengineImGuiToolComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "data/ImGuiToolComponent.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkengineImGuiToolComponent() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::ImGuiToolComponent'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkengineAdjustableComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "data/AdjustableComponent.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkengineAdjustableComponent() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::AdjustableComponent'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /examples/newPlugin/imgui/.github/workflows/scheduled.yml: -------------------------------------------------------------------------------- 1 | # 2 | # This is a dummy workflow used to trigger scheduled builds. Forked repositories most likely should disable this 3 | # workflow to avoid daily builds of inactive repositories. 4 | # 5 | name: scheduled 6 | 7 | on: 8 | schedule: 9 | - cron: '0 9 * * *' 10 | 11 | jobs: 12 | scheduled: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - run: exit 0 16 | -------------------------------------------------------------------------------- /src/types/registerkengineCommandLineComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "data/CommandLineComponent.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkengineCommandLineComponent() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::CommandLineComponent'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_apple_metal/README.md: -------------------------------------------------------------------------------- 1 | # iOS / OSX Metal example 2 | 3 | ## Introduction 4 | 5 | This example shows how to integrate Dear ImGui with Metal. It is based on the "cross-platform" game template provided with Xcode as of Xcode 9. 6 | 7 | Consider basing your work off the example_glfw_metal/ or example_sdl_metal/ examples. They are better supported and will be portable unlike this one. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/types/registerkengineTimeModulatorComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "data/TimeModulatorComponent.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkengineTimeModulatorComponent() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::TimeModulatorComponent'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/types/registerkenginemetaForEachEntityWithout.cpp: -------------------------------------------------------------------------------- 1 | #include "helpers/registerTypeHelper.hpp" 2 | #include "meta/ForEachEntity.hpp" 3 | #include "helpers/logHelper.hpp" 4 | 5 | namespace types{ 6 | void registerkenginemetaForEachEntityWithout() noexcept { 7 | kengine_log(Log, "Init/registerTypes", "Registering 'kengine::meta::ForEachEntityWithout'"); 8 | kengine::registerComponents(); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /copy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ ! -d $1 && ! -f $1 ]] 4 | then 5 | exit 1 6 | fi 7 | 8 | SOURCE=$1 9 | 10 | function copyTo() { 11 | DEST=$1 12 | 13 | if [[ ! -d $DEST ]] 14 | then 15 | mkdir $DEST 16 | fi 17 | 18 | rm -rf $DEST/$SOURCE && cp -r $SOURCE $DEST 19 | ln adjust.cnf $DEST 20 | } 21 | 22 | copyTo bin 23 | copyTo bin/debug 24 | copyTo bin/release 25 | copyTo bin/relwithdebinfo 26 | copyTo bin/minsizerel 27 | -------------------------------------------------------------------------------- /examples/example.lua: -------------------------------------------------------------------------------- 1 | TOOL_NAME = "Lua" 2 | -- can use IMGUI_SCALE to properly scale child windows 3 | 4 | if EXAMPLE_BUTTON_CLICKED == nil then 5 | EXAMPLE_BUTTON_CLICKED = false 6 | end 7 | 8 | shouldDraw, TOOL_ENABLED = imgui.Begin("Lua", TOOL_ENABLED) 9 | if shouldDraw then 10 | if imgui.SmallButton("Click me") then 11 | EXAMPLE_BUTTON_CLICKED = true 12 | end 13 | 14 | if EXAMPLE_BUTTON_CLICKED then 15 | imgui.TextUnformatted("Good job!") 16 | end 17 | end 18 | imgui.End() 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | cmake-build-*/ 3 | .vs/ 4 | .vscode/ 5 | build/ 6 | bin/ 7 | lib/ 8 | *.swp 9 | *.swo 10 | 11 | # Prerequisites 12 | *.d 13 | 14 | # Compiled Object files 15 | *.slo 16 | *.lo 17 | *.o 18 | *.obj 19 | 20 | # Precompiled Headers 21 | *.gch 22 | *.pch 23 | 24 | # Compiled Dynamic libraries 25 | *.so 26 | *.dylib 27 | *.dll 28 | 29 | # Fortran module files 30 | *.mod 31 | *.smod 32 | 33 | # Compiled Static libraries 34 | *.lai 35 | *.la 36 | *.a 37 | *.lib 38 | 39 | # Executables 40 | *.exe 41 | *.out 42 | *.app 43 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.c text 4 | *.cpp text 5 | *.h text 6 | *.m text 7 | *.mm text 8 | *.md text 9 | *.txt text 10 | *.html text 11 | *.bat text 12 | *.frag text 13 | *.vert text 14 | *.mkb text 15 | *.icf text 16 | 17 | *.sln text eol=crlf 18 | *.vcxproj text eol=crlf 19 | *.vcxproj.filters text eol=crlf 20 | *.natvis text eol=crlf 21 | 22 | Makefile text eol=lf 23 | *.sh text eol=lf 24 | *.pbxproj text eol=lf 25 | *.storyboard text eol=lf 26 | *.plist text eol=lf 27 | 28 | *.png binary 29 | *.ttf binary 30 | *.lib binary 31 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/debuggers/README.txt: -------------------------------------------------------------------------------- 1 | 2 | HELPER FILES FOR POPULAR DEBUGGERS 3 | 4 | imgui.gdb 5 | GDB: disable stepping into trivial functions. 6 | (read comments inside file for details) 7 | 8 | imgui.natstepfilter 9 | Visual Studio Debugger: disable stepping into trivial functions. 10 | (read comments inside file for details) 11 | 12 | imgui.natvis 13 | Visual Studio Debugger: describe Dear ImGui types for better display. 14 | With this, types like ImVector<> will be displayed nicely in the debugger. 15 | (read comments inside file for details) 16 | 17 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_android_opengl3/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.4.31' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | mavenCentral() 19 | } 20 | } 21 | 22 | task clean(type: Delete) { 23 | delete rootProject.buildDir 24 | } 25 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_win32_directx9/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_directx9 4 | @set INCLUDES=/I..\.. /I..\..\backends /I "%DXSDK_DIR%/Include" 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_dx9.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d9.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/vulkan/glsl_shader.vert: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | layout(location = 0) in vec2 aPos; 3 | layout(location = 1) in vec2 aUV; 4 | layout(location = 2) in vec4 aColor; 5 | 6 | layout(push_constant) uniform uPushConstant { 7 | vec2 uScale; 8 | vec2 uTranslate; 9 | } pc; 10 | 11 | out gl_PerVertex { 12 | vec4 gl_Position; 13 | }; 14 | 15 | layout(location = 0) out struct { 16 | vec4 Color; 17 | vec2 UV; 18 | } Out; 19 | 20 | void main() 21 | { 22 | Out.Color = aColor; 23 | Out.UV = aUV; 24 | gl_Position = vec4(aPos * pc.uScale + pc.uTranslate, 0, 1); 25 | } 26 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_glfw_opengl2/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_glfw_opengl2 4 | @set INCLUDES=/I..\.. /I..\..\backends /I..\libs\glfw\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\backends\imgui_impl_glfw.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:..\libs\glfw\lib-vc2010-32 glfw3.lib opengl32.lib gdi32.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_glfw_opengl3/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_glfw_opengl3 4 | @set INCLUDES=/I..\.. /I..\..\backends /I..\libs\glfw\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_glfw.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:..\libs\glfw\lib-vc2010-32 glfw3.lib opengl32.lib gdi32.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_sdlrenderer/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl_sdlrenderer_ 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_sdlrenderer.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_opengl2/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl_opengl2 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_opengl3/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl_opengl3 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/cpp/README.txt: -------------------------------------------------------------------------------- 1 | 2 | imgui_stdlib.h + imgui_stdlib.cpp 3 | InputText() wrappers for C++ standard library (STL) type: std::string. 4 | This is also an example of how you may wrap your own similar types. 5 | 6 | imgui_scoped.h 7 | [Experimental, not currently in main repository] 8 | Additional header file with some RAII-style wrappers for common Dear ImGui functions. 9 | Try by merging: https://github.com/ocornut/imgui/pull/2197 10 | Discuss at: https://github.com/ocornut/imgui/issues/2096 11 | 12 | See more C++ related extension on Wiki 13 | https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness 14 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/debuggers/imgui.gdb: -------------------------------------------------------------------------------- 1 | # GDB configuration to aid debugging experience 2 | 3 | # To enable these customizations edit $HOME/.gdbinit (or ./.gdbinit if local gdbinit is enabled) and add: 4 | # add-auto-load-safe-path /path/to/imgui.gdb 5 | # source /path/to/imgui.gdb 6 | # 7 | # More Information at: 8 | # * https://sourceware.org/gdb/current/onlinedocs/gdb/gdbinit-man.html 9 | # * https://sourceware.org/gdb/current/onlinedocs/gdb/Init-File-in-the-Current-Directory.html#Init-File-in-the-Current-Directory 10 | 11 | # Disable stepping into trivial functions 12 | skip -rfunction Im(Vec2|Vec4|Strv|Vector|Span)::.+ 13 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_allegro5/imconfig_allegro5.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // COMPILE-TIME OPTIONS FOR DEAR IMGUI ALLEGRO 5 EXAMPLE 3 | // See imconfig.h for the full template 4 | // Because Allegro doesn't support 16-bit vertex indices, we enable the compile-time option of imgui to use 32-bit indices 5 | //----------------------------------------------------------------------------- 6 | 7 | #pragma once 8 | 9 | // Use 32-bit vertex indices because Allegro doesn't support 16-bit ones 10 | // This allows us to avoid converting vertices format at runtime 11 | #define ImDrawIdx int 12 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/README.txt: -------------------------------------------------------------------------------- 1 | See BACKENDS and EXAMPLES files in the docs/ folder, or on the web at: https://github.com/ocornut/imgui/tree/master/docs 2 | 3 | Backends = Helper code to facilitate integration with platforms/graphics api (used by Examples + should be used by your app). 4 | Examples = Standalone applications showcasing integration with platforms/graphics api. 5 | 6 | Some Examples have extra README files in their respective directory, please check them too! 7 | 8 | Once Dear ImGui is running (in either examples or your own application/game/engine), 9 | run and refer to ImGui::ShowDemoWindow() in imgui_demo.cpp for the end-user API. 10 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_win32_directx10/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_directx10 4 | @set INCLUDES=/I..\.. /I..\..\backends /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I "%DXSDK_DIR%Include" 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\backends\imgui_impl_dx10.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d10.lib d3dcompiler.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_win32_directx11/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_directx11 4 | @set INCLUDES=/I..\.. /I..\..\backends /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I "%DXSDK_DIR%Include" 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_dx11.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d11.lib d3dcompiler.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | 10 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_vulkan/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | 3 | @set OUT_EXE=example_sdl_vulkan 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include /I %VULKAN_SDK%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 /libpath:%VULKAN_SDK%\lib32 SDL2.lib SDL2main.lib shell32.lib vulkan-1.lib 7 | 8 | @set OUT_DIR=Debug 9 | mkdir %OUT_DIR% 10 | cl /nologo /Zi /MD %INCLUDES% /D ImTextureID=ImU64 %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 11 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_directx11/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl_directx11 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I "%DXSDK_DIR%Include" 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_dx11.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib /LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d11.lib d3dcompiler.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /examples/newPlugin/framework.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | static float g_scale; 4 | 5 | static bool PLUGIN_ENABLED; // Used to know if window is open 6 | static const char * getName(); 7 | static void imguiFunction(); 8 | 9 | #if defined(__unix__) || defined(__APPLE__) 10 | # define EXPORT extern "C" 11 | #endif 12 | #ifdef _WIN32 13 | # define EXPORT extern "C" __declspec(dllexport) 14 | #endif 15 | 16 | EXPORT const char * getNameAndEnabled(bool ** outEnabled) { 17 | *outEnabled = &PLUGIN_ENABLED; 18 | return getName(); 19 | } 20 | 21 | struct ImGuiContext; 22 | extern ImGuiContext * GImGui; 23 | 24 | EXPORT void drawImGui(ImGuiContext & context, float scale) { 25 | if (!PLUGIN_ENABLED) 26 | return; 27 | GImGui = &context; 28 | g_scale = scale; 29 | 30 | imguiFunction(); 31 | } 32 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_win32_directx12/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @REM Important: to build on 32-bit systems, the DX12 backends needs '#define ImTextureID ImU64', so we pass it here. 3 | @set OUT_DIR=Debug 4 | @set OUT_EXE=example_win32_directx12 5 | @set INCLUDES=/I..\.. /I..\..\backends /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" 6 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_dx12.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\imgui*.cpp 7 | @set LIBS=d3d12.lib d3dcompiler.lib dxgi.lib 8 | mkdir Debug 9 | cl /nologo /Zi /MD %INCLUDES% /D ImTextureID=ImU64 /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 10 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_glfw_vulkan/build_win64.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of amd64/vcvars32.bat to setup 64-bit command-line compiler. 2 | 3 | @set INCLUDES=/I..\.. /I..\..\backends /I..\libs\glfw\include /I %VULKAN_SDK%\include 4 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\backends\imgui_impl_glfw.cpp ..\..\imgui*.cpp 5 | @set LIBS=/LIBPATH:..\libs\glfw\lib-vc2010-64 /libpath:%VULKAN_SDK%\lib glfw3.lib opengl32.lib gdi32.lib shell32.lib vulkan-1.lib 6 | 7 | @set OUT_DIR=Debug 8 | mkdir %OUT_DIR% 9 | cl /nologo /Zi /MD %INCLUDES% /D ImTextureID=ImU64 %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 10 | 11 | @set OUT_DIR=Release 12 | mkdir %OUT_DIR% 13 | cl /nologo /Zi /MD /Ox /Oi %INCLUDES% /D ImTextureID=ImU64 %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 14 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/single_file/imgui_single_file.h: -------------------------------------------------------------------------------- 1 | // dear imgui: single-file wrapper include 2 | // We use this to validate compiling all *.cpp files in a same compilation unit. 3 | // Users of that technique (also called "Unity builds") can generally provide this themselves, 4 | // so we don't really recommend you use this in your projects. 5 | 6 | // Do this: 7 | // #define IMGUI_IMPLEMENTATION 8 | // Before you include this file in *one* C++ file to create the implementation. 9 | // Using this in your project will leak the contents of imgui_internal.h and ImVec2 operators in this compilation unit. 10 | #include "../../imgui.h" 11 | 12 | #ifdef IMGUI_IMPLEMENTATION 13 | #include "../../imgui.cpp" 14 | #include "../../imgui_demo.cpp" 15 | #include "../../imgui_draw.cpp" 16 | #include "../../imgui_tables.cpp" 17 | #include "../../imgui_widgets.cpp" 18 | #endif 19 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_glfw_vulkan/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | 3 | @set OUT_EXE=example_glfw_vulkan 4 | @set INCLUDES=/I..\.. /I..\..\backends /I..\libs\glfw\include /I %VULKAN_SDK%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\backends\imgui_impl_glfw.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:..\libs\glfw\lib-vc2010-32 /libpath:%VULKAN_SDK%\lib32 glfw3.lib opengl32.lib gdi32.lib shell32.lib vulkan-1.lib 7 | 8 | @set OUT_DIR=Debug 9 | mkdir %OUT_DIR% 10 | cl /nologo /Zi /MD %INCLUDES% /D ImTextureID=ImU64 %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 11 | 12 | @set OUT_DIR=Release 13 | mkdir %OUT_DIR% 14 | cl /nologo /Zi /MD /Ox /Oi %INCLUDES% /D ImTextureID=ImU64 %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 15 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/.editorconfig: -------------------------------------------------------------------------------- 1 | # See http://editorconfig.org to read about the EditorConfig format. 2 | # - In theory automatically supported by VS2017+ and most common IDE or text editors. 3 | # - In practice VS2019 stills gets trailing whitespaces wrong :( 4 | # - Suggest install to trim whitespaces: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespaceVisualizer 5 | # - Alternative for older VS2010 to VS2015: https://marketplace.visualstudio.com/items?itemName=EditorConfigTeam.EditorConfig 6 | 7 | # top-most EditorConfig file 8 | root = true 9 | 10 | # Default settings: 11 | # Use 4 spaces as indentation 12 | [*] 13 | indent_style = space 14 | indent_size = 4 15 | insert_final_newline = true 16 | trim_trailing_whitespace = true 17 | 18 | [imstb_*] 19 | indent_size = 3 20 | trim_trailing_whitespace = false 21 | 22 | [Makefile] 23 | indent_style = tab 24 | indent_size = 4 25 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_android_opengl3/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdkVersion 29 6 | buildToolsVersion "30.0.3" 7 | ndkVersion "21.4.7075529" 8 | defaultConfig { 9 | applicationId "imgui.example.android" 10 | minSdkVersion 23 11 | targetSdkVersion 29 12 | versionCode 1 13 | versionName "1.0" 14 | } 15 | 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt') 20 | } 21 | } 22 | 23 | externalNativeBuild { 24 | cmake { 25 | path "../../CMakeLists.txt" 26 | } 27 | } 28 | } 29 | repositories { 30 | mavenCentral() 31 | } 32 | dependencies { 33 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 34 | } 35 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/libs/glfw/COPYING.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | Copyright (c) 2006-2010 Camilla Berglund 3 | 4 | This software is provided 'as-is', without any express or implied 5 | warranty. In no event will the authors be held liable for any damages 6 | arising from the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not 13 | claim that you wrote the original software. If you use this software 14 | in a product, an acknowledgment in the product documentation would 15 | be appreciated but is not required. 16 | 17 | 2. Altered source versions must be plainly marked as such, and must not 18 | be misrepresented as being the original software. 19 | 20 | 3. This notice may not be removed or altered from any source 21 | distribution. 22 | 23 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_android_opengl3/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /plugins/controller/ControllerSystem.cpp: -------------------------------------------------------------------------------- 1 | #include "kengine.hpp" 2 | #include "Export.hpp" 3 | 4 | #include "helpers/pluginHelper.hpp" 5 | #include "helpers/sortHelper.hpp" 6 | 7 | #include "data/NameComponent.hpp" 8 | #include "data/ImGuiToolComponent.hpp" 9 | #include "functions/Execute.hpp" 10 | #include "imgui.h" 11 | 12 | EXPORT void loadKenginePlugin(void * state) noexcept { 13 | kengine::pluginHelper::initPlugin(state); 14 | 15 | kengine::entities += [&](kengine::Entity & e) noexcept { 16 | e += kengine::NameComponent{ "Controller" }; 17 | 18 | auto & tool = e.attach(); 19 | tool.enabled = true; 20 | 21 | e += kengine::functions::Execute{ [&](float deltaTime) noexcept { 22 | if (!tool.enabled) 23 | return; 24 | 25 | if (ImGui::Begin("Koverlay", &tool.enabled)) { 26 | const auto sorted = kengine::sortHelper::getNameSortedEntities<0, kengine::ImGuiToolComponent>(); 27 | for (const auto & [e, name, tool] : sorted) 28 | ImGui::Checkbox(name->name, &tool->enabled); 29 | } 30 | ImGui::End(); 31 | } }; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/README.txt: -------------------------------------------------------------------------------- 1 | 2 | misc/cpp/ 3 | InputText() wrappers for C++ standard library (STL) type: std::string. 4 | This is also an example of how you may wrap your own similar types. 5 | 6 | misc/debuggers/ 7 | Helper files for popular debuggers. 8 | With the .natvis file, types like ImVector<> will be displayed nicely in Visual Studio debugger. 9 | 10 | misc/fonts/ 11 | Fonts loading/merging instructions (e.g. How to handle glyph ranges, how to merge icons fonts). 12 | Command line tool "binary_to_compressed_c" to create compressed arrays to embed data in source code. 13 | Suggested fonts and links. 14 | 15 | misc/freetype/ 16 | Font atlas builder/rasterizer using FreeType instead of stb_truetype. 17 | Benefit from better FreeType rasterization, in particular for small fonts. 18 | 19 | misc/single_file/ 20 | Single-file header stub. 21 | We use this to validate compiling all *.cpp files in a same compilation unit. 22 | Users of that technique (also called "Unity builds") can generally provide this themselves, 23 | so we don't really recommend you use this in your projects. 24 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/cpp/imgui_stdlib.h: -------------------------------------------------------------------------------- 1 | // dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.) 2 | // This is also an example of how you may wrap your own similar types. 3 | 4 | // Changelog: 5 | // - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace ImGui 12 | { 13 | // ImGui::InputText() with std::string 14 | // Because text input needs dynamic resizing, we need to setup a callback to grow the capacity 15 | IMGUI_API bool InputText(const char* label, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); 16 | IMGUI_API bool InputTextMultiline(const char* label, std::string* str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); 17 | IMGUI_API bool InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); 18 | } 19 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_apple_metal/macOS/Info-macOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | imgui 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSMainStoryboardFile 26 | MainMenu 27 | NSPrincipalClass 28 | NSApplication 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/.gitignore: -------------------------------------------------------------------------------- 1 | ## OSX artifacts 2 | .DS_Store 3 | 4 | ## Dear ImGui artifacts 5 | imgui.ini 6 | 7 | ## General build artifacts 8 | *.o 9 | *.obj 10 | *.exe 11 | examples/build/* 12 | examples/*/Debug/* 13 | examples/*/Release/* 14 | examples/*/x64/* 15 | 16 | ## Visual Studio artifacts 17 | .vs 18 | ipch 19 | *.opensdf 20 | *.log 21 | *.pdb 22 | *.ilk 23 | *.user 24 | *.sdf 25 | *.suo 26 | *.VC.db 27 | *.VC.VC.opendb 28 | 29 | ## Commonly used CMake directories 30 | /build*/ 31 | 32 | ## Xcode artifacts 33 | project.xcworkspace 34 | xcuserdata 35 | 36 | ## Emscripten artifacts 37 | examples/*.o.tmp 38 | examples/*.out.js 39 | examples/*.out.wasm 40 | examples/example_emscripten_opengl3/web/* 41 | examples/example_emscripten_wgpu/web/* 42 | 43 | ## JetBrains IDE artifacts 44 | .idea 45 | cmake-build-* 46 | 47 | ## Unix executables from our example Makefiles 48 | examples/example_glfw_opengl2/example_glfw_opengl2 49 | examples/example_glfw_opengl3/example_glfw_opengl3 50 | examples/example_glut_opengl2/example_glut_opengl2 51 | examples/example_null/example_null 52 | examples/example_sdl_opengl2/example_sdl_opengl2 53 | examples/example_sdl_opengl3/example_sdl_opengl3 54 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2022 Omar Cornut 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /examples/newSystem/NewSystem.cpp: -------------------------------------------------------------------------------- 1 | #include "kengine.hpp" 2 | #include "Export.hpp" 3 | 4 | #include "helpers/pluginHelper.hpp" 5 | 6 | #include "data/NameComponent.hpp" 7 | #include "data/ImGuiToolComponent.hpp" 8 | #include "data/ImGuiScaleComponent.hpp" 9 | 10 | #include "functions/Execute.hpp" 11 | 12 | #include "imgui.h" 13 | 14 | // can use this function to properly scale child windows and other elements 15 | static float getScale() noexcept; 16 | 17 | EXPORT void loadKenginePlugin(void * state) noexcept { 18 | kengine::pluginHelper::initPlugin(state); 19 | 20 | kengine::entities += [&](kengine::Entity & e) { 21 | e += kengine::NameComponent{ "New System" }; 22 | 23 | auto & tool = e.attach(); 24 | tool.enabled = false; 25 | 26 | e += kengine::functions::Execute{ [&](float deltaTime) noexcept { 27 | if (!tool.enabled) 28 | return; 29 | 30 | if (ImGui::Begin("NewSystem", &tool.enabled)) { 31 | } 32 | ImGui::End(); 33 | }}; 34 | }; 35 | } 36 | 37 | static float getScale() noexcept { 38 | float ret = 1.f; 39 | for (const auto & [e, scale] : kengine::entities.with()) 40 | ret *= scale.scale; 41 | return ret; 42 | } -------------------------------------------------------------------------------- /common/registerTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "EntityManager.hpp" 4 | 5 | #include "systems/LuaSystem.hpp" 6 | #include "systems/PySystem.hpp" 7 | 8 | #include "helpers/RegisterComponentFunctions.hpp" 9 | #include "helpers/RegisterComponentEditor.hpp" 10 | #include "helpers/RegisterComponentMatcher.hpp" 11 | #include "helpers/RegisterComponentJSONLoader.hpp" 12 | 13 | template 14 | static void registerFunction(kengine::EntityManager & em, const std::string & name, F && func) { 15 | em.getSystem().registerFunction(name, func); 16 | em.getSystem().registerFunction(name, func); 17 | } 18 | 19 | template 20 | static void registerTypes(kengine::EntityManager & em) { 21 | em.registerTypes(); 22 | em.registerTypes(); 23 | } 24 | 25 | template 26 | static void registerComponents(kengine::EntityManager & em) { 27 | registerTypes(em); 28 | 29 | kengine::registerComponentsFunctions(em); 30 | kengine::registerComponentEditors(em); 31 | kengine::registerComponentMatchers(em); 32 | kengine::registerComponentJSONLoaders(em); 33 | } 34 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_null/main.cpp: -------------------------------------------------------------------------------- 1 | // dear imgui: "null" example application 2 | // (compile and link imgui, create context, run headless with NO INPUTS, NO GRAPHICS OUTPUT) 3 | // This is useful to test building, but you cannot interact with anything here! 4 | #include "imgui.h" 5 | #include 6 | 7 | int main(int, char**) 8 | { 9 | IMGUI_CHECKVERSION(); 10 | ImGui::CreateContext(); 11 | ImGuiIO& io = ImGui::GetIO(); 12 | 13 | // Build atlas 14 | unsigned char* tex_pixels = NULL; 15 | int tex_w, tex_h; 16 | io.Fonts->GetTexDataAsRGBA32(&tex_pixels, &tex_w, &tex_h); 17 | 18 | for (int n = 0; n < 20; n++) 19 | { 20 | printf("NewFrame() %d\n", n); 21 | io.DisplaySize = ImVec2(1920, 1080); 22 | io.DeltaTime = 1.0f / 60.0f; 23 | ImGui::NewFrame(); 24 | 25 | static float f = 0.0f; 26 | ImGui::Text("Hello, world!"); 27 | ImGui::SliderFloat("float", &f, 0.0f, 1.0f); 28 | ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); 29 | ImGui::ShowDemoWindow(NULL); 30 | 31 | ImGui::Render(); 32 | } 33 | 34 | printf("DestroyContext()\n"); 35 | ImGui::DestroyContext(); 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: packages 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | paths: 7 | - '**.cpp' 8 | - '**.hpp' 9 | - '**.inl' 10 | - '**/CMakeLists.txt' 11 | - '**.cmake' 12 | - 'kengine' 13 | pull_request: 14 | branches: [ main ] 15 | paths: 16 | - '**.cpp' 17 | - '**.hpp' 18 | - '**.inl' 19 | - '**/CMakeLists.txt' 20 | - '**.cmake' 21 | - 'kengine' 22 | workflow_dispatch: 23 | 24 | jobs: 25 | build: 26 | uses: phisko/cmake-cxx-conan/.github/workflows/build.yml@main 27 | with: 28 | apt_dependencies: libgl-dev libglu1-mesa-dev libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev 29 | package_platforms: all 30 | package_configurations: >- 31 | [ "Release" ] 32 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_android_opengl3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.6) 2 | 3 | project(ImGuiExample) 4 | 5 | set(CMAKE_CXX_STANDARD 11) 6 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 7 | set(CMAKE_CXX_EXTENSIONS OFF) 8 | 9 | add_library(${CMAKE_PROJECT_NAME} SHARED 10 | ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp 11 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui.cpp 12 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui_demo.cpp 13 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui_draw.cpp 14 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui_tables.cpp 15 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui_widgets.cpp 16 | ${CMAKE_CURRENT_SOURCE_DIR}/../../backends/imgui_impl_android.cpp 17 | ${CMAKE_CURRENT_SOURCE_DIR}/../../backends/imgui_impl_opengl3.cpp 18 | ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c 19 | ) 20 | 21 | set(CMAKE_SHARED_LINKER_FLAGS 22 | "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate" 23 | ) 24 | 25 | target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE 26 | IMGUI_IMPL_OPENGL_ES3 27 | ) 28 | 29 | target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE 30 | ${CMAKE_CURRENT_SOURCE_DIR}/../.. 31 | ${CMAKE_CURRENT_SOURCE_DIR}/../../backends 32 | ${ANDROID_NDK}/sources/android/native_app_glue 33 | ) 34 | 35 | target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE 36 | android 37 | EGL 38 | GLESv3 39 | log 40 | ) 41 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/debuggers/imgui.natstepfilter: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | (ImVec2|ImVec4|ImStrv)::.+ 23 | NoStepInto 24 | 25 | 26 | (ImVector|ImSpan).*::operator.+ 27 | NoStepInto 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_sdlrenderer/README.md: -------------------------------------------------------------------------------- 1 | 2 | # How to Build 3 | 4 | - On Windows with Visual Studio's CLI 5 | 6 | ``` 7 | set SDL2_DIR=path_to_your_sdl2_folder 8 | cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_sdlrenderer.cpp ..\..\imgui*.cpp /FeDebug/example_sdl_sdlrenderer.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib /subsystem:console 9 | # ^^ include paths ^^ source files ^^ output exe ^^ output dir ^^ libraries 10 | # or for 64-bit: 11 | cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_sdlrenderer.cpp ..\..\imgui*.cpp /FeDebug/example_sdl_sdlrenderer.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x64 SDL2.lib SDL2main.lib /subsystem:console 12 | ``` 13 | 14 | - On Linux and similar Unixes 15 | 16 | ``` 17 | c++ `sdl2-config --cflags` -I .. -I ../.. main.cpp ../../backends/imgui_impl_sdl.cpp ../../backends/imgui_impl_sdlrenderer.cpp ../../imgui*.cpp `sdl2-config --libs` -lGL 18 | ``` 19 | 20 | - On Mac OS X 21 | 22 | ``` 23 | brew install sdl2 24 | c++ `sdl2-config --cflags` -I .. -I ../.. main.cpp ../../backends/imgui_impl_sdl.cpp ../../backends/imgui_impl_sdlrenderer.cpp ../../imgui*.cpp `sdl2-config --libs` -framework OpenGl 25 | ``` 26 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_glfw_metal/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # You will need GLFW (http://www.glfw.org): 3 | # brew install glfw 4 | # 5 | 6 | #CXX = g++ 7 | #CXX = clang++ 8 | 9 | EXE = example_glfw_metal 10 | IMGUI_DIR = ../.. 11 | SOURCES = main.mm 12 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 13 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glfw.cpp $(IMGUI_DIR)/backends/imgui_impl_metal.mm 14 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 15 | 16 | LIBS = -framework Metal -framework MetalKit -framework Cocoa -framework IOKit -framework CoreVideo -framework QuartzCore 17 | LIBS += -L/usr/local/lib -L/opt/homebrew/lib 18 | LIBS += -lglfw 19 | 20 | CXXFLAGS = -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends -I/usr/local/include -I/opt/homebrew/include 21 | CXXFLAGS += -Wall -Wformat 22 | CFLAGS = $(CXXFLAGS) 23 | 24 | %.o:%.cpp 25 | $(CXX) $(CXXFLAGS) -c -o $@ $< 26 | 27 | %.o:$(IMGUI_DIR)/%.cpp 28 | $(CXX) $(CXXFLAGS) -c -o $@ $< 29 | 30 | %.o:$(IMGUI_DIR)/backends/%.cpp 31 | $(CXX) $(CXXFLAGS) -c -o $@ $< 32 | 33 | %.o:%.mm 34 | $(CXX) $(CXXFLAGS) -ObjC++ -fobjc-weak -fobjc-arc -c -o $@ $< 35 | 36 | %.o:$(IMGUI_DIR)/backends/%.mm 37 | $(CXX) $(CXXFLAGS) -ObjC++ -fobjc-weak -fobjc-arc -c -o $@ $< 38 | 39 | all: $(EXE) 40 | @echo Build complete 41 | 42 | $(EXE): $(OBJS) 43 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 44 | 45 | clean: 46 | rm -f $(EXE) $(OBJS) 47 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_metal/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # You will need SDL2 (http://www.libsdl.org): 3 | # brew install sdl2 4 | # 5 | 6 | #CXX = g++ 7 | #CXX = clang++ 8 | 9 | EXE = example_sdl_metal 10 | IMGUI_DIR = ../.. 11 | SOURCES = main.mm 12 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 13 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_sdl.cpp $(IMGUI_DIR)/backends/imgui_impl_metal.mm 14 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 15 | 16 | LIBS = -framework Metal -framework MetalKit -framework Cocoa -framework IOKit -framework CoreVideo -framework QuartzCore 17 | LIBS += `sdl2-config --libs` 18 | LIBS += -L/usr/local/lib 19 | 20 | CXXFLAGS = -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends -I/usr/local/include 21 | CXXFLAGS += `sdl2-config --cflags` 22 | CXXFLAGS += -Wall -Wformat 23 | CFLAGS = $(CXXFLAGS) 24 | 25 | %.o:%.cpp 26 | $(CXX) $(CXXFLAGS) -c -o $@ $< 27 | 28 | %.o:$(IMGUI_DIR)/%.cpp 29 | $(CXX) $(CXXFLAGS) -c -o $@ $< 30 | 31 | %.o:$(IMGUI_DIR)/backends/%.cpp 32 | $(CXX) $(CXXFLAGS) -c -o $@ $< 33 | 34 | %.o:%.mm 35 | $(CXX) $(CXXFLAGS) -ObjC++ -fobjc-weak -fobjc-arc -c -o $@ $< 36 | 37 | %.o:$(IMGUI_DIR)/backends/%.mm 38 | $(CXX) $(CXXFLAGS) -ObjC++ -fobjc-weak -fobjc-arc -c -o $@ $< 39 | 40 | all: $(EXE) 41 | @echo Build complete 42 | 43 | $(EXE): $(OBJS) 44 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 45 | 46 | clean: 47 | rm -f $(EXE) $(OBJS) 48 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_dx9.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX9 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'LPDIRECT3DTEXTURE9' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Multi-viewport support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 7 | // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. 8 | 9 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 10 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 11 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 12 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 13 | 14 | #pragma once 15 | #include "imgui.h" // IMGUI_IMPL_API 16 | 17 | struct IDirect3DDevice9; 18 | 19 | IMGUI_IMPL_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device); 20 | IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown(); 21 | IMGUI_IMPL_API void ImGui_ImplDX9_NewFrame(); 22 | IMGUI_IMPL_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data); 23 | 24 | // Use if you want to reset your rendering device without losing Dear ImGui state. 25 | IMGUI_IMPL_API bool ImGui_ImplDX9_CreateDeviceObjects(); 26 | IMGUI_IMPL_API void ImGui_ImplDX9_InvalidateDeviceObjects(); 27 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_dx10.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX10 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'ID3D10ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Multi-viewport support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 7 | // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. 8 | 9 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 10 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 11 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 12 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 13 | 14 | #pragma once 15 | #include "imgui.h" // IMGUI_IMPL_API 16 | 17 | struct ID3D10Device; 18 | 19 | IMGUI_IMPL_API bool ImGui_ImplDX10_Init(ID3D10Device* device); 20 | IMGUI_IMPL_API void ImGui_ImplDX10_Shutdown(); 21 | IMGUI_IMPL_API void ImGui_ImplDX10_NewFrame(); 22 | IMGUI_IMPL_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data); 23 | 24 | // Use if you want to reset your rendering device without losing Dear ImGui state. 25 | IMGUI_IMPL_API void ImGui_ImplDX10_InvalidateDeviceObjects(); 26 | IMGUI_IMPL_API bool ImGui_ImplDX10_CreateDeviceObjects(); 27 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_wgpu.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer for WebGPU 2 | // This needs to be used along with a Platform Binding (e.g. GLFW) 3 | // (Please note that WebGPU is currently experimental, will not run on non-beta browsers, and may break.) 4 | 5 | // Implemented features: 6 | // [X] Renderer: User texture binding. Use 'WGPUTextureView' as ImTextureID. Read the FAQ about ImTextureID! 7 | // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. 8 | 9 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 10 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 11 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 12 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 13 | 14 | #pragma once 15 | #include "imgui.h" // IMGUI_IMPL_API 16 | #include 17 | 18 | IMGUI_IMPL_API bool ImGui_ImplWGPU_Init(WGPUDevice device, int num_frames_in_flight, WGPUTextureFormat rt_format); 19 | IMGUI_IMPL_API void ImGui_ImplWGPU_Shutdown(); 20 | IMGUI_IMPL_API void ImGui_ImplWGPU_NewFrame(); 21 | IMGUI_IMPL_API void ImGui_ImplWGPU_RenderDrawData(ImDrawData* draw_data, WGPURenderPassEncoder pass_encoder); 22 | 23 | // Use if you want to reset your rendering device without losing Dear ImGui state. 24 | IMGUI_IMPL_API void ImGui_ImplWGPU_InvalidateDeviceObjects(); 25 | IMGUI_IMPL_API bool ImGui_ImplWGPU_CreateDeviceObjects(); 26 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_opengl2/README.md: -------------------------------------------------------------------------------- 1 | 2 | # How to Build 3 | 4 | - On Windows with Visual Studio's IDE 5 | 6 | Use the provided project file (.vcxproj). Add to solution (imgui_examples.sln) if necessary. 7 | 8 | - On Windows with Visual Studio's CLI 9 | 10 | ``` 11 | set SDL2_DIR=path_to_your_sdl2_folder 12 | cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl_opengl2.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console 13 | # ^^ include paths ^^ source files ^^ output exe ^^ output dir ^^ libraries 14 | # or for 64-bit: 15 | cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl_opengl2.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x64 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console 16 | ``` 17 | 18 | - On Linux and similar Unixes 19 | 20 | ``` 21 | c++ `sdl2-config --cflags` -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_sdl.cpp ../../backends/imgui_impl_opengl2.cpp ../../imgui*.cpp `sdl2-config --libs` -lGL 22 | ``` 23 | 24 | - On Mac OS X 25 | 26 | ``` 27 | brew install sdl2 28 | c++ `sdl2-config --cflags` -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_sdl.cpp ../../backends/imgui_impl_opengl2.cpp ../../imgui*.cpp `sdl2-config --libs` -framework OpenGl 29 | ``` 30 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_dx11.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX11 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'ID3D11ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Multi-viewport support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 7 | // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. 8 | 9 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 10 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 11 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 12 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 13 | 14 | #pragma once 15 | #include "imgui.h" // IMGUI_IMPL_API 16 | 17 | struct ID3D11Device; 18 | struct ID3D11DeviceContext; 19 | 20 | IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); 21 | IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); 22 | IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); 23 | IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); 24 | 25 | // Use if you want to reset your rendering device without losing Dear ImGui state. 26 | IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); 27 | IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); 28 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_opengl3/README.md: -------------------------------------------------------------------------------- 1 | 2 | # How to Build 3 | 4 | - On Windows with Visual Studio's IDE 5 | 6 | Use the provided project file (.vcxproj). Add to solution (imgui_examples.sln) if necessary. 7 | 8 | - On Windows with Visual Studio's CLI 9 | 10 | ``` 11 | set SDL2_DIR=path_to_your_sdl2_folder 12 | cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp /FeDebug/example_sdl_opengl3.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console 13 | # ^^ include paths ^^ source files ^^ output exe ^^ output dir ^^ libraries 14 | # or for 64-bit: 15 | cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp /FeDebug/example_sdl_opengl3.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x64 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console 16 | ``` 17 | 18 | - On Linux and similar Unixes 19 | 20 | ``` 21 | c++ `sdl2-config --cflags` -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_sdl.cpp ../../backends/imgui_impl_opengl3.cpp ../../imgui*.cpp `sdl2-config --libs` -lGL -ldl 22 | ``` 23 | 24 | - On Mac OS X 25 | 26 | ``` 27 | brew install sdl2 28 | c++ `sdl2-config --cflags` -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_sdl.cpp ../../backends/imgui_impl_opengl3.cpp ../../imgui*.cpp `sdl2-config --libs` -framework OpenGl -framework CoreFoundation 29 | ``` 30 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_sdlrenderer.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for SDL_Renderer 2 | // (Requires: SDL 2.0.17+) 3 | 4 | // Important to understand: SDL_Renderer is an _optional_ component of SDL. 5 | // For a multi-platform app consider using e.g. SDL+DirectX on Windows and SDL+OpenGL on Linux/OSX. 6 | // If your application will want to render any non trivial amount of graphics other than UI, 7 | // please be aware that SDL_Renderer offers a limited graphic API to the end-user and it might 8 | // be difficult to step out of those boundaries. 9 | // However, we understand it is a convenient choice to get an app started easily. 10 | 11 | // Implemented features: 12 | // [X] Renderer: User texture binding. Use 'SDL_Texture*' as ImTextureID. Read the FAQ about ImTextureID! 13 | // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. 14 | // Missing features: 15 | // [ ] Renderer: Multi-viewport support (multiple windows). 16 | 17 | #pragma once 18 | #include "imgui.h" // IMGUI_IMPL_API 19 | 20 | struct SDL_Renderer; 21 | 22 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer_Init(SDL_Renderer* renderer); 23 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer_Shutdown(); 24 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer_NewFrame(); 25 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer_RenderDrawData(ImDrawData* draw_data); 26 | 27 | // Called by Init/NewFrame/Shutdown 28 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer_CreateFontsTexture(); 29 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer_DestroyFontsTexture(); 30 | IMGUI_IMPL_API bool ImGui_ImplSDLRenderer_CreateDeviceObjects(); 31 | IMGUI_IMPL_API void ImGui_ImplSDLRenderer_DestroyDeviceObjects(); 32 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_android_opengl3/android/app/src/main/java/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package imgui.example.android 2 | 3 | import android.app.NativeActivity 4 | import android.os.Bundle 5 | import android.content.Context 6 | import android.view.inputmethod.InputMethodManager 7 | import android.view.KeyEvent 8 | import java.util.concurrent.LinkedBlockingQueue 9 | 10 | class MainActivity : NativeActivity() { 11 | public override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | } 14 | 15 | fun showSoftInput() { 16 | val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager 17 | inputMethodManager.showSoftInput(this.window.decorView, 0) 18 | } 19 | 20 | fun hideSoftInput() { 21 | val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager 22 | inputMethodManager.hideSoftInputFromWindow(this.window.decorView.windowToken, 0) 23 | } 24 | 25 | // Queue for the Unicode characters to be polled from native code (via pollUnicodeChar()) 26 | private var unicodeCharacterQueue: LinkedBlockingQueue = LinkedBlockingQueue() 27 | 28 | // We assume dispatchKeyEvent() of the NativeActivity is actually called for every 29 | // KeyEvent and not consumed by any View before it reaches here 30 | override fun dispatchKeyEvent(event: KeyEvent): Boolean { 31 | if (event.action == KeyEvent.ACTION_DOWN) { 32 | unicodeCharacterQueue.offer(event.getUnicodeChar(event.metaState)) 33 | } 34 | return super.dispatchKeyEvent(event) 35 | } 36 | 37 | fun pollUnicodeChar(): Int { 38 | return unicodeCharacterQueue.poll() ?: 0 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_allegro5/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Configuration 3 | 4 | Dear ImGui outputs 16-bit vertex indices by default. 5 | Allegro doesn't support them natively, so we have two solutions: convert the indices manually in imgui_impl_allegro5.cpp, or compile dear imgui with 32-bit indices. 6 | You can either modify imconfig.h that comes with Dear ImGui (easier), or set a C++ preprocessor option IMGUI_USER_CONFIG to find to a filename. 7 | We are providing `imconfig_allegro5.h` that enables 32-bit indices. 8 | Note that the backend supports _BOTH_ 16-bit and 32-bit indices, but 32-bit indices will be slightly faster as they won't require a manual conversion. 9 | 10 | # How to Build 11 | 12 | ### On Ubuntu 14.04+ and macOS 13 | 14 | ```bash 15 | g++ -DIMGUI_USER_CONFIG=\"examples/example_allegro5/imconfig_allegro5.h\" -I .. -I ../.. main.cpp ../../backends/imgui_impl_allegro5.cpp ../../imgui*.cpp -lallegro -lallegro_main -lallegro_primitives -o allegro5_example 16 | ``` 17 | 18 | On macOS, install Allegro with homebrew: `brew install allegro`. 19 | 20 | ### On Windows with Visual Studio's CLI 21 | 22 | You may install Allegro using vcpkg: 23 | ``` 24 | git clone https://github.com/Microsoft/vcpkg 25 | cd vcpkg 26 | bootstrap-vcpkg.bat 27 | vcpkg install allegro5 --triplet=x86-windows ; for win32 28 | vcpkg install allegro5 --triplet=x64-windows ; for win64 29 | vcpkg integrate install ; register include / libs in Visual Studio 30 | ``` 31 | 32 | Build: 33 | ``` 34 | set ALLEGRODIR=path_to_your_allegro5_folder 35 | cl /Zi /MD /I %ALLEGRODIR%\include /DIMGUI_USER_CONFIG=\"examples/example_allegro5/imconfig_allegro5.h\" /I .. /I ..\.. main.cpp ..\..\backends\imgui_impl_allegro5.cpp ..\..\imgui*.cpp /link /LIBPATH:%ALLEGRODIR%\lib allegro-5.0.10-monolith-md.lib user32.lib 36 | ``` 37 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_apple_metal/iOS/Info-iOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | imgui 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | metal 29 | 30 | UIRequiresFullScreen 31 | 32 | UIStatusBarHidden 33 | 34 | UISupportedInterfaceOrientations 35 | 36 | UIInterfaceOrientationPortrait 37 | UIInterfaceOrientationLandscapeLeft 38 | UIInterfaceOrientationLandscapeRight 39 | UIInterfaceOrientationPortraitUpsideDown 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_glfw_vulkan/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Example usage: 2 | # mkdir build 3 | # cd build 4 | # cmake -g "Visual Studio 14 2015" .. 5 | 6 | cmake_minimum_required(VERSION 2.8) 7 | project(imgui_example_glfw_vulkan C CXX) 8 | 9 | if(NOT CMAKE_BUILD_TYPE) 10 | set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE) 11 | endif() 12 | 13 | set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVK_PROTOTYPES") 14 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_PROTOTYPES") 15 | 16 | # GLFW 17 | set(GLFW_DIR ../../../glfw) # Set this to point to an up-to-date GLFW repo 18 | option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF) 19 | option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF) 20 | option(GLFW_BUILD_DOCS "Build the GLFW documentation" OFF) 21 | option(GLFW_INSTALL "Generate installation target" OFF) 22 | option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF) 23 | add_subdirectory(${GLFW_DIR} binary_dir EXCLUDE_FROM_ALL) 24 | include_directories(${GLFW_DIR}/include) 25 | 26 | # Dear ImGui 27 | set(IMGUI_DIR ../../) 28 | include_directories(${IMGUI_DIR} ${IMGUI_DIR}/backends ..) 29 | 30 | # Libraries 31 | find_package(Vulkan REQUIRED) 32 | #find_library(VULKAN_LIBRARY 33 | #NAMES vulkan vulkan-1) 34 | #set(LIBRARIES "glfw;${VULKAN_LIBRARY}") 35 | set(LIBRARIES "glfw;Vulkan::Vulkan") 36 | 37 | # Use vulkan headers from glfw: 38 | include_directories(${GLFW_DIR}/deps) 39 | 40 | file(GLOB sources *.cpp) 41 | 42 | add_executable(example_glfw_vulkan ${sources} ${IMGUI_DIR}/backends/imgui_impl_glfw.cpp ${IMGUI_DIR}/backends/imgui_impl_vulkan.cpp ${IMGUI_DIR}/imgui.cpp ${IMGUI_DIR}/imgui_draw.cpp ${IMGUI_DIR}/imgui_demo.cpp ${IMGUI_DIR}/imgui_tables.cpp ${IMGUI_DIR}/imgui_widgets.cpp) 43 | target_link_libraries(example_glfw_vulkan ${LIBRARIES}) 44 | target_compile_definitions(example_glfw_vulkan PUBLIC -DImTextureID=ImU64) 45 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_osx.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for OSX / Cocoa 2 | // This needs to be used along with a Renderer (e.g. OpenGL2, OpenGL3, Vulkan, Metal..) 3 | // [ALPHA] Early backend, not well tested. If you want a portable application, prefer using the GLFW or SDL platform Backends on Mac. 4 | 5 | // Implemented features: 6 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 7 | // [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy kVK_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 8 | // [X] Platform: OSX clipboard is supported within core Dear ImGui (no specific code in this backend). 9 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 10 | // [X] Platform: IME support. 11 | // Issues: 12 | // [ ] Platform: Multi-viewport / platform windows. 13 | 14 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 15 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 16 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 17 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 18 | 19 | #include "imgui.h" // IMGUI_IMPL_API 20 | 21 | @class NSEvent; 22 | @class NSView; 23 | 24 | IMGUI_IMPL_API bool ImGui_ImplOSX_Init(NSView* _Nonnull view); 25 | IMGUI_IMPL_API void ImGui_ImplOSX_Shutdown(); 26 | IMGUI_IMPL_API void ImGui_ImplOSX_NewFrame(NSView* _Nullable view); 27 | IMGUI_IMPL_API bool ImGui_ImplOSX_HandleEvent(NSEvent* _Nonnull event, NSView* _Nullable view); 28 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_apple_metal/iOS/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/freetype/README.md: -------------------------------------------------------------------------------- 1 | # imgui_freetype 2 | 3 | Build font atlases using FreeType instead of stb_truetype (which is the default font rasterizer). 4 |
by @vuhdo, @mikesart, @ocornut. 5 | 6 | ### Usage 7 | 8 | 1. Get latest FreeType binaries or build yourself (under Windows you may use vcpkg with `vcpkg install freetype --triplet=x64-windows`, `vcpkg integrate install`). 9 | 2. Add imgui_freetype.h/cpp alongside your project files. 10 | 3. Add `#define IMGUI_ENABLE_FREETYPE` in your [imconfig.h](https://github.com/ocornut/imgui/blob/master/imconfig.h) file 11 | 12 | ### About Gamma Correct Blending 13 | 14 | FreeType assumes blending in linear space rather than gamma space. 15 | See FreeType note for [FT_Render_Glyph](https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_Render_Glyph). 16 | For correct results you need to be using sRGB and convert to linear space in the pixel shader output. 17 | The default Dear ImGui styles will be impacted by this change (alpha values will need tweaking). 18 | 19 | ### Testbed for toying with settings (for developers) 20 | 21 | See https://gist.github.com/ocornut/b3a9ecf13502fd818799a452969649ad 22 | 23 | ### Known issues 24 | 25 | - Oversampling settins are ignored but also not so much necessary with the higher quality rendering. 26 | 27 | ### Comparaison 28 | 29 | Small, thin anti-aliased fonts typically benefit a lot from FreeType's hinting: 30 | ![comparing_font_rasterizers](https://user-images.githubusercontent.com/8225057/107550178-fef87f00-6bd0-11eb-8d09-e2edb2f0ccfc.gif) 31 | 32 | ### Colorful glyphs/emojis 33 | 34 | You can use the `ImGuiFreeTypeBuilderFlags_LoadColor` flag to load certain colorful glyphs. See the 35 | ["Using Colorful Glyphs/Emojis"](https://github.com/ocornut/imgui/edit/master/docs/FONTS.md#using-colorful-glyphsemojis) section of FONTS.md. 36 | 37 | ![colored glyphs](https://user-images.githubusercontent.com/8225057/106171241-9dc4ba80-6191-11eb-8a69-ca1467b206d1.png) 38 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_android.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Binding for Android native app 2 | // This needs to be used along with the OpenGL 3 Renderer (imgui_impl_opengl3) 3 | 4 | // Implemented features: 5 | // [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy AKEYCODE_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 6 | // Missing features: 7 | // [ ] Platform: Clipboard support. 8 | // [ ] Platform: Gamepad support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 9 | // [ ] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. FIXME: Check if this is even possible with Android. 10 | // Important: 11 | // - Consider using SDL or GLFW backend on Android, which will be more full-featured than this. 12 | // - FIXME: On-screen keyboard currently needs to be enabled by the application (see examples/ and issue #3446) 13 | // - FIXME: Unicode character inputs needs to be passed by Dear ImGui by the application (see examples/ and issue #3446) 14 | 15 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 16 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 17 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 18 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 19 | 20 | #pragma once 21 | 22 | struct ANativeWindow; 23 | struct AInputEvent; 24 | 25 | IMGUI_IMPL_API bool ImGui_ImplAndroid_Init(ANativeWindow* window); 26 | IMGUI_IMPL_API int32_t ImGui_ImplAndroid_HandleInputEvent(AInputEvent* input_event); 27 | IMGUI_IMPL_API void ImGui_ImplAndroid_Shutdown(); 28 | IMGUI_IMPL_API void ImGui_ImplAndroid_NewFrame(); 29 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/.github/issue_template.md: -------------------------------------------------------------------------------- 1 | (Click "Preview" above ^ to turn URL into clickable links) 2 | 3 | 1. FOR FIRST-TIME USERS ISSUES COMPILING/LINKING/RUNNING or LOADING FONTS, please use [GitHub Discussions](https://github.com/ocornut/imgui/discussions). 4 | 5 | 2. PLEASE CAREFULLY READ: [FAQ](https://github.com/ocornut/imgui/blob/master/docs/FAQ.md) 6 | 7 | 3. PLEASE CAREFULLY READ: [Issue Submitting Guidelines](https://github.com/ocornut/imgui/issues/2261) 8 | 9 | 4. PLEASE MAKE SURE that you have: read the FAQ; explored the contents of `ShowDemoWindow()` including the Examples menu; searched among Issues; used your IDE to search for keywords in all sources and text files; and read the links above. 10 | 11 | 5. Be mindful that messages are being sent to the e-mail box of "Watching" users. Try to proof-read your messages before sending them. Edits are not seen by those users. 12 | 13 | 6. Delete points 1-6 and PLEASE FILL THE TEMPLATE BELOW before submitting your issue. 14 | 15 | Thank you! 16 | 17 | ---- 18 | 19 | _(you may also go to Demo>About Window, and click "Config/Build Information" to obtain a bunch of detailed information that you can paste here)_ 20 | 21 | **Version/Branch of Dear ImGui:** 22 | 23 | Version: XXX 24 | Branch: XXX _(master/viewport/docking/etc.)_ 25 | 26 | **Back-end/Renderer/Compiler/OS** 27 | 28 | Back-ends: imgui_impl_XXX.cpp + imgui_impl_XXX.cpp _(or specify if using a custom engine/back-end)_ 29 | Compiler: XXX _(if the question is related to building or platform specific features)_ 30 | Operating System: XXX 31 | 32 | **My Issue/Question:** 33 | 34 | XXX _(please provide as much context as possible)_ 35 | 36 | **Screenshots/Video** 37 | 38 | XXX _(you can drag files here)_ 39 | 40 | **Standalone, minimal, complete and verifiable example:** _(see https://github.com/ocornut/imgui/issues/2261)_ 41 | ``` 42 | // Here's some code anyone can copy and paste to reproduce your issue 43 | ImGui::Begin("Example Bug"); 44 | MoreCodeToExplainMyIssue(); 45 | ImGui::End(); 46 | ``` 47 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_allegro5.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer + Platform Backend for Allegro 5 2 | // (Info: Allegro 5 is a cross-platform general purpose library for handling windows, inputs, graphics, etc.) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'ALLEGRO_BITMAP*' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy ALLEGRO_KEY_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 7 | // [X] Platform: Clipboard support (from Allegro 5.1.12) 8 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 9 | // Issues: 10 | // [ ] Renderer: The renderer is suboptimal as we need to unindex our buffers and convert vertices manually. 11 | // [ ] Platform: Missing gamepad support. 12 | 13 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 14 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 15 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 16 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 17 | 18 | #pragma once 19 | #include "imgui.h" // IMGUI_IMPL_API 20 | 21 | struct ALLEGRO_DISPLAY; 22 | union ALLEGRO_EVENT; 23 | 24 | IMGUI_IMPL_API bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display); 25 | IMGUI_IMPL_API void ImGui_ImplAllegro5_Shutdown(); 26 | IMGUI_IMPL_API void ImGui_ImplAllegro5_NewFrame(); 27 | IMGUI_IMPL_API void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data); 28 | IMGUI_IMPL_API bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT* event); 29 | 30 | // Use if you want to reset your rendering device without losing Dear ImGui state. 31 | IMGUI_IMPL_API bool ImGui_ImplAllegro5_CreateDeviceObjects(); 32 | IMGUI_IMPL_API void ImGui_ImplAllegro5_InvalidateDeviceObjects(); 33 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_win32_directx12/example_win32_directx12.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {fb3d294f-51ec-478e-a627-25831c80fefd} 6 | 7 | 8 | {4f33ddea-9910-456d-b868-4267eb3c2b19} 9 | 10 | 11 | 12 | 13 | imgui 14 | 15 | 16 | imgui 17 | 18 | 19 | imgui 20 | 21 | 22 | sources 23 | 24 | 25 | sources 26 | 27 | 28 | 29 | 30 | imgui 31 | 32 | 33 | sources 34 | 35 | 36 | imgui 37 | 38 | 39 | imgui 40 | 41 | 42 | sources 43 | 44 | 45 | sources 46 | 47 | 48 | imgui 49 | 50 | 51 | imgui 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_allegro5/example_allegro5.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | imgui 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | sources 27 | 28 | 29 | sources 30 | 31 | 32 | imgui 33 | 34 | 35 | imgui 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | 53 | 54 | 55 | sources 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_opengl2.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for OpenGL2 (legacy OpenGL, fixed pipeline) 2 | // This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Multi-viewport support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 7 | 8 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 9 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 10 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 11 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 12 | 13 | // **DO NOT USE THIS CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)** 14 | // **Prefer using the code in imgui_impl_opengl3.cpp** 15 | // This code is mostly provided as a reference to learn how ImGui integration works, because it is shorter to read. 16 | // If your code is using GL3+ context or any semi modern OpenGL calls, using this is likely to make everything more 17 | // complicated, will require your code to reset every single OpenGL attributes to their initial state, and might 18 | // confuse your GPU driver. 19 | // The GL2 code is unable to reset attributes or even call e.g. "glUseProgram(0)" because they don't exist in that API. 20 | 21 | #pragma once 22 | #include "imgui.h" // IMGUI_IMPL_API 23 | 24 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_Init(); 25 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_Shutdown(); 26 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_NewFrame(); 27 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data); 28 | 29 | // Called by Init/NewFrame/Shutdown 30 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_CreateFontsTexture(); 31 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_DestroyFontsTexture(); 32 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_CreateDeviceObjects(); 33 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_DestroyDeviceObjects(); 34 | -------------------------------------------------------------------------------- /src/ImGuiPluginSystem.cpp: -------------------------------------------------------------------------------- 1 | #include "ImGuiPluginSystem.hpp" 2 | #include "PluginManager.hpp" 3 | #include "kengine.hpp" 4 | 5 | // kengine data 6 | #include "data/NameComponent.hpp" 7 | #include "data/ImGuiScaleComponent.hpp" 8 | #include "data/ImGuiToolComponent.hpp" 9 | 10 | // kengine functions 11 | #include "functions/Execute.hpp" 12 | 13 | 14 | struct ImGuiContext; 15 | extern ImGuiContext * GImGui; 16 | 17 | namespace { 18 | struct impl { 19 | static inline putils::PluginManager pm; 20 | 21 | static void init(kengine::Entity &system) noexcept { 22 | system += kengine::functions::Execute{execute}; 23 | } 24 | 25 | struct PluginEnabledPointerComponent { 26 | bool *enabled; 27 | }; 28 | 29 | static void execute(float deltaTime) noexcept { 30 | bool *enabled; 31 | const auto names = pm.rescanDirectoryWithReturn<1, const char *>("plugins", "getNameAndEnabled", &enabled); 32 | for (const auto &name: names) { 33 | kengine::entities += [&](kengine::Entity &e) { 34 | e += kengine::NameComponent{name}; 35 | e += PluginEnabledPointerComponent{enabled}; 36 | e += kengine::ImGuiToolComponent{*enabled}; 37 | }; 38 | } 39 | 40 | drawImGui(); 41 | } 42 | 43 | static void drawImGui() noexcept { 44 | for (const auto &[e, enabled, tool]: kengine::entities.with()) 45 | *enabled.enabled = tool.enabled; 46 | 47 | pm.execute("drawImGui", *GImGui, getScale()); 48 | 49 | for (const auto &[e, enabled, tool]: kengine::entities.with()) 50 | tool.enabled = *enabled.enabled; 51 | } 52 | 53 | static float getScale() noexcept { 54 | float scale = 1.f; 55 | for (const auto &[e, comp]: kengine::entities.with()) 56 | scale *= comp.scale; 57 | return scale; 58 | } 59 | }; 60 | } 61 | 62 | kengine::EntityCreator * ImGuiPluginSystem() noexcept { 63 | return impl::init; 64 | } -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_directx11/example_sdl_directx11.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {0587d7a3-f2ce-4d56-b84f-a0005d3bfce6} 6 | 7 | 8 | {08e36723-ce4f-4cff-9662-c40801cf1acf} 9 | 10 | 11 | 12 | 13 | imgui 14 | 15 | 16 | imgui 17 | 18 | 19 | imgui 20 | 21 | 22 | sources 23 | 24 | 25 | sources 26 | 27 | 28 | 29 | 30 | imgui 31 | 32 | 33 | sources 34 | 35 | 36 | imgui 37 | 38 | 39 | imgui 40 | 41 | 42 | imgui 43 | 44 | 45 | imgui 46 | 47 | 48 | sources 49 | 50 | 51 | sources 52 | 53 | 54 | 55 | 56 | 57 | sources 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_win32_directx10/example_win32_directx10.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {0587d7a3-f2ce-4d56-b84f-a0005d3bfce6} 6 | 7 | 8 | {08e36723-ce4f-4cff-9662-c40801cf1acf} 9 | 10 | 11 | 12 | 13 | imgui 14 | 15 | 16 | imgui 17 | 18 | 19 | imgui 20 | 21 | 22 | sources 23 | 24 | 25 | sources 26 | 27 | 28 | 29 | 30 | imgui 31 | 32 | 33 | sources 34 | 35 | 36 | imgui 37 | 38 | 39 | imgui 40 | 41 | 42 | sources 43 | 44 | 45 | sources 46 | 47 | 48 | imgui 49 | 50 | 51 | imgui 52 | 53 | 54 | 55 | 56 | 57 | sources 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_win32_directx11/example_win32_directx11.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {0587d7a3-f2ce-4d56-b84f-a0005d3bfce6} 6 | 7 | 8 | {08e36723-ce4f-4cff-9662-c40801cf1acf} 9 | 10 | 11 | 12 | 13 | imgui 14 | 15 | 16 | imgui 17 | 18 | 19 | imgui 20 | 21 | 22 | sources 23 | 24 | 25 | sources 26 | 27 | 28 | 29 | 30 | imgui 31 | 32 | 33 | sources 34 | 35 | 36 | imgui 37 | 38 | 39 | imgui 40 | 41 | 42 | imgui 43 | 44 | 45 | sources 46 | 47 | 48 | sources 49 | 50 | 51 | imgui 52 | 53 | 54 | 55 | 56 | 57 | sources 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_glut_opengl2/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # Linux: 6 | # apt-get install freeglut3-dev 7 | # 8 | 9 | #CXX = g++ 10 | #CXX = clang++ 11 | 12 | EXE = example_glut_opengl2 13 | IMGUI_DIR = ../.. 14 | SOURCES = main.cpp 15 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 16 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glut.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl2.cpp 17 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 18 | UNAME_S := $(shell uname -s) 19 | 20 | CXXFLAGS = -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 21 | CXXFLAGS += -g -Wall -Wformat 22 | LIBS = 23 | 24 | ##--------------------------------------------------------------------- 25 | ## BUILD FLAGS PER PLATFORM 26 | ##--------------------------------------------------------------------- 27 | 28 | ifeq ($(UNAME_S), Linux) #LINUX 29 | ECHO_MESSAGE = "Linux" 30 | LIBS += -lGL -lglut 31 | CFLAGS = $(CXXFLAGS) 32 | endif 33 | 34 | ifeq ($(UNAME_S), Darwin) #APPLE 35 | ECHO_MESSAGE = "Mac OS X" 36 | LIBS += -framework OpenGL -framework GLUT 37 | LIBS += -L/usr/local/lib -L/opt/local/lib 38 | 39 | CXXFLAGS += -I/usr/local/include -I/opt/local/include 40 | CFLAGS = $(CXXFLAGS) 41 | endif 42 | 43 | ifeq ($(OS), Windows_NT) 44 | ECHO_MESSAGE = "MinGW" 45 | LIBS += -lgdi32 -lopengl32 -limm32 46 | ifeq ($(shell pkg-config freeglut --exists 2> /dev/null && echo yes || echo no),yes) 47 | CXXFLAGS += $(shell pkg-config freeglut --cflags) 48 | LIBS += $(shell pkg-config freeglut --libs) 49 | else 50 | LIBS += -lglut 51 | endif 52 | CFLAGS = $(CXXFLAGS) 53 | endif 54 | 55 | ##--------------------------------------------------------------------- 56 | ## BUILD RULES 57 | ##--------------------------------------------------------------------- 58 | 59 | %.o:%.cpp 60 | $(CXX) $(CXXFLAGS) -c -o $@ $< 61 | 62 | %.o:$(IMGUI_DIR)/%.cpp 63 | $(CXX) $(CXXFLAGS) -c -o $@ $< 64 | 65 | %.o:$(IMGUI_DIR)/backends/%.cpp 66 | $(CXX) $(CXXFLAGS) -c -o $@ $< 67 | 68 | all: $(EXE) 69 | @echo Build complete for $(ECHO_MESSAGE) 70 | 71 | $(EXE): $(OBJS) 72 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 73 | 74 | clean: 75 | rm -f $(EXE) $(OBJS) 76 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_vulkan/example_sdl_vulkan.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | imgui 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | sources 27 | 28 | 29 | sources 30 | 31 | 32 | imgui 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | sources 59 | 60 | 61 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | imgui 24 | 25 | 26 | imgui 27 | 28 | 29 | imgui 30 | 31 | 32 | sources 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | sources 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_opengl2/example_sdl_opengl2.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | imgui 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | imgui 27 | 28 | 29 | imgui 30 | 31 | 32 | sources 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | sources 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_win32_directx9/example_win32_directx9.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {a82cba23-9de0-45c2-b1e3-2eb1666702de} 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | imgui 24 | 25 | 26 | sources 27 | 28 | 29 | sources 30 | 31 | 32 | imgui 33 | 34 | 35 | imgui 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | sources 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {c336cfe3-f0c4-464c-9ef0-a9e17a7ff222} 6 | 7 | 8 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | imgui 24 | 25 | 26 | imgui 27 | 28 | 29 | imgui 30 | 31 | 32 | sources 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | sources 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_glut_opengl2/example_glut_opengl2.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {c336cfe3-f0c4-464c-9ef0-a9e17a7ff222} 6 | 7 | 8 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | imgui 24 | 25 | 26 | imgui 27 | 28 | 29 | imgui 30 | 31 | 32 | sources 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | sources 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_sdlrenderer/example_sdl_sdlrenderer.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | imgui 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | imgui 27 | 28 | 29 | imgui 30 | 31 | 32 | sources 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | 56 | 57 | 58 | sources 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_emscripten_wgpu/README.md: -------------------------------------------------------------------------------- 1 | ## How to Build 2 | 3 | - You need to install Emscripten from https://emscripten.org/docs/getting_started/downloads.html, and have the environment variables set, as described in https://emscripten.org/docs/getting_started/downloads.html#installation-instructions 4 | 5 | - Depending on your configuration, in Windows you may need to run `emsdk/emsdk_env.bat` in your console to access the Emscripten command-line tools. 6 | 7 | - You may also refer to our [Continuous Integration setup](https://github.com/ocornut/imgui/tree/master/.github/workflows) for Emscripten setup. 8 | 9 | - Then build using `make` while in the `example_emscripten_wgpu/` directory. 10 | 11 | - Requires recent Emscripten as WGPU is still a work-in-progress API. 12 | 13 | ## How to Run 14 | 15 | To run on a local machine: 16 | - Make sure your browse supports WGPU and it is enabled. WGPU is still WIP not enabled by default in most browser. 17 | - `make serve` will use Python3 to spawn a local webserver, you can then browse http://localhost:8000 to access your build. 18 | - Otherwise, generally you will need a local webserver: 19 | - Quoting [https://emscripten.org/docs/getting_started](https://emscripten.org/docs/getting_started/Tutorial.html#generating-html):
20 | _"Unfortunately several browsers (including Chrome, Safari, and Internet Explorer) do not support file:// [XHR](https://emscripten.org/docs/site/glossary.html#term-xhr) requests, and can’t load extra files needed by the HTML (like a .wasm file, or packaged file data as mentioned lower down). For these browsers you’ll need to serve the files using a [local webserver](https://emscripten.org/docs/getting_started/FAQ.html#faq-local-webserver) and then open http://localhost:8000/hello.html."_ 21 | - Emscripten SDK has a handy `emrun` command: `emrun web/example_emscripten_opengl3.html --browser firefox` which will spawn a temporary local webserver (in Firefox). See https://emscripten.org/docs/compiling/Running-html-files-with-emrun.html for details. 22 | - You may use Python 3 builtin webserver: `python -m http.server -d web` (this is what `make serve` uses). 23 | - You may use Python 2 builtin webserver: `cd web && python -m SimpleHTTPServer`. 24 | - If you are accessing the files over a network, certain browsers, such as Firefox, will restrict Gamepad API access to secure contexts only (e.g. https only). 25 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_opengl2/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # You will need SDL2 (http://www.libsdl.org): 6 | # Linux: 7 | # apt-get install libsdl2-dev 8 | # Mac OS X: 9 | # brew install sdl2 10 | # MSYS2: 11 | # pacman -S mingw-w64-i686-SDL2 12 | # 13 | 14 | #CXX = g++ 15 | #CXX = clang++ 16 | 17 | EXE = example_sdl_opengl2 18 | IMGUI_DIR = ../.. 19 | SOURCES = main.cpp 20 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 21 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_sdl.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl2.cpp 22 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 23 | UNAME_S := $(shell uname -s) 24 | 25 | CXXFLAGS = -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 26 | CXXFLAGS += -g -Wall -Wformat 27 | LIBS = 28 | 29 | ##--------------------------------------------------------------------- 30 | ## BUILD FLAGS PER PLATFORM 31 | ##--------------------------------------------------------------------- 32 | 33 | ifeq ($(UNAME_S), Linux) #LINUX 34 | ECHO_MESSAGE = "Linux" 35 | LIBS += -lGL -ldl `sdl2-config --libs` 36 | 37 | CXXFLAGS += `sdl2-config --cflags` 38 | CFLAGS = $(CXXFLAGS) 39 | endif 40 | 41 | ifeq ($(UNAME_S), Darwin) #APPLE 42 | ECHO_MESSAGE = "Mac OS X" 43 | LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo `sdl2-config --libs` 44 | LIBS += -L/usr/local/lib -L/opt/local/lib 45 | 46 | CXXFLAGS += `sdl2-config --cflags` 47 | CXXFLAGS += -I/usr/local/include -I/opt/local/include 48 | CFLAGS = $(CXXFLAGS) 49 | endif 50 | 51 | ifeq ($(OS), Windows_NT) 52 | ECHO_MESSAGE = "MinGW" 53 | LIBS += -lgdi32 -lopengl32 -limm32 `pkg-config --static --libs sdl2` 54 | 55 | CXXFLAGS += `pkg-config --cflags sdl2` 56 | CFLAGS = $(CXXFLAGS) 57 | endif 58 | 59 | ##--------------------------------------------------------------------- 60 | ## BUILD RULES 61 | ##--------------------------------------------------------------------- 62 | 63 | %.o:%.cpp 64 | $(CXX) $(CXXFLAGS) -c -o $@ $< 65 | 66 | %.o:$(IMGUI_DIR)/%.cpp 67 | $(CXX) $(CXXFLAGS) -c -o $@ $< 68 | 69 | %.o:$(IMGUI_DIR)/backends/%.cpp 70 | $(CXX) $(CXXFLAGS) -c -o $@ $< 71 | 72 | all: $(EXE) 73 | @echo Build complete for $(ECHO_MESSAGE) 74 | 75 | $(EXE): $(OBJS) 76 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 77 | 78 | clean: 79 | rm -f $(EXE) $(OBJS) 80 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/debuggers/imgui.natvis: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | {{Size={Size} Capacity={Capacity}}} 18 | 19 | 20 | Size 21 | Data 22 | 23 | 24 | 25 | 26 | 27 | {{Size={DataEnd-Data} }} 28 | 29 | 30 | DataEnd-Data 31 | Data 32 | 33 | 34 | 35 | 36 | 37 | {{x={x,g} y={y,g}}} 38 | 39 | 40 | 41 | {{x={x,g} y={y,g} z={z,g} w={w,g}}} 42 | 43 | 44 | 45 | {{Min=({Min.x,g} {Min.y,g}) Max=({Max.x,g} {Max.y,g}) Size=({Max.x-Min.x,g} {Max.y-Min.y,g})}} 46 | 47 | Min 48 | Max 49 | Max.x - Min.x 50 | Max.y - Min.y 51 | 52 | 53 | 54 | 55 | {{Name {Name,s} Active {(Active||WasActive)?1:0,d} Child {(Flags & 0x01000000)?1:0,d} Popup {(Flags & 0x04000000)?1:0,d} Hidden {(Hidden)?1:0,d}} 56 | 57 | 58 | 59 | {{ID {ID,x} Pos=({Pos.x,g} {Pos.y,g}) Size=({Size.x,g} {Size.y,g}) Parent {(ParentNode==0)?0:ParentNode->ID,x} Childs {(ChildNodes[0] != 0)+(ChildNodes[1] != 0)} Windows {Windows.Size} } 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_sdlrenderer/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # You will need SDL2 (http://www.libsdl.org): 6 | # Linux: 7 | # apt-get install libsdl2-dev 8 | # Mac OS X: 9 | # brew install sdl2 10 | # MSYS2: 11 | # pacman -S mingw-w64-i686-SDL2 12 | # 13 | 14 | #CXX = g++ 15 | #CXX = clang++ 16 | 17 | EXE = example_sdl_sdlrenderer 18 | IMGUI_DIR = ../.. 19 | SOURCES = main.cpp 20 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 21 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_sdl.cpp $(IMGUI_DIR)/backends/imgui_impl_sdlrenderer.cpp 22 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 23 | UNAME_S := $(shell uname -s) 24 | 25 | CXXFLAGS = -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 26 | CXXFLAGS += -g -Wall -Wformat 27 | LIBS = 28 | 29 | ##--------------------------------------------------------------------- 30 | ## BUILD FLAGS PER PLATFORM 31 | ##--------------------------------------------------------------------- 32 | 33 | ifeq ($(UNAME_S), Linux) #LINUX 34 | ECHO_MESSAGE = "Linux" 35 | LIBS += -lGL -ldl `sdl2-config --libs` 36 | 37 | CXXFLAGS += `sdl2-config --cflags` 38 | CFLAGS = $(CXXFLAGS) 39 | endif 40 | 41 | ifeq ($(UNAME_S), Darwin) #APPLE 42 | ECHO_MESSAGE = "Mac OS X" 43 | LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo `sdl2-config --libs` 44 | LIBS += -L/usr/local/lib -L/opt/local/lib 45 | 46 | CXXFLAGS += `sdl2-config --cflags` 47 | CXXFLAGS += -I/usr/local/include -I/opt/local/include 48 | CFLAGS = $(CXXFLAGS) 49 | endif 50 | 51 | ifeq ($(OS), Windows_NT) 52 | ECHO_MESSAGE = "MinGW" 53 | LIBS += -lgdi32 -lopengl32 -limm32 `pkg-config --static --libs sdl2` 54 | 55 | CXXFLAGS += `pkg-config --cflags sdl2` 56 | CFLAGS = $(CXXFLAGS) 57 | endif 58 | 59 | ##--------------------------------------------------------------------- 60 | ## BUILD RULES 61 | ##--------------------------------------------------------------------- 62 | 63 | %.o:%.cpp 64 | $(CXX) $(CXXFLAGS) -c -o $@ $< 65 | 66 | %.o:$(IMGUI_DIR)/%.cpp 67 | $(CXX) $(CXXFLAGS) -c -o $@ $< 68 | 69 | %.o:$(IMGUI_DIR)/backends/%.cpp 70 | $(CXX) $(CXXFLAGS) -c -o $@ $< 71 | 72 | all: $(EXE) 73 | @echo Build complete for $(ECHO_MESSAGE) 74 | 75 | $(EXE): $(OBJS) 76 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 77 | 78 | clean: 79 | rm -f $(EXE) $(OBJS) 80 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_emscripten_opengl3/shell_minimal.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dear ImGui Emscripten example 7 | 29 | 30 | 31 | 32 | 62 | {{{ SCRIPT }}} 63 | 64 | 65 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_opengl3/example_sdl_opengl3.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | imgui 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | sources 24 | 25 | 26 | sources 27 | 28 | 29 | sources 30 | 31 | 32 | imgui 33 | 34 | 35 | imgui 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | sources 56 | 57 | 58 | 59 | 60 | 61 | sources 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {20b90ce4-7fcb-4731-b9a0-075f875de82d} 6 | 7 | 8 | {f18ab499-84e1-499f-8eff-9754361e0e52} 9 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 10 | 11 | 12 | 13 | 14 | sources 15 | 16 | 17 | imgui 18 | 19 | 20 | imgui 21 | 22 | 23 | imgui 24 | 25 | 26 | imgui 27 | 28 | 29 | imgui 30 | 31 | 32 | sources 33 | 34 | 35 | sources 36 | 37 | 38 | 39 | 40 | imgui 41 | 42 | 43 | imgui 44 | 45 | 46 | imgui 47 | 48 | 49 | sources 50 | 51 | 52 | sources 53 | 54 | 55 | sources 56 | 57 | 58 | 59 | 60 | 61 | sources 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_glfw_opengl2/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # You will need GLFW (http://www.glfw.org): 6 | # Linux: 7 | # apt-get install libglfw-dev 8 | # Mac OS X: 9 | # brew install glfw 10 | # MSYS2: 11 | # pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-glfw 12 | # 13 | 14 | #CXX = g++ 15 | #CXX = clang++ 16 | 17 | EXE = example_glfw_opengl2 18 | IMGUI_DIR = ../.. 19 | SOURCES = main.cpp 20 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 21 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glfw.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl2.cpp 22 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 23 | UNAME_S := $(shell uname -s) 24 | 25 | CXXFLAGS = -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 26 | CXXFLAGS += -g -Wall -Wformat 27 | LIBS = 28 | 29 | ##--------------------------------------------------------------------- 30 | ## BUILD FLAGS PER PLATFORM 31 | ##--------------------------------------------------------------------- 32 | 33 | ifeq ($(UNAME_S), Linux) #LINUX 34 | ECHO_MESSAGE = "Linux" 35 | LIBS += -lGL `pkg-config --static --libs glfw3` 36 | 37 | CXXFLAGS += `pkg-config --cflags glfw3` 38 | CFLAGS = $(CXXFLAGS) 39 | endif 40 | 41 | ifeq ($(UNAME_S), Darwin) #APPLE 42 | ECHO_MESSAGE = "Mac OS X" 43 | LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo 44 | LIBS += -L/usr/local/lib -L/opt/local/lib -L/opt/homebrew/lib 45 | #LIBS += -lglfw3 46 | LIBS += -lglfw 47 | 48 | CXXFLAGS += -I/usr/local/include -I/opt/local/include -I/opt/homebrew/include 49 | CFLAGS = $(CXXFLAGS) 50 | endif 51 | 52 | ifeq ($(OS), Windows_NT) 53 | ECHO_MESSAGE = "MinGW" 54 | LIBS += -lglfw3 -lgdi32 -lopengl32 -limm32 55 | 56 | CXXFLAGS += `pkg-config --cflags glfw3` 57 | CFLAGS = $(CXXFLAGS) 58 | endif 59 | 60 | ##--------------------------------------------------------------------- 61 | ## BUILD RULES 62 | ##--------------------------------------------------------------------- 63 | 64 | %.o:%.cpp 65 | $(CXX) $(CXXFLAGS) -c -o $@ $< 66 | 67 | %.o:$(IMGUI_DIR)/%.cpp 68 | $(CXX) $(CXXFLAGS) -c -o $@ $< 69 | 70 | %.o:$(IMGUI_DIR)/backends/%.cpp 71 | $(CXX) $(CXXFLAGS) -c -o $@ $< 72 | 73 | all: $(EXE) 74 | @echo Build complete for $(ECHO_MESSAGE) 75 | 76 | $(EXE): $(OBJS) 77 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 78 | 79 | clean: 80 | rm -f $(EXE) $(OBJS) 81 | 82 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_dx12.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX12 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'D3D12_GPU_DESCRIPTOR_HANDLE' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Multi-viewport support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 7 | // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. 8 | 9 | // Important: to compile on 32-bit systems, this backend requires code to be compiled with '#define ImTextureID ImU64'. 10 | // See imgui_impl_dx12.cpp file for details. 11 | 12 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 13 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 14 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 15 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 16 | 17 | #pragma once 18 | #include "imgui.h" // IMGUI_IMPL_API 19 | #include // DXGI_FORMAT 20 | 21 | struct ID3D12Device; 22 | struct ID3D12DescriptorHeap; 23 | struct ID3D12GraphicsCommandList; 24 | struct D3D12_CPU_DESCRIPTOR_HANDLE; 25 | struct D3D12_GPU_DESCRIPTOR_HANDLE; 26 | 27 | // cmd_list is the command list that the implementation will use to render imgui draw lists. 28 | // Before calling the render function, caller must prepare cmd_list by resetting it and setting the appropriate 29 | // render target and descriptor heap that contains font_srv_cpu_desc_handle/font_srv_gpu_desc_handle. 30 | // font_srv_cpu_desc_handle and font_srv_gpu_desc_handle are handles to a single SRV descriptor to use for the internal font texture. 31 | IMGUI_IMPL_API bool ImGui_ImplDX12_Init(ID3D12Device* device, int num_frames_in_flight, DXGI_FORMAT rtv_format, ID3D12DescriptorHeap* cbv_srv_heap, 32 | D3D12_CPU_DESCRIPTOR_HANDLE font_srv_cpu_desc_handle, D3D12_GPU_DESCRIPTOR_HANDLE font_srv_gpu_desc_handle); 33 | IMGUI_IMPL_API void ImGui_ImplDX12_Shutdown(); 34 | IMGUI_IMPL_API void ImGui_ImplDX12_NewFrame(); 35 | IMGUI_IMPL_API void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandList* graphics_command_list); 36 | 37 | // Use if you want to reset your rendering device without losing Dear ImGui state. 38 | IMGUI_IMPL_API void ImGui_ImplDX12_InvalidateDeviceObjects(); 39 | IMGUI_IMPL_API bool ImGui_ImplDX12_CreateDeviceObjects(); 40 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_emscripten_opengl3/README.md: -------------------------------------------------------------------------------- 1 | ## How to Build 2 | 3 | - You need to install Emscripten from https://emscripten.org/docs/getting_started/downloads.html, and have the environment variables set, as described in https://emscripten.org/docs/getting_started/downloads.html#installation-instructions 4 | 5 | - Depending on your configuration, in Windows you may need to run `emsdk/emsdk_env.bat` in your console to access the Emscripten command-line tools. 6 | 7 | - You may also refer to our [Continuous Integration setup](https://github.com/ocornut/imgui/tree/master/.github/workflows) for Emscripten setup. 8 | 9 | - Then build using `make` while in the `example_emscripten_opengl3/` directory. 10 | 11 | ## How to Run 12 | 13 | To run on a local machine: 14 | - `make serve` will use Python3 to spawn a local webserver, you can then browse http://localhost:8000 to access your build. 15 | - Otherwise, generally you will need a local webserver: 16 | - Quoting [https://emscripten.org/docs/getting_started](https://emscripten.org/docs/getting_started/Tutorial.html#generating-html):
17 | _"Unfortunately several browsers (including Chrome, Safari, and Internet Explorer) do not support file:// [XHR](https://emscripten.org/docs/site/glossary.html#term-xhr) requests, and can’t load extra files needed by the HTML (like a .wasm file, or packaged file data as mentioned lower down). For these browsers you’ll need to serve the files using a [local webserver](https://emscripten.org/docs/getting_started/FAQ.html#faq-local-webserver) and then open http://localhost:8000/hello.html."_ 18 | - Emscripten SDK has a handy `emrun` command: `emrun web/example_emscripten_opengl3.html --browser firefox` which will spawn a temporary local webserver (in Firefox). See https://emscripten.org/docs/compiling/Running-html-files-with-emrun.html for details. 19 | - You may use Python 3 builtin webserver: `python -m http.server -d web` (this is what `make serve` uses). 20 | - You may use Python 2 builtin webserver: `cd web && python -m SimpleHTTPServer`. 21 | - If you are accessing the files over a network, certain browsers, such as Firefox, will restrict Gamepad API access to secure contexts only (e.g. https only). 22 | 23 | ## Obsolete features: 24 | 25 | - Emscripten 2.0 (August 2020) obsoleted the fastcomp backend, only llvm is supported. 26 | - Emscripten 1.39.0 (October 2019) obsoleted the `BINARYEN_TRAP_MODE=clamp` compilation flag which was required with version older than 1.39.0 to avoid rendering artefacts. See [#2877](https://github.com/ocornut/imgui/issues/2877) for details. If you use an older version, uncomment this line in the Makefile: `#EMS += -s BINARYEN_TRAP_MODE=clamp` 27 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_sdl.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for SDL2 2 | // This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) 3 | // (Info: SDL2 is a cross-platform general purpose library for handling windows, inputs, graphics context creation, etc.) 4 | 5 | // Implemented features: 6 | // [X] Platform: Clipboard support. 7 | // [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] 8 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 9 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 10 | // [X] Platform: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 11 | // Missing features: 12 | // [ ] Platform: SDL2 handling of IME under Windows appears to be broken and it explicitly disable the regular Windows IME. You can restore Windows IME by compiling SDL with SDL_DISABLE_WINDOWS_IME. 13 | // [ ] Platform: Multi-viewport + Minimized windows seems to break mouse wheel events (at least under Windows). 14 | 15 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 16 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 17 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 18 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 19 | 20 | #pragma once 21 | #include "imgui.h" // IMGUI_IMPL_API 22 | 23 | struct SDL_Window; 24 | struct SDL_Renderer; 25 | typedef union SDL_Event SDL_Event; 26 | 27 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window, void* sdl_gl_context); 28 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window); 29 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForD3D(SDL_Window* window); 30 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForMetal(SDL_Window* window); 31 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForSDLRenderer(SDL_Window* window, SDL_Renderer* renderer); 32 | IMGUI_IMPL_API void ImGui_ImplSDL2_Shutdown(); 33 | IMGUI_IMPL_API void ImGui_ImplSDL2_NewFrame(); 34 | IMGUI_IMPL_API bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event); 35 | 36 | #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 37 | static inline void ImGui_ImplSDL2_NewFrame(SDL_Window*) { ImGui_ImplSDL2_NewFrame(); } // 1.84: removed unnecessary parameter 38 | #endif 39 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_glfw_opengl3/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # You will need GLFW (http://www.glfw.org): 6 | # Linux: 7 | # apt-get install libglfw-dev 8 | # Mac OS X: 9 | # brew install glfw 10 | # MSYS2: 11 | # pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-glfw 12 | # 13 | 14 | #CXX = g++ 15 | #CXX = clang++ 16 | 17 | EXE = example_glfw_opengl3 18 | IMGUI_DIR = ../.. 19 | SOURCES = main.cpp 20 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 21 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glfw.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl3.cpp 22 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 23 | UNAME_S := $(shell uname -s) 24 | LINUX_GL_LIBS = -lGL 25 | 26 | CXXFLAGS = -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 27 | CXXFLAGS += -g -Wall -Wformat 28 | LIBS = 29 | 30 | ##--------------------------------------------------------------------- 31 | ## OPENGL ES 32 | ##--------------------------------------------------------------------- 33 | 34 | ## This assumes a GL ES library available in the system, e.g. libGLESv2.so 35 | # CXXFLAGS += -DIMGUI_IMPL_OPENGL_ES2 36 | # LINUX_GL_LIBS = -lGLESv2 37 | 38 | ##--------------------------------------------------------------------- 39 | ## BUILD FLAGS PER PLATFORM 40 | ##--------------------------------------------------------------------- 41 | 42 | ifeq ($(UNAME_S), Linux) #LINUX 43 | ECHO_MESSAGE = "Linux" 44 | LIBS += $(LINUX_GL_LIBS) `pkg-config --static --libs glfw3` 45 | 46 | CXXFLAGS += `pkg-config --cflags glfw3` 47 | CFLAGS = $(CXXFLAGS) 48 | endif 49 | 50 | ifeq ($(UNAME_S), Darwin) #APPLE 51 | ECHO_MESSAGE = "Mac OS X" 52 | LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo 53 | LIBS += -L/usr/local/lib -L/opt/local/lib -L/opt/homebrew/lib 54 | #LIBS += -lglfw3 55 | LIBS += -lglfw 56 | 57 | CXXFLAGS += -I/usr/local/include -I/opt/local/include -I/opt/homebrew/include 58 | CFLAGS = $(CXXFLAGS) 59 | endif 60 | 61 | ifeq ($(OS), Windows_NT) 62 | ECHO_MESSAGE = "MinGW" 63 | LIBS += -lglfw3 -lgdi32 -lopengl32 -limm32 64 | 65 | CXXFLAGS += `pkg-config --cflags glfw3` 66 | CFLAGS = $(CXXFLAGS) 67 | endif 68 | 69 | ##--------------------------------------------------------------------- 70 | ## BUILD RULES 71 | ##--------------------------------------------------------------------- 72 | 73 | %.o:%.cpp 74 | $(CXX) $(CXXFLAGS) -c -o $@ $< 75 | 76 | %.o:$(IMGUI_DIR)/%.cpp 77 | $(CXX) $(CXXFLAGS) -c -o $@ $< 78 | 79 | %.o:$(IMGUI_DIR)/backends/%.cpp 80 | $(CXX) $(CXXFLAGS) -c -o $@ $< 81 | 82 | all: $(EXE) 83 | @echo Build complete for $(ECHO_MESSAGE) 84 | 85 | $(EXE): $(OBJS) 86 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 87 | 88 | clean: 89 | rm -f $(EXE) $(OBJS) 90 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_sdl_opengl3/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # You will need SDL2 (http://www.libsdl.org): 6 | # Linux: 7 | # apt-get install libsdl2-dev 8 | # Mac OS X: 9 | # brew install sdl2 10 | # MSYS2: 11 | # pacman -S mingw-w64-i686-SDL2 12 | # 13 | 14 | #CXX = g++ 15 | #CXX = clang++ 16 | 17 | EXE = example_sdl_opengl3 18 | IMGUI_DIR = ../.. 19 | SOURCES = main.cpp 20 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 21 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_sdl.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl3.cpp 22 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 23 | UNAME_S := $(shell uname -s) 24 | LINUX_GL_LIBS = -lGL 25 | 26 | CXXFLAGS = -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 27 | CXXFLAGS += -g -Wall -Wformat 28 | LIBS = 29 | 30 | ##--------------------------------------------------------------------- 31 | ## OPENGL ES 32 | ##--------------------------------------------------------------------- 33 | 34 | ## This assumes a GL ES library available in the system, e.g. libGLESv2.so 35 | # CXXFLAGS += -DIMGUI_IMPL_OPENGL_ES2 36 | # LINUX_GL_LIBS = -lGLESv2 37 | ## If you're on a Raspberry Pi and want to use the legacy drivers, 38 | ## use the following instead: 39 | # LINUX_GL_LIBS = -L/opt/vc/lib -lbrcmGLESv2 40 | 41 | ##--------------------------------------------------------------------- 42 | ## BUILD FLAGS PER PLATFORM 43 | ##--------------------------------------------------------------------- 44 | 45 | ifeq ($(UNAME_S), Linux) #LINUX 46 | ECHO_MESSAGE = "Linux" 47 | LIBS += $(LINUX_GL_LIBS) -ldl `sdl2-config --libs` 48 | 49 | CXXFLAGS += `sdl2-config --cflags` 50 | CFLAGS = $(CXXFLAGS) 51 | endif 52 | 53 | ifeq ($(UNAME_S), Darwin) #APPLE 54 | ECHO_MESSAGE = "Mac OS X" 55 | LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo `sdl2-config --libs` 56 | LIBS += -L/usr/local/lib -L/opt/local/lib 57 | 58 | CXXFLAGS += `sdl2-config --cflags` 59 | CXXFLAGS += -I/usr/local/include -I/opt/local/include 60 | CFLAGS = $(CXXFLAGS) 61 | endif 62 | 63 | ifeq ($(OS), Windows_NT) 64 | ECHO_MESSAGE = "MinGW" 65 | LIBS += -lgdi32 -lopengl32 -limm32 `pkg-config --static --libs sdl2` 66 | 67 | CXXFLAGS += `pkg-config --cflags sdl2` 68 | CFLAGS = $(CXXFLAGS) 69 | endif 70 | 71 | ##--------------------------------------------------------------------- 72 | ## BUILD RULES 73 | ##--------------------------------------------------------------------- 74 | 75 | %.o:%.cpp 76 | $(CXX) $(CXXFLAGS) -c -o $@ $< 77 | 78 | %.o:$(IMGUI_DIR)/%.cpp 79 | $(CXX) $(CXXFLAGS) -c -o $@ $< 80 | 81 | %.o:$(IMGUI_DIR)/backends/%.cpp 82 | $(CXX) $(CXXFLAGS) -c -o $@ $< 83 | 84 | all: $(EXE) 85 | @echo Build complete for $(ECHO_MESSAGE) 86 | 87 | $(EXE): $(OBJS) 88 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 89 | 90 | clean: 91 | rm -f $(EXE) $(OBJS) 92 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_glut.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for GLUT/FreeGLUT 2 | // This needs to be used along with a Renderer (e.g. OpenGL2) 3 | 4 | // !!! GLUT/FreeGLUT IS OBSOLETE PREHISTORIC SOFTWARE. Using GLUT is not recommended unless you really miss the 90's. !!! 5 | // !!! If someone or something is teaching you GLUT today, you are being abused. Please show some resistance. !!! 6 | // !!! Nowadays, prefer using GLFW or SDL instead! 7 | 8 | // Implemented features: 9 | // [X] Platform: Partial 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 GLUT values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 10 | // Issues: 11 | // [ ] Platform: GLUT is unable to distinguish e.g. Backspace from CTRL+H or TAB from CTRL+I 12 | // [ ] Platform: Missing mouse cursor shape/visibility support. 13 | // [ ] Platform: Missing clipboard support (not supported by Glut). 14 | // [ ] Platform: Missing gamepad support. 15 | 16 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 17 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 18 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 19 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 20 | 21 | #pragma once 22 | #include "imgui.h" // IMGUI_IMPL_API 23 | 24 | IMGUI_IMPL_API bool ImGui_ImplGLUT_Init(); 25 | IMGUI_IMPL_API void ImGui_ImplGLUT_InstallFuncs(); 26 | IMGUI_IMPL_API void ImGui_ImplGLUT_Shutdown(); 27 | IMGUI_IMPL_API void ImGui_ImplGLUT_NewFrame(); 28 | 29 | // You can call ImGui_ImplGLUT_InstallFuncs() to get all those functions installed automatically, 30 | // or call them yourself from your own GLUT handlers. We are using the same weird names as GLUT for consistency.. 31 | //---------------------------------------- GLUT name --------------------------------------------- Decent Name --------- 32 | IMGUI_IMPL_API void ImGui_ImplGLUT_ReshapeFunc(int w, int h); // ~ ResizeFunc 33 | IMGUI_IMPL_API void ImGui_ImplGLUT_MotionFunc(int x, int y); // ~ MouseMoveFunc 34 | IMGUI_IMPL_API void ImGui_ImplGLUT_MouseFunc(int button, int state, int x, int y); // ~ MouseButtonFunc 35 | IMGUI_IMPL_API void ImGui_ImplGLUT_MouseWheelFunc(int button, int dir, int x, int y); // ~ MouseWheelFunc 36 | IMGUI_IMPL_API void ImGui_ImplGLUT_KeyboardFunc(unsigned char c, int x, int y); // ~ CharPressedFunc 37 | IMGUI_IMPL_API void ImGui_ImplGLUT_KeyboardUpFunc(unsigned char c, int x, int y); // ~ CharReleasedFunc 38 | IMGUI_IMPL_API void ImGui_ImplGLUT_SpecialFunc(int key, int x, int y); // ~ KeyPressedFunc 39 | IMGUI_IMPL_API void ImGui_ImplGLUT_SpecialUpFunc(int key, int x, int y); // ~ KeyReleasedFunc 40 | -------------------------------------------------------------------------------- /scripts/types.json: -------------------------------------------------------------------------------- 1 | { 2 | "components": [ 3 | { 4 | "type": "kengine::AdjustableComponent", 5 | "header": "data/AdjustableComponent.hpp" 6 | }, 7 | { 8 | "type": "kengine::WindowComponent", 9 | "header": "data/WindowComponent.hpp" 10 | }, 11 | { 12 | "type": "kengine::CommandLineComponent", 13 | "header": "data/CommandLineComponent.hpp" 14 | }, 15 | { 16 | "type": "kengine::functions::Execute", 17 | "header": "functions/Execute.hpp" 18 | }, 19 | { 20 | "type": "kengine::ImGuiToolComponent", 21 | "header": "data/ImGuiToolComponent.hpp" 22 | }, 23 | { 24 | "type": "kengine::InstanceComponent", 25 | "header": "data/InstanceComponent.hpp" 26 | }, 27 | { 28 | "type": "kengine::LuaComponent", 29 | "header": "data/LuaComponent.hpp" 30 | }, 31 | { 32 | "type": "kengine::LuaTableComponent", 33 | "header": "data/LuaTableComponent.hpp" 34 | }, 35 | { 36 | "type": "kengine::ModelComponent", 37 | "header": "data/ModelComponent.hpp" 38 | }, 39 | { 40 | "type": "kengine::NameComponent", 41 | "header": "data/NameComponent.hpp" 42 | }, 43 | { 44 | "type": "kengine::PythonComponent", 45 | "header": "data/PythonComponent.hpp" 46 | }, 47 | { 48 | "type": "kengine::SelectedComponent", 49 | "header": "data/SelectedComponent.hpp" 50 | }, 51 | { 52 | "type": "kengine::TimeModulatorComponent", 53 | "header": "data/TimeModulatorComponent.hpp" 54 | }, 55 | { 56 | "type": "kengine::meta::AttachTo", 57 | "header": "meta/AttachTo.hpp" 58 | }, 59 | { 60 | "type": "kengine::meta::Attributes", 61 | "header": "meta/Attributes.hpp" 62 | }, 63 | { 64 | "type": "kengine::meta::Copy", 65 | "header": "meta/Copy.hpp" 66 | }, 67 | { 68 | "type": "kengine::meta::Count", 69 | "header": "meta/Count.hpp" 70 | }, 71 | { 72 | "type": "kengine::meta::DetachFrom", 73 | "header": "meta/DetachFrom.hpp" 74 | }, 75 | { 76 | "type": "kengine::meta::DisplayImGui", 77 | "header": "meta/DisplayImGui.hpp" 78 | }, 79 | { 80 | "type": "kengine::meta::EditImGui", 81 | "header": "meta/EditImGui.hpp" 82 | }, 83 | { 84 | "type": "kengine::meta::ForEachEntity", 85 | "header": "meta/ForEachEntity.hpp" 86 | }, 87 | { 88 | "type": "kengine::meta::ForEachEntityWithout", 89 | "header": "meta/ForEachEntity.hpp" 90 | }, 91 | { 92 | "type": "kengine::meta::Get", 93 | "header": "meta/Get.hpp" 94 | }, 95 | { 96 | "type": "kengine::meta::Has", 97 | "header": "meta/Has.hpp" 98 | }, 99 | { 100 | "type": "kengine::meta::LoadFromJSON", 101 | "header": "meta/LoadFromJSON.hpp" 102 | }, 103 | { 104 | "type": "kengine::meta::MatchString", 105 | "header": "meta/MatchString.hpp" 106 | }, 107 | { 108 | "type": "kengine::meta::SaveToJSON", 109 | "header": "meta/SaveToJSON.hpp" 110 | }, 111 | { 112 | "type": "kengine::meta::Size", 113 | "header": "meta/Size.hpp" 114 | } 115 | ] 116 | } 117 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_null/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Cross Platform Makefile 3 | # Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X 4 | # 5 | # Important: This is a "null backend" application, with no visible output or interaction! 6 | # This is used for testing purpose and continuous integration, and has little use for end-user. 7 | # 8 | 9 | # Options 10 | WITH_EXTRA_WARNINGS ?= 0 11 | WITH_FREETYPE ?= 0 12 | 13 | EXE = example_null 14 | IMGUI_DIR = ../.. 15 | SOURCES = main.cpp 16 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 17 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 18 | UNAME_S := $(shell uname -s) 19 | 20 | CXXFLAGS += -I$(IMGUI_DIR) 21 | CXXFLAGS += -g -Wall -Wformat 22 | LIBS = 23 | 24 | # We use the WITH_EXTRA_WARNINGS flag on our CI setup to eagerly catch zealous warnings 25 | ifeq ($(WITH_EXTRA_WARNINGS), 1) 26 | CXXFLAGS += -Wno-zero-as-null-pointer-constant -Wno-double-promotion -Wno-variadic-macros 27 | endif 28 | 29 | # We use the WITH_FREETYPE flag on our CI setup to test compiling misc/freetype/imgui_freetype.cpp 30 | # (only supported on Linux, and note that the imgui_freetype code currently won't be executed) 31 | ifeq ($(WITH_FREETYPE), 1) 32 | SOURCES += $(IMGUI_DIR)/misc/freetype/imgui_freetype.cpp 33 | CXXFLAGS += $(shell pkg-config --cflags freetype2) 34 | LIBS += $(shell pkg-config --libs freetype2) 35 | endif 36 | 37 | ##--------------------------------------------------------------------- 38 | ## BUILD FLAGS PER PLATFORM 39 | ##--------------------------------------------------------------------- 40 | 41 | ifeq ($(UNAME_S), Linux) #LINUX 42 | ECHO_MESSAGE = "Linux" 43 | ifeq ($(WITH_EXTRA_WARNINGS), 1) 44 | CXXFLAGS += -Wextra -Wpedantic 45 | ifeq ($(shell $(CXX) -v 2>&1 | grep -c "clang version"), 1) 46 | CXXFLAGS += -Wshadow -Wsign-conversion 47 | endif 48 | endif 49 | CFLAGS = $(CXXFLAGS) 50 | endif 51 | 52 | ifeq ($(UNAME_S), Darwin) #APPLE 53 | ECHO_MESSAGE = "Mac OS X" 54 | ifeq ($(WITH_EXTRA_WARNINGS), 1) 55 | CXXFLAGS += -Weverything -Wno-reserved-id-macro -Wno-c++98-compat-pedantic -Wno-padded -Wno-c++11-long-long -Wno-poison-system-directories 56 | endif 57 | CFLAGS = $(CXXFLAGS) 58 | endif 59 | 60 | ifeq ($(OS), Windows_NT) 61 | ECHO_MESSAGE = "MinGW" 62 | ifeq ($(WITH_EXTRA_WARNINGS), 1) 63 | CXXFLAGS += -Wextra -Wpedantic 64 | endif 65 | LIBS += -limm32 66 | CFLAGS = $(CXXFLAGS) 67 | endif 68 | 69 | ##--------------------------------------------------------------------- 70 | ## BUILD RULES 71 | ##--------------------------------------------------------------------- 72 | 73 | %.o:%.cpp 74 | $(CXX) $(CXXFLAGS) -c -o $@ $< 75 | 76 | %.o:$(IMGUI_DIR)/%.cpp 77 | $(CXX) $(CXXFLAGS) -c -o $@ $< 78 | 79 | %.o:$(IMGUI_DIR)/backends/%.cpp 80 | $(CXX) $(CXXFLAGS) -c -o $@ $< 81 | 82 | %.o:$(IMGUI_DIR)/misc/freetype/%.cpp 83 | $(CXX) $(CXXFLAGS) -c -o $@ $< 84 | 85 | all: $(EXE) 86 | @echo Build complete for $(ECHO_MESSAGE) 87 | 88 | $(EXE): $(OBJS) 89 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 90 | 91 | clean: 92 | rm -f $(EXE) $(OBJS) 93 | -------------------------------------------------------------------------------- /src/types/registerTypes.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "helpers/logHelper.hpp" 3 | 4 | namespace types{ 5 | void registerTypes() noexcept { 6 | kengine_log(Log, "Init", "Registering types"); 7 | 8 | extern void registerkengineAdjustableComponent() noexcept; 9 | registerkengineAdjustableComponent(); 10 | 11 | extern void registerkengineWindowComponent() noexcept; 12 | registerkengineWindowComponent(); 13 | 14 | extern void registerkengineCommandLineComponent() noexcept; 15 | registerkengineCommandLineComponent(); 16 | 17 | extern void registerkenginefunctionsExecute() noexcept; 18 | registerkenginefunctionsExecute(); 19 | 20 | extern void registerkengineImGuiToolComponent() noexcept; 21 | registerkengineImGuiToolComponent(); 22 | 23 | extern void registerkengineInstanceComponent() noexcept; 24 | registerkengineInstanceComponent(); 25 | 26 | extern void registerkengineLuaComponent() noexcept; 27 | registerkengineLuaComponent(); 28 | 29 | extern void registerkengineLuaTableComponent() noexcept; 30 | registerkengineLuaTableComponent(); 31 | 32 | extern void registerkengineModelComponent() noexcept; 33 | registerkengineModelComponent(); 34 | 35 | extern void registerkengineNameComponent() noexcept; 36 | registerkengineNameComponent(); 37 | 38 | extern void registerkenginePythonComponent() noexcept; 39 | registerkenginePythonComponent(); 40 | 41 | extern void registerkengineSelectedComponent() noexcept; 42 | registerkengineSelectedComponent(); 43 | 44 | extern void registerkengineTimeModulatorComponent() noexcept; 45 | registerkengineTimeModulatorComponent(); 46 | 47 | extern void registerkenginemetaAttachTo() noexcept; 48 | registerkenginemetaAttachTo(); 49 | 50 | extern void registerkenginemetaAttributes() noexcept; 51 | registerkenginemetaAttributes(); 52 | 53 | extern void registerkenginemetaCopy() noexcept; 54 | registerkenginemetaCopy(); 55 | 56 | extern void registerkenginemetaCount() noexcept; 57 | registerkenginemetaCount(); 58 | 59 | extern void registerkenginemetaDetachFrom() noexcept; 60 | registerkenginemetaDetachFrom(); 61 | 62 | extern void registerkenginemetaDisplayImGui() noexcept; 63 | registerkenginemetaDisplayImGui(); 64 | 65 | extern void registerkenginemetaEditImGui() noexcept; 66 | registerkenginemetaEditImGui(); 67 | 68 | extern void registerkenginemetaForEachEntity() noexcept; 69 | registerkenginemetaForEachEntity(); 70 | 71 | extern void registerkenginemetaForEachEntityWithout() noexcept; 72 | registerkenginemetaForEachEntityWithout(); 73 | 74 | extern void registerkenginemetaGet() noexcept; 75 | registerkenginemetaGet(); 76 | 77 | extern void registerkenginemetaHas() noexcept; 78 | registerkenginemetaHas(); 79 | 80 | extern void registerkenginemetaLoadFromJSON() noexcept; 81 | registerkenginemetaLoadFromJSON(); 82 | 83 | extern void registerkenginemetaMatchString() noexcept; 84 | registerkenginemetaMatchString(); 85 | 86 | extern void registerkenginemetaSaveToJSON() noexcept; 87 | registerkenginemetaSaveToJSON(); 88 | 89 | extern void registerkenginemetaSize() noexcept; 90 | registerkenginemetaSize(); 91 | 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_opengl3.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for modern OpenGL with shaders / programmatic pipeline 2 | // - Desktop GL: 2.x 3.x 4.x 3 | // - Embedded GL: ES 2.0 (WebGL 1.0), ES 3.0 (WebGL 2.0) 4 | // This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..) 5 | 6 | // Implemented features: 7 | // [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID! 8 | // [X] Renderer: Multi-viewport support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 9 | // [x] Renderer: Desktop GL only: Support for large meshes (64k+ vertices) with 16-bit indices. 10 | 11 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 12 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 13 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 14 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 15 | 16 | // About GLSL version: 17 | // The 'glsl_version' initialization parameter should be NULL (default) or a "#version XXX" string. 18 | // On computer platform the GLSL version default to "#version 130". On OpenGL ES 3 platform it defaults to "#version 300 es" 19 | // Only override if your GL version doesn't handle this GLSL version. See GLSL version table at the top of imgui_impl_opengl3.cpp. 20 | 21 | #pragma once 22 | #include "imgui.h" // IMGUI_IMPL_API 23 | 24 | // Backend API 25 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = NULL); 26 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown(); 27 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_NewFrame(); 28 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data); 29 | 30 | // (Optional) Called by Init/NewFrame/Shutdown 31 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateFontsTexture(); 32 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyFontsTexture(); 33 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateDeviceObjects(); 34 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects(); 35 | 36 | // Specific OpenGL ES versions 37 | //#define IMGUI_IMPL_OPENGL_ES2 // Auto-detected on Emscripten 38 | //#define IMGUI_IMPL_OPENGL_ES3 // Auto-detected on iOS/Android 39 | 40 | // You can explicitly select GLES2 or GLES3 API by using one of the '#define IMGUI_IMPL_OPENGL_LOADER_XXX' in imconfig.h or compiler command-line. 41 | #if !defined(IMGUI_IMPL_OPENGL_ES2) \ 42 | && !defined(IMGUI_IMPL_OPENGL_ES3) 43 | 44 | // Try to detect GLES on matching platforms 45 | #if defined(__APPLE__) 46 | #include 47 | #endif 48 | #if (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_TV)) || (defined(__ANDROID__)) 49 | #define IMGUI_IMPL_OPENGL_ES3 // iOS, Android -> GL ES 3, "#version 300 es" 50 | #elif defined(__EMSCRIPTEN__) 51 | #define IMGUI_IMPL_OPENGL_ES2 // Emscripten -> GL ES 2, "#version 100" 52 | #else 53 | // Otherwise imgui_impl_opengl3_loader.h will be used. 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/cpp/imgui_stdlib.cpp: -------------------------------------------------------------------------------- 1 | // dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.) 2 | // This is also an example of how you may wrap your own similar types. 3 | 4 | // Changelog: 5 | // - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string 6 | 7 | #include "imgui.h" 8 | #include "imgui_stdlib.h" 9 | 10 | struct InputTextCallback_UserData 11 | { 12 | std::string* Str; 13 | ImGuiInputTextCallback ChainCallback; 14 | void* ChainCallbackUserData; 15 | }; 16 | 17 | static int InputTextCallback(ImGuiInputTextCallbackData* data) 18 | { 19 | InputTextCallback_UserData* user_data = (InputTextCallback_UserData*)data->UserData; 20 | if (data->EventFlag == ImGuiInputTextFlags_CallbackResize) 21 | { 22 | // Resize string callback 23 | // If for some reason we refuse the new length (BufTextLen) and/or capacity (BufSize) we need to set them back to what we want. 24 | std::string* str = user_data->Str; 25 | IM_ASSERT(data->Buf == str->c_str()); 26 | str->resize(data->BufTextLen); 27 | data->Buf = (char*)str->c_str(); 28 | } 29 | else if (user_data->ChainCallback) 30 | { 31 | // Forward to user callback, if any 32 | data->UserData = user_data->ChainCallbackUserData; 33 | return user_data->ChainCallback(data); 34 | } 35 | return 0; 36 | } 37 | 38 | bool ImGui::InputText(const char* label, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) 39 | { 40 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); 41 | flags |= ImGuiInputTextFlags_CallbackResize; 42 | 43 | InputTextCallback_UserData cb_user_data; 44 | cb_user_data.Str = str; 45 | cb_user_data.ChainCallback = callback; 46 | cb_user_data.ChainCallbackUserData = user_data; 47 | return InputText(label, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data); 48 | } 49 | 50 | bool ImGui::InputTextMultiline(const char* label, std::string* str, const ImVec2& size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) 51 | { 52 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); 53 | flags |= ImGuiInputTextFlags_CallbackResize; 54 | 55 | InputTextCallback_UserData cb_user_data; 56 | cb_user_data.Str = str; 57 | cb_user_data.ChainCallback = callback; 58 | cb_user_data.ChainCallbackUserData = user_data; 59 | return InputTextMultiline(label, (char*)str->c_str(), str->capacity() + 1, size, flags, InputTextCallback, &cb_user_data); 60 | } 61 | 62 | bool ImGui::InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) 63 | { 64 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); 65 | flags |= ImGuiInputTextFlags_CallbackResize; 66 | 67 | InputTextCallback_UserData cb_user_data; 68 | cb_user_data.Str = str; 69 | cb_user_data.ChainCallback = callback; 70 | cb_user_data.ChainCallbackUserData = user_data; 71 | return InputTextWithHint(label, hint, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data); 72 | } 73 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_win32.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for Windows (standard windows API for 32 and 64 bits applications) 2 | // This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) 3 | 4 | // Implemented features: 5 | // [X] Platform: Clipboard support (for Win32 this is actually part of core dear imgui) 6 | // [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy VK_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 7 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 8 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 9 | // [X] Platform: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 10 | 11 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 12 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 13 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 14 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 15 | 16 | #pragma once 17 | #include "imgui.h" // IMGUI_IMPL_API 18 | 19 | IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd); 20 | IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown(); 21 | IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame(); 22 | 23 | // Win32 message handler your application need to call. 24 | // - Intentionally commented out in a '#if 0' block to avoid dragging dependencies on from this helper. 25 | // - You should COPY the line below into your .cpp code to forward declare the function and then you can call it. 26 | #if 0 27 | extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 28 | #endif 29 | 30 | // DPI-related helpers (optional) 31 | // - Use to enable DPI awareness without having to create an application manifest. 32 | // - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps. 33 | // - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc. 34 | // but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime, 35 | // neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies. 36 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness(); 37 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd 38 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor 39 | 40 | // Transparency related helpers (optional) [experimental] 41 | // - Use to enable alpha compositing transparency with the desktop. 42 | // - Use together with e.g. clearing your framebuffer with zero-alpha. 43 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableAlphaCompositing(void* hwnd); // HWND hwnd 44 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_emscripten_wgpu/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile to use with emscripten 3 | # See https://emscripten.org/docs/getting_started/downloads.html 4 | # for installation instructions. 5 | # 6 | # This Makefile assumes you have loaded emscripten's environment. 7 | # (On Windows, you may need to execute emsdk_env.bat or encmdprompt.bat ahead) 8 | # 9 | # Running `make` will produce three files: 10 | # - web/index.html (current stored in the repository) 11 | # - web/index.js 12 | # - web/index.wasm 13 | # 14 | # All three are needed to run the demo. 15 | 16 | CC = emcc 17 | CXX = em++ 18 | WEB_DIR = web 19 | EXE = $(WEB_DIR)/index.js 20 | IMGUI_DIR = ../.. 21 | SOURCES = main.cpp 22 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 23 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glfw.cpp $(IMGUI_DIR)/backends/imgui_impl_wgpu.cpp 24 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 25 | UNAME_S := $(shell uname -s) 26 | CPPFLAGS = 27 | LDFLAGS = 28 | EMS = 29 | 30 | ##--------------------------------------------------------------------- 31 | ## EMSCRIPTEN OPTIONS 32 | ##--------------------------------------------------------------------- 33 | 34 | # ("EMS" options gets added to both CPPFLAGS and LDFLAGS, whereas some options are for linker only) 35 | EMS += -s DISABLE_EXCEPTION_CATCHING=1 36 | LDFLAGS += -s USE_GLFW=3 -s USE_WEBGPU=1 37 | LDFLAGS += -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s NO_EXIT_RUNTIME=0 -s ASSERTIONS=1 38 | 39 | # Emscripten allows preloading a file or folder to be accessible at runtime. 40 | # The Makefile for this example project suggests embedding the misc/fonts/ folder into our application, it will then be accessible as "/fonts" 41 | # See documentation for more details: https://emscripten.org/docs/porting/files/packaging_files.html 42 | # (Default value is 0. Set to 1 to enable file-system and include the misc/fonts/ folder as part of the build.) 43 | USE_FILE_SYSTEM ?= 0 44 | ifeq ($(USE_FILE_SYSTEM), 0) 45 | LDFLAGS += -s NO_FILESYSTEM=1 46 | CPPFLAGS += -DIMGUI_DISABLE_FILE_FUNCTIONS 47 | endif 48 | ifeq ($(USE_FILE_SYSTEM), 1) 49 | LDFLAGS += --no-heap-copy --preload-file ../../misc/fonts@/fonts 50 | endif 51 | 52 | ##--------------------------------------------------------------------- 53 | ## FINAL BUILD FLAGS 54 | ##--------------------------------------------------------------------- 55 | 56 | CPPFLAGS += -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 57 | #CPPFLAGS += -g 58 | CPPFLAGS += -Wall -Wformat -Os $(EMS) 59 | #LDFLAGS += --shell-file shell_minimal.html 60 | LDFLAGS += $(EMS) 61 | 62 | ##--------------------------------------------------------------------- 63 | ## BUILD RULES 64 | ##--------------------------------------------------------------------- 65 | 66 | %.o:%.cpp 67 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< 68 | 69 | %.o:$(IMGUI_DIR)/%.cpp 70 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< 71 | 72 | %.o:$(IMGUI_DIR)/backends/%.cpp 73 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< 74 | 75 | all: $(EXE) 76 | @echo Build complete for $(EXE) 77 | 78 | $(WEB_DIR): 79 | mkdir $@ 80 | 81 | serve: all 82 | python3 -m http.server -d $(WEB_DIR) 83 | 84 | $(EXE): $(OBJS) $(WEB_DIR) 85 | $(CXX) -o $@ $(OBJS) $(LDFLAGS) 86 | 87 | clean: 88 | rm -f $(EXE) $(OBJS) $(WEB_DIR)/*.js $(WEB_DIR)/*.wasm $(WEB_DIR)/*.wasm.pre 89 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_metal.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for Metal 2 | // This needs to be used along with a Platform Backend (e.g. OSX) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'MTLTexture' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. 7 | // Missing features: 8 | // [ ] Renderer: Multi-viewport / platform windows. 9 | 10 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 11 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 12 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 13 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 14 | 15 | #include "imgui.h" // IMGUI_IMPL_API 16 | 17 | //----------------------------------------------------------------------------- 18 | // ObjC API 19 | //----------------------------------------------------------------------------- 20 | 21 | #ifdef __OBJC__ 22 | 23 | @class MTLRenderPassDescriptor; 24 | @protocol MTLDevice, MTLCommandBuffer, MTLRenderCommandEncoder; 25 | 26 | IMGUI_IMPL_API bool ImGui_ImplMetal_Init(id device); 27 | IMGUI_IMPL_API void ImGui_ImplMetal_Shutdown(); 28 | IMGUI_IMPL_API void ImGui_ImplMetal_NewFrame(MTLRenderPassDescriptor* renderPassDescriptor); 29 | IMGUI_IMPL_API void ImGui_ImplMetal_RenderDrawData(ImDrawData* draw_data, 30 | id commandBuffer, 31 | id commandEncoder); 32 | 33 | // Called by Init/NewFrame/Shutdown 34 | IMGUI_IMPL_API bool ImGui_ImplMetal_CreateFontsTexture(id device); 35 | IMGUI_IMPL_API void ImGui_ImplMetal_DestroyFontsTexture(); 36 | IMGUI_IMPL_API bool ImGui_ImplMetal_CreateDeviceObjects(id device); 37 | IMGUI_IMPL_API void ImGui_ImplMetal_DestroyDeviceObjects(); 38 | 39 | #endif 40 | 41 | //----------------------------------------------------------------------------- 42 | // C++ API 43 | //----------------------------------------------------------------------------- 44 | 45 | // Enable Metal C++ binding support with '#define IMGUI_IMPL_METAL_CPP' in your imconfig.h file 46 | // More info about using Metal from C++: https://developer.apple.com/metal/cpp/ 47 | 48 | #ifdef IMGUI_IMPL_METAL_CPP 49 | 50 | #include 51 | 52 | #ifndef __OBJC__ 53 | 54 | IMGUI_IMPL_API bool ImGui_ImplMetal_Init(MTL::Device* device); 55 | IMGUI_IMPL_API void ImGui_ImplMetal_Shutdown(); 56 | IMGUI_IMPL_API void ImGui_ImplMetal_NewFrame(MTL::RenderPassDescriptor* renderPassDescriptor); 57 | IMGUI_IMPL_API void ImGui_ImplMetal_RenderDrawData(ImDrawData* draw_data, 58 | MTL::CommandBuffer* commandBuffer, 59 | MTL::RenderCommandEncoder* commandEncoder); 60 | 61 | // Called by Init/NewFrame/Shutdown 62 | IMGUI_IMPL_API bool ImGui_ImplMetal_CreateFontsTexture(MTL::Device* device); 63 | IMGUI_IMPL_API void ImGui_ImplMetal_DestroyFontsTexture(); 64 | IMGUI_IMPL_API bool ImGui_ImplMetal_CreateDeviceObjects(MTL::Device* device); 65 | IMGUI_IMPL_API void ImGui_ImplMetal_DestroyDeviceObjects(); 66 | 67 | #endif 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/examples/example_emscripten_opengl3/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile to use with emscripten 3 | # See https://emscripten.org/docs/getting_started/downloads.html 4 | # for installation instructions. 5 | # 6 | # This Makefile assumes you have loaded emscripten's environment. 7 | # (On Windows, you may need to execute emsdk_env.bat or encmdprompt.bat ahead) 8 | # 9 | # Running `make` will produce three files: 10 | # - web/index.html 11 | # - web/index.js 12 | # - web/index.wasm 13 | # 14 | # All three are needed to run the demo. 15 | 16 | CC = emcc 17 | CXX = em++ 18 | WEB_DIR = web 19 | EXE = $(WEB_DIR)/index.html 20 | IMGUI_DIR = ../.. 21 | SOURCES = main.cpp 22 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 23 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_sdl.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl3.cpp 24 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 25 | UNAME_S := $(shell uname -s) 26 | CPPFLAGS = 27 | LDFLAGS = 28 | EMS = 29 | 30 | ##--------------------------------------------------------------------- 31 | ## EMSCRIPTEN OPTIONS 32 | ##--------------------------------------------------------------------- 33 | 34 | # ("EMS" options gets added to both CPPFLAGS and LDFLAGS, whereas some options are for linker only) 35 | EMS += -s USE_SDL=2 36 | EMS += -s DISABLE_EXCEPTION_CATCHING=1 37 | LDFLAGS += -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s NO_EXIT_RUNTIME=0 -s ASSERTIONS=1 38 | 39 | # Uncomment next line to fix possible rendering bugs with Emscripten version older then 1.39.0 (https://github.com/ocornut/imgui/issues/2877) 40 | #EMS += -s BINARYEN_TRAP_MODE=clamp 41 | #EMS += -s SAFE_HEAP=1 ## Adds overhead 42 | 43 | # Emscripten allows preloading a file or folder to be accessible at runtime. 44 | # The Makefile for this example project suggests embedding the misc/fonts/ folder into our application, it will then be accessible as "/fonts" 45 | # See documentation for more details: https://emscripten.org/docs/porting/files/packaging_files.html 46 | # (Default value is 0. Set to 1 to enable file-system and include the misc/fonts/ folder as part of the build.) 47 | USE_FILE_SYSTEM ?= 0 48 | ifeq ($(USE_FILE_SYSTEM), 0) 49 | LDFLAGS += -s NO_FILESYSTEM=1 50 | CPPFLAGS += -DIMGUI_DISABLE_FILE_FUNCTIONS 51 | endif 52 | ifeq ($(USE_FILE_SYSTEM), 1) 53 | LDFLAGS += --no-heap-copy --preload-file ../../misc/fonts@/fonts 54 | endif 55 | 56 | ##--------------------------------------------------------------------- 57 | ## FINAL BUILD FLAGS 58 | ##--------------------------------------------------------------------- 59 | 60 | CPPFLAGS += -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 61 | #CPPFLAGS += -g 62 | CPPFLAGS += -Wall -Wformat -Os $(EMS) 63 | LDFLAGS += --shell-file shell_minimal.html $(EMS) 64 | 65 | ##--------------------------------------------------------------------- 66 | ## BUILD RULES 67 | ##--------------------------------------------------------------------- 68 | 69 | %.o:%.cpp 70 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< 71 | 72 | %.o:$(IMGUI_DIR)/%.cpp 73 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< 74 | 75 | %.o:$(IMGUI_DIR)/backends/%.cpp 76 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< 77 | 78 | all: $(EXE) 79 | @echo Build complete for $(EXE) 80 | 81 | $(WEB_DIR): 82 | mkdir $@ 83 | 84 | serve: all 85 | python3 -m http.server -d $(WEB_DIR) 86 | 87 | $(EXE): $(OBJS) $(WEB_DIR) 88 | $(CXX) -o $@ $(OBJS) $(LDFLAGS) 89 | 90 | clean: 91 | rm -rf $(OBJS) $(WEB_DIR) 92 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/.github/workflows/static-analysis.yml: -------------------------------------------------------------------------------- 1 | name: static-analysis 2 | 3 | on: 4 | workflow_run: 5 | # Perform static analysis together with build workflow. Build triggers of "build" workflow do not need to be repeated here. 6 | workflows: 7 | - build 8 | types: 9 | - requested 10 | 11 | jobs: 12 | PVS-Studio: 13 | runs-on: ubuntu-18.04 14 | steps: 15 | - uses: actions/checkout@v1 16 | with: 17 | fetch-depth: 1 18 | 19 | - name: Install Dependencies 20 | env: 21 | # The Secret variable setup in GitHub must be in format: "name_or_email key", on a single line 22 | PVS_STUDIO_LICENSE: ${{ secrets.PVS_STUDIO_LICENSE }} 23 | run: | 24 | if [[ "$PVS_STUDIO_LICENSE" != "" ]]; 25 | then 26 | wget -q https://files.viva64.com/etc/pubkey.txt 27 | sudo apt-key add pubkey.txt 28 | sudo wget -O /etc/apt/sources.list.d/viva64.list https://files.viva64.com/etc/viva64.list 29 | sudo apt-get update 30 | sudo apt-get install -y pvs-studio 31 | pvs-studio-analyzer credentials -o pvs-studio.lic $PVS_STUDIO_LICENSE 32 | fi 33 | 34 | - name: PVS-Studio static analysis 35 | run: | 36 | if [[ ! -f pvs-studio.lic ]]; 37 | then 38 | echo "PVS Studio license is missing. No analysis will be performed." 39 | echo "If you have a PVS Studio license please create a project secret named PVS_STUDIO_LICENSE with your license." 40 | echo "You may use a free license. More information at https://www.viva64.com/en/b/0457/" 41 | exit 0 42 | fi 43 | cd examples/example_null 44 | pvs-studio-analyzer trace -- make WITH_EXTRA_WARNINGS=1 45 | pvs-studio-analyzer analyze -e ../../imstb_rectpack.h -e ../../imstb_textedit.h -e ../../imstb_truetype.h -l ../../pvs-studio.lic -o pvs-studio.log 46 | plog-converter -a 'GA:1,2;OP:1' -d V1071 -t errorfile -w pvs-studio.log 47 | 48 | Discord-CI: 49 | runs-on: ubuntu-18.04 50 | needs: [PVS-Studio] 51 | if: always() 52 | steps: 53 | - uses: dearimgui/github_discord_notifier@latest 54 | with: 55 | discord-webhook: ${{ secrets.DISCORD_CI_WEBHOOK }} 56 | github-token: ${{ github.token }} 57 | action-task: discord-jobs 58 | discord-filter: "'{{ github.branch }}'.match(/master|docking/g) != null && '{{ run.conclusion }}' != '{{ last_run.conclusion }}'" 59 | discord-username: GitHub Actions 60 | discord-job-new-failure-message: '' 61 | discord-job-fixed-failure-message: '' 62 | discord-job-new-failure-embed: | 63 | { 64 | "title": "`{{ job.name }}` job is failing on `{{ github.branch }}`!", 65 | "description": "Commit [{{ github.context.payload.head_commit.title }}]({{ github.context.payload.head_commit.url }}) pushed to [{{ github.branch }}]({{ github.branch_url }}) broke static analysis [{{ job.name }}]({{ job.url }}) job.\nFailing steps: {{ failing_steps }}", 66 | "url": "{{ job.url }}", 67 | "color": "0xFF0000", 68 | "timestamp": "{{ run.updated_at }}" 69 | } 70 | discord-job-fixed-failure-embed: | 71 | { 72 | "title": "`{{ github.branch }}` branch is no longer failing!", 73 | "description": "Static analysis failures were fixed on [{{ github.branch }}]({{ github.branch_url }}) branch.", 74 | "color": "0x00FF00", 75 | "url": "{{ github.context.payload.head_commit.url }}", 76 | "timestamp": "{{ run.completed_at }}" 77 | } 78 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/misc/freetype/imgui_freetype.h: -------------------------------------------------------------------------------- 1 | // dear imgui: FreeType font builder (used as a replacement for the stb_truetype builder) 2 | // (headers) 3 | 4 | #pragma once 5 | 6 | #include "imgui.h" // IMGUI_API 7 | 8 | // Forward declarations 9 | struct ImFontAtlas; 10 | struct ImFontBuilderIO; 11 | 12 | // Hinting greatly impacts visuals (and glyph sizes). 13 | // - By default, hinting is enabled and the font's native hinter is preferred over the auto-hinter. 14 | // - When disabled, FreeType generates blurrier glyphs, more or less matches the stb_truetype.h 15 | // - The Default hinting mode usually looks good, but may distort glyphs in an unusual way. 16 | // - The Light hinting mode generates fuzzier glyphs but better matches Microsoft's rasterizer. 17 | // You can set those flags globaly in ImFontAtlas::FontBuilderFlags 18 | // You can set those flags on a per font basis in ImFontConfig::FontBuilderFlags 19 | enum ImGuiFreeTypeBuilderFlags 20 | { 21 | ImGuiFreeTypeBuilderFlags_NoHinting = 1 << 0, // Disable hinting. This generally generates 'blurrier' bitmap glyphs when the glyph are rendered in any of the anti-aliased modes. 22 | ImGuiFreeTypeBuilderFlags_NoAutoHint = 1 << 1, // Disable auto-hinter. 23 | ImGuiFreeTypeBuilderFlags_ForceAutoHint = 1 << 2, // Indicates that the auto-hinter is preferred over the font's native hinter. 24 | ImGuiFreeTypeBuilderFlags_LightHinting = 1 << 3, // A lighter hinting algorithm for gray-level modes. Many generated glyphs are fuzzier but better resemble their original shape. This is achieved by snapping glyphs to the pixel grid only vertically (Y-axis), as is done by Microsoft's ClearType and Adobe's proprietary font renderer. This preserves inter-glyph spacing in horizontal text. 25 | ImGuiFreeTypeBuilderFlags_MonoHinting = 1 << 4, // Strong hinting algorithm that should only be used for monochrome output. 26 | ImGuiFreeTypeBuilderFlags_Bold = 1 << 5, // Styling: Should we artificially embolden the font? 27 | ImGuiFreeTypeBuilderFlags_Oblique = 1 << 6, // Styling: Should we slant the font, emulating italic style? 28 | ImGuiFreeTypeBuilderFlags_Monochrome = 1 << 7, // Disable anti-aliasing. Combine this with MonoHinting for best results! 29 | ImGuiFreeTypeBuilderFlags_LoadColor = 1 << 8, // Enable FreeType color-layered glyphs 30 | ImGuiFreeTypeBuilderFlags_Bitmap = 1 << 9 // Enable FreeType bitmap glyphs 31 | }; 32 | 33 | namespace ImGuiFreeType 34 | { 35 | // This is automatically assigned when using '#define IMGUI_ENABLE_FREETYPE'. 36 | // If you need to dynamically select between multiple builders: 37 | // - you can manually assign this builder with 'atlas->FontBuilderIO = ImGuiFreeType::GetBuilderForFreeType()' 38 | // - prefer deep-copying this into your own ImFontBuilderIO instance if you use hot-reloading that messes up static data. 39 | IMGUI_API const ImFontBuilderIO* GetBuilderForFreeType(); 40 | 41 | // Override allocators. By default ImGuiFreeType will use IM_ALLOC()/IM_FREE() 42 | // However, as FreeType does lots of allocations we provide a way for the user to redirect it to a separate memory heap if desired. 43 | IMGUI_API void SetAllocatorFunctions(void* (*alloc_func)(size_t sz, void* user_data), void (*free_func)(void* ptr, void* user_data), void* user_data = NULL); 44 | 45 | // Obsolete names (will be removed soon) 46 | // Prefer using '#define IMGUI_ENABLE_FREETYPE' 47 | #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 48 | static inline bool BuildFontAtlas(ImFontAtlas* atlas, unsigned int flags = 0) { atlas->FontBuilderIO = GetBuilderForFreeType(); atlas->FontBuilderFlags = flags; return atlas->Build(); } 49 | #endif 50 | } 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![packages](https://github.com/phisko/koverlay/workflows/packages/badge.svg)](https://github.com/phisko/koverlay/actions/workflows/packages.yml) 2 | 3 | Simple and extensible overlay system using ImGui and the [Kengine](https://github.com/phisko/kengine). 4 | 5 | ImGui windows are rendered as "always-on-top" windows over other Windows applications. 6 | 7 | ![koverlay](https://github.com/phisko/koverlay/blob/master/screenshot.png) 8 | 9 | # System tray icon 10 | Right-clicking on the system tray icon lets you start/stop various tools. 11 | 12 | # Keyboard shortcut 13 | Alt + Q: enable/disable the overlay 14 | 15 | # Creating tools 16 | 17 | Tools can be created in three different ways: lua scripts, C++ plugins, and `kengine` Systems (which are also loaded as plugins). 18 | 19 | ## Lua scripts 20 | 21 | Scripts can be added to the `scripts` directory, next to the executable, and will be automatically loaded. 22 | 23 | Lua scripts use the [ImGui lua bindings](https://github.com/patrickriordan/imgui_lua_bindings). 24 | 25 | Scripts should define a global `TOOL_NAME` variable. This will be used by the overlay to provide an entry for the tool in the top-screen menubar, as well as system tray icon's context menu. 26 | 27 | Scripts should also set a global `TOOL_ENABLED` variable according to what `imgui.Begin()` returns as its second parameter, e.g.: 28 | 29 | ```lua 30 | shouldDraw, TOOL_ENABLED = imgui.Begin("Example", TOOL_ENABLED) 31 | ``` 32 | 33 | A user-provided scale factor can be accessed through the `IMGUI_SCALE` global variable. This should be used to properly scale child windows and other elements. 34 | 35 | ### Example 36 | 37 | An example lua script can be found [here](examples/example.lua). 38 | 39 | ## C++ plugins 40 | 41 | Plugins can be added to the `plugins` directory, next to the executable, and will be automatically loaded. 42 | 43 | Plugins should link with the `ImGui` version provided in `examples/newPlugin` to ensure ABI compatibility (as the internal `ImGui` data structures may change between versions). 44 | 45 | Plugins should include the [framework.hpp](examples/newPlugin/framework.hpp) file provided in `examples/newPlugin`. For those who care, this defines some trampoline functions which take care of getting the `GImGui` context from the main executable's address space and setting up a `PLUGIN_ENABLED` variable, used to identify the state of the tool for the system tray context menu and the top-screen menubar. 46 | 47 | Plugins simply have to define a `const char * getName()` function and a `void imguiFunction()` function. 48 | 49 | A user-provided scale factor can be accessed through the `g_scale` global variable. This should be used to properly scale child windows and other elements. 50 | 51 | ### Example 52 | 53 | An example plugin can be found [here](examples/newPlugin/NewPlugin.cpp). 54 | 55 | ## Kengine plugins 56 | 57 | As the overlay uses the [Kengine](https://github.com/phisko/kengine), it can load plugins which provide systems for the engine (which may do anything you want them to, and access each other's entities and components to share data between systems). 58 | 59 | These plugins can be added to the `plugins` directory, next to the executable, and will be automatically loaded. 60 | 61 | Plugins should link with the `kengine` version used to compile the overlay's main executable to ensure ABI compatibility (as the internal `kengine` data structures may change between versions). 62 | 63 | Plugins simply have to define a `void loadKenginePlugin(kengine::EntityManager & em)` function that creates a `kengine::Entity` and attaches whatever behavior the plugin needs. 64 | 65 | A user-provided scale factor can be accessed through the `GetImGuiScale` function component. This should be used to properly scale child windows and other elements. 66 | 67 | ### Example 68 | 69 | An example system can be found [here](examples/newSystem/NewSystem.cpp). 70 | -------------------------------------------------------------------------------- /examples/newPlugin/imgui/backends/imgui_impl_glfw.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for GLFW 2 | // This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan, WebGPU..) 3 | // (Info: GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.) 4 | // (Requires: GLFW 3.1+. Prefer GLFW 3.3+ for full feature support.) 5 | 6 | // Implemented features: 7 | // [X] Platform: Clipboard support. 8 | // [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 GLFW_KEY_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 9 | // [X] Platform: Gamepad support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 10 | // [x] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange' (note: the resizing cursors requires GLFW 3.4+). 11 | // [X] Platform: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 12 | 13 | // Issues: 14 | // [ ] Platform: Multi-viewport support: ParentViewportID not honored, and so io.ConfigViewportsNoDefaultParent has no effect (minor). 15 | 16 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 17 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 18 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 19 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 20 | 21 | // About GLSL version: 22 | // The 'glsl_version' initialization parameter defaults to "#version 150" if NULL. 23 | // Only override if your GL version doesn't handle this GLSL version. Keep NULL if unsure! 24 | 25 | #pragma once 26 | #include "imgui.h" // IMGUI_IMPL_API 27 | 28 | struct GLFWwindow; 29 | struct GLFWmonitor; 30 | 31 | IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window, bool install_callbacks); 32 | IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window, bool install_callbacks); 33 | IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOther(GLFWwindow* window, bool install_callbacks); 34 | IMGUI_IMPL_API void ImGui_ImplGlfw_Shutdown(); 35 | IMGUI_IMPL_API void ImGui_ImplGlfw_NewFrame(); 36 | 37 | // GLFW callbacks (installer) 38 | // - When calling Init with 'install_callbacks=true': ImGui_ImplGlfw_InstallCallbacks() is called. GLFW callbacks will be installed for you. They will chain-call user's previously installed callbacks, if any. 39 | // - When calling Init with 'install_callbacks=false': GLFW callbacks won't be installed. You will need to call individual function yourself from your own GLFW callbacks. 40 | IMGUI_IMPL_API void ImGui_ImplGlfw_InstallCallbacks(GLFWwindow* window); 41 | IMGUI_IMPL_API void ImGui_ImplGlfw_RestoreCallbacks(GLFWwindow* window); 42 | 43 | // GLFW callbacks (individual callbacks to call if you didn't install callbacks) 44 | IMGUI_IMPL_API void ImGui_ImplGlfw_WindowFocusCallback(GLFWwindow* window, int focused); // Since 1.84 45 | IMGUI_IMPL_API void ImGui_ImplGlfw_CursorEnterCallback(GLFWwindow* window, int entered); // Since 1.84 46 | IMGUI_IMPL_API void ImGui_ImplGlfw_CursorPosCallback(GLFWwindow* window, double x, double y); // Since 1.87 47 | IMGUI_IMPL_API void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods); 48 | IMGUI_IMPL_API void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset); 49 | IMGUI_IMPL_API void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods); 50 | IMGUI_IMPL_API void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c); 51 | IMGUI_IMPL_API void ImGui_ImplGlfw_MonitorCallback(GLFWmonitor* monitor, int event); 52 | -------------------------------------------------------------------------------- /src/ImGuiLuaSystem.cpp: -------------------------------------------------------------------------------- 1 | #include "ImGuiLuaSystem.hpp" 2 | #include "kengine.hpp" 3 | 4 | // kengine data 5 | #include "data/CommandLineComponent.hpp" 6 | #include "data/ImGuiScaleComponent.hpp" 7 | #include "data/ImGuiToolComponent.hpp" 8 | #include "data/LuaStateComponent.hpp" 9 | #include "data/NameComponent.hpp" 10 | 11 | // kengine functions 12 | #include "functions/Execute.hpp" 13 | 14 | // kengine helpers 15 | #include "helpers/commandLineHelper.hpp" 16 | 17 | // putils 18 | #include "Directory.hpp" 19 | 20 | namespace { 21 | struct Options { 22 | bool printLuaFunctions = false; 23 | }; 24 | } 25 | 26 | #define refltype Options 27 | putils_reflection_info{ 28 | putils_reflection_custom_class_name(ImGui Lua); 29 | putils_reflection_attributes( 30 | putils_reflection_attribute(printLuaFunctions, 31 | putils_reflection_metadata("help", "Print a list of all ImGui functions exposed to Lua") 32 | ) 33 | ); 34 | }; 35 | #undef refltype 36 | 37 | extern void LoadImguiBindings(); 38 | extern lua_State * lState; 39 | 40 | namespace { 41 | struct impl { 42 | static inline sol::state * g_state = nullptr; 43 | 44 | static void init(kengine::Entity &system) noexcept { 45 | initBindings(); 46 | system += kengine::functions::Execute{[&](float deltaTime) noexcept { 47 | runScripts(); 48 | }}; 49 | } 50 | 51 | static void initBindings() noexcept { 52 | const auto options = kengine::parseCommandLine(); 53 | 54 | for (const auto &[e, state]: kengine::entities.with()) { 55 | lState = *state.state; 56 | LoadImguiBindings(); 57 | g_state = state.state; 58 | if (options.printLuaFunctions) 59 | g_state->script( 60 | R"( 61 | print("ImGui Lua bindings:") 62 | for k, v in pairs(imgui) do 63 | print("\t", k) 64 | end 65 | )"); 66 | } 67 | } 68 | 69 | static void runScripts() noexcept { 70 | (*g_state)["IMGUI_SCALE"] = getScale(); 71 | 72 | putils::Directory d("scripts"); 73 | 74 | d.for_each([&](const putils::Directory::File &f) { 75 | const auto view = std::string_view(f.name); 76 | const auto dot = view.find_last_of('.'); 77 | if (!f.isDirectory && dot != std::string_view::npos && view.substr(dot) == ".lua") 78 | runScript(f.fullPath.c_str()); 79 | }); 80 | } 81 | 82 | static float getScale() noexcept { 83 | float scale = 1.f; 84 | for (const auto &[e, comp]: kengine::entities.with()) 85 | scale *= comp.scale; 86 | return scale; 87 | } 88 | 89 | static void runScript(const char *script) noexcept { 90 | auto e = getEntityForScript(script); 91 | auto &tool = e.get(); 92 | 93 | if (!tool.enabled) 94 | return; 95 | 96 | (*g_state)["TOOL_ENABLED"] = tool.enabled; 97 | try { 98 | g_state->script_file(script); 99 | } 100 | catch (const std::exception &e) { 101 | std::cerr << e.what() << std::endl; 102 | } 103 | tool.enabled = (*g_state)["TOOL_ENABLED"]; 104 | } 105 | 106 | static kengine::Entity getEntityForScript(const char *script) noexcept { 107 | static std::unordered_map ids; 108 | 109 | const auto it = ids.find(script); 110 | if (it != ids.end()) 111 | return kengine::entities[it->second]; 112 | 113 | return kengine::entities.create([&](kengine::Entity &e) { 114 | ids[script] = e.id; 115 | try { 116 | g_state->script_file(script); 117 | } 118 | catch (const std::exception &e) { 119 | std::cerr << e.what() << std::endl; 120 | } 121 | e += kengine::ImGuiToolComponent{(*g_state)["TOOL_ENABLED"]}; 122 | const std::string name = (*g_state)["TOOL_NAME"]; 123 | e += kengine::NameComponent{name}; 124 | }); 125 | } 126 | }; 127 | } 128 | 129 | kengine::EntityCreator * ImGuiLuaSystem() noexcept { 130 | return impl::init; 131 | } -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.21) 2 | project(koverlay HOMEPAGE_URL "https://github.com/phisko/koverlay") 3 | 4 | set(CMAKE_CXX_STANDARD 20) 5 | if (MSVC) 6 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /std:c++20 /DNOMINMAX /MP8") 7 | elseif(UNIX) 8 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") 9 | endif() 10 | 11 | # 12 | # Executable 13 | # 14 | 15 | set(exe_name koverlay) 16 | 17 | file(GLOB exeFiles 18 | src/*.cpp src/*.hpp 19 | src/types/*.cpp src/types/*.hpp) 20 | 21 | add_executable(${exe_name} ${exeFiles} appicon.rc) 22 | target_include_directories(${exe_name} PRIVATE src) 23 | 24 | # set plugin dir 25 | set(runtime_dir $) 26 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${runtime_dir}/plugins) 27 | 28 | # copy koala.ico 29 | add_custom_command(TARGET koverlay POST_BUILD COMMAND ${CMAKE_COMMAND} -E 30 | make_directory ${runtime_dir}/resources) 31 | add_custom_command(TARGET koverlay POST_BUILD COMMAND ${CMAKE_COMMAND} -E 32 | copy 33 | ${CMAKE_CURRENT_SOURCE_DIR}/koala.ico 34 | ${runtime_dir}/resources) 35 | 36 | # copy example.lua 37 | add_custom_command(TARGET koverlay POST_BUILD COMMAND ${CMAKE_COMMAND} -E 38 | make_directory ${runtime_dir}/scripts) 39 | add_custom_command(TARGET koverlay POST_BUILD COMMAND ${CMAKE_COMMAND} -E 40 | copy ${CMAKE_CURRENT_SOURCE_DIR}/examples/example.lua ${runtime_dir}/scripts) 41 | 42 | # 43 | # API 44 | # 45 | 46 | add_library(api INTERFACE) 47 | target_include_directories(api INTERFACE common) 48 | target_link_libraries(${exe_name} api) 49 | 50 | # 51 | # Kengine 52 | # 53 | 54 | set(KENGINE_NO_TYPE_REGISTRATION TRUE) 55 | 56 | # rendering 57 | set(KENGINE_GLFW TRUE) 58 | set(KENGINE_OPENGL TRUE) 59 | set(KENGINE_OPENGL_NO_DEBUG_TOOLS TRUE) 60 | set(KENGINE_OPENGL_NO_DEFAULT_SHADERS TRUE) 61 | 62 | # log 63 | set(KENGINE_LOG_FILE TRUE) 64 | set(KENGINE_LOG_IMGUI TRUE) 65 | set(KENGINE_LOG_STDOUT TRUE) 66 | set(KENGINE_LOG_VISUAL_STUDIO TRUE) 67 | 68 | # imgui 69 | set(KENGINE_IMGUI_ADJUSTABLE TRUE) 70 | set(KENGINE_IMGUI_PROMPT TRUE) 71 | set(KENGINE_IMGUI_TOOL TRUE) 72 | 73 | # scripting 74 | set(KENGINE_LUA TRUE) 75 | set(KENGINE_PYTHON TRUE) 76 | 77 | # Unused 78 | # set(KENGINE_ASSIMP TRUE) 79 | # set(KENGINE_BULLET TRUE) 80 | # set(KENGINE_COLLISION TRUE) 81 | # set(KENGINE_IMGUI_ENGINE_STATS TRUE) 82 | # set(KENGINE_IMGUI_ENTITY_EDITOR TRUE) 83 | # set(KENGINE_IMGUI_ENTITY_SELECTOR TRUE) 84 | # set(KENGINE_INPUT TRUE) 85 | # set(KENGINE_KINEMATIC TRUE) 86 | # set(KENGINE_MODEL_CREATOR TRUE) 87 | # set(KENGINE_ONCLICK TRUE) 88 | # set(KENGINE_OPENGL_SPRITES TRUE) 89 | # set(KENGINE_POLYVOX TRUE) 90 | # set(KENGINE_RECAST TRUE) 91 | # set(KENGINE_SFML TRUE) 92 | 93 | add_subdirectory(kengine) 94 | target_link_libraries(${exe_name} kengine) 95 | 96 | # 97 | # Plugins 98 | # 99 | 100 | add_subdirectory(plugins) 101 | 102 | # examples 103 | 104 | file(GLOB children examples/*) 105 | foreach(child ${children}) 106 | if(IS_DIRECTORY ${child}) 107 | add_subdirectory(${child}) 108 | endif() 109 | endforeach() 110 | 111 | # 112 | # Installer 113 | # 114 | 115 | install(IMPORTED_RUNTIME_ARTIFACTS ${exe_name} FRAMEWORK 116 | COMPONENT core) 117 | install(FILES koala.ico 118 | DESTINATION bin/resources 119 | COMPONENT core) 120 | install(TARGETS controller 121 | DESTINATION bin/plugins 122 | COMPONENT core) 123 | 124 | install(DIRECTORY examples 125 | DESTINATION . 126 | COMPONENT examples) 127 | install(FILES examples/example.lua 128 | DESTINATION bin/scripts 129 | COMPONENT examples) 130 | 131 | install(TARGETS kengine 132 | DESTINATION sources/lib 133 | COMPONENT sources) 134 | install(TARGETS putils_imgui 135 | DESTINATION sources/lib 136 | COMPONENT sources) 137 | install(DIRECTORY common 138 | DESTINATION sources 139 | COMPONENT sources) 140 | install(DIRECTORY kengine 141 | DESTINATION sources 142 | COMPONENT sources) 143 | 144 | include(InstallRequiredSystemLibraries) 145 | 146 | set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Koala Overlay: a framework for ImGui tools") 147 | set(CPACK_PACKAGE_VENDOR "Nicolas Phister") 148 | set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md") 149 | set(CPACK_PACKAGE_VERSION_MAJOR "1") 150 | set(CPACK_PACKAGE_VERSION_MINOR "0") 151 | set(CPACK_PACKAGE_VERSION_PATCH "0") 152 | SET(CPACK_NSIS_INSTALLED_ICON_NAME ${exe_name}) 153 | set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\koala.ico") 154 | set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\koala.ico") 155 | set(CPACK_NSIS_HELP_LINK ${CMAKE_PROJECT_HOMEPAGE_URL}) 156 | set(CPACK_NSIS_URL_INFO_ABOUT ${CMAKE_PROJECT_HOMEPAGE_URL}) 157 | set(CPACK_NSIS_MODIFY_PATH ON) 158 | set(CPACK_PACKAGE_EXECUTABLES ${exe_name} ${exe_name}) 159 | 160 | include(CPack) 161 | cpack_add_component(core REQUIRED 162 | DESCRIPTION "The core executable required for the framework") 163 | cpack_add_component(examples 164 | DESCRIPTION "Sample Lua script and sources for a plugin and kengine system") 165 | cpack_add_component(sources 166 | DESCRIPTION "The source code required to build new plugins and systems") 167 | --------------------------------------------------------------------------------