[GH-ISSUE #400] A small fix for playing games in FullScreen mode in Windows #116

Closed
opened 2026-03-17 03:45:44 +03:00 by kerem · 2 comments
Owner

Originally created by @oioitff on GitHub (Jan 11, 2013).
Original GitHub issue: https://github.com/hrydgard/ppsspp/issues/400

When I try to play games in FullScreen mode in Windows, it doesn't work well. So I try to fix some codes in file Windows/WndMainWindow.cpp. And now, it seems to work well.

fix for function SetZoom():


  void SetZoom(float zoomx, float zoomy=0) {
    if (zoomx < 5)
        g_Config.iWindowZoom = (int) zoomx;
    RECT rc, rcOuter;
    if (zoomy==0)    
    {
        zoomy=zoomx;
        GetWindowRectAtZoom((int) zoomx, rc, rcOuter);
    }
    else             //  Change to FullScreen
    {
        rcOuter.left = 0;
        rcOuter.top = 0;
        rcOuter.right = 480*zoomx;
        rcOuter.bottom = 272*zoomy;
        rc = rcOuter;
    }
    MoveWindow(hwndMain, rcOuter.left, rcOuter.top, rcOuter.right - rcOuter.left, rcOuter.bottom - rcOuter.top, TRUE);
    MoveWindow(hwndDisplay, 0, 0, rc.right - rc.left, rc.bottom - rc.top, TRUE);
    PSP_CoreParameter().pixelWidth = (int) (480 * zoomx);
    PSP_CoreParameter().pixelHeight = (int) (272 * zoomy);
    GL_Resized();
}

fix for message ID_OPTIONS_FULLSCREEN:


       case ID_OPTIONS_FULLSCREEN:
            if(g_bFullScreen) {
                _ViewNormal(hWnd); 
                SetZoom(1); //restore window to original size
            }
            else {
                int cx = ::GetSystemMetrics(SM_CXSCREEN);
                int cy = ::GetSystemMetrics(SM_CYSCREEN);
                SetZoom(cx / 480.0f, cy / 272.0f);
                _ViewFullScreen(hWnd);
            }
            break;

Originally created by @oioitff on GitHub (Jan 11, 2013). Original GitHub issue: https://github.com/hrydgard/ppsspp/issues/400 When I try to play games in FullScreen mode in Windows, it doesn't work well. So I try to fix some codes in file Windows/WndMainWindow.cpp. And now, it seems to work well. fix for function SetZoom(): --- ``` void SetZoom(float zoomx, float zoomy=0) { if (zoomx < 5) g_Config.iWindowZoom = (int) zoomx; RECT rc, rcOuter; if (zoomy==0) { zoomy=zoomx; GetWindowRectAtZoom((int) zoomx, rc, rcOuter); } else // Change to FullScreen { rcOuter.left = 0; rcOuter.top = 0; rcOuter.right = 480*zoomx; rcOuter.bottom = 272*zoomy; rc = rcOuter; } MoveWindow(hwndMain, rcOuter.left, rcOuter.top, rcOuter.right - rcOuter.left, rcOuter.bottom - rcOuter.top, TRUE); MoveWindow(hwndDisplay, 0, 0, rc.right - rc.left, rc.bottom - rc.top, TRUE); PSP_CoreParameter().pixelWidth = (int) (480 * zoomx); PSP_CoreParameter().pixelHeight = (int) (272 * zoomy); GL_Resized(); } ``` --- fix for message ID_OPTIONS_FULLSCREEN: --- ``` case ID_OPTIONS_FULLSCREEN: if(g_bFullScreen) { _ViewNormal(hWnd); SetZoom(1); //restore window to original size } else { int cx = ::GetSystemMetrics(SM_CXSCREEN); int cy = ::GetSystemMetrics(SM_CYSCREEN); SetZoom(cx / 480.0f, cy / 272.0f); _ViewFullScreen(hWnd); } break; ``` ---
kerem closed this issue 2026-03-17 03:45:49 +03:00
Author
Owner

@devnoname120 commented on GitHub (Jan 11, 2013):

Please do a pull request instead.

<!-- gh-comment-id:12151991 --> @devnoname120 commented on GitHub (Jan 11, 2013): Please do a pull request instead.
Author
Owner

@oioitff commented on GitHub (Jan 12, 2013):

Oh, thanks!

<!-- gh-comment-id:12173976 --> @oioitff commented on GitHub (Jan 12, 2013): Oh, thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ppsspp#116
No description provided.