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

Author Topic: [SOLVED] Fullscreen and sf::VideoMode::GetMode problems  (Read 2573 times)

0 Members and 1 Guest are viewing this topic.

aFictitiousForce

  • Newbie
  • *
  • Posts: 4
    • View Profile
[SOLVED] Fullscreen and sf::VideoMode::GetMode problems
« on: May 11, 2010, 11:45:59 am »
So, I've basically copy and pasted the code from the Graphics tutorial:

Code: [Select]

#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <iostream>

int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics", sf::Style::Fullscreen);

    // 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();
        }

        // Clear the screen (fill it with black color)
        App.Clear();

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

    return EXIT_SUCCESS;
}


I've simply added the fullscreen parameter in the sf::RenderWindow declaration.  However, on execution, I keep getting the following output or something similar:

Quote

Failed to get the list of available video modes
Failed to get the list of available video modes
Failed to get the list of available video modes
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  1 (X_CreateWindow)
  Value in failed request:  0x0
  Serial number of failed request:  98
  Current serial number in output stream:  103


Similar messages occur whenever I use sf::VideoMode::GetMode(int) in any capacity, fullscreen or otherwise.

Creating a VideoMode with every other sf::Style works fine.  That is, I can do this:

Code: [Select]

sf::RenderWindow App(sf::VideoMode(800, 600, 32), "AAAA", sf::Style::Resize);


and it compiles and runs just fine.

I'm using Ubuntu 10.04, GNOME.  My video card's an NVIDIA 8500GT using driver 195.36.15.  Any idea what could be wrong?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[SOLVED] Fullscreen and sf::VideoMode::GetMode problems
« Reply #1 on: May 11, 2010, 11:50:10 am »
Do you have the XRandr extension installed? Are your graphics drivers up to date?
Laurent Gomila - SFML developer

aFictitiousForce

  • Newbie
  • *
  • Posts: 4
    • View Profile
[SOLVED] Fullscreen and sf::VideoMode::GetMode problems
« Reply #2 on: May 11, 2010, 11:59:18 am »
According to Synaptic I have both libxrandr2, and libxrandr-dev packages installed.  My driver is slightly out of date, but I believe it's the version that came with the distro.  I'll try updating in the morning and report what I find[/i]

aFictitiousForce

  • Newbie
  • *
  • Posts: 4
    • View Profile
[SOLVED] Fullscreen and sf::VideoMode::GetMode problems
« Reply #3 on: May 11, 2010, 08:51:26 pm »
Turns out it's a Xinerama/XRandr issue.  Whenever I start nvidia-settings I get this warning:

Quote

Xlib:  extension "RANDR" missing on display ":0.0".


In short, I just needed to disable Xinerama.  Any other method of dual-screening works fine.[/quote]

 

anything