SFML community forums

Help => Window => Topic started by: wasalski on May 27, 2011, 01:36:42 am

Title: Context Settings Help
Post by: wasalski on May 27, 2011, 01:36:42 am
I'm having some trouble setting the Context Settings for my window. I'm using SFML 2.0.


Code: [Select]
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>

#include <iostream>

int main(int argc, char** argv)
{
  sf::ContextSettings Settings;
  Settings.DepthBits         = 24; // Request a 24 bits depth buffer
  Settings.StencilBits       = 8;  // Request a 8 bits stencil buffer

  // Opens window and passes in my context settings
  sf::Window App(sf::VideoMode(400,400,32), "Test Window", sf::Style::Close, Settings);

  // Prints out the Depth Bits and Stencil Bits of the Window
  std::cout << "DepthBits: " << App.GetSettings().DepthBits << std::endl;
  std::cout << "StencilBits: " << App.GetSettings().StencilBits << std::endl;

  while ( App.IsOpened() )
  {
    sf::Event Event;
    while ( App.PollEvent(Event) )
    {
      if (Event.Type == sf::Event::Closed)
        App.Close();

      if (Event.Type == sf::Event::KeyPressed)
        App.Close();
    }

    App.Display();
  }

  return 0;
}



When I run this, I get:

Quote
DepthBits: 16
StencilBits: 0


Does anyone know what is going on?
Title: Context Settings Help
Post by: Laurent on May 27, 2011, 07:36:13 am
Are you on Linux?
Title: Context Settings Help
Post by: wasalski on May 27, 2011, 06:22:21 pm
Yes, I'm running Scientific Linux.
Title: Context Settings Help
Post by: Laurent on May 27, 2011, 06:34:24 pm
Ok, this is a known bug.