Arreglar degradado de fondo restaurando campo alpha en SDL_Vertex

- Identificado que SDL_RenderGeometry requiere campo alpha en SDL_Vertex
- Restaurada implementación original con alpha=1.0f en todos los vértices
- Eliminado código debug temporal y workaround con SDL_RenderFillRect
- El degradado de fondo ahora funciona correctamente como en la versión original

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-28 07:58:29 +02:00
parent 6a84234265
commit dab71d41b6
6 changed files with 225 additions and 96 deletions
+7 -1
View File
@@ -2,6 +2,7 @@
#include <SDL3/SDL_events.h> // for SDL_Event
#include <SDL3/SDL_stdinc.h> // for Uint64
#include <SDL3/SDL_render.h> // for SDL_Vertex
#include <array> // for array
#include <memory> // for unique_ptr, shared_ptr
@@ -12,6 +13,7 @@
#include "ball.h" // for Ball
#include "window_manager.h" // for WindowManager
#include "backends/renderer_interface.h" // for CRTParams, SpriteData
#include "external/texture.h" // for Texture
class Engine {
public:
@@ -23,7 +25,7 @@ public:
private:
// Sistema de renderizado
std::unique_ptr<vibe4::WindowManager> window_manager_;
void* texture_data_ = nullptr; // Datos de textura para sprites
std::shared_ptr<Texture> texture_ = nullptr; // Textura para sprites
// Estado del simulador
std::vector<std::unique_ptr<Ball>> balls_;
@@ -82,6 +84,10 @@ private:
// Batch rendering
std::vector<vibe4::SpriteData> sprite_batch_;
// Batch rendering directo (como el original)
std::vector<SDL_Vertex> batch_vertices_;
std::vector<int> batch_indices_;
// Métodos principales del loop
void calculateDeltaTime();
void update();