Changeset 43181 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/render
- Timestamp:
- Sep 4, 2012 7:20:15 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_wgl.c
r41073 r43181 413 413 window->hWnd = NULL; 414 414 window->visual = NULL; 415 if (window->hRgn) 416 { 417 DeleteObject(window->hRgn); 418 window->hRgn = NULL; 419 } 415 420 } 416 421 … … 687 692 int window_plus_caption_height; 688 693 694 window->hRgn = NULL; 689 695 window->visual = visual; 690 696 window->nativeWindow = 0; … … 835 841 } 836 842 837 if (showIt) { 838 /* NO ERROR CODE FOR SHOWWINDOW */ 839 crDebug( "Render SPU: Showing the window" ); 840 crDebug("renderspu_SystemCreateWindow: showwindow: %x", window->hWnd); 841 ShowWindow( window->hWnd, SW_SHOWNORMAL ); 842 } 843 /* Intel drivers require a window to be visible for proper 3D rendering, 844 * so set it visible and handle the visibility with visible regions (see below) */ 845 ShowWindow( window->hWnd, SW_SHOWNORMAL ); 843 846 844 847 SetForegroundWindow( window->hWnd ); … … 863 866 crError( "Render SPU: Couldn't set up the device context! Yikes!" ); 864 867 return GL_FALSE; 868 } 869 870 window->visible = showIt; 871 872 if (!showIt) 873 { 874 renderspu_SystemShowWindow( window, 0 ); 875 if (window->height <= 0 || window->width <= 0) 876 { 877 renderspu_SystemWindowSize(window, 878 window->width > 0 ? window->width : 4, 879 window->height > 0 ? window->height : 4); 880 } 881 } 882 else 883 { 884 crDebug( "Render SPU: Showing the window" ); 885 crDebug("renderspu_SystemCreateWindow: showwindow: %x", window->hWnd); 865 886 } 866 887 … … 879 900 int window_plus_caption_height; 880 901 902 window->hRgn = NULL; 881 903 window->visual = visual; 882 904 window->nativeWindow = 0; … … 1082 1104 } 1083 1105 1084 if (showIt) { 1085 /* NO ERROR CODE FOR SHOWWINDOW */ 1086 crDebug( "Render SPU: Showing the window" ); 1087 crDebug("renderspu_SystemVBoxCreateWindow: showwindow: %x", window->hWnd); 1088 ShowWindow( window->hWnd, SW_SHOWNORMAL ); 1089 } 1106 /* Intel drivers require a window to be visible for proper 3D rendering, 1107 * so set it visible and handle the visibility with visible regions (see below) */ 1108 ShowWindow( window->hWnd, SW_SHOWNORMAL ); 1090 1109 1091 1110 //SetForegroundWindow( visual->hWnd ); … … 1112 1131 } 1113 1132 1133 window->visible = showIt; 1134 1135 if (!showIt) 1136 { 1137 renderspu_SystemShowWindow( window, 0 ); 1138 if (window->height <= 0 || window->width <= 0) 1139 { 1140 renderspu_SystemWindowSize(window, 1141 window->width > 0 ? window->width : 4, 1142 window->height > 0 ? window->height : 4); 1143 } 1144 } 1145 else 1146 { 1147 crDebug( "Render SPU: Showing the window" ); 1148 crDebug("renderspu_SystemCreateWindow: showwindow: %x", window->hWnd); 1149 } 1150 1114 1151 return GL_TRUE; 1115 1152 } 1116 1117 1153 1118 1154 /* Either show or hide the render SPU's window. */ … … 1122 1158 { 1123 1159 crDebug("SHOW renderspu_SystemShowWindow: %x", window->hWnd); 1124 S howWindow( window->hWnd, SW_SHOWNORMAL);1160 SetWindowRgn(window->hWnd, window->hRgn, true); 1125 1161 } 1126 1162 else 1127 1163 { 1164 HRGN hRgn; 1128 1165 crDebug("HIDE renderspu_SystemShowWindow: %x", window->hWnd); 1129 ShowWindow( window->hWnd, SW_HIDE ); 1130 } 1166 hRgn = CreateRectRgn(0, 0, 0, 0); 1167 SetWindowRgn(window->hWnd, hRgn, true); 1168 DeleteObject(hRgn); 1169 } 1170 window->visible = showIt; 1131 1171 } 1132 1172 … … 1223 1263 * various tables. This is hack which just hides the root case. 1224 1264 */ 1225 cr Debug("Recreating window in renderspu_SystemMakeCurrent\n");1265 crWarning("Recreating window in renderspu_SystemMakeCurrent\n"); 1226 1266 renderspu_SystemDestroyWindow( window ); 1227 1267 renderspu_SystemVBoxCreateWindow( context->visual, window->visible, window ); … … 1411 1451 CRASSERT(window->visual); 1412 1452 1453 if (window->hRgn) 1454 { 1455 DeleteObject(window->hRgn); 1456 window->hRgn = NULL; 1457 } 1458 1413 1459 hRgn = CreateRectRgn(0, 0, 0, 0); 1414 1460 … … 1420 1466 } 1421 1467 1422 SetWindowRgn(window->hWnd, hRgn, true); 1468 if (window->visible) 1469 SetWindowRgn(window->hWnd, hRgn, true); 1470 1423 1471 crDebug("Render SPU: SetWindowRgn (%x, cRects=%i)", window->hWnd, cRects); 1472 1473 window->hRgn = hRgn; 1424 1474 } 1425 1475
Note:
See TracChangeset
for help on using the changeset viewer.