@@ -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