Lines Matching refs:window

365      * Namely ATI drivers check whether ogl window is foreground and fullscreen
376 #define WINDOW_NAME window->title
387 /* In the windows world, we need a window before a context.
393 void renderspu_SystemDestroyWindow( WindowInfo *window )
397 CRASSERT(window);
399 /*DestroyWindow( window->hWnd );*/
401 vrdw.hWnd = window->hWnd;
410 crError("Render SPU: window thread is not running");
413 window->hWnd = NULL;
414 window->visual = NULL;
415 if (window->hRgn)
417 DeleteObject(window->hRgn);
418 window->hRgn = NULL;
490 crDebug("Render SPU: caught WM_DESTROY for our window %x", hWnd);
619 PFD_DRAW_TO_WINDOW | /* support window */
733 GLboolean renderspu_SystemCreateWindow( VisualInfo *visual, GLboolean showIt, WindowInfo *window )
742 window->hRgn = NULL;
743 window->visual = visual;
744 window->nativeWindow = 0;
805 crError( "Render SPU: Couldn't register window class -- you're not trying "
815 /* Full screen window should be a popup (undecorated) window */
833 window->BltInfo.width = GetSystemMetrics( SM_CXSCREEN ) ;
834 window->BltInfo.height = GetSystemMetrics( SM_CYSCREEN ) ;
836 crDebug( "Render SPU: Window Dims: %d, %d", window->BltInfo.width, window->BltInfo.height );
838 window->x = render_spu->defaultX - smCxFixedFrame - 1;
839 window->y = render_spu->defaultY - smCyFixedFrame - smCyCaption;
841 window_plus_caption_width = window->BltInfo.width + 2 * smCxFixedFrame;
842 window_plus_caption_height = window->BltInfo.height + 2 * smCyFixedFrame + smCyCaption;
848 window->BltInfo.width = GetSystemMetrics( SM_CXSCREEN ) ;
849 window->BltInfo.height = GetSystemMetrics( SM_CYSCREEN ) ;
850 window->x = 0;
851 window->y = 0;
852 window_plus_caption_width = window->BltInfo.width;
853 window_plus_caption_height = window->BltInfo.height;
859 /* CreateWindow takes the size of the entire window, so we add
870 window_plus_caption_width = window->BltInfo.width + 2 * smCxFixedFrame;
871 window_plus_caption_height = window->BltInfo.height + 2 * smCyFixedFrame + smCyCaption;
873 window->x = render_spu.defaultX - smCxFixedFrame;
874 window->y = render_spu.defaultY - smCyFixedFrame - smCyCaption;
877 crDebug( "Render SPU: Creating the window: (%d,%d), (%d,%d)", render_spu.defaultX, render_spu.defaultY, window_plus_caption_width, window_plus_caption_height );
878 window->hWnd = CreateWindow( WINDOW_NAME, WINDOW_NAME,
880 window->x, window->y,
885 if ( !window->hWnd )
891 window->visible = showIt;
895 renderspu_SystemShowWindow( window, 0 );
896 if (window->BltInfo.height <= 0 || window->BltInfo.width <= 0)
898 renderspu_SystemWindowSize(window,
899 window->BltInfo.width > 0 ? window->BltInfo.width : 4,
900 window->BltInfo.height > 0 ? window->BltInfo.height : 4);
905 crDebug( "Render SPU: Showing the window" );
906 crDebug("renderspu_SystemCreateWindow: showwindow: %x", window->hWnd);
909 CRASSERT(!window->visible == !showIt);
911 /* Intel drivers require a window to be visible for proper 3D rendering,
913 ShowWindow( window->hWnd, SW_SHOWNORMAL );
915 SetForegroundWindow( window->hWnd );
917 SetWindowPos( window->hWnd, HWND_TOP, window->x, window->y,
928 window->device_context = GetDC( window->hWnd );
929 if (!window->device_context)
935 crDebug( "Render SPU: Got the DC: 0x%x", window->device_context );
937 if ( !bSetupPixelFormat( window->device_context, visual->visAttribs ) )
946 GLboolean renderspu_SystemVBoxCreateWindow( VisualInfo *visual, GLboolean showIt, WindowInfo *window )
957 window->hRgn = NULL;
958 window->visual = visual;
959 window->nativeWindow = 0;
1022 crError( "Render SPU: Couldn't register window class -- you're not trying "
1032 /* Full screen window should be a popup (undecorated) window */
1054 window->BltInfo.width = GetSystemMetrics( SM_CXSCREEN ) ;
1055 window->BltInfo.height = GetSystemMetrics( SM_CYSCREEN ) ;
1057 crDebug( "Render SPU: Window Dims: %d, %d", window->BltInfo.width, window->BltInfo.height );
1059 window->x = render_spu->defaultX - smCxFixedFrame - 1;
1060 window->y = render_spu->defaultY - smCyFixedFrame - smCyCaption;
1062 window_plus_caption_width = window->BltInfo.width + 2 * smCxFixedFrame;
1063 window_plus_caption_height = window->BltInfo.height + 2 * smCyFixedFrame + smCyCaption;
1069 window->BltInfo.width = GetSystemMetrics( SM_CXSCREEN ) ;
1070 window->BltInfo.height = GetSystemMetrics( SM_CYSCREEN ) ;
1071 window->x = 0;
1072 window->y = 0;
1073 window_plus_caption_width = window->BltInfo.width;
1074 window_plus_caption_height = window->BltInfo.height;
1080 /* CreateWindow takes the size of the entire window, so we add
1090 window_plus_caption_width = window->BltInfo.width + 2 * smCxFixedFrame;
1091 window_plus_caption_height = window->BltInfo.height + 2 * smCyFixedFrame + smCyCaption;
1093 window->x = render_spu.defaultX;
1094 window->y = render_spu.defaultY;
1097 crDebug( "Render SPU: Creating the window: (%d,%d), (%d,%d)", render_spu.defaultX, render_spu.defaultY, window_plus_caption_width, window_plus_caption_height );
1098 /*window->hWnd = CreateWindowEx( WS_EX_NOACTIVATE | WS_EX_NOPARENTNOTIFY,
1101 window->x, window->y,
1102 window->BltInfo.width,
1103 window->BltInfo.height,
1108 cs.lpCreateParams = window;
1114 cs.x = window->x;
1115 cs.y = window->y;
1116 cs.cx = window->BltInfo.width;
1117 cs.cy = window->BltInfo.height;
1140 crDebug("Render SPU: window thread waited %i secs", cnt);
1144 crError("Render SPU: window thread not responded after %i tries", cnt);
1150 crError("Render SPU: window thread is not running");
1155 if ( !window->hWnd )
1161 window->visible = 1;
1165 renderspu_SystemShowWindow( window, 0 );
1166 if (window->BltInfo.height <= 0 || window->BltInfo.width <= 0)
1168 renderspu_SystemWindowSize(window,
1169 window->BltInfo.width > 0 ? window->BltInfo.width : 4,
1170 window->BltInfo.height > 0 ? window->BltInfo.height : 4);
1176 crWarning( "Render SPU: Showing the window" );
1178 crDebug( "Render SPU: Showing the window" );
1180 crDebug("renderspu_SystemCreateWindow: showwindow: %x", window->hWnd);
1183 CRASSERT(!window->visible == !showIt);
1185 /* Intel drivers require a window to be visible for proper 3D rendering,
1187 if (window->BltInfo.Base.id != CR_RENDER_DEFAULT_WINDOW_ID)
1189 ShowWindow( window->hWnd, SW_SHOWNORMAL );
1194 /* dummy window is always hidden in any way */
1199 SetWindowPos( window->hWnd, HWND_TOP, window->x, window->y,
1200 window->BltInfo.width, window->BltInfo.height,
1204 crDebug("Render SPU: SetWindowPos (%x, %d, %d, %d, %d)", window->hWnd,
1205 window->x, window->y, window->BltInfo.width, window->BltInfo.height);
1210 window->device_context = GetDC( window->hWnd );
1211 if (!window->device_context)
1217 crDebug( "Render SPU: Got the DC: 0x%x", window->device_context );
1219 if ( !bSetupPixelFormat( window->device_context, visual->visAttribs ) )
1225 /* set the window pointer data at the last step to ensure our WM_PAINT callback does not do anything until we are fully initialized */
1227 LONG_PTR oldVal = SetWindowLongPtr(window->hWnd, GWLP_USERDATA, (LONG_PTR)window);
1235 static void renderspuWindowRgnApply(WindowInfo *window)
1237 HRGN hRgn = window->hRgn;
1253 result = CombineRgn(hRgn, window->hRgn, NULL, RGN_COPY);
1261 SetWindowRgn(window->hWnd, hRgn, true);
1264 /* Either show or hide the render SPU's window. */
1265 void renderspu_SystemShowWindow( WindowInfo *window, GLboolean showIt )
1269 crDebug("SHOW renderspu_SystemShowWindow: %x", window->hWnd);
1270 renderspuWindowRgnApply(window);
1275 crDebug("HIDE renderspu_SystemShowWindow: %x", window->hWnd);
1277 SetWindowRgn(window->hWnd, hRgn, true);
1282 window->visible = showIt;
1285 void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry )
1294 int rc = renderspuVBoxCompositorTryAcquire(window, &pCompositor);
1297 renderspuVBoxPresentCompositionGeneric(window, pCompositor, pChangedEntry, 0, false);
1298 renderspuVBoxCompositorRelease(window);
1304 renderspuVBoxPresentBlitterEnsureCreated(window, 0);
1305 RedrawWindow(window->hWnd, NULL, NULL, RDW_INTERNALPAINT);
1349 WindowInfo *window;
1359 window = renderspuGetDummyWindow(sharedContext->visual->visAttribs);
1360 if (!window)
1366 CRASSERT(window->device_context);
1368 crDebug( "Render SPU: renderspuChkActivateSharedContext: made the DC: 0x%x", window->device_context );
1370 sharedContext->hRC = render_spu.ws.wglCreateContext(window->device_context);
1373 crError( "Render SPU: (renderspuChkActivateSharedContext) Couldn't create the context for the window (error 0x%x)", GetLastError() );
1380 void renderspu_SystemMakeCurrent( WindowInfo *window, GLint nativeWindow, ContextInfo *context )
1384 if (context && window) {
1385 if (window->visual != context->visual) {
1389 * But for now we destroy the current window
1393 /*@todo Chromium has no correct code to remove window ids and associated info from
1396 crWarning("Recreating window in renderspu_SystemMakeCurrent\n");
1397 renderspu_SystemDestroyWindow( window );
1398 renderspu_SystemVBoxCreateWindow( context->visual, window->visible, window );
1420 window->nativeWindow = (HDC) nativeWindow;
1422 context->hRC = render_spu.ws.wglCreateContext( window->nativeWindow );
1425 crError( "(MakeCurrent) Couldn't create the context for the window (error 0x%x)", GetLastError() );
1437 render_spu.ws.wglMakeCurrent( window->nativeWindow, context->hRC );
1449 context->hRC = render_spu.ws.wglCreateContext(window->device_context);
1452 crError( "Render SPU: (MakeCurrent) Couldn't create the context for the window (error 0x%x)", GetLastError() );
1493 /*crDebug("MakeCurrent 0x%x, 0x%x", window->device_context, context->hRC);*/
1494 if (!render_spu.ws.wglMakeCurrent(!nativeWindow ? window->device_context : window->redraw_device_context, context->hRC))
1497 crError("Render SPU: (MakeCurrent) failed to make 0x%x, 0x%x current with 0x%x error.", window->device_context, context->hRC, err);
1508 void renderspu_SystemWindowSize( WindowInfo *window, GLint w, GLint h )
1511 CRASSERT(window);
1512 CRASSERT(window->visual);
1519 /*SetWindowRgn(window->hWnd, NULL, false);*/
1521 if (!SetWindowPos( window->hWnd, HWND_TOP,
1522 window->x, window->y, w, h, winprop )) {
1523 crWarning("!!!FAILED!!! Render SPU: SetWindowPos (%x, %d, %d, %d, %d)", window->hWnd, window->x, window->y, w, h);
1525 crDebug("Render SPU: SetWindowSize (%x, %d, %d, %d, %d)", window->hWnd, window->x, window->y, w, h);
1528 window->BltInfo.width = w;
1529 window->BltInfo.height = h;
1533 void renderspu_SystemGetWindowGeometry( WindowInfo *window, GLint *x, GLint *y, GLint *w, GLint *h )
1537 CRASSERT(window);
1538 CRASSERT(window->visual);
1540 GetClientRect( window->hWnd, &rect );
1548 void renderspu_SystemGetMaxWindowSize( WindowInfo *window, GLint *w, GLint *h )
1551 (void) window;
1557 void renderspu_SystemWindowPosition( WindowInfo *window, GLint x, GLint y )
1560 CRASSERT(window);
1561 CRASSERT(window->visual);
1568 /*SetWindowRgn(window->visual->hWnd, NULL, false);*/
1570 if (!SetWindowPos( window->hWnd, HWND_TOP,
1571 x, y, window->BltInfo.width, window->BltInfo.height, winprop )) {
1572 crWarning("!!!FAILED!!! Render SPU: SetWindowPos (%x, %d, %d, %d, %d)", window->hWnd, x, y, window->BltInfo.width, window->BltInfo.height);
1574 crDebug("Render SPU: SetWindowPos (%x, %d, %d, %d, %d)", window->hWnd,
1575 x, y, window->BltInfo.width, window->BltInfo.height);
1578 window->x = x;
1579 window->y = y;
1582 GLboolean renderspu_SystemWindowNeedEmptyPresent(WindowInfo *window)
1587 void renderspu_SystemWindowVisibleRegion(WindowInfo *window, GLint cRects, const GLint* pRects)
1592 CRASSERT(window);
1593 CRASSERT(window->visual);
1595 if (window->hRgn)
1597 DeleteObject(window->hRgn);
1598 window->hRgn = NULL;
1610 window->hRgn = hRgn;
1612 if (window->visible)
1613 renderspuWindowRgnApply(window);
1615 crDebug("Render SPU: SetWindowRgn (%x, cRects=%i)", window->hWnd, cRects);
1707 void renderspu_SystemReparentWindow(WindowInfo *window)
1709 SetParent(window->hWnd, (HWND)render_spu_parent_window_id);