From d25578efd8d9d4115b0ea8ffadaea61317eaa84e Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 3 Apr 2015 12:11:41 +0100 Subject: [PATCH] Examples: initializing float + missing comment. --- examples/directx11_example/main.cpp | 3 ++- examples/directx9_example/main.cpp | 3 ++- examples/opengl3_example/main.cpp | 2 +- examples/opengl_example/main.cpp | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/directx11_example/main.cpp b/examples/directx11_example/main.cpp index 80e20fb9..5e70a482 100644 --- a/examples/directx11_example/main.cpp +++ b/examples/directx11_example/main.cpp @@ -149,6 +149,7 @@ int main(int, char**) // Setup ImGui binding ImGui_ImplDX11_Init(hwnd, g_pd3dDevice, g_pd3dDeviceContext); + //ImGuiIO& io = ImGui::GetIO(); //ImFont* my_font0 = io.Fonts->AddFontDefault(); //ImFont* my_font1 = io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f); //ImFont* my_font2 = io.Fonts->AddFontFromFileTTF("../../extra_fonts/Karla-Regular.ttf", 16.0f); @@ -176,7 +177,7 @@ int main(int, char**) // 1. Show a simple window // Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug" { - static float f; + static float f = 0.0f; ImGui::Text("Hello, world!"); ImGui::SliderFloat("float", &f, 0.0f, 1.0f); ImGui::ColorEdit3("clear color", (float*)&clear_col); diff --git a/examples/directx9_example/main.cpp b/examples/directx9_example/main.cpp index b564dbc3..98bc4261 100644 --- a/examples/directx9_example/main.cpp +++ b/examples/directx9_example/main.cpp @@ -73,6 +73,7 @@ int main(int, char**) // Setup ImGui binding ImGui_ImplDX9_Init(hwnd, g_pd3dDevice); + //ImGuiIO& io = ImGui::GetIO(); //ImFont* my_font0 = io.Fonts->AddFontDefault(); //ImFont* my_font1 = io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f); //ImFont* my_font2 = io.Fonts->AddFontFromFileTTF("../../extra_fonts/Karla-Regular.ttf", 16.0f); @@ -103,7 +104,7 @@ int main(int, char**) // 1. Show a simple window // Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug" { - static float f; + static float f = 0.0f; ImGui::Text("Hello, world!"); ImGui::SliderFloat("float", &f, 0.0f, 1.0f); ImGui::ColorEdit3("clear color", (float*)&clear_col); diff --git a/examples/opengl3_example/main.cpp b/examples/opengl3_example/main.cpp index 0e718741..effadff4 100644 --- a/examples/opengl3_example/main.cpp +++ b/examples/opengl3_example/main.cpp @@ -48,7 +48,7 @@ int main(int, char**) // 1. Show a simple window // Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug" { - static float f; + static float f = 0.0f; ImGui::Text("Hello, world!"); ImGui::SliderFloat("float", &f, 0.0f, 1.0f); ImGui::ColorEdit3("clear color", (float*)&clear_color); diff --git a/examples/opengl_example/main.cpp b/examples/opengl_example/main.cpp index 3ff10fe3..4b68a8c9 100644 --- a/examples/opengl_example/main.cpp +++ b/examples/opengl_example/main.cpp @@ -42,7 +42,7 @@ int main(int, char**) // 1. Show a simple window // Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug" { - static float f; + static float f = 0.0f; ImGui::Text("Hello, world!"); ImGui::SliderFloat("float", &f, 0.0f, 1.0f); ImGui::ColorEdit3("clear color", (float*)&clear_color);