{"id":13731994,"url":"https://github.com/pgruenbacher/bsfImgui","last_synced_at":"2025-05-08T06:31:05.606Z","repository":{"id":83137503,"uuid":"195561127","full_name":"pgruenbacher/bsfImgui","owner":"pgruenbacher","description":"bsf imgui plugin","archived":false,"fork":false,"pushed_at":"2019-07-17T17:59:29.000Z","size":62,"stargazers_count":13,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-04T02:10:43.284Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pgruenbacher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-07-06T16:35:17.000Z","updated_at":"2022-07-08T10:26:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"513955c8-bcf1-48c0-85be-976d0095c65a","html_url":"https://github.com/pgruenbacher/bsfImgui","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgruenbacher%2FbsfImgui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgruenbacher%2FbsfImgui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgruenbacher%2FbsfImgui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgruenbacher%2FbsfImgui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgruenbacher","download_url":"https://codeload.github.com/pgruenbacher/bsfImgui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224707583,"owners_count":17356361,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:43.288Z","updated_at":"2024-11-14T23:30:46.463Z","avatar_url":"https://github.com/pgruenbacher.png","language":"C++","funding_links":[],"categories":["Graphics"],"sub_categories":[],"readme":"\n# Bsf Dear-Imgui Plugin\n\nA submodule plugin of the bsf library. It's meant to be built as a cmake\ndependency of bsf. It is meant for fast prototyping of editor features and\ngamedev tools. It is not meant to be used as an in-game UI or as a replacement\nfor the bsf gui library. While imgui has low overhead and a simple api, it's\nnot meant for more complex guis. Need to have a custom scene editor? Yes use\nimgui. Need to render out a 3d interface for your spaceship cockpit? Don't use\nimgui. More thoughts can be found on this\n[gist](https://gist.github.com/bkaradzic/853fd21a15542e0ec96f7268150f1b62).\n\n# Features\n\n* Implements [dear-imgui](https://github.com/ocornut/imgui/) library for fast dev prototyping\n* Integrates with [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo)\n  library for 3d gizmo editing of bsf scene objects.\n* Renders on core thread while the imgui interface can be built on the\n  simulation thread\n\n![bsfImguiScreenshot](bsfImgui.png)\n\n# Usage\n\nUsage is simple, just select the plugin as part of the bsf cmake options. The\nplugin can be manually loaded as a dynamic plugin. \n\n```  \nDynLib* imguiPlugin = nullptr;\nApplication::instance().loadPlugin(\"bsfImgui\", \u0026imguiPlugin);\nApplication::instance().runMainLoop();\nApplication::instance().unloadPlugin(imguiPlugin);\n```\n\nSee BsImgui_test.cpp file for example of how imgui can be drawn as part of the\nmain thread components.\n\n```\n#include \"imgui.h\"\n#include \"BsImgui.h\"\n#include \"BsImGuizmo.h\"\nclass DemoUI : public Component {\npublic:\n\tDemoUI(const HSceneObject\u0026 parent)\n\t\t: Component(parent)\n\t{\n\t\tsetFlag(ComponentFlag::AlwaysRun, true);\n\t\tsetName(\"DemoUI\");\n\t}\n\n\tvoid update() override {\n\t\tComponent::update();\n\t\tdemoImguiUI();\n\t}\n};\n\nclass DemoEditTransform : public Component {\n\t// keep a modifiable reference to the scene object.\n\tHSceneObject mParent;\npublic:\n\tDemoEditTransform(HSceneObject parent)\n\t\t: Component(parent), mParent(parent)\n\t{\n\t\tsetFlag(ComponentFlag::AlwaysRun, true);\n\t\tsetName(\"DemoEditTransform\");\n\t}\n\n\tvoid update() override {\n\t\tComponent::update();\n\t\tTransform transform = mParent-\u003egetLocalTransform();\n\n    ImGui::Begin(\"Transform example\");    \n\t\t\tEditTransform(transform, gSceneManager().getMainCamera());\n\t\tImGui::End();\n\t\tManipulateTransform(transform, gSceneManager().getMainCamera());\n\t\tauto\u0026 so = SO();\n\t\tso-\u003esetLocalTransform(transform);\n\t}\t\n};\n```\n\n# TODO\n\n* try out imgui docking branch demo\n* add useful widgets and bsf utilities to the repository as the plugin is\n  adopted and used.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgruenbacher%2FbsfImgui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgruenbacher%2FbsfImgui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgruenbacher%2FbsfImgui/lists"}