Fixing all other macros by adding RL_ prefix.

This commit is contained in:
Marco Lizza 2018-12-20 16:15:55 +01:00
commit b6cb51e3e8
9 changed files with 1821 additions and 1821 deletions

View file

@ -47,10 +47,10 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawTextEx(fontBm, msgBm, fontPosition, fontBm.baseSize, 0, MAROON);
DrawTextEx(fontTtf, msgTtf, (Vector2){ 75.0f, 240.0f }, fontTtf.baseSize*0.8f, 2, LIME);
DrawTextEx(fontBm, msgBm, fontPosition, fontBm.baseSize, 0, RL_MAROON);
DrawTextEx(fontTtf, msgTtf, (Vector2){ 75.0f, 240.0f }, fontTtf.baseSize*0.8f, 2, RL_LIME);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -42,13 +42,13 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawText("Font name: PixAntiqua", 40, 50, 20, GRAY);
DrawText(FormatText("Font base size: %i", font.baseSize), 40, 80, 20, GRAY);
DrawText(FormatText("Font chars number: %i", font.charsCount), 40, 110, 20, GRAY);
DrawText("Font name: PixAntiqua", 40, 50, 20, RL_GRAY);
DrawText(FormatText("Font base size: %i", font.baseSize), 40, 80, 20, RL_GRAY);
DrawText(FormatText("Font chars number: %i", font.charsCount), 40, 110, 20, RL_GRAY);
DrawTextEx(font, msg, (Vector2){ 40, 180 }, font.baseSize, 0, MAROON);
DrawTextEx(font, msg, (Vector2){ 40, 180 }, font.baseSize, 0, RL_MAROON);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -81,31 +81,31 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
if (currentFont == 1)
{
// NOTE: SDF fonts require a custom SDf shader to compute fragment color
BeginShaderMode(shader); // Activate SDF font shader
DrawTextEx(fontSDF, msg, fontPosition, fontSize, 0, BLACK);
DrawTextEx(fontSDF, msg, fontPosition, fontSize, 0, RL_BLACK);
EndShaderMode(); // Activate our default shader for next drawings
DrawTexture(fontSDF.texture, 10, 10, BLACK);
DrawTexture(fontSDF.texture, 10, 10, RL_BLACK);
}
else
{
DrawTextEx(fontDefault, msg, fontPosition, fontSize, 0, BLACK);
DrawTexture(fontDefault.texture, 10, 10, BLACK);
DrawTextEx(fontDefault, msg, fontPosition, fontSize, 0, RL_BLACK);
DrawTexture(fontDefault.texture, 10, 10, RL_BLACK);
}
if (currentFont == 1) DrawText("SDF!", 320, 20, 80, RED);
else DrawText("default font", 315, 40, 30, GRAY);
if (currentFont == 1) DrawText("SDF!", 320, 20, 80, RL_RED);
else DrawText("default font", 315, 40, 30, RL_GRAY);
DrawText("FONT SIZE: 16.0", GetScreenWidth() - 240, 20, 20, DARKGRAY);
DrawText(FormatText("RENDER SIZE: %02.02f", fontSize), GetScreenWidth() - 240, 50, 20, DARKGRAY);
DrawText("Use MOUSE WHEEL to SCALE TEXT!", GetScreenWidth() - 240, 90, 10, DARKGRAY);
DrawText("FONT SIZE: 16.0", GetScreenWidth() - 240, 20, 20, RL_DARKGRAY);
DrawText(FormatText("RENDER SIZE: %02.02f", fontSize), GetScreenWidth() - 240, 50, 20, RL_DARKGRAY);
DrawText("Use MOUSE WHEEL to SCALE TEXT!", GetScreenWidth() - 240, 90, 10, RL_DARKGRAY);
DrawText("PRESS SPACE to USE SDF FONT VERSION!", 340, GetScreenHeight() - 30, 20, MAROON);
DrawText("PRESS SPACE to USE SDF FONT VERSION!", 340, GetScreenHeight() - 30, 20, RL_MAROON);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -39,15 +39,15 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawText(FormatText("Score: %08i", score), 200, 80, 20, RED);
DrawText(FormatText("Score: %08i", score), 200, 80, 20, RL_RED);
DrawText(FormatText("HiScore: %08i", hiscore), 200, 120, 20, GREEN);
DrawText(FormatText("HiScore: %08i", hiscore), 200, 120, 20, RL_GREEN);
DrawText(FormatText("Lives: %02i", lives), 200, 160, 40, BLUE);
DrawText(FormatText("Lives: %02i", lives), 200, 160, 40, RL_BLUE);
DrawText(FormatText("Elapsed Time: %02.02f ms", GetFrameTime()*1000), 200, 220, 20, BLACK);
DrawText(FormatText("Elapsed Time: %02.02f ms", GetFrameTime()*1000), 200, 220, 20, RL_BLACK);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -69,26 +69,26 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawText("PLACE MOUSE OVER INPUT BOX!", 240, 140, 20, GRAY);
DrawText("PLACE MOUSE OVER INPUT BOX!", 240, 140, 20, RL_GRAY);
DrawRectangleRec(textBox, LIGHTGRAY);
if (mouseOnText) DrawRectangleLines(textBox.x, textBox.y, textBox.width, textBox.height, RED);
else DrawRectangleLines(textBox.x, textBox.y, textBox.width, textBox.height, DARKGRAY);
DrawRectangleRec(textBox, RL_LIGHTGRAY);
if (mouseOnText) DrawRectangleLines(textBox.x, textBox.y, textBox.width, textBox.height, RL_RED);
else DrawRectangleLines(textBox.x, textBox.y, textBox.width, textBox.height, RL_DARKGRAY);
DrawText(name, textBox.x + 5, textBox.y + 8, 40, MAROON);
DrawText(name, textBox.x + 5, textBox.y + 8, 40, RL_MAROON);
DrawText(FormatText("INPUT CHARS: %i/%i", letterCount, MAX_INPUT_CHARS), 315, 250, 20, DARKGRAY);
DrawText(FormatText("INPUT CHARS: %i/%i", letterCount, MAX_INPUT_CHARS), 315, 250, 20, RL_DARKGRAY);
if (mouseOnText)
{
if (letterCount < MAX_INPUT_CHARS)
{
// Draw blinking underscore char
if (((framesCounter/20)%2) == 0) DrawText("_", textBox.x + 8 + MeasureText(name, 40), textBox.y + 12, 40, MAROON);
if (((framesCounter/20)%2) == 0) DrawText("_", textBox.x + 8 + MeasureText(name, 40), textBox.y + 12, 40, RL_MAROON);
}
else DrawText("Press BACKSPACE to delete chars...", 230, 300, 20, GRAY);
else DrawText("Press BACKSPACE to delete chars...", 230, 300, 20, RL_GRAY);
}
EndDrawing();

View file

@ -61,7 +61,7 @@ int main()
positions[4].y += 2;
positions[7].y -= 8;
Color colors[MAX_FONTS] = { MAROON, ORANGE, DARKGREEN, DARKBLUE, DARKPURPLE, LIME, GOLD, RED };
Color colors[MAX_FONTS] = { RL_MAROON, RL_ORANGE, RL_DARKGREEN, RL_DARKBLUE, RL_DARKPURPLE, RL_LIME, RL_GOLD, RL_RED };
//--------------------------------------------------------------------------------------
// Main game loop
@ -76,10 +76,10 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawText("free fonts included with raylib", 250, 20, 20, DARKGRAY);
DrawLine(220, 50, 590, 50, DARKGRAY);
DrawText("free fonts included with raylib", 250, 20, 20, RL_DARKGRAY);
DrawLine(220, 50, 590, 50, RL_DARKGRAY);
for (int i = 0; i < MAX_FONTS; i++)
{

View file

@ -54,11 +54,11 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawTextEx(font1, msg1, fontPosition1, font1.baseSize, -3, WHITE);
DrawTextEx(font2, msg2, fontPosition2, font2.baseSize, -2, WHITE);
DrawTextEx(font3, msg3, fontPosition3, font3.baseSize, 2, WHITE);
DrawTextEx(font1, msg1, fontPosition1, font1.baseSize, -3, RL_WHITE);
DrawTextEx(font2, msg2, fontPosition2, font2.baseSize, -2, RL_WHITE);
DrawTextEx(font3, msg3, fontPosition3, font3.baseSize, 2, RL_WHITE);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -97,26 +97,26 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawText("Use mouse wheel to change font size", 20, 20, 10, GRAY);
DrawText("Use KEY_RIGHT and KEY_LEFT to move text", 20, 40, 10, GRAY);
DrawText("Use 1, 2, 3 to change texture filter", 20, 60, 10, GRAY);
DrawText("Drop a new TTF font for dynamic loading", 20, 80, 10, DARKGRAY);
DrawText("Use mouse wheel to change font size", 20, 20, 10, RL_GRAY);
DrawText("Use KEY_RIGHT and KEY_LEFT to move text", 20, 40, 10, RL_GRAY);
DrawText("Use 1, 2, 3 to change texture filter", 20, 60, 10, RL_GRAY);
DrawText("Drop a new TTF font for dynamic loading", 20, 80, 10, RL_DARKGRAY);
DrawTextEx(font, msg, fontPosition, fontSize, 0, BLACK);
DrawTextEx(font, msg, fontPosition, fontSize, 0, RL_BLACK);
// TODO: It seems texSize measurement is not accurate due to chars offsets...
//DrawRectangleLines(fontPosition.x, fontPosition.y, textSize.x, textSize.y, RED);
//DrawRectangleLines(fontPosition.x, fontPosition.y, textSize.x, textSize.y, RL_RED);
DrawRectangle(0, screenHeight - 80, screenWidth, 80, LIGHTGRAY);
DrawText(FormatText("Font size: %02.02f", fontSize), 20, screenHeight - 50, 10, DARKGRAY);
DrawText(FormatText("Text size: [%02.02f, %02.02f]", textSize.x, textSize.y), 20, screenHeight - 30, 10, DARKGRAY);
DrawText("CURRENT TEXTURE FILTER:", 250, 400, 20, GRAY);
DrawRectangle(0, screenHeight - 80, screenWidth, 80, RL_LIGHTGRAY);
DrawText(FormatText("Font size: %02.02f", fontSize), 20, screenHeight - 50, 10, RL_DARKGRAY);
DrawText(FormatText("Text size: [%02.02f, %02.02f]", textSize.x, textSize.y), 20, screenHeight - 30, 10, RL_DARKGRAY);
DrawText("CURRENT TEXTURE FILTER:", 250, 400, 20, RL_GRAY);
if (currentFontFilter == 0) DrawText("POINT", 570, 400, 20, BLACK);
else if (currentFontFilter == 1) DrawText("BILINEAR", 570, 400, 20, BLACK);
else if (currentFontFilter == 2) DrawText("TRILINEAR", 570, 400, 20, BLACK);
if (currentFontFilter == 0) DrawText("POINT", 570, 400, 20, RL_BLACK);
else if (currentFontFilter == 1) DrawText("BILINEAR", 570, 400, 20, RL_BLACK);
else if (currentFontFilter == 2) DrawText("TRILINEAR", 570, 400, 20, RL_BLACK);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -42,12 +42,12 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawText(SubText(message, 0, framesCounter/10), 210, 160, 20, MAROON);
DrawText(SubText(message, 0, framesCounter/10), 210, 160, 20, RL_MAROON);
DrawText("PRESS [ENTER] to RESTART!", 240, 260, 20, LIGHTGRAY);
DrawText("PRESS [SPACE] to SPEED UP!", 239, 300, 20, LIGHTGRAY);
DrawText("PRESS [ENTER] to RESTART!", 240, 260, 20, RL_LIGHTGRAY);
DrawText("PRESS [SPACE] to SPEED UP!", 239, 300, 20, RL_LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------