aboutsummaryrefslogtreecommitdiff
path: root/examples/textures_rectangle.c
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2014-09-29 23:41:05 +0200
committerraysan5 <raysan5@gmail.com>2014-09-29 23:41:05 +0200
commit51688c004cb9b41cd573b7f84ce8574ca2a4b9d7 (patch)
tree1d8bf01ec8deb3acabb747182f2a1384cec2ec49 /examples/textures_rectangle.c
parente2ff32eb847f0332d546f51c442f336e0dc7b309 (diff)
downloadraylib-51688c004cb9b41cd573b7f84ce8574ca2a4b9d7.tar.gz
raylib-51688c004cb9b41cd573b7f84ce8574ca2a4b9d7.zip
Code cleaning, removed useless spaces
Diffstat (limited to 'examples/textures_rectangle.c')
-rw-r--r--examples/textures_rectangle.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/examples/textures_rectangle.c b/examples/textures_rectangle.c
index 95caf0a4..c0fb0d97 100644
--- a/examples/textures_rectangle.c
+++ b/examples/textures_rectangle.c
@@ -1,6 +1,6 @@
/*******************************************************************************************
*
-* raylib [textures] example - Texture loading and drawing a part defined by a rectangle
+* raylib [textures] example - Texture loading and drawing a part defined by a rectangle
*
* This example has been created using raylib 1.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
@@ -19,18 +19,18 @@ int main()
int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [texture] example - texture rectangle");
-
+
const char textLine1[] = "Lena image is a standard test image which has been in use since 1973.";
const char textLine2[] = "It comprises 512x512 pixels, and it is probably the most widely used";
const char textLine3[] = "test image for all sorts of image processing algorithms.";
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
Texture2D texture = LoadTexture("resources/lena.png"); // Texture loading
-
+
Rectangle eyesRec = { 225, 240, 155, 50 }; // Part of the texture to draw
Vector2 position = { 369, 241 };
//--------------------------------------------------------------------------------------
-
+
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
@@ -38,23 +38,23 @@ int main()
//----------------------------------------------------------------------------------
// TODO: Update your variables here
//----------------------------------------------------------------------------------
-
+
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
-
+
ClearBackground(RAYWHITE);
-
+
DrawText("LENA", 220, 100, 20, PINK);
-
+
DrawTexture(texture, screenWidth/2 - 256, 0, Fade(WHITE, 0.1f)); // Draw background image
-
+
DrawTextureRec(texture, eyesRec, position, WHITE); // Draw eyes part of image
DrawText(textLine1, 220, 140, 10, DARKGRAY);
- DrawText(textLine2, 220, 160, 10, DARKGRAY);
- DrawText(textLine3, 220, 180, 10, DARKGRAY);
-
+ DrawText(textLine2, 220, 160, 10, DARKGRAY);
+ DrawText(textLine3, 220, 180, 10, DARKGRAY);
+
EndDrawing();
//----------------------------------------------------------------------------------
}
@@ -62,9 +62,9 @@ int main()
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadTexture(texture); // Texture unloading
-
+
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
-
+
return 0;
} \ No newline at end of file