{"id":20230225,"url":"https://github.com/enkisoftware/rccpp-dearimgui-glfw-example","last_synced_at":"2025-04-10T17:52:00.380Z","repository":{"id":95098766,"uuid":"239165806","full_name":"enkisoftware/RCCpp-DearImGui-GLFW-example","owner":"enkisoftware","description":"Add Runtime Compiled C++ to the Dear ImGui example using the GLFW and OpenGL backend - with power saving","archived":false,"fork":false,"pushed_at":"2024-05-28T15:49:03.000Z","size":26,"stargazers_count":87,"open_issues_count":1,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-06T00:37:03.947Z","etag":null,"topics":["c-plus-plus","cmake","compile","cpp","dear-imgui","energy-efficiency","gamedev","glfw","imgui","linux","live-coding","macos","opengl","rccpp","runtimecompiledcplusplus","unix","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enkisoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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,"publiccode":null,"codemeta":null},"funding":{"github":"dougbinks","patreon":"enkisoftware","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://www.enkisoftware.com/avoyd"}},"created_at":"2020-02-08T16:38:43.000Z","updated_at":"2025-04-01T13:07:40.000Z","dependencies_parsed_at":"2024-11-14T07:44:07.115Z","dependency_job_id":"474d3d40-c773-4744-8c2b-869498bcb204","html_url":"https://github.com/enkisoftware/RCCpp-DearImGui-GLFW-example","commit_stats":null,"previous_names":["enkisoftware/rccpp-dearimgui-glfw-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enkisoftware%2FRCCpp-DearImGui-GLFW-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enkisoftware%2FRCCpp-DearImGui-GLFW-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enkisoftware%2FRCCpp-DearImGui-GLFW-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enkisoftware%2FRCCpp-DearImGui-GLFW-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enkisoftware","download_url":"https://codeload.github.com/enkisoftware/RCCpp-DearImGui-GLFW-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248262433,"owners_count":21074308,"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":["c-plus-plus","cmake","compile","cpp","dear-imgui","energy-efficiency","gamedev","glfw","imgui","linux","live-coding","macos","opengl","rccpp","runtimecompiledcplusplus","unix","windows"],"created_at":"2024-11-14T07:40:20.972Z","updated_at":"2025-04-10T17:52:00.373Z","avatar_url":"https://github.com/enkisoftware.png","language":"C++","funding_links":["https://github.com/sponsors/dougbinks","https://patreon.com/enkisoftware","https://www.enkisoftware.com/avoyd","https://www.patreon.com/enkisoftware"],"categories":[],"sub_categories":[],"readme":"Support our work through [GitHub Sponsors](https://github.com/sponsors/dougbinks) or [Patreon](https://www.patreon.com/enkisoftware)\n\n[\u003cimg src=\"https://img.shields.io/static/v1?logo=github\u0026label=Github\u0026message=Sponsor\u0026color=#ea4aaa\" width=\"200\"/\u003e](https://github.com/sponsors/dougbinks)    [\u003cimg src=\"https://c5.patreon.com/external/logo/become_a_patron_button@2x.png\" alt=\"Become a Patron\" width=\"150\"/\u003e](https://www.patreon.com/enkisoftware)\n\n\n# RCC++ Dear ImGui GLFW example with Power Saving\n\nThis project adds Runtime Compiled C++ to the Dear ImGui example using the GLFW and OpenGL backend. This enables us to edit the code at runtime and see the results live, without recompiling and restarting the project. \n\nThis is a cross platform project using CMake.\n\nRuntime-Compiled C++ (RCC++) is a way to reliably make major changes to C++ code at runtime and see the results immediately. It's aimed at games development but could be useful in any industry where turnaround times are a bottleneck.\n\n[github.com/RuntimeCompiledCPlusPlus/RuntimeCompiledCPlusPlus](https://github.com/RuntimeCompiledCPlusPlus/RuntimeCompiledCPlusPlus)\n\nRCC++ is primarily designed to shorten iteration times in development - developers can build their project, run it, make changes during runtime and see the results in a few seconds.\n\n![Short teaser of Runtime Compiled C++ Dear ImGui example running on Linux](https://github.com/juliettef/Media/blob/main/RCCpp-DearImGui-example.gif)\n\nNote - you can also find a similar Windows-only example in the devlog post [Runtime Compiled C++ Dear ImGui and DirectX11 Tutorial](https://www.enkisoftware.com/devlogpost-20200202-1-Runtime-Compiled-C++-Dear-ImGui-and-DirectX11-Tutorial).\n\n## Power Saving\n\nTo reduce the energy used by Dear Imgui, the application draws the user interface only when there is user input. \n\n[Example power saving code in commit](https://github.com/juliettef/RCCpp-DearImGui-GLFW-example/commit/19a0d59551331f1d5d2e6ec6a077f92257af4354)\n\nThe implementation consists in switching the event handling from polling to waiting for events. A power save variable counts a predefined number of frames after the last input has been received. When the countdown ends the application waits for further events, therefore saving power. If input is received the countdown is reset. This allows the GUI to display input changes and for immediate mode states to propagate.\n\nThough not shown in the example, any graphical application can also track when updates are in progress and temporarily disable power saving (for example by resetting the power save countdown). The example sets the swap interval to 1; if the application sets the swap interval to 0 (for example for low latency gaming), another power saving feature would be to set this to 1 when the user is interacting with the GUI.\n\n## Getting the code\n\nThe easiest way to get hold of the starter code is to run the following command using a shell you can run git from:\n\n```\ngit clone --recursive https://github.com/juliettef/RCCpp-DearImGui-GLFW-example\n```\n\nIf you are on Windows you can download git from [git-scm.com/download/win](https://git-scm.com/download/win) and use the right click menu in Windows File Explorer to \"Git Bash here\" and then run git commands.\n\nThis will create the directory _RCCpp-DearImGui-GLFW-example_ and get the latest source code, using the ```--recursive``` option to download the RuntimeCompiledCPlusPlus, Dear ImGui and GLFW code, which have been included in the tutorial repository as submodules. If you want to run further git commands from the command line you'll need to cd into the directory:\n\n```\ncd RCCpp-DearImGui-GLFW-example\n```\n\nAlternatively you can use a git GUI program such as [Fork](https://git-fork.com/) to get the code. Most of these will automatically download the git submodules.\n\nIf you download the code from GitHub via the \"Download ZIP\" approach, you'll also need to download the RuntimeCompiledCPlusPlus, Dear ImGui and GLFW into the _RuntimeCompiledCPlusPlus_, _imgui_ and _glfw_ directories. The correct version can be found by clicking on the _RuntimeCompiledCPlusPlus_, _imgui_ and _glfw_ folders you see on the [front page of the _RCCpp-DearImGui-GLFW-example_ GitHub repository](https://github.com/juliettef/RCCpp-DearImGui-GLFW-example).\n\n## Using CMake to create the project\n\nFrom a command prompt in the `RCCpp-DearImGui-GLFW-example` directory:\n1. `mkdir build`\n1. `cd build`\n1. `cmake ..`\n1. Either run `make all` or for Visual Studio open `RCCpp-DearImGui-GLFW-example.sln`\n    \nThe _RCCpp-DearImGui-GLFW-example_ Window should open.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenkisoftware%2Frccpp-dearimgui-glfw-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenkisoftware%2Frccpp-dearimgui-glfw-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenkisoftware%2Frccpp-dearimgui-glfw-example/lists"}