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

Author Topic: Context Settings Help  (Read 1812 times)

0 Members and 1 Guest are viewing this topic.

wasalski

  • Newbie
  • *
  • Posts: 5
    • View Profile
Context Settings Help
« 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Context Settings Help
« Reply #1 on: May 27, 2011, 07:36:13 am »
Are you on Linux?
Laurent Gomila - SFML developer

wasalski

  • Newbie
  • *
  • Posts: 5
    • View Profile
Context Settings Help
« Reply #2 on: May 27, 2011, 06:22:21 pm »
Yes, I'm running Scientific Linux.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Context Settings Help
« Reply #3 on: May 27, 2011, 06:34:24 pm »
Ok, this is a known bug.
Laurent Gomila - SFML developer

 

anything