Examples: DirectX10: Reusing imgui_impl_win32, removed that code from imgui_impl_dx10

This commit is contained in:
omar
2018-02-16 23:11:43 +01:00
parent 19540479d4
commit 6cd4e30b58
6 changed files with 35 additions and 182 deletions

View File

@ -2,7 +2,8 @@
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
#include "imgui.h"
#include "imgui_impl_dx10.h"
#include "../imgui_impl_win32.h"
#include "../imgui_impl_dx10.h"
#include <d3d10_1.h>
#include <d3d10.h>
#define DIRECTINPUT_VERSION 0x0800
@ -122,7 +123,8 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
ImGui_ImplDX10_Init(hwnd, g_pd3dDevice);
ImGui_ImplWin32_Init(hwnd);
ImGui_ImplDX10_Init(g_pd3dDevice);
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
// Setup style
@ -164,6 +166,7 @@ int main(int, char**)
continue;
}
ImGui_ImplDX10_NewFrame();
ImGui_ImplWin32_NewFrame();
// 1. Show a simple window.
// Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets automatically appears in a window called "Debug".
@ -213,6 +216,7 @@ int main(int, char**)
}
ImGui_ImplDX10_Shutdown();
ImGui_ImplWin32_Shutdown();
ImGui::DestroyContext();
CleanupDeviceD3D();