Commit ae2cc29f8ba793cf41c8f748f885e8350d33e3b5

Sam Lantinga 2022-06-03T09:44:34

Make sure initial state is set correctly for the D3D renderer Fixes https://github.com/libsdl-org/SDL/issues/5749

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c
index 97047f4..8c68d3e 100644
--- a/src/render/direct3d/SDL_render_d3d.c
+++ b/src/render/direct3d/SDL_render_d3d.c
@@ -1747,6 +1747,9 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags)
         }
     }
 #endif
+    data->drawstate.viewport_dirty = SDL_TRUE;
+    data->drawstate.cliprect_dirty = SDL_TRUE;
+    data->drawstate.cliprect_enabled_dirty = SDL_TRUE;
     data->drawstate.blend = SDL_BLENDMODE_INVALID;
 
     return renderer;