Examples: DirectX9: Reusing imgui_impl_win32, removed that code from imgui_impl_dx9

This commit is contained in:
omar
2018-02-16 23:15:14 +01:00
parent 6cd4e30b58
commit 4f0db01f7c
6 changed files with 25 additions and 164 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_dx9.h"
#include "../imgui_impl_dx9.h"
#include "../imgui_impl_win32.h"
#include <d3d9.h>
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
@ -77,7 +78,8 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
ImGui_ImplDX9_Init(hwnd, g_pd3dDevice);
ImGui_ImplWin32_Init(hwnd);
ImGui_ImplDX9_Init(g_pd3dDevice);
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
// Setup style
@ -121,6 +123,7 @@ int main(int, char**)
continue;
}
ImGui_ImplDX9_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".
@ -184,6 +187,7 @@ int main(int, char**)
}
ImGui_ImplDX9_Shutdown();
ImGui_ImplWin32_Shutdown();
ImGui::DestroyContext();
if (g_pd3dDevice) g_pd3dDevice->Release();