Renamed ImGuiNavFlags io.NavFlags to ImGuiConfigFlags io.ConfigFlags. (#787)

This commit is contained in:
omar
2018-02-28 18:51:40 +01:00
parent 29510fcb83
commit 8074d56bdd
21 changed files with 60 additions and 56 deletions

View File

@ -25,8 +25,8 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
ImGui_ImplAllegro5_Init(display);
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
// Setup style
ImGui::StyleColorsDark();

View File

@ -115,9 +115,9 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
ImGui_ImplWin32_Init(hwnd);
ImGui_ImplDX10_Init(g_pd3dDevice);
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
// Setup style
ImGui::StyleColorsDark();

View File

@ -118,9 +118,9 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
ImGui_ImplWin32_Init(hwnd);
ImGui_ImplDX11_Init(g_pd3dDevice, g_pd3dDeviceContext);
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
// Setup style
ImGui::StyleColorsDark();

View File

@ -289,7 +289,7 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
ImGui_ImplWin32_Init(hwnd);
ImGui_ImplDX12_Init(g_pd3dDevice, NUM_FRAMES_IN_FLIGHT, DXGI_FORMAT_R8G8B8A8_UNORM,
g_pd3dSrvDescHeap->GetCPUDescriptorHandleForHeapStart(), g_pd3dSrvDescHeap->GetGPUDescriptorHandleForHeapStart());

View File

@ -78,9 +78,9 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
ImGui_ImplWin32_Init(hwnd);
ImGui_ImplDX9_Init(g_pd3dDevice);
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
// Setup style
ImGui::StyleColorsDark();

View File

@ -3,7 +3,7 @@
// (Info: GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.)
// Implemented features:
// [X] Gamepad navigation mapping. Enable with 'io.NavFlags |= ImGuiNavFlags_EnableGamepad'.
// [X] Gamepad navigation mapping. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
// If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown().
@ -15,8 +15,8 @@
// 2018-XX-XX: Inputs: Added support for mouse cursors, honoring ImGui::GetMouseCursor() value.
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.
// 2018-01-25: Inputs: Added gamepad support if ImGuiNavFlags_EnableGamepad is set.
// 2018-01-25: Inputs: Honoring the io.WantMoveMouse by repositioning the mouse by using navigation and ImGuiNavFlags_MoveMouse is set.
// 2018-01-25: Inputs: Added gamepad support if ImGuiConfigFlags_NavEnableGamepad is set.
// 2018-01-25: Inputs: Honoring the io.WantMoveMouse by repositioning the mouse (when using navigation and ImGuiConfigFlags_NavMoveMouse is set).
// 2018-01-20: Inputs: Added Horizontal Mouse Wheel support.
// 2018-01-18: Inputs: Added mapping for ImGuiKey_Insert.
// 2017-08-25: Inputs: MousePos set to -FLT_MAX,-FLT_MAX when mouse is unavailable/missing (instead of -1,-1).
@ -152,6 +152,7 @@ void ImGui_ImplGlfw_Shutdown()
static void ImGui_ImplGlfw_UpdateMousePosButtons()
{
// Update buttons
ImGuiIO& io = ImGui::GetIO();
for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++)
{
// If a mouse press event came, always pass it as "mouse held this frame", so we don't miss click-release events that are shorter than 1 frame.
@ -214,7 +215,7 @@ void ImGui_ImplGlfw_NewFrame()
// Gamepad navigation mapping [BETA]
memset(io.NavInputs, 0, sizeof(io.NavInputs));
if (io.NavFlags & ImGuiNavFlags_EnableGamepad)
if (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad)
{
// Update gamepad inputs
#define MAP_BUTTON(NAV_NO, BUTTON_NO) { if (buttons_count > BUTTON_NO && buttons[BUTTON_NO] == GLFW_PRESS) io.NavInputs[NAV_NO] = 1.0f; }

View File

@ -3,7 +3,7 @@
// (Info: GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.)
// Implemented features:
// [X] Gamepad navigation mapping. Enable with 'io.NavFlags |= ImGuiNavFlags_EnableGamepad'.
// [X] Gamepad navigation mapping. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
// If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown().

View File

@ -9,7 +9,7 @@
// CHANGELOG
// 2018-02-20: Inputs: Added support for mouse cursors (ImGui::GetMouseCursor() value and WM_SETCURSOR message handling).
// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.
// 2018-02-06: Inputs: Honoring the io.WantMoveMouse by repositioning the mouse by using navigation and ImGuiNavFlags_MoveMouse is set.
// 2018-02-06: Inputs: Honoring the io.WantMoveMouse by repositioning the mouse (when using navigation and ImGuiConfigFlags_NavMoveMouse is set).
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
// 2018-01-20: Inputs: Added Horizontal Mouse Wheel support.
// 2018-01-08: Inputs: Added mapping for ImGuiKey_Insert.

View File

@ -19,8 +19,8 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
ImGui_Marmalade_Init(true);
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
// Setup style
ImGui::StyleColorsDark();

View File

@ -30,9 +30,9 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
ImGui_ImplGlfw_Init(window, true);
ImGui_ImplOpenGL2_Init();
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
// Setup style
ImGui::StyleColorsDark();

View File

@ -35,10 +35,10 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
ImGui_ImplGlfw_Init(window, true);
ImGui_ImplOpenGL3_Init();
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
//io.NavFlags |= ImGuiNavFlags_EnableGamepad; // Enable Gamepad Controls
// Setup style
ImGui::StyleColorsDark();

View File

@ -37,9 +37,9 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
ImGui_ImplSDL2_Init(window);
ImGui_ImplOpenGL2_Init();
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
// Setup style
ImGui::StyleColorsDark();

View File

@ -37,9 +37,9 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
ImGui_ImplSDL2_Init(window);
ImGui_ImplOpenGL3_Init();
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard;
// Setup style
ImGui::StyleColorsDark();

View File

@ -612,8 +612,6 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard;
ImGui_ImplVulkan_InitData init_data = {};
init_data.allocator = g_Allocator;
@ -623,6 +621,9 @@ int main(int, char**)
init_data.pipeline_cache = g_PipelineCache;
init_data.descriptor_pool = g_DescriptorPool;
init_data.check_vk_result = check_vk_result;
ImGuiIO& io = ImGui::GetIO(); (void)io;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
ImGui_ImplVulkan_Init(&init_data);
ImGui_ImplSDL2_Init(window);

View File

@ -615,7 +615,7 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
ImGui_ImplVulkan_InitData init_data = {};
init_data.allocator = g_Allocator;
init_data.gpu = g_Gpu;
@ -624,9 +624,11 @@ int main(int, char**)
init_data.pipeline_cache = g_PipelineCache;
init_data.descriptor_pool = g_DescriptorPool;
init_data.check_vk_result = check_vk_result;
ImGuiIO& io = ImGui::GetIO(); (void)io;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
ImGui_ImplVulkan_Init(&init_data);
ImGui_ImplGlfw_Init(window, true);
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
// Setup style
ImGui::StyleColorsDark();