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:
commit
17cf6873aa
1
extlibs/bin/x86_64/sndfile.framework/Resources
Symbolic link
1
extlibs/bin/x86_64/sndfile.framework/Resources
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
Versions/Current/Resources
|
@ -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>
|
BIN
extlibs/bin/x86_64/sndfile.framework/Versions/A/sndfile
Executable file
BIN
extlibs/bin/x86_64/sndfile.framework/Versions/A/sndfile
Executable file
Binary file not shown.
1
extlibs/bin/x86_64/sndfile.framework/Versions/Current
Symbolic link
1
extlibs/bin/x86_64/sndfile.framework/Versions/Current
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
A
|
1
extlibs/bin/x86_64/sndfile.framework/sndfile
Symbolic link
1
extlibs/bin/x86_64/sndfile.framework/sndfile
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
Versions/Current/sndfile
|
@ -29,6 +29,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
|
|
||||||
namespace sf
|
namespace sf
|
||||||
{
|
{
|
||||||
namespace priv
|
namespace priv
|
||||||
|
@ -36,29 +36,29 @@ namespace priv
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
double Platform::GetSystemTime()
|
double Platform::GetSystemTime()
|
||||||
{
|
{
|
||||||
static LARGE_INTEGER Frequency;
|
static LARGE_INTEGER frequency;
|
||||||
static BOOL UseHighPerformanceTimer = QueryPerformanceFrequency(&Frequency);
|
static BOOL useHighPerformanceTimer = QueryPerformanceFrequency(&frequency);
|
||||||
|
|
||||||
if (UseHighPerformanceTimer)
|
if (useHighPerformanceTimer)
|
||||||
{
|
{
|
||||||
// High performance counter available : use it
|
// High performance counter available : use it
|
||||||
LARGE_INTEGER CurrentTime;
|
LARGE_INTEGER currentTime;
|
||||||
QueryPerformanceCounter(&CurrentTime);
|
QueryPerformanceCounter(¤tTime);
|
||||||
|
|
||||||
return static_cast<double>(CurrentTime.QuadPart) / Frequency.QuadPart;
|
return static_cast<double>(currentTime.QuadPart) / frequency.QuadPart;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// High performance counter not available : use GetTickCount (less accurate)
|
// High performance counter not available: use GetTickCount (less accurate)
|
||||||
return GetTickCount() * 0.001;
|
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
|
} // namespace priv
|
||||||
|
@ -100,10 +100,12 @@ myIsCursorIn (false)
|
|||||||
RegisterWindowClass();
|
RegisterWindowClass();
|
||||||
|
|
||||||
// Compute position and size
|
// Compute position and size
|
||||||
int left = (GetDeviceCaps(GetDC(NULL), HORZRES) - mode.Width) / 2;
|
HDC screenDC = GetDC(NULL);
|
||||||
int top = (GetDeviceCaps(GetDC(NULL), VERTRES) - mode.Height) / 2;
|
int left = (GetDeviceCaps(screenDC, HORZRES) - mode.Width) / 2;
|
||||||
|
int top = (GetDeviceCaps(screenDC, VERTRES) - mode.Height) / 2;
|
||||||
int width = myWidth = mode.Width;
|
int width = myWidth = mode.Width;
|
||||||
int height = myHeight = mode.Height;
|
int height = myHeight = mode.Height;
|
||||||
|
ReleaseDC(NULL, screenDC);
|
||||||
|
|
||||||
// Choose the window style according to the Style parameter
|
// Choose the window style according to the Style parameter
|
||||||
DWORD win32Style = WS_VISIBLE;
|
DWORD win32Style = WS_VISIBLE;
|
||||||
|
Loading…
Reference in New Issue
Block a user