Skip to content

Commit

Permalink
Update the API to follow cImGui v1.53.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lenormf authored and Stephan Dilly committed Mar 13, 2018
1 parent 9b35b51 commit 7ac970e
Show file tree
Hide file tree
Showing 6 changed files with 367 additions and 204 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ Dynamic bindings to the [cimgui](https://github.com/Extrawurst/cimgui) library (
![screenshot](https://raw.github.com/extrawurst/DerelictImgui/master/Screen%20Shot%202015-04-09.png)

Notes:
* (c)imgui version 1.50
* (c)imgui version 1.53.1
* See imgui_d_test for a usage example using D: https://github.com/Extrawurst/imgui_d_test
* See official examples in imgui project for reference: https://github.com/ocornut/imgui/tree/master/examples
16 changes: 8 additions & 8 deletions examples/imgui_demo/source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import imgui_demo;

GLFWwindow* window;
float[3] clear_color = [0.3f, 0.4f, 0.8f];
bool showDTestWindow;
bool showOrgTestWindow;
bool showDDemoWindow;
bool showOrgDemoWindow;

void main(string[] argv) {

Expand All @@ -33,15 +33,15 @@ void main(string[] argv) {
igImplGlfwGL3_NewFrame();

// contents
if(igButton("RUN imgui_demo (D-lang version)")) showDTestWindow = !showDTestWindow;
if(igButton("RUN imgui_demo (C++ version)")) showOrgTestWindow = !showOrgTestWindow;
if(showDTestWindow) {
if(igButton("RUN imgui_demo (D-lang version)")) showDDemoWindow = !showDDemoWindow;
if(igButton("RUN imgui_demo (C++ version)")) showOrgDemoWindow = !showOrgDemoWindow;
if(showDDemoWindow) {
igSetNextWindowPos(ImVec2(660, 30), ImGuiCond_FirstUseEver);
imgui_demo.igShowTestWindow(&showDTestWindow);
imgui_demo.igShowDemoWindow(&showDDemoWindow);
}
if(showOrgTestWindow) {
if(showOrgDemoWindow) {
igSetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver);
derelict.imgui.imgui.igShowTestWindow(&showOrgTestWindow);
derelict.imgui.imgui.igShowDemoWindow(&showOrgDemoWindow);
}

// Rendering
Expand Down
Loading

0 comments on commit 7ac970e

Please sign in to comment.