st/nine: Init cursor position at device creation
authorAxel Davy <davyaxel0@gmail.com>
Sat, 15 Sep 2018 18:39:23 +0000 (20:39 +0200)
committerAxel Davy <davyaxel0@gmail.com>
Tue, 25 Sep 2018 20:05:24 +0000 (22:05 +0200)
This is only useful for software cursor,
but at least now we won't start it at (0, 0).

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
src/gallium/state_trackers/nine/device9.c

index 9bb97bdf9c3c2ebdfc895d1a9c209eba3e650790..113ba9d975d416dfbb7bb9336dfbca1fad2ef41c 100644 (file)
@@ -333,8 +333,11 @@ NineDevice9_ctor( struct NineDevice9 *This,
     This->cursor.hotspot.y = -1;
     This->cursor.w = This->cursor.h = 0;
     This->cursor.visible = FALSE;
-    This->cursor.pos.x = 0;
-    This->cursor.pos.y = 0;
+    if (ID3DPresent_GetCursorPos(This->swapchains[0]->present, &This->cursor.pos) != S_OK) {
+        This->cursor.pos.x = 0;
+        This->cursor.pos.y = 0;
+    }
+
     {
         struct pipe_resource tmpl;
         memset(&tmpl, 0, sizeof(tmpl));