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

Author Topic: Make properties of Window readable  (Read 2848 times)

0 Members and 1 Guest are viewing this topic.

Oberon

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • My Github profile
Make properties of Window readable
« on: February 26, 2012, 01:02:39 pm »
The Window class has (too) many write-only properties, i.e. setters without corresponding getters (I found 10, to be exact):
  • SetPosition (pull request #168, issue #15)
  • EnableVerticalSync (SetVerticalSyncEnabled)
  • SetFrameRateLimit
  • SetJoystickThreshold
  • video mode (bits per pixel) and style (Create and constructor)
  • SetTitle
  • Show(bool): Could also be named SetVisible
  • EnableKeyRepeat (SetKeyRepeatEnabled)
  • SetIcon
  • ShowMouseCursor
  • (SetSize has GetWidth and GetHeight, but could be more consistent (would also affect RenderTarget, RenderWindow))


Many of them could be useful e.g. for displaying an options-dialog, without having to save e.g. the joystick threshold in another variable.
In addition, I suspect this to be the reason for the usage SetXx methods  instead of properties in SMFL.net, am I right?

Imho, this is all not high priority but should be considered for 2.x.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Make properties of Window readable
« Reply #1 on: February 27, 2012, 08:28:06 pm »
Good point.

I should at least make the name of existing functions more consistent, I won't be able to change them after SFML 2.0 is released.

Getters can be added in SFML 2.x though.
Laurent Gomila - SFML developer