mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-19 06:26:35 +00:00
Viewport: Changed signature of ResizeViewport to be consistent with other similar functions.
This commit is contained in:
parent
4d46383100
commit
1eb89d7e3b
@ -566,7 +566,7 @@ static void ImGui_ImplDX10_DestroyViewport(ImGuiViewport* viewport)
|
||||
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;
|
||||
if (data->RTView)
|
||||
@ -577,7 +577,7 @@ static void ImGui_ImplDX10_ResizeViewport(ImGuiViewport* viewport, int w, int h)
|
||||
if (data->SwapChain)
|
||||
{
|
||||
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));
|
||||
g_pd3dDevice->CreateRenderTargetView(pBackBuffer, NULL, &data->RTView);
|
||||
pBackBuffer->Release();
|
||||
|
@ -574,7 +574,7 @@ static void ImGui_ImplDX11_DestroyViewport(ImGuiViewport* viewport)
|
||||
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;
|
||||
if (data->RTView)
|
||||
@ -585,7 +585,7 @@ static void ImGui_ImplDX11_ResizeViewport(ImGuiViewport* viewport, int w, int h)
|
||||
if (data->SwapChain)
|
||||
{
|
||||
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));
|
||||
g_pd3dDevice->CreateRenderTargetView(pBackBuffer, NULL, &data->RTView);
|
||||
pBackBuffer->Release();
|
||||
|
@ -1055,13 +1055,12 @@ static void ImGui_ImplVulkan_DestroyViewport(ImGuiViewport* viewport)
|
||||
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;
|
||||
//...
|
||||
(void)data;
|
||||
(void)w;
|
||||
(void)h;
|
||||
(void)size;
|
||||
}
|
||||
|
||||
static void ImGui_ImplVulkan_RenderViewport(ImGuiViewport* viewport)
|
||||
|
@ -418,7 +418,7 @@ static LRESULT CALLBACK ImGui_ImplWin32_WndProcHandler_PlatformWindow(HWND hWnd,
|
||||
if (!data->ExternalResize)
|
||||
viewport->PlatformRequestResize = true;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
2
imgui.h
2
imgui.h
@ -973,7 +973,7 @@ struct ImGuiRendererInterface
|
||||
{
|
||||
void (*CreateViewport)(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 (*SwapBuffers)(ImGuiViewport* viewport); // Call Present/SwapBuffers
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user