Merge pull request #1594 from gerryhernandez/fix-apple-example
Examples: Apple: Fix iOS code; fixes entire XCode build for Apple example
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5761abc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.o
diff --git a/examples/apple_example/imguiex-ios/debug_hud.cpp b/examples/apple_example/imguiex-ios/debug_hud.cpp
index 002d6ba..28722b5 100644
--- a/examples/apple_example/imguiex-ios/debug_hud.cpp
+++ b/examples/apple_example/imguiex-ios/debug_hud.cpp
@@ -22,6 +22,11 @@
hud->cubeColor2[1] = 0.4f;
hud->cubeColor2[2] = 0.4f;
hud->cubeColor2[3] = 1.0f;
+
+ hud->clearColor[0] = 0.45f;
+ hud->clearColor[1] = 0.55f;
+ hud->clearColor[2] = 0.60f;
+ hud->clearColor[3] = 1.00f;
}
void DebugHUD_DoInterface(DebugHUD *hud)
@@ -33,7 +38,7 @@
static int counter = 0;
ImGui::Text("Hello, world!"); // Display some text (you can use a format string too)
ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
- ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
+ ImGui::ColorEdit3("clear color", hud->clearColor); // Edit 3 floats representing a color
ImGui::Checkbox("Demo Window", &hud->show_demo_window); // Edit bools storing our windows open/close state
ImGui::Checkbox("Another Window", &hud->show_another_window);
@@ -49,7 +54,7 @@
// 2. Show another simple window. In most cases you will use an explicit Begin/End pair to name your windows.
if (hud->show_another_window)
{
- ImGui::Begin("Another Window", &hud-?show_another_window);
+ ImGui::Begin("Another Window", &hud->show_another_window);
ImGui::Text("Hello from another window!");
ImGui::ColorEdit3("Cube 1 Color", hud->cubeColor1);
ImGui::ColorEdit3("Cube 2 Color", hud->cubeColor2);
diff --git a/examples/apple_example/imguiex-ios/debug_hud.h b/examples/apple_example/imguiex-ios/debug_hud.h
index 89b79a4..4ef5357 100644
--- a/examples/apple_example/imguiex-ios/debug_hud.h
+++ b/examples/apple_example/imguiex-ios/debug_hud.h
@@ -11,6 +11,7 @@
float rotation_speed;
float cubeColor1[4];
float cubeColor2[4];
+ float clearColor[4];
} DebugHUD;
#if __cplusplus