ported new mouse changes by Titi to win32 (and removed debug output for image classes)

This commit is contained in:
Mark Vejvoda
2010-03-25 01:06:28 +00:00
parent bf9ebf4912
commit 2b56cfe3b0
5 changed files with 16 additions and 4 deletions

View File

@@ -35,6 +35,7 @@ int Window::nextClassName= 0;
Window::WindowMap Window::createdWindows;
unsigned int Window::lastMouseEvent = 0; /** for use in mouse hover calculations */
static int oldX=0,oldY=0;
Vec2i Window::mousePos;
MouseState Window::mouseState;
@@ -68,6 +69,13 @@ Window::~Window(){
//static
bool Window::handleEvent(){
MSG msg;
POINT point;
bool ret = GetCursorPos(&point);
if(ret == true) {
oldX = point.x;
oldY = point.y;
}
while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)){
if(msg.message==WM_QUIT){
@@ -80,6 +88,10 @@ bool Window::handleEvent(){
return true;
}
void Window::revertMousePos() {
SetCursorPos(oldX, oldY);
}
string Window::getText(){
if(handle==0){
return text;