mirror of
https://github.com/glest/glest-source.git
synced 2025-08-24 08:52:49 +02:00
- update for windows mouse pointer in fullscreen mode. Alt-Enter enables mouse pointer so user can scroll off screen.
This commit is contained in:
@@ -783,6 +783,7 @@ void showCursor(bool b) {
|
|||||||
//SDL_GetMouseState( &x, &y );
|
//SDL_GetMouseState( &x, &y );
|
||||||
}
|
}
|
||||||
SDL_ShowCursor(b ? SDL_ENABLE : SDL_DISABLE);
|
SDL_ShowCursor(b ? SDL_ENABLE : SDL_DISABLE);
|
||||||
|
SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||||
if(b) {
|
if(b) {
|
||||||
//SDL_WM_GrabInput(SDL_GRAB_OFF);
|
//SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||||
//SDL_WarpMouse(x,y);
|
//SDL_WarpMouse(x,y);
|
||||||
|
@@ -91,6 +91,8 @@ void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits) {
|
|||||||
<< depthBits << " depth-buffer). SDL Error is: " << SDL_GetError();
|
<< depthBits << " depth-buffer). SDL Error is: " << SDL_GetError();
|
||||||
throw std::runtime_error(msg.str());
|
throw std::runtime_error(msg.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlatformContextGl::end() {
|
void PlatformContextGl::end() {
|
||||||
|
@@ -186,9 +186,7 @@ bool Window::handleEvent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive);
|
||||||
if(Window::isActive && Window::getUseDefaultCursorOnly() == false) {
|
showCursor(!Window::isActive || Window::getUseDefaultCursorOnly());
|
||||||
showCursor(!Window::isActive);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Check if the program has lost window focus
|
// Check if the program has lost window focus
|
||||||
else if (event.active.state == SDL_APPACTIVE) {
|
else if (event.active.state == SDL_APPACTIVE) {
|
||||||
@@ -200,9 +198,7 @@ bool Window::handleEvent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive);
|
||||||
if(Window::isActive && Window::getUseDefaultCursorOnly() == false) {
|
showCursor(!Window::isActive || Window::getUseDefaultCursorOnly());
|
||||||
showCursor(!Window::isActive);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Check if the program has lost window focus
|
// Check if the program has lost window focus
|
||||||
else if (event.active.state == SDL_APPMOUSEFOCUS) {
|
else if (event.active.state == SDL_APPMOUSEFOCUS) {
|
||||||
@@ -214,9 +210,7 @@ bool Window::handleEvent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive);
|
||||||
if(Window::isActive && Window::getUseDefaultCursorOnly() == false) {
|
showCursor(!Window::isActive || Window::getUseDefaultCursorOnly());
|
||||||
showCursor(!Window::isActive);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (event.active.gain == 0) {
|
if (event.active.gain == 0) {
|
||||||
@@ -227,9 +221,7 @@ bool Window::handleEvent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d, event.active.state = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive,event.active.state);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::isActive = %d, event.active.state = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::isActive,event.active.state);
|
||||||
if(Window::isActive && Window::getUseDefaultCursorOnly() == false) {
|
showCursor(!Window::isActive || Window::getUseDefaultCursorOnly());
|
||||||
showCursor(!Window::isActive);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -431,7 +423,7 @@ void Window::toggleFullscreen() {
|
|||||||
if(Window::isFullScreen == true) {
|
if(Window::isFullScreen == true) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d] Window::isFullScreen == true [%d]\n",__FILE__,__FUNCTION__,__LINE__,handle);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d] Window::isFullScreen == true [%d]\n",__FILE__,__FUNCTION__,__LINE__,handle);
|
||||||
ShowWindow(handle, SW_MAXIMIZE);
|
ShowWindow(handle, SW_MAXIMIZE);
|
||||||
if(Window::isActive && Window::getUseDefaultCursorOnly() == false) {
|
if(Window::getUseDefaultCursorOnly() == false) {
|
||||||
showCursor(false);
|
showCursor(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user