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

Author Topic: [SOLVED] Knowing the style of the RenderWindow?  (Read 1475 times)

0 Members and 1 Guest are viewing this topic.

santiaboy

  • Full Member
  • ***
  • Posts: 118
    • View Profile
[SOLVED] Knowing the style of the RenderWindow?
« on: March 22, 2013, 07:50:55 pm »
Hey guys, im re-making my Options menu, and I was wondering if there was some way of knowing the style of a renderwindow. I looked at the documentation, but there isn't a .getStyle() or anyting similar.

I wanted to do something like this
if(!windowIsFullscreen && fullscreenOptionChecked){
    window.create(VideoMode, "Blah", Style::Fullscreen);
}
 

without recurring to using bools(windowIsFUllscreen, windowIsWithoutBorder, etc) so it would be like
if(window.getStyle() == Style::Fullscreen && fullscreenOptionChecked){
    window.create(VideoMode, "Blah", Style::Fullscreen);
}
 

EDIT: I know the .getStyle() doesn't exist, I just wrote it for clarification of what I wanted  ::)
« Last Edit: March 22, 2013, 11:15:03 pm by santiaboy »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Knowing the style of the RenderWindow?
« Reply #1 on: March 22, 2013, 08:30:05 pm »
Just store the style in a variable before passing it to the window, and you get your getStyle() replacement ;)

unsigned long style = sf::Style::Fullscreen;
window.create(..., style);
Laurent Gomila - SFML developer

santiaboy

  • Full Member
  • ***
  • Posts: 118
    • View Profile
Re: Knowing the style of the RenderWindow?
« Reply #2 on: March 22, 2013, 11:14:49 pm »
Thanks, worked like a charm!  ;D

Marked as Solved

 

anything