mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-05 04:28:47 +02:00
Merge branch 'context'
# Conflicts: # examples/allegro5_example/main.cpp # examples/directx10_example/main.cpp # examples/directx11_example/main.cpp # examples/directx9_example/main.cpp # examples/marmalade_example/main.cpp # examples/opengl2_example/main.cpp # examples/opengl3_example/main.cpp # examples/sdl_opengl2_example/main.cpp # examples/sdl_opengl3_example/main.cpp # examples/vulkan_example/main.cpp
This commit is contained in:
@ -252,6 +252,9 @@ static bool IsAnyMouseButtonDown()
|
||||
// PS: We treat DBLCLK messages as regular mouse down messages, so this code will work on windows classes that have the CS_DBLCLKS flag set. Our own example app code doesn't set this flag.
|
||||
IMGUI_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (ImGui::GetCurrentContext() == NULL)
|
||||
return 0;
|
||||
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
switch (msg)
|
||||
{
|
||||
@ -574,7 +577,6 @@ bool ImGui_ImplDX11_Init(void* hwnd, ID3D11Device* device, ID3D11DeviceContex
|
||||
void ImGui_ImplDX11_Shutdown()
|
||||
{
|
||||
ImGui_ImplDX11_InvalidateDeviceObjects();
|
||||
ImGui::Shutdown();
|
||||
g_pd3dDevice = NULL;
|
||||
g_pd3dDeviceContext = NULL;
|
||||
g_hWnd = (HWND)0;
|
||||
|
@ -123,6 +123,7 @@ int main(int, char**)
|
||||
UpdateWindow(hwnd);
|
||||
|
||||
// Setup ImGui binding
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
||||
ImGui_ImplDX11_Init(hwnd, g_pd3dDevice, g_pd3dDeviceContext);
|
||||
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
|
||||
@ -214,6 +215,8 @@ int main(int, char**)
|
||||
}
|
||||
|
||||
ImGui_ImplDX11_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
|
||||
CleanupDeviceD3D();
|
||||
UnregisterClass(_T("ImGui Example"), wc.hInstance);
|
||||
|
||||
|
Reference in New Issue
Block a user