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

Author Topic: BUG: Fullscreen mode on OS X  (Read 2452 times)

0 Members and 1 Guest are viewing this topic.

eigen

  • Jr. Member
  • **
  • Posts: 64
  • Brobdingnagian ding dong
    • View Profile
    • Pioneersgame.com
BUG: Fullscreen mode on OS X
« 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.


(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:

(Click to see full size)
« Last Edit: June 05, 2012, 02:33:50 pm by eigen »

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: BUG: Fullscreen mode on OS X
« Reply #1 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.
SFML / OS X developer

eigen

  • Jr. Member
  • **
  • Posts: 64
  • Brobdingnagian ding dong
    • View Profile
    • Pioneersgame.com
Re: BUG: Fullscreen mode on OS X
« Reply #2 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:


640 x 480 full-screen mode. I don't see anything ... don't know how that's even possible.


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

1024 x 768 full-screen mode. Something has appeared.


1280 x 800 full-screen mode. The blue bits have appeared.


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.


Native resolution 1920 x 1200 in full-screen mode


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:



Hopefully this helps. Not sure what else I can say.
« Last Edit: June 06, 2012, 10:24:51 am by Laurent »

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: BUG: Fullscreen mode on OS X
« Reply #3 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.
SFML / OS X developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: BUG: Fullscreen mode on OS X
« Reply #4 on: June 06, 2012, 01:40:36 pm »
Everything should be working if you get SFML from github now.  :D
SFML / OS X developer

eigen

  • Jr. Member
  • **
  • Posts: 64
  • Brobdingnagian ding dong
    • View Profile
    • Pioneersgame.com
Re: BUG: Fullscreen mode on OS X
« Reply #5 on: June 06, 2012, 03:49:46 pm »
Thank you! All is well now :)