mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
always do SetForegroundWindow()
This commit is contained in:
parent
fed924dab0
commit
1d49310670
@ -2407,6 +2407,12 @@ CreateScreenBuffersAndDevice(DXScreenData &Display) {
|
|||||||
if(dx_preserve_fpu_state)
|
if(dx_preserve_fpu_state)
|
||||||
dwBehaviorFlags|=D3DCREATE_FPU_PRESERVE;
|
dwBehaviorFlags|=D3DCREATE_FPU_PRESERVE;
|
||||||
|
|
||||||
|
// if window is not foreground in exclusive mode, ddraw thinks you are 'not active', so
|
||||||
|
// it changes your WM_ACTIVATEAPP from true to false, causing us
|
||||||
|
// to go into a 'wait-for WM_ACTIVATEAPP true' loop, and the event never comes so we hang
|
||||||
|
// in fullscreen wait. also doing this for windowed mode since it was requested.
|
||||||
|
SetForegroundWindow(Display.hWnd);
|
||||||
|
|
||||||
if(_props._fullscreen) {
|
if(_props._fullscreen) {
|
||||||
pPresParams->SwapEffect = D3DSWAPEFFECT_DISCARD; // we dont care about preserving contents of old frame
|
pPresParams->SwapEffect = D3DSWAPEFFECT_DISCARD; // we dont care about preserving contents of old frame
|
||||||
pPresParams->FullScreen_PresentationInterval = (dx_sync_video ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE);
|
pPresParams->FullScreen_PresentationInterval = (dx_sync_video ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE);
|
||||||
@ -2434,13 +2440,6 @@ CreateScreenBuffersAndDevice(DXScreenData &Display) {
|
|||||||
assert(pPresParams->SwapEffect == D3DSWAPEFFECT_DISCARD); // only valid effect for multisample
|
assert(pPresParams->SwapEffect == D3DSWAPEFFECT_DISCARD); // only valid effect for multisample
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// if window is not foreground in exclusive mode, ddraw thinks you are 'not active', so
|
|
||||||
// it changes your WM_ACTIVATEAPP from true to false, causing us
|
|
||||||
// to go into a 'wait-for WM_ACTIVATEAPP true' loop, and the event never comes so we hang
|
|
||||||
// in fullscreen wait.
|
|
||||||
|
|
||||||
SetForegroundWindow(Display.hWnd);
|
|
||||||
ClearToBlack(Display.hWnd,_props);
|
ClearToBlack(Display.hWnd,_props);
|
||||||
|
|
||||||
hr = pD3D8->CreateDevice(Display.CardIDNum, D3DDEVTYPE_HAL, _pParentWindowGroup->_hParentWindow,
|
hr = pD3D8->CreateDevice(Display.CardIDNum, D3DDEVTYPE_HAL, _pParentWindowGroup->_hParentWindow,
|
||||||
|
@ -458,6 +458,8 @@ void wglGraphicsWindow::config() {
|
|||||||
ShowWindow(_mwindow, SW_SHOWNORMAL);
|
ShowWindow(_mwindow, SW_SHOWNORMAL);
|
||||||
ShowWindow(_mwindow, SW_SHOWNORMAL);
|
ShowWindow(_mwindow, SW_SHOWNORMAL);
|
||||||
|
|
||||||
|
SetForegroundWindow(_mwindow);
|
||||||
|
|
||||||
int chg_result = ChangeDisplaySettings(&dm, CDS_FULLSCREEN);
|
int chg_result = ChangeDisplaySettings(&dm, CDS_FULLSCREEN);
|
||||||
|
|
||||||
if (chg_result!=DISP_CHANGE_SUCCESSFUL) {
|
if (chg_result!=DISP_CHANGE_SUCCESSFUL) {
|
||||||
@ -504,6 +506,8 @@ void wglGraphicsWindow::config() {
|
|||||||
window_style, win_rect.left, win_rect.top, win_rect.right-win_rect.left,
|
window_style, win_rect.left, win_rect.top, win_rect.right-win_rect.left,
|
||||||
win_rect.bottom-win_rect.top,
|
win_rect.bottom-win_rect.top,
|
||||||
NULL, NULL, hinstance, 0);
|
NULL, NULL, hinstance, 0);
|
||||||
|
|
||||||
|
SetForegroundWindow(_mwindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_mwindow) {
|
if (!_mwindow) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user