aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-02-11 11:49:21 +0100
committerraysan5 <raysan5@gmail.com>2016-02-11 11:49:21 +0100
commitae87484888fb4025ad8d8ded1ade342d2b8ee174 (patch)
treeb080bf2ee8f585d7a7cc9332a455f367941acde2 /examples
parent80798980c6f1395c909b28329f3682b07a30ad13 (diff)
downloadraylib-ae87484888fb4025ad8d8ded1ade342d2b8ee174.tar.gz
raylib-ae87484888fb4025ad8d8ded1ade342d2b8ee174.zip
Added new examples code
Diffstat (limited to 'examples')
-rw-r--r--examples/core_gestures_detection.c85
-rw-r--r--examples/core_storage_values.c47
-rw-r--r--examples/img/textures_image_drawing.pngbin14971 -> 420135 bytes
-rw-r--r--examples/text_bmfont_ttf.c34
-rw-r--r--examples/text_writing_anim.c22
-rw-r--r--examples/textures_image_drawing.c44
-rw-r--r--examples/textures_image_manipulation.c50
-rw-r--r--examples/textures_image_processing.c154
8 files changed, 348 insertions, 88 deletions
diff --git a/examples/core_gestures_detection.c b/examples/core_gestures_detection.c
index 51a90b07..b69497c5 100644
--- a/examples/core_gestures_detection.c
+++ b/examples/core_gestures_detection.c
@@ -1,15 +1,18 @@
/*******************************************************************************************
*
-* raylib [core] example - Basic window
+* raylib [core] example - Gestures Detection
*
-* This example has been created using raylib 1.0 (www.raylib.com)
+* This example has been created using raylib 1.4 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
-* Copyright (c) 2014 Ramon Santamaria (@raysan5)
+* Copyright (c) 2016 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
+#include <string.h>
+
+#define MAX_GESTURE_STRINGS 20
int main()
{
@@ -17,8 +20,21 @@ int main()
//--------------------------------------------------------------------------------------
int screenWidth = 800;
int screenHeight = 450;
+
+ InitWindow(screenWidth, screenHeight, "raylib [core] example - gestures detection");
+
+ Vector2 touchPosition = { 0, 0 };
+ Rectangle touchArea = { 220, 10, screenWidth - 230, screenHeight - 20 };
+
+ int gesturesCount = 0;
+ char gestureStrings[MAX_GESTURE_STRINGS][32];
- InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
+ int currentGesture = GESTURE_NONE;
+ int lastGesture = GESTURE_NONE;
+
+ //SetGesturesEnabled(0b0000000000001001); // Enable only some gestures to be detected
+
+ SetTargetFPS(30);
//--------------------------------------------------------------------------------------
// Main game loop
@@ -26,7 +42,41 @@ int main()
{
// Update
//----------------------------------------------------------------------------------
- // TODO: Update your variables here
+ lastGesture = currentGesture;
+ touchPosition = GetTouchPosition(0);
+
+ if (CheckCollisionPointRec(touchPosition, touchArea) && IsGestureDetected())
+ {
+ currentGesture = GetGestureType();
+
+ if (currentGesture != lastGesture)
+ {
+ // Store gesture string
+ switch (currentGesture)
+ {
+ case GESTURE_TAP: strcpy(gestureStrings[gesturesCount], "GESTURE TAP"); break;
+ case GESTURE_DOUBLETAP: strcpy(gestureStrings[gesturesCount], "GESTURE DOUBLETAP"); break;
+ case GESTURE_HOLD: strcpy(gestureStrings[gesturesCount], "GESTURE HOLD"); break;
+ case GESTURE_DRAG: strcpy(gestureStrings[gesturesCount], "GESTURE DRAG"); break;
+ case GESTURE_SWIPE_RIGHT: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE RIGHT"); break;
+ case GESTURE_SWIPE_LEFT: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE LEFT"); break;
+ case GESTURE_SWIPE_UP: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE UP"); break;
+ case GESTURE_SWIPE_DOWN: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE DOWN"); break;
+ default: break;
+ }
+
+ gesturesCount++;
+
+ // Reset gestures strings
+ if (gesturesCount >= MAX_GESTURE_STRINGS)
+ {
+ for (int i = 0; i < MAX_GESTURE_STRINGS; i++) strcpy(gestureStrings[i], "\0");
+
+ gesturesCount = 0;
+ }
+ }
+ }
+ else currentGesture = GESTURE_NONE;
//----------------------------------------------------------------------------------
// Draw
@@ -34,9 +84,26 @@ int main()
BeginDrawing();
ClearBackground(RAYWHITE);
-
- DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
-
+
+ DrawRectangleRec(touchArea, GRAY);
+ DrawRectangle(225, 15, screenWidth - 240, screenHeight - 30, RAYWHITE);
+
+ DrawText("GESTURES TEST AREA", screenWidth - 270, screenHeight - 40, 20, Fade(GRAY, 0.5f));
+
+ for (int i = 0; i < gesturesCount; i++)
+ {
+ if (i%2 == 0) DrawRectangle(10, 30 + 20*i, 200, 20, Fade(LIGHTGRAY, 0.5f));
+ else DrawRectangle(10, 30 + 20*i, 200, 20, Fade(LIGHTGRAY, 0.3f));
+
+ if (i < gesturesCount - 1) DrawText(gestureStrings[i], 35, 36 + 20*i, 10, DARKGRAY);
+ else DrawText(gestureStrings[i], 35, 36 + 20*i, 10, MAROON);
+ }
+
+ DrawRectangleLines(10, 29, 200, screenHeight - 50, GRAY);
+ DrawText("DETECTED GESTURES", 50, 15, 10, GRAY);
+
+ if (currentGesture != GESTURE_NONE) DrawCircleV(touchPosition, 30, MAROON);
+
EndDrawing();
//----------------------------------------------------------------------------------
}
@@ -45,6 +112,4 @@ int main()
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
-
- return 0;
} \ No newline at end of file
diff --git a/examples/core_storage_values.c b/examples/core_storage_values.c
index 51a90b07..43f0882f 100644
--- a/examples/core_storage_values.c
+++ b/examples/core_storage_values.c
@@ -1,16 +1,19 @@
/*******************************************************************************************
*
-* raylib [core] example - Basic window
+* raylib [core] example - Storage save/load values
*
-* This example has been created using raylib 1.0 (www.raylib.com)
+* This example has been created using raylib 1.4 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
-* Copyright (c) 2014 Ramon Santamaria (@raysan5)
+* Copyright (c) 2015 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
+// NOTE: Storage positions must start with 0, directly related to file memory layout
+typedef enum { STORAGE_SCORE = 0, STORAGE_HISCORE } StorageData;
+
int main()
{
// Initialization
@@ -18,7 +21,14 @@ int main()
int screenWidth = 800;
int screenHeight = 450;
- InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
+ InitWindow(screenWidth, screenHeight, "raylib [core] example - storage save/load values");
+
+ int score = 0;
+ int hiscore = 0;
+
+ int framesCounter = 0;
+
+ SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
@@ -26,7 +36,25 @@ int main()
{
// Update
//----------------------------------------------------------------------------------
- // TODO: Update your variables here
+ if (IsKeyPressed(KEY_R))
+ {
+ score = GetRandomValue(1000, 2000);
+ hiscore = GetRandomValue(2000, 4000);
+ }
+
+ if (IsKeyPressed(KEY_ENTER))
+ {
+ StorageSaveValue(STORAGE_SCORE, score);
+ StorageSaveValue(STORAGE_HISCORE, hiscore);
+ }
+ else if (IsKeyPressed(KEY_SPACE))
+ {
+ // NOTE: If requested position could not be found, value 0 is returned
+ score = StorageLoadValue(STORAGE_SCORE);
+ hiscore = StorageLoadValue(STORAGE_HISCORE);
+ }
+
+ framesCounter++;
//----------------------------------------------------------------------------------
// Draw
@@ -35,7 +63,14 @@ int main()
ClearBackground(RAYWHITE);
- DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
+ DrawText(FormatText("SCORE: %i", score), 280, 130, 40, MAROON);
+ DrawText(FormatText("HI-SCORE: %i", hiscore), 210, 200, 50, BLACK);
+
+ DrawText(FormatText("frames: %i", framesCounter), 10, 10, 20, LIME);
+
+ DrawText("Press R to generate random numbers", 220, 40, 20, LIGHTGRAY);
+ DrawText("Press ENTER to SAVE values", 250, 310, 20, LIGHTGRAY);
+ DrawText("Press SPACE to LOAD values", 252, 350, 20, LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/examples/img/textures_image_drawing.png b/examples/img/textures_image_drawing.png
index 8b98c0d6..acfee069 100644
--- a/examples/img/textures_image_drawing.png
+++ b/examples/img/textures_image_drawing.png
Binary files differ
diff --git a/examples/text_bmfont_ttf.c b/examples/text_bmfont_ttf.c
index 51a90b07..4157c968 100644
--- a/examples/text_bmfont_ttf.c
+++ b/examples/text_bmfont_ttf.c
@@ -1,11 +1,11 @@
/*******************************************************************************************
*
-* raylib [core] example - Basic window
+* raylib [text] example - BMFont and TTF SpriteFonts loading
*
-* This example has been created using raylib 1.0 (www.raylib.com)
+* This example has been created using raylib 1.4 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
-* Copyright (c) 2014 Ramon Santamaria (@raysan5)
+* Copyright (c) 2016 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -18,7 +18,21 @@ int main()
int screenWidth = 800;
int screenHeight = 450;
- InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
+ InitWindow(screenWidth, screenHeight, "raylib [text] example - bmfont and ttf sprite fonts loading");
+
+ const char msgBm[64] = "THIS IS AN AngelCode SPRITE FONT";
+ const char msgTtf[64] = "THIS SPRITE FONT has been GENERATED from a TTF";
+
+ // NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
+ SpriteFont fontBm = LoadSpriteFont("resources/bmfont.fnt"); // BMFont (AngelCode)
+ SpriteFont fontTtf = LoadSpriteFont("resources/pixantiqua.ttf"); // TTF font
+
+ Vector2 fontPosition;
+
+ fontPosition.x = screenWidth/2 - MeasureTextEx(fontBm, msgBm, fontBm.size, 0).x/2;
+ fontPosition.y = screenHeight/2 - fontBm.size/2 - 80;
+
+ SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
@@ -26,7 +40,7 @@ int main()
{
// Update
//----------------------------------------------------------------------------------
- // TODO: Update your variables here
+ // TODO: Update variables here...
//----------------------------------------------------------------------------------
// Draw
@@ -35,15 +49,19 @@ int main()
ClearBackground(RAYWHITE);
- DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
+ DrawTextEx(fontBm, msgBm, fontPosition, fontBm.size, 0, MAROON);
+ DrawTextEx(fontTtf, msgTtf, (Vector2){ 75.0f, 240.0f }, fontTtf.size*0.8f, 2, LIME);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
- //--------------------------------------------------------------------------------------
- CloseWindow(); // Close window and OpenGL context
+ //--------------------------------------------------------------------------------------
+ UnloadSpriteFont(fontBm); // AngelCode SpriteFont unloading
+ UnloadSpriteFont(fontTtf); // TTF SpriteFont unloading
+
+ CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
diff --git a/examples/text_writing_anim.c b/examples/text_writing_anim.c
index 51a90b07..5f19b468 100644
--- a/examples/text_writing_anim.c
+++ b/examples/text_writing_anim.c
@@ -1,11 +1,11 @@
/*******************************************************************************************
*
-* raylib [core] example - Basic window
+* raylib [text] example - Text Writing Animation
*
-* This example has been created using raylib 1.0 (www.raylib.com)
+* This example has been created using raylib 1.4 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
-* Copyright (c) 2014 Ramon Santamaria (@raysan5)
+* Copyright (c) 2016 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -18,7 +18,13 @@ int main()
int screenWidth = 800;
int screenHeight = 450;
- InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
+ InitWindow(screenWidth, screenHeight, "raylib [text] example - text writing anim");
+
+ const char message[128] = "This sample illustrates a text writing\nanimation effect! Check it out! ;)";
+
+ int framesCounter = 0;
+
+ SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
@@ -26,7 +32,9 @@ int main()
{
// Update
//----------------------------------------------------------------------------------
- // TODO: Update your variables here
+ framesCounter++;
+
+ if (IsKeyPressed(KEY_ENTER)) framesCounter = 0;
//----------------------------------------------------------------------------------
// Draw
@@ -35,7 +43,9 @@ int main()
ClearBackground(RAYWHITE);
- DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
+ DrawText(SubText(message, 0, framesCounter/10), 210, 160, 20, MAROON);
+
+ DrawText("PRESS [ENTER] to RESTART!", 240, 280, 20, LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/examples/textures_image_drawing.c b/examples/textures_image_drawing.c
index 51a90b07..e09828d5 100644
--- a/examples/textures_image_drawing.c
+++ b/examples/textures_image_drawing.c
@@ -1,11 +1,13 @@
/*******************************************************************************************
*
-* raylib [core] example - Basic window
+* raylib [textures] example - Image loading and drawing on it
*
-* This example has been created using raylib 1.0 (www.raylib.com)
+* NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM)
+*
+* This example has been created using raylib 1.4 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
-* Copyright (c) 2014 Ramon Santamaria (@raysan5)
+* Copyright (c) 2016 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
@@ -18,8 +20,28 @@ int main()
int screenWidth = 800;
int screenHeight = 450;
- InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
- //--------------------------------------------------------------------------------------
+ InitWindow(screenWidth, screenHeight, "raylib [textures] example - image drawing");
+
+ // NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
+
+ Image cat = LoadImage("resources/cat.png"); // Load image in CPU memory (RAM)
+ ImageCrop(&cat, (Rectangle){ 170, 120, 280, 380 }); // Crop an image piece
+ ImageFlipHorizontal(&cat); // Flip cropped image horizontally
+ ImageResize(&cat, 150, 200); // Resize flipped-cropped image
+
+ Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM)
+
+ // Draw one image over the other with a scaling of 1.5f
+ ImageDraw(&parrots, cat, (Rectangle){ 0, 0, cat.width, cat.height}, (Rectangle){ 30, 40, cat.width*1.5f, cat.height*1.5f });
+ ImageCrop(&parrots, (Rectangle){ 0, 50, parrots.width, parrots.height - 100 }); // Crop resulting image
+
+ UnloadImage(cat); // Unload image from RAM
+
+ Texture2D texture = LoadTextureFromImage(parrots); // Image converted to texture, uploaded to GPU memory (VRAM)
+ UnloadImage(parrots); // Once image has been converted to texture and uploaded to VRAM, it can be unloaded from RAM
+
+ SetTargetFPS(60);
+ //---------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
@@ -35,15 +57,21 @@ int main()
ClearBackground(RAYWHITE);
- DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
+ DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2 - 40, WHITE);
+ DrawRectangleLines(screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2 - 40, texture.width, texture.height, DARKGRAY);
+
+ DrawText("We are drawing only one texture from various images composed!", 240, 350, 10, DARKGRAY);
+ DrawText("Source images have been cropped, scaled, flipped and copied one over the other.", 190, 370, 10, DARKGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
- //--------------------------------------------------------------------------------------
- CloseWindow(); // Close window and OpenGL context
+ //--------------------------------------------------------------------------------------
+ UnloadTexture(texture); // Texture unloading
+
+ CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
diff --git a/examples/textures_image_manipulation.c b/examples/textures_image_manipulation.c
deleted file mode 100644
index 51a90b07..00000000
--- a/examples/textures_image_manipulation.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************************
-*
-* raylib [core] example - Basic window
-*
-* 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)
-*
-* Copyright (c) 2014 Ramon Santamaria (@raysan5)
-*
-********************************************************************************************/
-
-#include "raylib.h"
-
-int main()
-{
- // Initialization
- //--------------------------------------------------------------------------------------
- int screenWidth = 800;
- int screenHeight = 450;
-
- InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
- //--------------------------------------------------------------------------------------
-
- // Main game loop
- while (!WindowShouldClose()) // Detect window close button or ESC key
- {
- // Update
- //----------------------------------------------------------------------------------
- // TODO: Update your variables here
- //----------------------------------------------------------------------------------
-
- // Draw
- //----------------------------------------------------------------------------------
- BeginDrawing();
-
- ClearBackground(RAYWHITE);
-
- DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
-
- EndDrawing();
- //----------------------------------------------------------------------------------
- }
-
- // De-Initialization
- //--------------------------------------------------------------------------------------
- CloseWindow(); // Close window and OpenGL context
- //--------------------------------------------------------------------------------------
-
- return 0;
-} \ No newline at end of file
diff --git a/examples/textures_image_processing.c b/examples/textures_image_processing.c
new file mode 100644
index 00000000..58b746e0
--- /dev/null
+++ b/examples/textures_image_processing.c
@@ -0,0 +1,154 @@
+/*******************************************************************************************
+*
+* raylib [textures] example - Image processing
+*
+* NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM)
+*
+* This example has been created using raylib 1.4 (www.raylib.com)
+* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
+*
+* Copyright (c) 2016 Ramon Santamaria (@raysan5)
+*
+********************************************************************************************/
+
+#include "raylib.h"
+
+#include <stdlib.h> // Required for: free()
+
+#define NUM_PROCESSES 8
+
+typedef enum {
+ NONE = 0,
+ COLOR_GRAYSCALE,
+ COLOR_TINT,
+ COLOR_INVERT,
+ COLOR_CONTRAST,
+ COLOR_BRIGHTNESS,
+ FLIP_VERTICAL,
+ FLIP_HORIZONTAL
+} ImageProcess;
+
+static const char *processText[] = {
+ "NO PROCESSING",
+ "COLOR GRAYSCALE",
+ "COLOR TINT",
+ "COLOR INVERT",
+ "COLOR CONTRAST",
+ "COLOR BRIGHTNESS",
+ "FLIP VERTICAL",
+ "FLIP HORIZONTAL"
+};
+
+int main()
+{
+ // Initialization
+ //--------------------------------------------------------------------------------------
+ int screenWidth = 800;
+ int screenHeight = 450;
+
+ InitWindow(screenWidth, screenHeight, "raylib [textures] example - image processing");
+
+ // NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
+
+ Image image = LoadImage("resources/parrots.png"); // Loaded in CPU memory (RAM)
+ ImageFormat(&image, UNCOMPRESSED_R8G8B8A8); // Format image to RGBA 32bit (required for texture update)
+ Texture2D texture = LoadTextureFromImage(image); // Image converted to texture, GPU memory (VRAM)
+
+ int currentProcess = NONE;
+ bool textureReload = false;
+
+ Rectangle selectRecs[NUM_PROCESSES];
+
+ for (int i = 0; i < NUM_PROCESSES; i++) selectRecs[i] = (Rectangle){ 40, 50 + 32*i, 150, 30 };
+
+ SetTargetFPS(60);
+ //---------------------------------------------------------------------------------------
+
+ // Main game loop
+ while (!WindowShouldClose()) // Detect window close button or ESC key
+ {
+ // Update
+ //----------------------------------------------------------------------------------
+ if (IsKeyPressed(KEY_DOWN))
+ {
+ currentProcess++;
+ if (currentProcess > 7) currentProcess = 0;
+ textureReload = true;
+ }
+ else if (IsKeyPressed(KEY_UP))
+ {
+ currentProcess--;
+ if (currentProcess < 0) currentProcess = 7;
+ textureReload = true;
+ }
+
+ if (textureReload)
+ {
+ UnloadImage(image); // Unload current image data
+ image = LoadImage("resources/parrots.png"); // Re-load image data
+
+ // NOTE: Image processing is a costly CPU process to be done every frame,
+ // If image processing is required in a frame-basis, it should be done
+ // with a texture and by shaders
+ switch (currentProcess)
+ {
+ case COLOR_GRAYSCALE: ImageColorGrayscale(&image); break;
+ case COLOR_TINT: ImageColorTint(&image, GREEN); break;
+ case COLOR_INVERT: ImageColorInvert(&image); break;
+ case COLOR_CONTRAST: ImageColorContrast(&image, -40); break;
+ case COLOR_BRIGHTNESS: ImageColorBrightness(&image, -80); break;
+ case FLIP_VERTICAL: ImageFlipVertical(&image); break;
+ case FLIP_HORIZONTAL: ImageFlipHorizontal(&image); break;
+ default: break;
+ }
+
+ Color *pixels = GetImageData(image); // Get pixel data from image (RGBA 32bit)
+ UpdateTexture(texture, pixels); // Update texture with new image data
+ free(pixels); // Unload pixels data from RAM
+
+ textureReload = false;
+ }
+ //----------------------------------------------------------------------------------
+
+ // Draw
+ //----------------------------------------------------------------------------------
+ BeginDrawing();
+
+ ClearBackground(RAYWHITE);
+
+ DrawText("IMAGE PROCESSING:", 40, 30, 10, DARKGRAY);
+
+ // Draw rectangles
+ for (int i = 0; i < NUM_PROCESSES; i++)
+ {
+ if (i == currentProcess)
+ {
+ DrawRectangleRec(selectRecs[i], SKYBLUE);
+ DrawRectangleLines(selectRecs[i].x, selectRecs[i].y, selectRecs[i].width, selectRecs[i].height, BLUE);
+ DrawText(processText[i], selectRecs[i].x + selectRecs[i].width/2 - MeasureText(processText[i], 10)/2, selectRecs[i].y + 11, 10, DARKBLUE);
+ }
+ else
+ {
+ DrawRectangleRec(selectRecs[i], LIGHTGRAY);
+ DrawRectangleLines(selectRecs[i].x, selectRecs[i].y, selectRecs[i].width, selectRecs[i].height, GRAY);
+ DrawText(processText[i], selectRecs[i].x + selectRecs[i].width/2 - MeasureText(processText[i], 10)/2, selectRecs[i].y + 11, 10, DARKGRAY);
+ }
+ }
+
+ DrawTexture(texture, screenWidth - texture.width - 60, screenHeight/2 - texture.height/2, WHITE);
+ DrawRectangleLines(screenWidth - texture.width - 60, screenHeight/2 - texture.height/2, texture.width, texture.height, BLACK);
+
+ EndDrawing();
+ //----------------------------------------------------------------------------------
+ }
+
+ // De-Initialization
+ //--------------------------------------------------------------------------------------
+ UnloadTexture(texture); // Unload texture from VRAM
+ UnloadImage(image); // Unload image from RAM
+
+ CloseWindow(); // Close window and OpenGL context
+ //--------------------------------------------------------------------------------------
+
+ return 0;
+} \ No newline at end of file