SFML community forums

Help => Graphics => Topic started by: eigen on June 05, 2012, 01:30:48 pm

Title: BUG: Fullscreen mode on OS X
Post by: eigen on June 05, 2012, 01:30:48 pm
Hi, I seem to be having a problem with running the game in fullscreen on OS X. I just updated to the RC. It used to work, I mean I'm not sure exactly which version but SFML 2.

iMac, early 2009, 1920x1200, NVIDIA GeForce 9400 ... thought I doubt it matters because it used to work and I haven't upgraded the software recently.

How the problem manifests:
Unless I use fullscreen mode in the native resolution, what I see on the screen is the bottom-left section of the whole thing. The section drawn is as large as the resolution I wanted.

I took a screenshot. Sorry it it's too big, I think Macs take a screenshot as large as the screen, not as large as the application resolution. Anyway, I ran it in 960 x 600, which is exactly half of the native one.

(http://eigen.pri.ee/images/sfml_fullscreen_bug.png) (http://eigen.pri.ee/images/sfml_fullscreen_bug.png)
(Click to see full size)


Also, the mouse is limited to the upper parts of the screen and I can't move it downwards from where it is. It probably goes up but I can't see that.

So, to cap: I see a 960 x 600 bottom-left section of the whole screen supposedly rendered to a 1920 x 1200 buffer/image/texture.

This is how the whole thing should look like:
(http://eigen.pri.ee/images/sfml_fullscreen_bug_2.png) (http://eigen.pri.ee/images/sfml_fullscreen_bug_2.png)
(Click to see full size)
Title: Re: BUG: Fullscreen mode on OS X
Post by: Hiura on June 05, 2012, 08:35:02 pm
Could you give me a minimal application (i.e. only a basic main function of ~30 lines of code) that reproduces the issue otherwise I won't be able to test.

Also, tell me exactly which version of SFML and OS you're using.
Title: Re: BUG: Fullscreen mode on OS X
Post by: eigen on June 06, 2012, 10:15:49 am
OS: Mac OS X 10.7.3
SFML: Not sure about the SFML version. I downloaded the RC version from the main website about 4 days ago.

This is the most basic thing ever. Put it in a main function and you're done.

  int w = 640;
  int h = 480;
 
  sf::RenderWindow * app = new sf::RenderWindow(sf::VideoMode(w, h, 32), "Test", sf::Style::Close | sf::Style::Fullscreen);

  while (app->isOpen())
  {
    sf::Event Event;
   
    while (app->pollEvent(Event))
    {
      if (Event.type == sf::Event::KeyPressed && Event.key.code == sf::Keyboard::Escape)
      {
        app->close();
      }
    }
   
    app->clear(sf::Color(64,128,64, 255));
   
   
    sf::RectangleShape shape;
    shape.setFillColor(sf::Color(255,128,128, 255));
   
    // Shape in the middle

    shape.setOutlineThickness(0);
    shape.setSize(sf::Vector2f(w - 100, h - 100));
    shape.setPosition(w/2 - (w - 100) / 2, h/2 - (h - 100) / 2);
    app->draw(shape);
   
    // Shape in the bottom-left corner
   
    shape.setSize(sf::Vector2f(50, 50));
    shape.setPosition(0, h - 50);
    app->draw(shape);
   
    // Shape in the top-left corner
   
    shape.setSize(sf::Vector2f(50, 50));
    shape.setPosition(0, 0);
    app->draw(shape);
   
    // Shape in the bottom-right corner
   
    shape.setSize(sf::Vector2f(50, 50));
    shape.setPosition(w - 50, h - 50);
    app->draw(shape);
   
    // Shape in the top-right corner
   
    shape.setSize(sf::Vector2f(50, 50));
    shape.setPosition(w - 50, 0);
    app->draw(shape);
   
    // Shape on the left edge
   
    shape.setFillColor(sf::Color(128,128,255, 255));
    shape.setSize(sf::Vector2f(50, 50));
    shape.setPosition(0, h/2 - 25);
    app->draw(shape);
   
    // Shape on the right edge
   
    shape.setFillColor(sf::Color(128,128,255, 255));
    shape.setSize(sf::Vector2f(50, 50));
    shape.setPosition(w - 50, h/2 - 25);
    app->draw(shape);
   

    app->display();
  }


Trying out on this simple project I get very weird results. It's no longer the bottom-left section ... most of the time I don't see anything at all.

(I resized the larger images to fit the forum)

640 x 480 windowed mode:
(http://eigen.pri.ee/images/debug1.png)

640 x 480 full-screen mode. I don't see anything ... don't know how that's even possible.
(http://eigen.pri.ee/images/debug2.png)

Same with 800 x 600. I don't see anything in full screen.

1024 x 768 full-screen mode. Something has appeared.
(http://eigen.pri.ee/images/debug3.png)

1280 x 800 full-screen mode. The blue bits have appeared.
(http://eigen.pri.ee/images/debug6.png)

Something more arbitary ... 1280 x 1200. This appears to be running in 1920 x 1200 actually, because there is no scaling and everything is pixel pefect.
(http://eigen.pri.ee/images/debug4.png)

Native resolution 1920 x 1200 in full-screen mode
(http://eigen.pri.ee/images/debug5.png)

I tried with both the dylibs and framework files. No difference.


When running the test app fullscreen in 640 x 480 on a co-workers Macbook Pro (OS 10.7.4, native resolution 1440 x 900) I see this:
(http://eigen.pri.ee/images/debug7.png)


Hopefully this helps. Not sure what else I can say.
Title: Re: BUG: Fullscreen mode on OS X
Post by: Hiura on June 06, 2012, 11:17:02 am
Arrr yes you're right!

Last time I checked it did work but that was a long time ago. At least 77ec92ce5e4f27111a9abecc56f74e339046b2d2 works but this old (30 january)....

I'll look into it, thanks for the report.
Title: Re: BUG: Fullscreen mode on OS X
Post by: Hiura on June 06, 2012, 01:40:36 pm
Everything should be working if you get SFML from github now.  :D
Title: Re: BUG: Fullscreen mode on OS X
Post by: eigen on June 06, 2012, 03:49:46 pm
Thank you! All is well now :)