Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: wxWidgets/SFML fullscreen issue  (Read 2373 times)

0 Members and 1 Guest are viewing this topic.

sgraves66

  • Newbie
  • *
  • Posts: 6
    • View Profile
wxWidgets/SFML fullscreen issue
« on: July 29, 2014, 05:27:25 am »
I use wxWidgets as the main windowing toolkit and create a child frame to host SFML for portability.

I'm currently experimenting with using a child wxFrame over the SFML frame for hosting an embedded VLC video window. Everything works fine until I enter full screen mode on my primary monitor.

wxWidgets has a ShowFullScreen() method that can be used and I'm not setting SFML full screen while doing so. The application feels like it is entering an exclusive full screen mode and for some reason no video playback is displayed. Setting the main window to bordless and maximized causes the same behavior. This only occurs on the primary monitor in a triple monitor setup essentially when the child SFML frame and the owner frame equal the resolution/position of the primary monitor. I haven't tried this on a single monitor setup, so it may or may not occur.

I'm currently using SFML 2.1 and wxWidgets 3.0.0 compiled using gcc (x32-4.8.1-posix-sjlj-rev5) on Win32. I'm rather unfamiliar with SFML and am hoping that I'm overlooking something obvious. Any suggestions for overcoming this behavior? I've yet to try Linux but I do suspect this is Win32-specific.

Windows 7 x64
NVIDIA GeForce GTX 560 Ti - Driver v337.88
« Last Edit: July 29, 2014, 05:40:25 am by sgraves66 »

sgraves66

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: wxWidgets/SFML fullscreen issue
« Reply #1 on: July 29, 2014, 11:55:24 pm »
It looks like this is normal opengl behavior and not configurable. Since I'm technically mixing Direct3D and OpenGL, full screen prevents the child VLC window from rendering. Interesting that it's limited to the primary display. Driver setting maybe? Not really a graphics guy.

Easy enough to work around by using a dedicated full screen video window or by offsetting 1pt.

Toggle full screen example for wxFrame:

void MainFrame::AppToggleFullScreen()
{
#ifdef _WIN32
    if (this->GetAppFullScreen())
    {
        SetWindowLong(this->GetHandle(), GWL_STYLE, this->GetNormalStyle());
        if (!(this->GetNormalStyle() & WS_MAXIMIZE))
        {
            this->SetSize(this->GetNormalRect());
        }
        this->SetAppFullScreen(false);
    }
    else
    {
        this->SetNormalRect(this->GetRect());
        this->SetNormalStyle(GetWindowLong(this->GetHandle(), GWL_STYLE));

        SetWindowLong(this->GetHandle(), GWL_STYLE, WS_POPUP | WS_VISIBLE);

        wxDisplay d(wxDisplay::GetFromWindow(this));
        wxRect monitorRect = d.GetGeometry();
        int x = monitorRect.x;
        int y = monitorRect.y - 1;
        int width = monitorRect.width;
        int height = monitorRect.height + 2;
        MoveWindow(this->GetHandle(), x, y, width, height, FALSE);

        this->SetAppFullScreen(true);
    }
#endif
}
 
« Last Edit: August 19, 2014, 10:23:03 pm by sgraves66 »

 

anything