mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[wpigui] Handle Direct3D framebuffer resize
This commit is contained in:
@@ -152,6 +152,15 @@ void gui::PlatformShutdown() {
|
||||
ImGui_ImplDX11_Shutdown();
|
||||
}
|
||||
|
||||
void gui::PlatformFramebufferSizeChanged(int width, int height) {
|
||||
if (gPlatformContext && gPlatformContext->pd3dDevice) {
|
||||
CleanupRenderTarget();
|
||||
gPlatformContext->pSwapChain->ResizeBuffers(0, width, height,
|
||||
DXGI_FORMAT_UNKNOWN, 0);
|
||||
CreateRenderTarget();
|
||||
}
|
||||
}
|
||||
|
||||
static inline DXGI_FORMAT DXPixelFormat(PixelFormat format) {
|
||||
switch (format) {
|
||||
case kPixelRGBA:
|
||||
|
||||
Reference in New Issue
Block a user