瀏覽代碼

examples/renderer/19-affine-textures: Flip coords so SDL logo is right-side up.

Ryan C. Gordon 5 月之前
父節點
當前提交
254f348083
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      examples/renderer/19-affine-textures/affine-textures.c

+ 3 - 3
examples/renderer/19-affine-textures/affine-textures.c

@@ -97,9 +97,9 @@ SDL_AppResult SDL_AppIterate(void *appstate)
 
     float corners[16];
     for (int i = 0; i < 8; i++) {
-        const float x = (i & 1) ? 0.5f : -0.5f;
-        const float y = (i & 2) ? 0.5f : -0.5f;
-        const float z = (i & 4) ? 0.5f : -0.5f;
+        const float x = (i & 1) ? -0.5f : 0.5f;
+        const float y = (i & 2) ? -0.5f : 0.5f;
+        const float z = (i & 4) ? -0.5f : 0.5f;
         corners[0 + 2*i] = mat[0]*x + mat[1]*y + mat[2]*z;
         corners[1 + 2*i] = mat[3]*x + mat[4]*y + mat[5]*z;
     }