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

Author Topic: Window sizes not accurate  (Read 3029 times)

0 Members and 1 Guest are viewing this topic.

Kaphonaits

  • Newbie
  • *
  • Posts: 21
    • View Profile
Window sizes not accurate
« on: November 02, 2014, 02:10:46 am »
If i create a renderWindow at 1024x768, sizer reports it to be at 1040x806. why is this?
The keyboard is mightier than the sword.

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Window sizes not accurate
« Reply #1 on: November 02, 2014, 03:36:51 am »
It's because windows are not just the content, they are also decorated, they have the borders, the titlebar and a bunch of buttons (close, minimize, etc.).
The size you get/set in SFML is just the size of the content (the rendering area) itself, it doesn't include the decorations.

There are some mentions of this in http://sfml-dev.org/documentation/2.1/classsf_1_1RenderWindow.php

Oh, and this is not .NET specific, it happens in all languages.
« Last Edit: November 02, 2014, 03:43:06 am by FRex »
Back to C++ gamedev with SFML in May 2023