Implementar toggle de escalado INTEGER/STRETCH en fullscreen (F5)
Funcionalidad: - Tecla F5 alterna entre escalado INTEGER y STRETCH - Solo activo en modo fullscreen F3 (no aplica en F4) - INTEGER: Mantiene aspecto 4:3 con bandas negras - STRETCH: Estira imagen a pantalla completa - Texto informativo: 'SCALING: INTEGER' o 'SCALING: STRETCH' Implementación: - Variable integer_scaling_enabled_ (true por defecto) - toggleIntegerScaling() cambia SDL_RendererLogicalPresentation - Solo funciona si fullscreen_enabled_ == true - Ignora la tecla si no estás en modo F3 README actualizado: - Añadida tecla F5 en controles de ventana - Actualizada descripción de F3 - Nueva característica en lista principal Comportamiento: - Por defecto: INTEGER (mantiene aspecto) - Presionar F5: Cambia a STRETCH (pantalla completa) - Presionar F5 otra vez: Vuelve a INTEGER 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,8 @@ El nombre refleja su proposito: **ViBe** (vibe-coding experimental) + **Physics*
|
||||
- **Transiciones LERP**: Cambios de tema suaves y fluidos (0.5s) sin reiniciar escenario
|
||||
- **Hot-swap de sprites**: Cambio de textura dinamico (ball.png ↔ ball_small.png) con tecla N
|
||||
- **Sistema de zoom dinamico**: F1/F2 para ajustar el zoom de ventana (1x-10x)
|
||||
- **Modos fullscreen**: F3 para fullscreen normal, F4 para real fullscreen con resolucion nativa
|
||||
- **Modos fullscreen**: F3 para fullscreen normal (mantiene aspecto), F4 para real fullscreen con resolucion nativa
|
||||
- **Escalado configurable**: F5 alterna entre INTEGER (mantiene aspecto) y STRETCH (pantalla completa) en modo F3
|
||||
- **Gravedad multidireccional**: Gravedad hacia abajo, arriba, izquierda o derecha
|
||||
- **8 Figuras 3D**: Esfera, Wave Grid, Helix, Torus, Cubo, Cilindro, Icosaedro, Atom
|
||||
- **Interactividad**: Controles de teclado para modificar el comportamiento
|
||||
@@ -35,8 +36,9 @@ El nombre refleja su proposito: **ViBe** (vibe-coding experimental) + **Physics*
|
||||
|-------|--------|
|
||||
| `F1` | **Zoom out (reducir zoom ventana)** |
|
||||
| `F2` | **Zoom in (aumentar zoom ventana)** |
|
||||
| `F3` | **Toggle fullscreen normal** |
|
||||
| `F3` | **Toggle fullscreen normal (mantiene aspecto)** |
|
||||
| `F4` | **Toggle real fullscreen (resolucion nativa)** |
|
||||
| `F5` | **Toggle escalado INTEGER/STRETCH (solo en modo F3)** |
|
||||
|
||||
### Controles de Temas
|
||||
| Tecla | Accion |
|
||||
|
||||
@@ -463,6 +463,11 @@ void Engine::handleEvents() {
|
||||
case SDLK_F4:
|
||||
toggleRealFullscreen();
|
||||
break;
|
||||
|
||||
// Toggle escalado entero/estirado (solo en fullscreen F3)
|
||||
case SDLK_F5:
|
||||
toggleIntegerScaling();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -784,6 +789,28 @@ void Engine::toggleRealFullscreen() {
|
||||
}
|
||||
}
|
||||
|
||||
void Engine::toggleIntegerScaling() {
|
||||
// Solo permitir cambio si estamos en modo fullscreen normal (F3)
|
||||
if (!fullscreen_enabled_) {
|
||||
return; // No hacer nada si no estamos en fullscreen
|
||||
}
|
||||
|
||||
integer_scaling_enabled_ = !integer_scaling_enabled_;
|
||||
|
||||
// Aplicar el nuevo modo de escalado
|
||||
SDL_RendererLogicalPresentation presentation = integer_scaling_enabled_
|
||||
? SDL_LOGICAL_PRESENTATION_INTEGER_SCALE
|
||||
: SDL_LOGICAL_PRESENTATION_STRETCH;
|
||||
|
||||
SDL_SetRenderLogicalPresentation(renderer_, SCREEN_WIDTH, SCREEN_HEIGHT, presentation);
|
||||
|
||||
// Mostrar texto informativo
|
||||
text_ = integer_scaling_enabled_ ? "SCALING: INTEGER" : "SCALING: STRETCH";
|
||||
text_pos_ = (current_screen_width_ - static_cast<int>(text_.length() * 8)) / 2;
|
||||
show_text_ = true;
|
||||
text_init_time_ = SDL_GetTicks();
|
||||
}
|
||||
|
||||
std::string Engine::gravityDirectionToString(GravityDirection direction) const {
|
||||
switch (direction) {
|
||||
case GravityDirection::DOWN: return "DOWN";
|
||||
|
||||
@@ -61,6 +61,7 @@ private:
|
||||
std::string vsync_text_ = "VSYNC ON";
|
||||
bool fullscreen_enabled_ = false;
|
||||
bool real_fullscreen_enabled_ = false;
|
||||
bool integer_scaling_enabled_ = true; // Escalado entero (mantiene aspecto) por defecto
|
||||
|
||||
// Auto-restart system
|
||||
Uint64 all_balls_stopped_start_time_ = 0; // Momento cuando todas se pararon
|
||||
@@ -121,6 +122,7 @@ private:
|
||||
void toggleVSync();
|
||||
void toggleFullscreen();
|
||||
void toggleRealFullscreen();
|
||||
void toggleIntegerScaling();
|
||||
std::string gravityDirectionToString(GravityDirection direction) const;
|
||||
void initializeThemes();
|
||||
void checkAutoRestart();
|
||||
|
||||
Reference in New Issue
Block a user