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

Author Topic: VideoMode taking XY positions  (Read 2802 times)

0 Members and 2 Guests are viewing this topic.

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
VideoMode taking XY positions
« on: March 11, 2014, 12:40:39 pm »
Hi

I'd like to request that a VideoMode's constructor be modified to take an xy position, with a default parameter of 0,0 (?). On certain hardware platforms we use, we cannot open a window, and then move it using setPosition. So we have had to modify SFML to create a window at its final position, which others may find useful too.

e.g. in VideoMode.cpp
VideoMode::VideoMode(int xPos, int yPos, unsigned int modeWidth, unsigned int modeHeight, unsigned int modeBitsPerPixel) :
XPos            (xPos),
YPos            (yPos),
width       (modeWidth),
height      (modeHeight),
bitsPerPixel(modeBitsPerPixel)
{
}
 

and in WindowImplWin32.cpp constructor:

    int left   = mode.XPos;
    int top    = mode.YPos;
 
SFML 2.1

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: VideoMode taking XY positions
« Reply #1 on: March 11, 2014, 01:11:06 pm »
This has already been requested before, and is more or less planned for a future version. However the position of the window has nothing to do with the video mode ;)

What I had in mind was to allow calling sf::Window's functions before creating it (in this case, calling Window::setPosition), and to use all the stored properties when Window::create is called. This would also solve another problem (inconsistency of window state when calling Window::create again).
Laurent Gomila - SFML developer

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Re: VideoMode taking XY positions
« Reply #2 on: March 11, 2014, 01:17:46 pm »
Sounds good to me! :)
SFML 2.1

 

anything