Skip to content

Commit 767df4c

Browse files
committed
Update core_render_texture.c
1 parent 5dd97ec commit 767df4c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/core/core_render_texture.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ int main(void)
6565

6666
ClearBackground(SKYBLUE);
6767

68+
DrawRectangle(0, 0, 20, 20, RED);
6869
DrawCircleV(ballPosition, (float)ballRadius, MAROON);
6970

7071
EndTextureMode();
@@ -75,11 +76,12 @@ int main(void)
7576
ClearBackground(RAYWHITE);
7677

7778
// Draw our render texture with rotation applied
78-
// NOTE: We set the origin of the texture to the center of the render texture
79+
// NOTE 1: We set the origin of the texture to the center of the render texture
80+
// NOTE 2: We flip vertically the texture setting negative source rectangle height
7981
DrawTexturePro(target.texture,
8082
(Rectangle){ 0, 0, target.texture.width, -target.texture.height },
81-
(Rectangle){ screenWidth/2, screenHeight/2, target.texture.width, -target.texture.height },
8283
(Vector2){ target.texture.width/2, target.texture.height/2 }, rotation, WHITE);
84+
(Rectangle){ screenWidth/2, screenHeight/2, target.texture.width, target.texture.height },
8385

8486
DrawText("DRAWING BOUNCING BALL INSIDE RENDER TEXTURE!", 10, screenHeight - 40, 20, BLACK);
8587

0 commit comments

Comments
 (0)