1
0
Fork 0
mirror of https://gitlab.com/Mr_Goldberg/goldberg_emulator.git synced 2024-11-14 10:50:13 +01:00

Put back the if new frame for overlay.

This commit is contained in:
Mr_Goldberg 2021-01-23 16:46:44 -05:00
parent 671277a154
commit cfff531a23
No known key found for this signature in database
GPG key ID: 8597D87419DEF278
15 changed files with 26 additions and 25 deletions

View file

@ -221,10 +221,11 @@ void ImGui_ImplOpenGL3_Shutdown()
ImGui_ImplOpenGL3_DestroyDeviceObjects(); ImGui_ImplOpenGL3_DestroyDeviceObjects();
} }
void ImGui_ImplOpenGL3_NewFrame() bool ImGui_ImplOpenGL3_NewFrame()
{ {
if (!g_ShaderHandle) if (!g_ShaderHandle)
ImGui_ImplOpenGL3_CreateDeviceObjects(); return ImGui_ImplOpenGL3_CreateDeviceObjects();
return true;
} }
static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_width, int fb_height, GLuint vertex_array_object) static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_width, int fb_height, GLuint vertex_array_object)

View file

@ -27,7 +27,7 @@
// Backend API // Backend API
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = NULL); IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = NULL);
IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown(); IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown();
IMGUI_IMPL_API void ImGui_ImplOpenGL3_NewFrame(); IMGUI_IMPL_API bool ImGui_ImplOpenGL3_NewFrame();
IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data); IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data);
// (Optional) Called by Init/NewFrame/Shutdown // (Optional) Called by Init/NewFrame/Shutdown

View file

@ -467,8 +467,10 @@ void ImGui_ImplDX10_Shutdown()
if (g_pd3dDevice) { g_pd3dDevice->Release(); g_pd3dDevice = NULL; } if (g_pd3dDevice) { g_pd3dDevice->Release(); g_pd3dDevice = NULL; }
} }
void ImGui_ImplDX10_NewFrame() bool ImGui_ImplDX10_NewFrame()
{ {
if (!g_pFontSampler) if (!g_pFontSampler)
ImGui_ImplDX10_CreateDeviceObjects(); return ImGui_ImplDX10_CreateDeviceObjects();
return true;
} }

View file

@ -16,7 +16,7 @@ struct ID3D10Device;
IMGUI_IMPL_API bool ImGui_ImplDX10_Init(ID3D10Device* device); IMGUI_IMPL_API bool ImGui_ImplDX10_Init(ID3D10Device* device);
IMGUI_IMPL_API void ImGui_ImplDX10_Shutdown(); IMGUI_IMPL_API void ImGui_ImplDX10_Shutdown();
IMGUI_IMPL_API void ImGui_ImplDX10_NewFrame(); IMGUI_IMPL_API bool ImGui_ImplDX10_NewFrame();
IMGUI_IMPL_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data); IMGUI_IMPL_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data);
// Use if you want to reset your rendering device without losing Dear ImGui state. // Use if you want to reset your rendering device without losing Dear ImGui state.

View file

@ -595,8 +595,9 @@ void ImGui_ImplDX11_Shutdown()
if (g_pd3dDeviceContext) { g_pd3dDeviceContext->Release(); g_pd3dDeviceContext = NULL; } if (g_pd3dDeviceContext) { g_pd3dDeviceContext->Release(); g_pd3dDeviceContext = NULL; }
} }
void ImGui_ImplDX11_NewFrame() bool ImGui_ImplDX11_NewFrame()
{ {
if (!g_pFontSampler) if (!g_pFontSampler)
ImGui_ImplDX11_CreateDeviceObjects(); return ImGui_ImplDX11_CreateDeviceObjects();
return true;
} }

View file

@ -17,7 +17,7 @@ struct ID3D11DeviceContext;
IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context);
IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown();
IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); IMGUI_IMPL_API bool ImGui_ImplDX11_NewFrame();
IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data);
// Use if you want to reset your rendering device without losing Dear ImGui state. // Use if you want to reset your rendering device without losing Dear ImGui state.

View file

@ -634,8 +634,9 @@ void ImGui_ImplDX12_Shutdown()
g_frameIndex = UINT_MAX; g_frameIndex = UINT_MAX;
} }
void ImGui_ImplDX12_NewFrame() bool ImGui_ImplDX12_NewFrame()
{ {
if (!g_pPipelineState) if (!g_pPipelineState)
ImGui_ImplDX12_CreateDeviceObjects(); return ImGui_ImplDX12_CreateDeviceObjects();
return true;
} }

View file

@ -35,7 +35,7 @@ struct D3D12_GPU_DESCRIPTOR_HANDLE;
IMGUI_IMPL_API bool ImGui_ImplDX12_Init(ID3D12Device* device, int num_frames_in_flight, DXGI_FORMAT rtv_format, ID3D12DescriptorHeap* cbv_srv_heap, IMGUI_IMPL_API bool ImGui_ImplDX12_Init(ID3D12Device* device, int num_frames_in_flight, DXGI_FORMAT rtv_format, ID3D12DescriptorHeap* cbv_srv_heap,
D3D12_CPU_DESCRIPTOR_HANDLE font_srv_cpu_desc_handle, D3D12_GPU_DESCRIPTOR_HANDLE font_srv_gpu_desc_handle); D3D12_CPU_DESCRIPTOR_HANDLE font_srv_cpu_desc_handle, D3D12_GPU_DESCRIPTOR_HANDLE font_srv_gpu_desc_handle);
IMGUI_IMPL_API void ImGui_ImplDX12_Shutdown(); IMGUI_IMPL_API void ImGui_ImplDX12_Shutdown();
IMGUI_IMPL_API void ImGui_ImplDX12_NewFrame(); IMGUI_IMPL_API bool ImGui_ImplDX12_NewFrame();
IMGUI_IMPL_API void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandList* graphics_command_list); IMGUI_IMPL_API void ImGui_ImplDX12_RenderDrawData(ImDrawData* draw_data, ID3D12GraphicsCommandList* graphics_command_list);
// Use if you want to reset your rendering device without losing Dear ImGui state. // Use if you want to reset your rendering device without losing Dear ImGui state.

View file

@ -277,8 +277,9 @@ void ImGui_ImplDX9_InvalidateDeviceObjects()
if (g_FontTexture) { g_FontTexture->Release(); g_FontTexture = NULL; ImGui::GetIO().Fonts->TexID = NULL; } // We copied g_pFontTextureView to io.Fonts->TexID so let's clear that as well. if (g_FontTexture) { g_FontTexture->Release(); g_FontTexture = NULL; ImGui::GetIO().Fonts->TexID = NULL; } // We copied g_pFontTextureView to io.Fonts->TexID so let's clear that as well.
} }
void ImGui_ImplDX9_NewFrame() bool ImGui_ImplDX9_NewFrame()
{ {
if (!g_FontTexture) if (!g_FontTexture)
ImGui_ImplDX9_CreateDeviceObjects(); return ImGui_ImplDX9_CreateDeviceObjects();
return true;
} }

View file

@ -16,7 +16,7 @@ struct IDirect3DDevice9;
IMGUI_IMPL_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device); IMGUI_IMPL_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device);
IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown(); IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown();
IMGUI_IMPL_API void ImGui_ImplDX9_NewFrame(); IMGUI_IMPL_API bool ImGui_ImplDX9_NewFrame();
IMGUI_IMPL_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data); IMGUI_IMPL_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data);
// Use if you want to reset your rendering device without losing Dear ImGui state. // Use if you want to reset your rendering device without losing Dear ImGui state.

View file

@ -80,8 +80,7 @@ void DX10_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
initialized = true; initialized = true;
} }
ImGui_ImplDX10_NewFrame(); if (ImGui_ImplDX10_NewFrame())
{ {
Windows_Hook::Inst()->prepareForOverlay(desc.OutputWindow); Windows_Hook::Inst()->prepareForOverlay(desc.OutputWindow);

View file

@ -121,8 +121,7 @@ void DX11_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
initialized = true; initialized = true;
} }
ImGui_ImplDX11_NewFrame(); if (ImGui_ImplDX11_NewFrame())
{ {
Windows_Hook::Inst()->prepareForOverlay(desc.OutputWindow); Windows_Hook::Inst()->prepareForOverlay(desc.OutputWindow);

View file

@ -176,8 +176,7 @@ void DX12_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
pDevice->Release(); pDevice->Release();
} }
ImGui_ImplDX12_NewFrame(); if (ImGui_ImplDX12_NewFrame())
{ {
Windows_Hook::Inst()->prepareForOverlay(sc_desc.OutputWindow); Windows_Hook::Inst()->prepareForOverlay(sc_desc.OutputWindow);

View file

@ -75,8 +75,7 @@ void DX9_Hook::prepareForOverlay(IDirect3DDevice9 *pDevice)
initialized = true; initialized = true;
} }
ImGui_ImplDX9_NewFrame(); if (ImGui_ImplDX9_NewFrame())
{ {
Windows_Hook::Inst()->prepareForOverlay(param.hFocusWindow); Windows_Hook::Inst()->prepareForOverlay(param.hFocusWindow);

View file

@ -84,8 +84,7 @@ void OpenGL_Hook::prepareForOverlay(HDC hDC)
initialized = true; initialized = true;
} }
ImGui_ImplOpenGL3_NewFrame(); if (ImGui_ImplOpenGL3_NewFrame())
{ {
Windows_Hook::Inst()->prepareForOverlay(hWnd); Windows_Hook::Inst()->prepareForOverlay(hWnd);