mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Fix compiler warnings, first part
This commit is contained in:
@ -26,12 +26,12 @@ int main()
|
||||
Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM)
|
||||
|
||||
// Draw over image using custom font
|
||||
ImageDrawTextEx(&parrots, (Vector2){ 20, 20 }, font, "[Parrots font drawing]", font.baseSize, 0, WHITE);
|
||||
ImageDrawTextEx(&parrots, (Vector2){ 20.0f, 20.0f }, font, "[Parrots font drawing]", (float)font.baseSize, 0.0f, WHITE);
|
||||
|
||||
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
|
||||
|
||||
Vector2 position = { screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2 - 20 };
|
||||
Vector2 position = { (float)(screenWidth/2 - texture.width/2), (float)(screenHeight/2 - texture.height/2 - 20) };
|
||||
|
||||
bool showFont = false;
|
||||
|
||||
@ -60,7 +60,7 @@ int main()
|
||||
|
||||
// Draw text directly using sprite font
|
||||
DrawTextEx(font, "[Parrots font drawing]", (Vector2){ position.x + 20,
|
||||
position.y + 20 + 280 }, font.baseSize, 0, WHITE);
|
||||
position.y + 20 + 280 }, (float)font.baseSize, 0.0f, WHITE);
|
||||
}
|
||||
else DrawTexture(font.texture, screenWidth/2 - font.texture.width/2, 50, BLACK);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user