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:
@ -201,7 +201,6 @@ bool ImGui_ImplA5_Init(ALLEGRO_DISPLAY* display)
|
||||
void ImGui_ImplA5_Shutdown()
|
||||
{
|
||||
ImGui_ImplA5_InvalidateDeviceObjects();
|
||||
ImGui::Shutdown();
|
||||
}
|
||||
|
||||
// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
|
||||
|
@ -23,6 +23,7 @@ int main(int, char**)
|
||||
al_register_event_source(queue, al_get_mouse_event_source());
|
||||
|
||||
// Setup ImGui binding
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
||||
ImGui_ImplA5_Init(display);
|
||||
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
|
||||
@ -118,6 +119,7 @@ int main(int, char**)
|
||||
|
||||
// Cleanup
|
||||
ImGui_ImplA5_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
al_destroy_event_queue(queue);
|
||||
al_destroy_display(display);
|
||||
|
||||
|
@ -245,6 +245,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)
|
||||
{
|
||||
@ -572,7 +575,6 @@ bool ImGui_ImplDX10_Init(void* hwnd, ID3D10Device* device)
|
||||
void ImGui_ImplDX10_Shutdown()
|
||||
{
|
||||
ImGui_ImplDX10_InvalidateDeviceObjects();
|
||||
ImGui::Shutdown();
|
||||
g_pd3dDevice = NULL;
|
||||
g_hWnd = (HWND)0;
|
||||
}
|
||||
|
@ -120,6 +120,7 @@ int main(int, char**)
|
||||
UpdateWindow(hwnd);
|
||||
|
||||
// Setup ImGui binding
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
||||
ImGui_ImplDX10_Init(hwnd, g_pd3dDevice);
|
||||
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
|
||||
@ -211,6 +212,8 @@ int main(int, char**)
|
||||
}
|
||||
|
||||
ImGui_ImplDX10_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
|
||||
CleanupDeviceD3D();
|
||||
UnregisterClass(_T("ImGui Example"), wc.hInstance);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -209,8 +209,6 @@ void ImGui_Marmalade_InvalidateDeviceObjects()
|
||||
|
||||
bool ImGui_Marmalade_Init(bool install_callbacks)
|
||||
{
|
||||
IwGxInit();
|
||||
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.KeyMap[ImGuiKey_Tab] = s3eKeyTab; // Keyboard mapping. ImGui will use those indices to peek into the io.KeyDown[] array.
|
||||
io.KeyMap[ImGuiKey_LeftArrow] = s3eKeyLeft;
|
||||
@ -251,8 +249,6 @@ bool ImGui_Marmalade_Init(bool install_callbacks)
|
||||
void ImGui_Marmalade_Shutdown()
|
||||
{
|
||||
ImGui_Marmalade_InvalidateDeviceObjects();
|
||||
ImGui::Shutdown();
|
||||
IwGxTerminate();
|
||||
}
|
||||
|
||||
void ImGui_Marmalade_NewFrame()
|
||||
|
@ -14,7 +14,10 @@
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
IwGxInit();
|
||||
|
||||
// Setup ImGui binding
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
||||
ImGui_Marmalade_Init(true);
|
||||
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
|
||||
@ -104,6 +107,8 @@ int main(int, char**)
|
||||
|
||||
// Cleanup
|
||||
ImGui_Marmalade_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
IwGxTerminate();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
|
||||
// Build atlas
|
||||
@ -27,7 +28,7 @@ int main(int, char**)
|
||||
ImGui::Render();
|
||||
}
|
||||
|
||||
printf("Shutdown()\n");
|
||||
ImGui::Shutdown();
|
||||
printf("DestroyContext()\n");
|
||||
ImGui::DestroyContext();
|
||||
return 0;
|
||||
}
|
||||
|
@ -249,7 +249,6 @@ bool ImGui_ImplGlfwGL2_Init(GLFWwindow* window, bool install_callbacks)
|
||||
void ImGui_ImplGlfwGL2_Shutdown()
|
||||
{
|
||||
ImGui_ImplGlfwGL2_InvalidateDeviceObjects();
|
||||
ImGui::Shutdown();
|
||||
}
|
||||
|
||||
void ImGui_ImplGlfwGL2_NewFrame()
|
||||
|
@ -27,6 +27,7 @@ int main(int, char**)
|
||||
glfwSwapInterval(1); // Enable vsync
|
||||
|
||||
// Setup ImGui binding
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
||||
ImGui_ImplGlfwGL2_Init(window, true);
|
||||
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
|
||||
@ -114,6 +115,7 @@ int main(int, char**)
|
||||
|
||||
// Cleanup
|
||||
ImGui_ImplGlfwGL2_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
glfwTerminate();
|
||||
|
||||
return 0;
|
||||
|
@ -362,7 +362,6 @@ bool ImGui_ImplGlfwGL3_Init(GLFWwindow* window, bool install_callbacks)
|
||||
void ImGui_ImplGlfwGL3_Shutdown()
|
||||
{
|
||||
ImGui_ImplGlfwGL3_InvalidateDeviceObjects();
|
||||
ImGui::Shutdown();
|
||||
}
|
||||
|
||||
void ImGui_ImplGlfwGL3_NewFrame()
|
||||
|
@ -32,6 +32,7 @@ int main(int, char**)
|
||||
gl3wInit();
|
||||
|
||||
// Setup ImGui binding
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
||||
ImGui_ImplGlfwGL3_Init(window, true);
|
||||
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
|
||||
@ -119,6 +120,7 @@ int main(int, char**)
|
||||
|
||||
// Cleanup
|
||||
ImGui_ImplGlfwGL3_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
glfwTerminate();
|
||||
|
||||
return 0;
|
||||
|
@ -250,7 +250,6 @@ bool ImGui_ImplSdlGL2_Init(SDL_Window* window)
|
||||
void ImGui_ImplSdlGL2_Shutdown()
|
||||
{
|
||||
ImGui_ImplSdlGL2_InvalidateDeviceObjects();
|
||||
ImGui::Shutdown();
|
||||
}
|
||||
|
||||
void ImGui_ImplSdlGL2_NewFrame(SDL_Window *window)
|
||||
|
@ -34,6 +34,7 @@ int main(int, char**)
|
||||
SDL_GL_SetSwapInterval(1); // Enable vsync
|
||||
|
||||
// Setup ImGui binding
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
||||
ImGui_ImplSdlGL2_Init(window);
|
||||
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard; // Enable Keyboard Controls
|
||||
@ -126,6 +127,8 @@ int main(int, char**)
|
||||
|
||||
// Cleanup
|
||||
ImGui_ImplSdlGL2_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
|
||||
SDL_GL_DeleteContext(glcontext);
|
||||
SDL_DestroyWindow(window);
|
||||
SDL_Quit();
|
||||
|
@ -361,7 +361,6 @@ bool ImGui_ImplSdlGL3_Init(SDL_Window* window)
|
||||
void ImGui_ImplSdlGL3_Shutdown()
|
||||
{
|
||||
ImGui_ImplSdlGL3_InvalidateDeviceObjects();
|
||||
ImGui::Shutdown();
|
||||
}
|
||||
|
||||
void ImGui_ImplSdlGL3_NewFrame(SDL_Window* window)
|
||||
|
@ -34,6 +34,7 @@ int main(int, char**)
|
||||
gl3wInit();
|
||||
|
||||
// Setup ImGui binding
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
||||
ImGui_ImplSdlGL3_Init(window);
|
||||
//io.NavFlags |= ImGuiNavFlags_EnableKeyboard;
|
||||
@ -125,6 +126,8 @@ int main(int, char**)
|
||||
|
||||
// Cleanup
|
||||
ImGui_ImplSdlGL3_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
|
||||
SDL_GL_DeleteContext(glcontext);
|
||||
SDL_DestroyWindow(window);
|
||||
SDL_Quit();
|
||||
|
@ -789,7 +789,6 @@ bool ImGui_ImplGlfwVulkan_Init(GLFWwindow* window, bool install_callbacks, Im
|
||||
void ImGui_ImplGlfwVulkan_Shutdown()
|
||||
{
|
||||
ImGui_ImplGlfwVulkan_InvalidateDeviceObjects();
|
||||
ImGui::Shutdown();
|
||||
}
|
||||
|
||||
void ImGui_ImplGlfwVulkan_NewFrame()
|
||||
|
@ -614,6 +614,7 @@ int main(int, char**)
|
||||
setup_vulkan(window);
|
||||
|
||||
// Setup ImGui binding
|
||||
ImGui::CreateContext();
|
||||
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
||||
ImGui_ImplGlfwVulkan_Init_Data init_data = {};
|
||||
init_data.allocator = g_Allocator;
|
||||
@ -745,6 +746,7 @@ int main(int, char**)
|
||||
VkResult err = vkDeviceWaitIdle(g_Device);
|
||||
check_vk_result(err);
|
||||
ImGui_ImplGlfwVulkan_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
cleanup_vulkan();
|
||||
glfwTerminate();
|
||||
|
||||
|
Reference in New Issue
Block a user