diff options
| author | Ray San <[email protected]> | 2018-05-04 16:25:31 +0200 |
|---|---|---|
| committer | Ray San <[email protected]> | 2018-05-04 16:25:31 +0200 |
| commit | 6324697ffd7fd410274599457dd9f85119510898 (patch) | |
| tree | fcba2d763973fcc59ecc77ef425c9735fb409050 /examples/textures/textures_image_processing.c | |
| parent | 9d103b7c2faeb11d1dded450b138a590d476b0cf (diff) | |
| download | raylib-6324697ffd7fd410274599457dd9f85119510898.tar.gz raylib-6324697ffd7fd410274599457dd9f85119510898.zip | |
Rectangle parameters changed to float
- Some examples tweaks
- Reviewed ImageFormat()
- Use float for text fontSize
Diffstat (limited to 'examples/textures/textures_image_processing.c')
| -rw-r--r-- | examples/textures/textures_image_processing.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/examples/textures/textures_image_processing.c b/examples/textures/textures_image_processing.c index 58b746e0..427faa60 100644 --- a/examples/textures/textures_image_processing.c +++ b/examples/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; @@ -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(selectRecs[i].x, selectRecs[i].y, selectRecs[i].width, selectRecs[i].height, (i == currentProcess) ? BLUE : GRAY); + DrawText(processText[i], selectRecs[i].x + selectRecs[i].width/2 - MeasureText(processText[i], 10)/2, selectRecs[i].y + 11, 10, (i == currentProcess) ? DARKBLUE : DARKGRAY); } DrawTexture(texture, screenWidth - texture.width - 60, screenHeight/2 - texture.height/2, WHITE); |
