We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1123 - SDL_WINDOWPOS_CENTERED does not work correctly
Summary: SDL_WINDOWPOS_CENTERED does not work correctly
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.0
Hardware: x86 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-15 01:10 UTC by Daniel
Modified: 2011-02-16 00:35 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel 2011-02-15 01:10:48 UTC
After spending 15 minutes wondering why all the appropriate functions returned success codes on creating my window, yet there was nothing to show for it. I realized the following ?constant? does not work correctly on Windows 7.
It does work as expected on Ubuntu 10.10; my other platform.

This was tested through: SDL_CreateWindow(name, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, flags);

I changed it to 0,0. And the window appeared as expected.
Comment 1 Sam Lantinga 2011-02-15 16:57:05 UTC
I just tried this in Windows 7 and it worked with the latest code:
http://www.libsdl.org/tmp/SDL-1.3.zip

Can you retry with the latest snapshot?
Are you using a single monitor or multi-monitor setup?
Comment 2 Daniel 2011-02-15 20:09:56 UTC
Works correctly with latest build, but not yesterdays (lol).

Cheers, fixed.
Comment 3 Sam Lantinga 2011-02-15 21:56:43 UTC
Great, thanks! :)
Comment 4 Daniel 2011-02-15 22:34:46 UTC
OK, tests are as follows:

Ubuntu 10.10 - ATI HD4890 - Works
Windows 7 - Intel HD Graphics - Works
Windows 7 - ATI HD4890 - Fails (as original bug posted).

I'm not sure what relevant information to gather, they are all running the same source code/version, Windows compiled with the same version of Visual Studio C++ Express 2010. Ubuntu obviously g++.

The Ubuntu 4890 and Windows 7 4890 are the same machine, both with up to date ATI drivers.

No idea.
Comment 5 Sam Lantinga 2011-02-15 23:08:28 UTC
Can you try again?  I just fixed a bunch of issues with windows display handling:
http://hg.libsdl.org/SDL/rev/75f5ff92ad08
Comment 6 Daniel 2011-02-15 23:34:57 UTC
Thats fixed it. Well done.
Comment 7 Sam Lantinga 2011-02-16 00:35:48 UTC
Great, thanks!