From 5a27bcaf7115e46a5123e9857007d940998f0650 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 14 May 2019 17:57:45 +0200 Subject: Review examples collection -WIP- WARNING: Examples list has been reviewed but examples haven't been recompiled yet... that's not trivial... --- examples/src/textures/textures_image_processing.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'examples/src/textures/textures_image_processing.c') diff --git a/examples/src/textures/textures_image_processing.c b/examples/src/textures/textures_image_processing.c index 58b746e..6d33d95 100644 --- a/examples/src/textures/textures_image_processing.c +++ b/examples/src/textures/textures_image_processing.c @@ -51,7 +51,7 @@ int main() // 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) + ImageFormat(&image, UNCOMPRESSED_R8G8B8A8); // Format image to RGBA 32bit (required for texture update) <-- ISSUE Texture2D texture = LoadTextureFromImage(image); // Image converted to texture, GPU memory (VRAM) int currentProcess = NONE; @@ -59,7 +59,7 @@ int main() Rectangle selectRecs[NUM_PROCESSES]; - for (int i = 0; i < NUM_PROCESSES; i++) selectRecs[i] = (Rectangle){ 40, 50 + 32*i, 150, 30 }; + for (int i = 0; i < NUM_PROCESSES; i++) selectRecs[i] = (Rectangle){ 40.0f, (float)(50 + 32*i), 150.0f, 30.0f }; SetTargetFPS(60); //--------------------------------------------------------------------------------------- @@ -121,18 +121,9 @@ int main() // 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); - } + DrawRectangleRec(selectRecs[i], (i == currentProcess) ? SKYBLUE : LIGHTGRAY); + DrawRectangleLines((int)selectRecs[i].x, (int) selectRecs[i].y, (int) selectRecs[i].width, (int) selectRecs[i].height, (i == currentProcess) ? BLUE : GRAY); + DrawText( processText[i], (int)( selectRecs[i].x + selectRecs[i].width/2 - MeasureText(processText[i], 10)/2), (int) selectRecs[i].y + 11, 10, (i == currentProcess) ? DARKBLUE : DARKGRAY); } DrawTexture(texture, screenWidth - texture.width - 60, screenHeight/2 - texture.height/2, WHITE); -- cgit v1.2.3