Fixed a memory leak in sf::Window implementation on Windows

Synchronized sfml2 with trunk

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1280 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2009-11-21 21:39:31 +00:00
commit 17cf6873aa
8 changed files with 37 additions and 11 deletions

View File

@ -0,0 +1 @@
Versions/Current/Resources

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>sndfile</string>
<key>CFBundleIdentifier</key>
<string>com.mega-nerd.sndfile</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
</dict>
</plist>

Binary file not shown.

View File

@ -0,0 +1 @@
A

View File

@ -0,0 +1 @@
Versions/Current/sndfile

View File

@ -29,6 +29,7 @@
#include <unistd.h>
#include <sys/time.h>
namespace sf
{
namespace priv

View File

@ -36,29 +36,29 @@ namespace priv
////////////////////////////////////////////////////////////
double Platform::GetSystemTime()
{
static LARGE_INTEGER Frequency;
static BOOL UseHighPerformanceTimer = QueryPerformanceFrequency(&Frequency);
static LARGE_INTEGER frequency;
static BOOL useHighPerformanceTimer = QueryPerformanceFrequency(&frequency);
if (UseHighPerformanceTimer)
if (useHighPerformanceTimer)
{
// High performance counter available : use it
LARGE_INTEGER CurrentTime;
QueryPerformanceCounter(&CurrentTime);
LARGE_INTEGER currentTime;
QueryPerformanceCounter(&currentTime);
return static_cast<double>(CurrentTime.QuadPart) / Frequency.QuadPart;
return static_cast<double>(currentTime.QuadPart) / frequency.QuadPart;
}
else
{
// High performance counter not available : use GetTickCount (less accurate)
// High performance counter not available: use GetTickCount (less accurate)
return GetTickCount() * 0.001;
}
}
////////////////////////////////////////////////////////////
void Platform::Sleep(float Time)
void Platform::Sleep(float time)
{
::Sleep(static_cast<DWORD>(Time * 1000));
::Sleep(static_cast<DWORD>(time * 1000));
}
} // namespace priv

View File

@ -100,10 +100,12 @@ myIsCursorIn (false)
RegisterWindowClass();
// Compute position and size
int left = (GetDeviceCaps(GetDC(NULL), HORZRES) - mode.Width) / 2;
int top = (GetDeviceCaps(GetDC(NULL), VERTRES) - mode.Height) / 2;
HDC screenDC = GetDC(NULL);
int left = (GetDeviceCaps(screenDC, HORZRES) - mode.Width) / 2;
int top = (GetDeviceCaps(screenDC, VERTRES) - mode.Height) / 2;
int width = myWidth = mode.Width;
int height = myHeight = mode.Height;
ReleaseDC(NULL, screenDC);
// Choose the window style according to the Style parameter
DWORD win32Style = WS_VISIBLE;