Implementar batch rendering con SDL_RenderGeometry para rendimiento masivo
- Reemplazar 50K+ llamadas SDL_RenderTexture individuales por 1 SDL_RenderGeometry - Crear sistema de acumulacion de vertices y indices para batch rendering - Añadir addSpriteToBatch() para generar quads con posicion, UV y color - Implementar getters Ball::getPosition() y getColor() para batch data - Añadir Texture::getSDLTexture() para acceso directo a textura SDL - Conversion correcta colores Uint8 a float para SDL_Vertex.color - Arquitectura: 4 vertices + 6 indices por sprite (2 triangulos) Rendimiento conseguido: - 50K bolas: 10 FPS -> >75 FPS constante (mejora 750%) - 100K bolas: inutilizable -> fluido y jugable - Escalabilidad masiva para renderizado de sprites 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
3
source/external/texture.h
vendored
3
source/external/texture.h
vendored
@@ -37,4 +37,7 @@ public:
|
||||
|
||||
// Modula el color de la textura
|
||||
void setColor(int r, int g, int b);
|
||||
|
||||
// Getter para batch rendering
|
||||
SDL_Texture* getSDLTexture() const { return texture_; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user