Viewport: Changed signature of ResizeViewport to be consistent with other similar functions.

docking
omar 7 years ago
parent 4d46383100
commit 1eb89d7e3b

@ -566,7 +566,7 @@ static void ImGui_ImplDX10_DestroyViewport(ImGuiViewport* viewport)
viewport->RendererUserData = NULL; viewport->RendererUserData = NULL;
} }
static void ImGui_ImplDX10_ResizeViewport(ImGuiViewport* viewport, int w, int h) static void ImGui_ImplDX10_ResizeViewport(ImGuiViewport* viewport, ImVec2 size)
{ {
ImGuiPlatformDataDx10* data = (ImGuiPlatformDataDx10*)viewport->RendererUserData; ImGuiPlatformDataDx10* data = (ImGuiPlatformDataDx10*)viewport->RendererUserData;
if (data->RTView) if (data->RTView)
@ -577,7 +577,7 @@ static void ImGui_ImplDX10_ResizeViewport(ImGuiViewport* viewport, int w, int h)
if (data->SwapChain) if (data->SwapChain)
{ {
ID3D10Texture2D* pBackBuffer = NULL; ID3D10Texture2D* pBackBuffer = NULL;
data->SwapChain->ResizeBuffers(0, w, h, DXGI_FORMAT_UNKNOWN, 0); data->SwapChain->ResizeBuffers(0, (UINT)size.x, (UINT)size.y, DXGI_FORMAT_UNKNOWN, 0);
data->SwapChain->GetBuffer(0, IID_PPV_ARGS(&pBackBuffer)); data->SwapChain->GetBuffer(0, IID_PPV_ARGS(&pBackBuffer));
g_pd3dDevice->CreateRenderTargetView(pBackBuffer, NULL, &data->RTView); g_pd3dDevice->CreateRenderTargetView(pBackBuffer, NULL, &data->RTView);
pBackBuffer->Release(); pBackBuffer->Release();

@ -574,7 +574,7 @@ static void ImGui_ImplDX11_DestroyViewport(ImGuiViewport* viewport)
viewport->RendererUserData = NULL; viewport->RendererUserData = NULL;
} }
static void ImGui_ImplDX11_ResizeViewport(ImGuiViewport* viewport, int w, int h) static void ImGui_ImplDX11_ResizeViewport(ImGuiViewport* viewport, ImVec2 size)
{ {
ImGuiPlatformDataDx11* data = (ImGuiPlatformDataDx11*)viewport->RendererUserData; ImGuiPlatformDataDx11* data = (ImGuiPlatformDataDx11*)viewport->RendererUserData;
if (data->RTView) if (data->RTView)
@ -585,7 +585,7 @@ static void ImGui_ImplDX11_ResizeViewport(ImGuiViewport* viewport, int w, int h)
if (data->SwapChain) if (data->SwapChain)
{ {
ID3D11Texture2D* pBackBuffer = NULL; ID3D11Texture2D* pBackBuffer = NULL;
data->SwapChain->ResizeBuffers(0, w, h, DXGI_FORMAT_UNKNOWN, 0); data->SwapChain->ResizeBuffers(0, (UINT)size.x, (UINT)size.y, DXGI_FORMAT_UNKNOWN, 0);
data->SwapChain->GetBuffer(0, IID_PPV_ARGS(&pBackBuffer)); data->SwapChain->GetBuffer(0, IID_PPV_ARGS(&pBackBuffer));
g_pd3dDevice->CreateRenderTargetView(pBackBuffer, NULL, &data->RTView); g_pd3dDevice->CreateRenderTargetView(pBackBuffer, NULL, &data->RTView);
pBackBuffer->Release(); pBackBuffer->Release();

@ -1055,13 +1055,12 @@ static void ImGui_ImplVulkan_DestroyViewport(ImGuiViewport* viewport)
viewport->RendererUserData = NULL; viewport->RendererUserData = NULL;
} }
static void ImGui_ImplVulkan_ResizeViewport(ImGuiViewport* viewport, int w, int h) static void ImGui_ImplVulkan_ResizeViewport(ImGuiViewport* viewport, ImVec2 size)
{ {
ImGuiPlatformDataVulkan* data = (ImGuiPlatformDataVulkan*)viewport->RendererUserData; ImGuiPlatformDataVulkan* data = (ImGuiPlatformDataVulkan*)viewport->RendererUserData;
//... //...
(void)data; (void)data;
(void)w; (void)size;
(void)h;
} }
static void ImGui_ImplVulkan_RenderViewport(ImGuiViewport* viewport) static void ImGui_ImplVulkan_RenderViewport(ImGuiViewport* viewport)

@ -418,7 +418,7 @@ static LRESULT CALLBACK ImGui_ImplWin32_WndProcHandler_PlatformWindow(HWND hWnd,
if (!data->ExternalResize) if (!data->ExternalResize)
viewport->PlatformRequestResize = true; viewport->PlatformRequestResize = true;
if (io.RendererInterface.ResizeViewport) if (io.RendererInterface.ResizeViewport)
io.RendererInterface.ResizeViewport(viewport, (int)LOWORD(lParam), (int)HIWORD(lParam)); io.RendererInterface.ResizeViewport(viewport, ImVec2((float)LOWORD(lParam), (float)HIWORD(lParam)));
break; break;
} }
} }

@ -973,7 +973,7 @@ struct ImGuiRendererInterface
{ {
void (*CreateViewport)(ImGuiViewport* viewport); void (*CreateViewport)(ImGuiViewport* viewport);
void (*DestroyViewport)(ImGuiViewport* viewport); void (*DestroyViewport)(ImGuiViewport* viewport);
void (*ResizeViewport)(ImGuiViewport* viewport, int w, int h); void (*ResizeViewport)(ImGuiViewport* viewport, ImVec2 size);
void (*RenderViewport)(ImGuiViewport* viewport); // Setup render output, clear targets, call Renderer_RenderDrawData void (*RenderViewport)(ImGuiViewport* viewport); // Setup render output, clear targets, call Renderer_RenderDrawData
void (*SwapBuffers)(ImGuiViewport* viewport); // Call Present/SwapBuffers void (*SwapBuffers)(ImGuiViewport* viewport); // Call Present/SwapBuffers
}; };

Loading…
Cancel
Save