examples/renderer/19-affine-textures: add metadata for examples.libsdl.org.

This commit is contained in:
Ryan C. Gordon 2025-03-28 14:18:39 -04:00
parent 5ab1aef367
commit 567dfd2ebc
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
4 changed files with 4 additions and 1 deletions

View File

@ -0,0 +1,3 @@
This example creates an SDL window and renderer, and uses
SDL_RenderTextureAffine to draw a 3D cube using only 2D rendering operations.

View File

@ -85,7 +85,7 @@ SDL_AppResult SDL_AppIterate(void *appstate)
const float px = SDL_min(WINDOW_WIDTH, WINDOW_HEIGHT) / SDL_sqrtf(3.0f);
const Uint64 now = SDL_GetTicks();
const float rad = (((float) ((int) (now % 4000))) / 4000.0f) * SDL_PI_F * 2;
const float rad = (((float) ((int) (now % 2000))) / 2000.0f) * SDL_PI_F * 2;
const float cos = SDL_cosf(rad);
const float sin = SDL_sinf(rad);
const float k[3] = { 3.0f / SDL_sqrtf(50.0f), 4.0f / SDL_sqrtf(50.0f), 5.0f / SDL_sqrtf(50.0f)};

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB