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

Author Topic: window style changes  (Read 6858 times)

0 Members and 1 Guest are viewing this topic.

DrEvil

  • Newbie
  • *
  • Posts: 21
    • View Profile
window style changes
« on: November 27, 2007, 04:03:32 pm »
I updated to the svn code so I could get the loading stuff from archives support, and I noticed that the GUI system I'm using(guichan) was misbehaving, when it didn't previously.

After digging around a bit to find out what was up I noticed that what appears to have happened is that the style changes of the render window seems to have caused issue. For example, creating an 800x600 render window, creates an 800x600 window, but due to the title bar, the actual client area is not 800x600. Alt-printscreen to take a screenshot of the window in the svn version results in an 800x600 screenshot, when a similar screenshot in the release version produced an 806x625 screenshot, presumably accounting for the borders and title bar, and in that case my GUI was working flawlessly. Now with the changed style I presume, the actual client area is no longer the requested resolution, and as a result the rendering of the GUI is off a bit by expecting the render area to be 800x600, which also adversely effects mouse position->widget detection. The window implementation doesn't seem to account for this discrepancy in the requested and resulting resolution of the client area, so I can't tell the GUI renderer what the real width and height are to correct the problem.

Was this an intentional side effect of the style changings? A bug?

Thanks

DrEvil

  • Newbie
  • *
  • Posts: 21
    • View Profile
window style changes
« Reply #1 on: November 27, 2007, 04:14:27 pm »
Btw, I'm using
new sf::RenderWindow(sf::VideoMode(800,600), "Window", sf::Style::NoStyle);

in the new svn code, and

new sf::RenderWindow(sf::VideoMode(800,600), "Window", sf::RenderWindow::Fixed);

in the old

win32, xp if it matters

DrEvil

  • Newbie
  • *
  • Posts: 21
    • View Profile
window style changes
« Reply #2 on: November 27, 2007, 04:33:03 pm »
Arg, turns out it was something simple enough I overlooked at first glance.

In WindowImplWin32.cpp

in the constructor, under

// In windowed mode, adjust width and height so that window will have the requested client area

change if(Fullscreen) to if(!Fullscreen)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
window style changes
« Reply #3 on: November 27, 2007, 05:13:48 pm »
Yep, stupid error, I just fixed it today.
Laurent Gomila - SFML developer

DrEvil

  • Newbie
  • *
  • Posts: 21
    • View Profile
window style changes
« Reply #4 on: November 27, 2007, 05:21:13 pm »
Is there a way I can get similar results out of the current version that I was getting previously? I would like a specified resolution of the client area, and not have the border and title bar effect that, even if it means the window itself is a bit larger. I haven't dug around to look for what exactly made it work that way before. Do you recall what does that?

When I run Quake 4, or HL2 in a window, and probably most games, I get a window larger than the specified resolution, so that the render window is the specified resolution, and not clipped by the title bar or border as sfml currently does.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
window style changes
« Reply #5 on: November 28, 2007, 03:18:16 am »
Quote
I would like a specified resolution of the client area, and not have the border and title bar effect that, even if it means the window itself is a bit larger

Hum... after applying the fix it should be ok. Isn't it ?
Laurent Gomila - SFML developer

DrEvil

  • Newbie
  • *
  • Posts: 21
    • View Profile
window style changes
« Reply #6 on: November 28, 2007, 03:26:33 am »
You're right, my bad. It's all good.