Add OSystem::setAppWindowPos functionality to Windows, and bumped version number for another test build.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2092 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2010-08-11 22:36:07 +00:00
parent 6a5998c684
commit 2818445bf2
4 changed files with 37 additions and 11 deletions

View File

@ -22,7 +22,7 @@
#include <cstdlib>
#define STELLA_VERSION "3.2_test4"
#define STELLA_VERSION "3.2_test5"
#define STELLA_BUILD atoi("$Rev$"+6)
#endif

View File

@ -17,6 +17,7 @@
// $Id$
//============================================================================
#include <SDL_syswm.h>
#include <fstream>
#include "bspf.hxx"
@ -90,7 +91,24 @@ OSystemWin32::~OSystemWin32()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt64 OSystemWin32::getTicks() const
{
return uInt64(SDL_GetTicks()) * 1000;
}
void OSystemWin32::setAppWindowPos(int x, int y, int w, int h)
{
SDL_SysWMinfo sdl_info;
memset(&sdl_info, 0, sizeof(sdl_info));
SDL_VERSION (&sdl_info.version);
if(SDL_GetWMInfo(&sdl_info) <= 0)
return;
// The following mostly comes from SDL_dx5video.c
HWND window = sdl_info.window;
RECT bounds;
bounds.left = x;
bounds.top = y;
bounds.right = x + w;
bounds.bottom = y + h;
AdjustWindowRectEx(&bounds, GetWindowLong(window, GWL_STYLE), (GetMenu(window) != NULL), 0);
SetWindowPos(window, HWND_NOTOPMOST, x, y, bounds.right-bounds.left,
bounds.bottom-bounds.top, SWP_NOCOPYBITS | SWP_SHOWWINDOW);
}

View File

@ -43,12 +43,12 @@ class OSystemWin32 : public OSystem
virtual ~OSystemWin32();
public:
/**
This method returns number of ticks in microseconds.
@return Current time in microseconds.
*/
virtual uInt64 getTicks() const;
/**
Move window to given position. The width and height are also
required for the underlying function, but the window size itself
absolutely must not be changed.
*/
void setAppWindowPos(int x, int y, int w, int h);
};
#endif

View File

@ -825,6 +825,10 @@
RelativePath="..\gui\CheckListWidget.cxx"
>
</File>
<File
RelativePath="..\gui\ComboDialog.cxx"
>
</File>
<File
RelativePath="..\gui\CommandDialog.cxx"
>
@ -1611,6 +1615,10 @@
RelativePath="..\gui\CheckListWidget.hxx"
>
</File>
<File
RelativePath="..\gui\ComboDialog.hxx"
>
</File>
<File
RelativePath="..\gui\Command.hxx"
>