Ajustar proporciones: ventana 50% más grande y sprite proporcional
Cambios realizados: - Ventana: 640x480 → 960x720 pixels (+50% tamaño) - Sprite: 64px → 30px (mantiene proporción original de 10px en 320x240) - Proporción matemática: 3.125% ancho, 4.167% alto (igual que referencia) La pelota ahora se ve del tamaño correcto relativo a la ventana, manteniendo la misma proporción visual que en la versión 320x240. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -53,7 +53,7 @@ int main(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Crear ventana
|
// Crear ventana
|
||||||
SDL_Window* window = SDL_CreateWindow("vibe5_metal - Triangle + Gradient + Sprites", 640, 480, SDL_WINDOW_HIGH_PIXEL_DENSITY);
|
SDL_Window* window = SDL_CreateWindow("vibe5_metal - Triangle + Gradient + Sprites", 960, 720, SDL_WINDOW_HIGH_PIXEL_DENSITY);
|
||||||
if (!window) {
|
if (!window) {
|
||||||
std::cout << "SDL_CreateWindow failed: " << SDL_GetError() << std::endl;
|
std::cout << "SDL_CreateWindow failed: " << SDL_GetError() << std::endl;
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
@@ -481,10 +481,10 @@ fragment float4 sprite_fragment_main(SpriteVertexOut in [[stage_in]],
|
|||||||
// Crear sprite centrado con un tamaño pequeño
|
// Crear sprite centrado con un tamaño pequeño
|
||||||
SpriteVertex spriteVertices[6]; // 2 triángulos para formar un quad
|
SpriteVertex spriteVertices[6]; // 2 triángulos para formar un quad
|
||||||
|
|
||||||
// Sprite centrado de 64x64 pixels en pantalla de 640x480
|
// Sprite centrado de 30x30 pixels en pantalla de 960x720 (mantiene proporción de 10px en 320x240)
|
||||||
float spriteSize = 64.0f;
|
float spriteSize = 30.0f;
|
||||||
float windowWidth = 640.0f;
|
float windowWidth = 960.0f;
|
||||||
float windowHeight = 480.0f;
|
float windowHeight = 720.0f;
|
||||||
|
|
||||||
// Convertir a coordenadas NDC
|
// Convertir a coordenadas NDC
|
||||||
float halfWidth = (spriteSize / windowWidth); // 0.1 en NDC
|
float halfWidth = (spriteSize / windowWidth); // 0.1 en NDC
|
||||||
|
|||||||
Reference in New Issue
Block a user