Compare commits
2 Commits
3e83e51e2d
...
59c5ebe9be
| Author | SHA1 | Date | |
|---|---|---|---|
| 59c5ebe9be | |||
| 3be3833e55 |
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -720,6 +725,13 @@ void Engine::toggleFullscreen() {
|
||||
|
||||
fullscreen_enabled_ = !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() {
|
||||
@@ -754,6 +766,9 @@ void Engine::toggleRealFullscreen() {
|
||||
}
|
||||
SDL_free(displays);
|
||||
}
|
||||
|
||||
// Ocultar cursor en real fullscreen
|
||||
SDL_HideCursor();
|
||||
} else {
|
||||
// Volver a resolución original
|
||||
current_screen_width_ = SCREEN_WIDTH;
|
||||
@@ -768,9 +783,34 @@ void Engine::toggleRealFullscreen() {
|
||||
|
||||
// Reinicar la escena con resolución original
|
||||
initBalls(scenario_);
|
||||
|
||||
// Mostrar cursor al salir de real fullscreen
|
||||
SDL_ShowCursor();
|
||||
}
|
||||
}
|
||||
|
||||
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