From ae30efc0fd55bf7015818e512db7aad6bf91cc9a Mon Sep 17 00:00:00 2001 From: omar Date: Tue, 6 Feb 2018 19:58:23 +0100 Subject: [PATCH] Nav: Examples: Added commented out io.NavFlags |= ImGuiNavFlags_EnableKeyboard to all examples. (#787) --- examples/allegro5_example/main.cpp | 3 ++- examples/directx10_example/main.cpp | 3 ++- examples/directx11_example/main.cpp | 2 +- examples/directx9_example/main.cpp | 3 ++- examples/marmalade_example/main.cpp | 3 ++- examples/opengl2_example/main.cpp | 3 ++- examples/opengl3_example/main.cpp | 4 ++-- examples/sdl_opengl2_example/main.cpp | 3 ++- examples/vulkan_example/main.cpp | 3 ++- 9 files changed, 17 insertions(+), 10 deletions(-) diff --git a/examples/allegro5_example/main.cpp b/examples/allegro5_example/main.cpp index b740dace..99da7492 100644 --- a/examples/allegro5_example/main.cpp +++ b/examples/allegro5_example/main.cpp @@ -23,7 +23,9 @@ int main(int, char**) al_register_event_source(queue, al_get_mouse_event_source()); // Setup ImGui binding + ImGuiIO& io = ImGui::GetIO(); (void)io; ImGui_ImplA5_Init(display); + //io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls // Setup style ImGui::StyleColorsDark(); @@ -36,7 +38,6 @@ int main(int, char**) // - The fonts will be rasterized at a given size (w/ oversampling) and stored into a texture when calling ImFontAtlas::Build()/GetTexDataAsXXXX(), which ImGui_ImplXXXX_NewFrame below will call. // - Read 'misc/fonts/README.txt' for more instructions and details. // - Remember that in C/C++ if you want to include a backslash \ in a string literal you need to write a double backslash \\ ! - //ImGuiIO& io = ImGui::GetIO(); //io.Fonts->AddFontDefault(); //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Roboto-Medium.ttf", 16.0f); //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf", 15.0f); diff --git a/examples/directx10_example/main.cpp b/examples/directx10_example/main.cpp index aebf81f8..8a3d3f29 100644 --- a/examples/directx10_example/main.cpp +++ b/examples/directx10_example/main.cpp @@ -120,7 +120,9 @@ int main(int, char**) UpdateWindow(hwnd); // Setup ImGui binding + ImGuiIO& io = ImGui::GetIO(); (void)io; ImGui_ImplDX10_Init(hwnd, g_pd3dDevice); + //io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls // Setup style ImGui::StyleColorsDark(); @@ -133,7 +135,6 @@ int main(int, char**) // - The fonts will be rasterized at a given size (w/ oversampling) and stored into a texture when calling ImFontAtlas::Build()/GetTexDataAsXXXX(), which ImGui_ImplXXXX_NewFrame below will call. // - Read 'misc/fonts/README.txt' for more instructions and details. // - Remember that in C/C++ if you want to include a backslash \ in a string literal you need to write a double backslash \\ ! - //ImGuiIO& io = ImGui::GetIO(); //io.Fonts->AddFontDefault(); //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Roboto-Medium.ttf", 16.0f); //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf", 15.0f); diff --git a/examples/directx11_example/main.cpp b/examples/directx11_example/main.cpp index 758ecc2e..48dc53ba 100644 --- a/examples/directx11_example/main.cpp +++ b/examples/directx11_example/main.cpp @@ -125,7 +125,7 @@ int main(int, char**) // Setup ImGui binding ImGuiIO& io = ImGui::GetIO(); (void)io; ImGui_ImplDX11_Init(hwnd, g_pd3dDevice, g_pd3dDeviceContext); - //io.NavFlags |= ImGuiNavFlags_EnableKeyboard; + //io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls // Setup style ImGui::StyleColorsDark(); diff --git a/examples/directx9_example/main.cpp b/examples/directx9_example/main.cpp index f40e5ef4..5b41ef62 100644 --- a/examples/directx9_example/main.cpp +++ b/examples/directx9_example/main.cpp @@ -75,7 +75,9 @@ int main(int, char**) } // Setup ImGui binding + ImGuiIO& io = ImGui::GetIO(); (void)io; ImGui_ImplDX9_Init(hwnd, g_pd3dDevice); + //io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls // Setup style ImGui::StyleColorsDark(); @@ -88,7 +90,6 @@ int main(int, char**) // - The fonts will be rasterized at a given size (w/ oversampling) and stored into a texture when calling ImFontAtlas::Build()/GetTexDataAsXXXX(), which ImGui_ImplXXXX_NewFrame below will call. // - Read 'misc/fonts/README.txt' for more instructions and details. // - Remember that in C/C++ if you want to include a backslash \ in a string literal you need to write a double backslash \\ ! - //ImGuiIO& io = ImGui::GetIO(); //io.Fonts->AddFontDefault(); //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Roboto-Medium.ttf", 16.0f); //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf", 15.0f); diff --git a/examples/marmalade_example/main.cpp b/examples/marmalade_example/main.cpp index 58c2182b..dc1db1b2 100644 --- a/examples/marmalade_example/main.cpp +++ b/examples/marmalade_example/main.cpp @@ -15,7 +15,9 @@ int main(int, char**) { // Setup ImGui binding + ImGuiIO& io = ImGui::GetIO(); (void)io; ImGui_Marmalade_Init(true); + //io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls // Setup style ImGui::StyleColorsDark(); @@ -28,7 +30,6 @@ int main(int, char**) // - The fonts will be rasterized at a given size (w/ oversampling) and stored into a texture when calling ImFontAtlas::Build()/GetTexDataAsXXXX(), which ImGui_ImplXXXX_NewFrame below will call. // - Read 'misc/fonts/README.txt' for more instructions and details. // - Remember that in C/C++ if you want to include a backslash \ in a string literal you need to write a double backslash \\ ! - //ImGuiIO& io = ImGui::GetIO(); //io.Fonts->AddFontDefault(); //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Roboto-Medium.ttf", 16.0f); //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf", 15.0f); diff --git a/examples/opengl2_example/main.cpp b/examples/opengl2_example/main.cpp index 89d41c37..182cc70c 100644 --- a/examples/opengl2_example/main.cpp +++ b/examples/opengl2_example/main.cpp @@ -27,7 +27,9 @@ int main(int, char**) glfwSwapInterval(1); // Enable vsync // Setup ImGui binding + ImGuiIO& io = ImGui::GetIO(); (void)io; ImGui_ImplGlfwGL2_Init(window, true); + //io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls // Setup style ImGui::StyleColorsDark(); @@ -40,7 +42,6 @@ int main(int, char**) // - The fonts will be rasterized at a given size (w/ oversampling) and stored into a texture when calling ImFontAtlas::Build()/GetTexDataAsXXXX(), which ImGui_ImplXXXX_NewFrame below will call. // - Read 'misc/fonts/README.txt' for more instructions and details. // - Remember that in C/C++ if you want to include a backslash \ in a string literal you need to write a double backslash \\ ! - //ImGuiIO& io = ImGui::GetIO(); //io.Fonts->AddFontDefault(); //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Roboto-Medium.ttf", 16.0f); //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf", 15.0f); diff --git a/examples/opengl3_example/main.cpp b/examples/opengl3_example/main.cpp index 59c60fb6..b5a60f7c 100644 --- a/examples/opengl3_example/main.cpp +++ b/examples/opengl3_example/main.cpp @@ -34,8 +34,8 @@ int main(int, char**) // Setup ImGui binding ImGuiIO& io = ImGui::GetIO(); (void)io; ImGui_ImplGlfwGL3_Init(window, true); - //io.NavFlags |= ImGuiNavFlags_EnableKeyboard; - //io.NavFlags |= ImGuiNavFlags_EnableGamepad; + //io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls + //io.NavFlags |= ImGuiNavFlags_EnableGamepad; // Enable Gamepad Controls // Setup style ImGui::StyleColorsDark(); diff --git a/examples/sdl_opengl2_example/main.cpp b/examples/sdl_opengl2_example/main.cpp index becf841a..35d28d9c 100644 --- a/examples/sdl_opengl2_example/main.cpp +++ b/examples/sdl_opengl2_example/main.cpp @@ -34,7 +34,9 @@ int main(int, char**) SDL_GL_SetSwapInterval(1); // Enable vsync // Setup ImGui binding + ImGuiIO& io = ImGui::GetIO(); (void)io; ImGui_ImplSdlGL2_Init(window); + //io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls // Setup style ImGui::StyleColorsDark(); @@ -47,7 +49,6 @@ int main(int, char**) // - The fonts will be rasterized at a given size (w/ oversampling) and stored into a texture when calling ImFontAtlas::Build()/GetTexDataAsXXXX(), which ImGui_ImplXXXX_NewFrame below will call. // - Read 'misc/fonts/README.txt' for more instructions and details. // - Remember that in C/C++ if you want to include a backslash \ in a string literal you need to write a double backslash \\ ! - //ImGuiIO& io = ImGui::GetIO(); //io.Fonts->AddFontDefault(); //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Roboto-Medium.ttf", 16.0f); //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf", 15.0f); diff --git a/examples/vulkan_example/main.cpp b/examples/vulkan_example/main.cpp index 41939aab..6a2c342c 100644 --- a/examples/vulkan_example/main.cpp +++ b/examples/vulkan_example/main.cpp @@ -614,6 +614,7 @@ int main(int, char**) setup_vulkan(window); // Setup ImGui binding + ImGuiIO& io = ImGui::GetIO(); (void)io; ImGui_ImplGlfwVulkan_Init_Data init_data = {}; init_data.allocator = g_Allocator; init_data.gpu = g_Gpu; @@ -623,6 +624,7 @@ int main(int, char**) init_data.descriptor_pool = g_DescriptorPool; init_data.check_vk_result = check_vk_result; ImGui_ImplGlfwVulkan_Init(window, true, &init_data); + //io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls // Setup style ImGui::StyleColorsDark(); @@ -635,7 +637,6 @@ int main(int, char**) // - The fonts will be rasterized at a given size (w/ oversampling) and stored into a texture when calling ImFontAtlas::Build()/GetTexDataAsXXXX(), which ImGui_ImplXXXX_NewFrame below will call. // - Read 'misc/fonts/README.txt' for more instructions and details. // - Remember that in C/C++ if you want to include a backslash \ in a string literal you need to write a double backslash \\ ! - //ImGuiIO& io = ImGui::GetIO(); //io.Fonts->AddFontDefault(); //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Roboto-Medium.ttf", 16.0f); //io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf", 15.0f);