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

Author Topic: Failed to change to fullscreen  (Read 5465 times)

0 Members and 1 Guest are viewing this topic.

Crazed

  • Newbie
  • *
  • Posts: 11
    • View Profile
Failed to change to fullscreen
« on: June 29, 2009, 08:26:17 am »
I havnt touched my projects using SFML in a months and I went to compile one and everything went fine, but my error log said "Failed to change display mode to fullscreen" and its in windowed mode.  Whats up? Last time I checked the code ran in fullscreen just fine..

help anyone?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Failed to change to fullscreen
« Reply #1 on: June 29, 2009, 08:29:28 am »
Can you show your code? What OS are you using?
Laurent Gomila - SFML developer

Crazed

  • Newbie
  • *
  • Posts: 11
    • View Profile
Failed to change to fullscreen
« Reply #2 on: June 30, 2009, 06:39:13 am »
64 bit Vista.  I have about 10 different little demos I had created a few months ago using SFML and they all worked fine but now each one fails to go into fullscreen and instead it just has a title bar at the top without any buttons.

Here is the only code I thought that would be relevant:
Code: [Select]

sf::VideoMode mode;
mode = sf::VideoMode::GetMode(0);
sf::RenderWindow game(mode, "Gamma", sf::Style::Fullscreen);


If you would like to see the entire source for one of them ill post it.  By the way this isnt the newest version of SFML, its from sometime around early January I believe.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Failed to change to fullscreen
« Reply #3 on: June 30, 2009, 07:52:47 am »
Do you have a USB joystick plugged?
Laurent Gomila - SFML developer

Crazed

  • Newbie
  • *
  • Posts: 11
    • View Profile
Failed to change to fullscreen
« Reply #4 on: June 30, 2009, 07:55:47 am »
Nope, this is a laptop and I have nothing plugged in at all.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Failed to change to fullscreen
« Reply #5 on: June 30, 2009, 07:59:48 am »
Ok. Anyway, you should try SFML 1.5 before I investigate more on this problem.
Laurent Gomila - SFML developer

Crazed

  • Newbie
  • *
  • Posts: 11
    • View Profile
Failed to change to fullscreen
« Reply #6 on: June 30, 2009, 07:11:35 pm »
The latest version didnt change anything. :(

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Failed to change to fullscreen
« Reply #7 on: June 30, 2009, 07:22:05 pm »
Can you show me a miniman and complete example that reproduces the problem?
Laurent Gomila - SFML developer

Crazed

  • Newbie
  • *
  • Posts: 11
    • View Profile
Failed to change to fullscreen
« Reply #8 on: June 30, 2009, 10:23:15 pm »
I thought it might be my code so I opened up one of the tutorials and used that code and it still happens:
Code: [Select]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>


////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");

    // Load the sprite image from a file
    sf::Image Image;
    if (!Image.LoadFromFile("sprite.tga"))
        return EXIT_FAILURE;

    // Create the sprite
    sf::Sprite Sprite(Image);

    // Change its properties
    Sprite.SetColor(sf::Color(0, 255, 255, 128));
    Sprite.SetPosition(200.f, 100.f);
    Sprite.SetScale(2.f, 2.f);

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Get elapsed time
        float ElapsedTime = App.GetFrameTime();

        // Move the sprite
        if (App.GetInput().IsKeyDown(sf::Key::Left))  Sprite.Move(-100 * ElapsedTime, 0);
        if (App.GetInput().IsKeyDown(sf::Key::Right)) Sprite.Move( 100 * ElapsedTime, 0);
        if (App.GetInput().IsKeyDown(sf::Key::Up))    Sprite.Move(0, -100 * ElapsedTime);
        if (App.GetInput().IsKeyDown(sf::Key::Down))  Sprite.Move(0,  100 * ElapsedTime);

        // Rotate the sprite
        if (App.GetInput().IsKeyDown(sf::Key::Add))      Sprite.Rotate(- 100 * ElapsedTime);
        if (App.GetInput().IsKeyDown(sf::Key::Subtract)) Sprite.Rotate(+ 100 * ElapsedTime);

        // Clear screen
        App.Clear();

        // Display sprite in our window
        App.Draw(Sprite);

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Failed to change to fullscreen
« Reply #9 on: July 01, 2009, 08:36:21 am »
So you just added the Fullscreen flag to this call
Code: [Select]
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
And you got the error?
Laurent Gomila - SFML developer

Sirt

  • Newbie
  • *
  • Posts: 27
    • View Profile
Failed to change to fullscreen
« Reply #10 on: July 02, 2009, 05:11:05 am »
As well as Laurents last question,I'll add that I
had a similer but not the same problem when I ran sfml in fullscreen mode when my screens resolution was 1280x720.

The sfml window would be totally invisable.
So I put it back on 1024x768 and it worked normally.

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Failed to change to fullscreen
« Reply #11 on: July 06, 2009, 11:32:02 pm »
It might be a thing with OpenGL drivers. Have you updated them to the latest?

Maybe non 4:3 resolutions (like 16:9) fuck up something in fullscreen (wouldn't be the first time).

Laurent, I think that it would be nice to check if the resolution available is "virtual".
Widescreens can accept 4:3 fullscreen dimensions stretching everything or maybe even failing.
I think there is a library that does this kind of checks, but can't remember the name.
This could be adressed by actually using the wide fullscreen dimensions but setting the viewport/proportions acording to the difference (So it has black bars on the sides or something)

Regards
-Martín

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Failed to change to fullscreen
« Reply #12 on: July 07, 2009, 07:45:43 am »
Quote
Laurent, I think that it would be nice to check if the resolution available is "virtual".

How? Every valid mode I retrieve from the OS is supposed to work anyway.
Laurent Gomila - SFML developer