forked from pthom/imgui_bundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
430 additions
and
12 deletions.
There are no files selected for viewing
70 changes: 70 additions & 0 deletions
70
bindings/imgui_bundle/demos_cpp/sandbox/sandbox_immapp_manual_render.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#include "immapp/immapp.h" | ||
#include "imgui_md_wrapper/imgui_md_wrapper.h" | ||
#include "hello_imgui/hello_imgui.h" | ||
#include "imgui.h" | ||
|
||
|
||
void Gui() | ||
{ | ||
ImGuiMd::RenderUnindented(R"( | ||
# Sandbox | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit | ||
)"); | ||
if (ImGui::Button("Save")) | ||
{ | ||
// Save something | ||
} | ||
ImGui::SameLine(); | ||
if (ImGui::Button("Load")) | ||
{ | ||
// Load something | ||
} | ||
} | ||
|
||
int main(int, char **) | ||
{ | ||
|
||
//ImmApp::Run(runnerParams, addonsParams); | ||
|
||
{ | ||
HelloImGui::RunnerParams runnerParams; | ||
runnerParams.callbacks.ShowGui = Gui; | ||
ImmApp::AddOnsParams addonsParams; | ||
addonsParams.withMarkdown = true; | ||
|
||
ImmApp::ManualRender::SetupFromRunnerParams(runnerParams, addonsParams); | ||
while(!HelloImGui::GetRunnerParams()->appShallExit) | ||
ImmApp::ManualRender::Render(); | ||
ImmApp::ManualRender::TearDown(); | ||
} | ||
|
||
{ | ||
ImmApp::ManualRender::SetupFromGuiFunction( | ||
Gui, | ||
"Sandbox", // windowTitle | ||
false, // windowSizeAuto | ||
false, // windowRestorePreviousGeometry | ||
ImmApp::DefaultWindowSize, // windowSize | ||
10.f, // fpsIdle | ||
false, // withImplot | ||
true, // withMarkdown | ||
false // withNodeEditor | ||
); | ||
while(!HelloImGui::GetRunnerParams()->appShallExit) | ||
ImmApp::ManualRender::Render(); | ||
ImmApp::ManualRender::TearDown(); | ||
} | ||
|
||
{ | ||
HelloImGui::SimpleRunnerParams runnerParams; | ||
runnerParams.guiFunction = Gui; | ||
ImmApp::AddOnsParams addonsParams; | ||
addonsParams.withMarkdown = true; | ||
ImmApp::ManualRender::SetupFromSimpleRunnerParams(runnerParams, addonsParams); | ||
while(!HelloImGui::GetRunnerParams()->appShallExit) | ||
ImmApp::ManualRender::Render(); | ||
ImmApp::ManualRender::TearDown(); | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
bindings/imgui_bundle/demos_python/sandbox/sandbox_immapp_manual_render.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from imgui_bundle import immapp, hello_imgui, imgui_md, imgui | ||
|
||
|
||
def gui(): | ||
imgui_md.render_unindented(""" | ||
# Sandbox | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit | ||
""") | ||
if imgui.button("Save"): | ||
# Save something | ||
pass | ||
imgui.same_line() | ||
if imgui.button("Load"): | ||
# Load something | ||
pass | ||
|
||
|
||
def main(): | ||
immapp.manual_render.setup_from_gui_function(gui) | ||
while not hello_imgui.get_runner_params().app_shall_exit: | ||
immapp.manual_render.render() | ||
immapp.manual_render.tear_down() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
main() | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.