mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 20:18: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:
@ -191,6 +191,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)
|
||||
{
|
||||
@ -291,7 +294,6 @@ bool ImGui_ImplDX9_Init(void* hwnd, IDirect3DDevice9* device)
|
||||
void ImGui_ImplDX9_Shutdown()
|
||||
{
|
||||
ImGui_ImplDX9_InvalidateDeviceObjects();
|
||||
ImGui::Shutdown();
|
||||
g_pd3dDevice = NULL;
|
||||
g_hWnd = 0;
|
||||
}
|
||||
|
@ -75,6 +75,7 @@ int main(int, char**)
|
||||
}
|
||||
|
||||
// Setup ImGui binding
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
||||
ImGui_ImplDX9_Init(hwnd, g_pd3dDevice);
|
||||
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
|
||||
@ -182,6 +183,8 @@ int main(int, char**)
|
||||
}
|
||||
|
||||
ImGui_ImplDX9_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
|
||||
if (g_pd3dDevice) g_pd3dDevice->Release();
|
||||
if (pD3D) pD3D->Release();
|
||||
UnregisterClass(_T("ImGui Example"), wc.hInstance);
|
||||
|
Reference in New Issue
Block a user