Ocultar cursor del ratón en modos fullscreen (F3 y F4)
Cambios: - toggleFullscreen(): Oculta cursor al entrar, muestra al salir - toggleRealFullscreen(): Oculta cursor al entrar, muestra al salir - Usa SDL3 API correcta: SDL_HideCursor() y SDL_ShowCursor() Comportamiento: - F3 (fullscreen normal): Cursor oculto - F4 (real fullscreen): Cursor oculto - Salir de cualquier fullscreen: Cursor visible de nuevo 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -720,6 +720,13 @@ void Engine::toggleFullscreen() {
|
|||||||
|
|
||||||
fullscreen_enabled_ = !fullscreen_enabled_;
|
fullscreen_enabled_ = !fullscreen_enabled_;
|
||||||
SDL_SetWindowFullscreen(window_, fullscreen_enabled_);
|
SDL_SetWindowFullscreen(window_, fullscreen_enabled_);
|
||||||
|
|
||||||
|
// Ocultar/mostrar cursor según modo fullscreen
|
||||||
|
if (fullscreen_enabled_) {
|
||||||
|
SDL_HideCursor();
|
||||||
|
} else {
|
||||||
|
SDL_ShowCursor();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Engine::toggleRealFullscreen() {
|
void Engine::toggleRealFullscreen() {
|
||||||
@@ -754,6 +761,9 @@ void Engine::toggleRealFullscreen() {
|
|||||||
}
|
}
|
||||||
SDL_free(displays);
|
SDL_free(displays);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ocultar cursor en real fullscreen
|
||||||
|
SDL_HideCursor();
|
||||||
} else {
|
} else {
|
||||||
// Volver a resolución original
|
// Volver a resolución original
|
||||||
current_screen_width_ = SCREEN_WIDTH;
|
current_screen_width_ = SCREEN_WIDTH;
|
||||||
@@ -768,6 +778,9 @@ void Engine::toggleRealFullscreen() {
|
|||||||
|
|
||||||
// Reinicar la escena con resolución original
|
// Reinicar la escena con resolución original
|
||||||
initBalls(scenario_);
|
initBalls(scenario_);
|
||||||
|
|
||||||
|
// Mostrar cursor al salir de real fullscreen
|
||||||
|
SDL_ShowCursor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user