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
12 changed files with 1821 additions and 1821 deletions

View file

@ -41,7 +41,7 @@ int main()
Font font = LoadFont("resources/custom_jupiter_crash.png");
// Draw over image using custom font
ImageDrawTextEx(&parrots, (Vector2){ 300, 230 }, font, "PARROTS & CAT", font.baseSize, -2, WHITE);
ImageDrawTextEx(&parrots, (Vector2){ 300, 230 }, font, "PARROTS & CAT", font.baseSize, -2, RL_WHITE);
UnloadFont(font); // Unload custom spritefont (already drawn used on image)
@ -63,13 +63,13 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
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);
DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2 - 40, RL_WHITE);
DrawRectangleLines(screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2 - 40, texture.width, texture.height, RL_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);
DrawText("We are drawing only one texture from various images composed!", 240, 350, 10, RL_DARKGRAY);
DrawText("Source images have been cropped, scaled, flipped and copied one over the other.", 190, 370, 10, RL_DARKGRAY);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -22,10 +22,10 @@ int main()
InitWindow(screenWidth, screenHeight, "raylib [textures] example - procedural images generation");
Image verticalGradient = GenImageGradientV(screenWidth, screenHeight, RED, BLUE);
Image horizontalGradient = GenImageGradientH(screenWidth, screenHeight, RED, BLUE);
Image radialGradient = GenImageGradientRadial(screenWidth, screenHeight, 0.0f, WHITE, BLACK);
Image checked = GenImageChecked(screenWidth, screenHeight, 32, 32, RED, BLUE);
Image verticalGradient = GenImageGradientV(screenWidth, screenHeight, RL_RED, RL_BLUE);
Image horizontalGradient = GenImageGradientH(screenWidth, screenHeight, RL_RED, RL_BLUE);
Image radialGradient = GenImageGradientRadial(screenWidth, screenHeight, 0.0f, RL_WHITE, RL_BLACK);
Image checked = GenImageChecked(screenWidth, screenHeight, 32, 32, RL_RED, RL_BLUE);
Image whiteNoise = GenImageWhiteNoise(screenWidth, screenHeight, 0.5f);
Image perlinNoise = GenImagePerlinNoise(screenWidth, screenHeight, 50, 50, 4.0f);
Image cellular = GenImageCellular(screenWidth, screenHeight, 32);
@ -68,23 +68,23 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawTexture(textures[currentTexture], 0, 0, WHITE);
DrawTexture(textures[currentTexture], 0, 0, RL_WHITE);
DrawRectangle(30, 400, 325, 30, Fade(SKYBLUE, 0.5f));
DrawRectangleLines(30, 400, 325, 30, Fade(WHITE, 0.5f));
DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL TEXTURES", 40, 410, 10, WHITE);
DrawRectangle(30, 400, 325, 30, Fade(RL_SKYBLUE, 0.5f));
DrawRectangleLines(30, 400, 325, 30, Fade(RL_WHITE, 0.5f));
DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL TEXTURES", 40, 410, 10, RL_WHITE);
switch(currentTexture)
{
case 0: DrawText("VERTICAL GRADIENT", 560, 10, 20, RAYWHITE); break;
case 1: DrawText("HORIZONTAL GRADIENT", 540, 10, 20, RAYWHITE); break;
case 2: DrawText("RADIAL GRADIENT", 580, 10, 20, LIGHTGRAY); break;
case 3: DrawText("CHECKED", 680, 10, 20, RAYWHITE); break;
case 4: DrawText("WHITE NOISE", 640, 10, 20, RED); break;
case 5: DrawText("PERLIN NOISE", 630, 10, 20, RAYWHITE); break;
case 6: DrawText("CELLULAR", 670, 10, 20, RAYWHITE); break;
case 0: DrawText("VERTICAL GRADIENT", 560, 10, 20, RL_RAYWHITE); break;
case 1: DrawText("HORIZONTAL GRADIENT", 540, 10, 20, RL_RAYWHITE); break;
case 2: DrawText("RADIAL GRADIENT", 580, 10, 20, RL_LIGHTGRAY); break;
case 3: DrawText("CHECKED", 680, 10, 20, RL_RAYWHITE); break;
case 4: DrawText("RL_WHITE NOISE", 640, 10, 20, RL_RED); break;
case 5: DrawText("PERLIN NOISE", 630, 10, 20, RL_RAYWHITE); break;
case 6: DrawText("CELLULAR", 670, 10, 20, RL_RAYWHITE); break;
default: break;
}

View file

@ -42,11 +42,11 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2, WHITE);
DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2, RL_WHITE);
DrawText("this IS a texture loaded from an image!", 300, 370, 10, GRAY);
DrawText("this IS a texture loaded from an image!", 300, 370, 10, RL_GRAY);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -73,25 +73,25 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
// Draw the n-patches
DrawTextureNPatch(nPatchTexture, ninePatchInfo2, dstRec2, origin, 0.0f, WHITE);
DrawTextureNPatch(nPatchTexture, ninePatchInfo1, dstRec1, origin, 0.0f, WHITE);
DrawTextureNPatch(nPatchTexture, h3PatchInfo, dstRecH, origin, 0.0f, WHITE);
DrawTextureNPatch(nPatchTexture, v3PatchInfo, dstRecV, origin, 0.0f, WHITE);
DrawTextureNPatch(nPatchTexture, ninePatchInfo2, dstRec2, origin, 0.0f, RL_WHITE);
DrawTextureNPatch(nPatchTexture, ninePatchInfo1, dstRec1, origin, 0.0f, RL_WHITE);
DrawTextureNPatch(nPatchTexture, h3PatchInfo, dstRecH, origin, 0.0f, RL_WHITE);
DrawTextureNPatch(nPatchTexture, v3PatchInfo, dstRecV, origin, 0.0f, RL_WHITE);
// Draw the source texture
DrawRectangleLines( 5, 88, 74, 266, BLUE);
DrawTexture(nPatchTexture, 10, 93, WHITE);
DrawText("TEXTURE", 15, 360, 10, DARKGRAY);
DrawRectangleLines( 5, 88, 74, 266, RL_BLUE);
DrawTexture(nPatchTexture, 10, 93, RL_WHITE);
DrawText("TEXTURE", 15, 360, 10, RL_DARKGRAY);
DrawRectangle( 10, 10, 250, 73, Fade(SKYBLUE, 0.5));
DrawRectangleLines( 10, 10, 250, 73, BLUE);
DrawRectangle( 10, 10, 250, 73, Fade(RL_SKYBLUE, 0.5));
DrawRectangleLines( 10, 10, 250, 73, RL_BLUE);
DrawText("9-Patch and 3-Patch example", 20, 20, 10, BLACK);
DrawText(" Move the mouse to stretch or", 40, 40, 10, DARKGRAY);
DrawText(" shrink the n-patches.", 40, 60, 10, DARKGRAY);
DrawText("9-Patch and 3-Patch example", 20, 20, 10, RL_BLACK);
DrawText(" Move the mouse to stretch or", 40, 40, 10, RL_DARKGRAY);
DrawText(" shrink the n-patches.", 40, 60, 10, RL_DARKGRAY);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -93,7 +93,7 @@ int main()
switch (currentProcess)
{
case COLOR_GRAYSCALE: ImageColorGrayscale(&image); break;
case COLOR_TINT: ImageColorTint(&image, GREEN); break;
case COLOR_TINT: ImageColorTint(&image, RL_GREEN); break;
case COLOR_INVERT: ImageColorInvert(&image); break;
case COLOR_CONTRAST: ImageColorContrast(&image, -40); break;
case COLOR_BRIGHTNESS: ImageColorBrightness(&image, -80); break;
@ -114,20 +114,20 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawText("IMAGE PROCESSING:", 40, 30, 10, DARKGRAY);
DrawText("IMAGE PROCESSING:", 40, 30, 10, RL_DARKGRAY);
// Draw rectangles
for (int i = 0; i < NUM_PROCESSES; i++)
{
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);
DrawRectangleRec(selectRecs[i], (i == currentProcess) ? RL_SKYBLUE : RL_LIGHTGRAY);
DrawRectangleLines((int)selectRecs[i].x, (int) selectRecs[i].y, (int) selectRecs[i].width, (int) selectRecs[i].height, (i == currentProcess) ? RL_BLUE : RL_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) ? RL_DARKBLUE : RL_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);
DrawTexture(texture, screenWidth - texture.width - 60, screenHeight/2 - texture.height/2, RL_WHITE);
DrawRectangleLines(screenWidth - texture.width - 60, screenHeight/2 - texture.height/2, texture.width, texture.height, RL_BLACK);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -26,7 +26,7 @@ int main()
Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM)
// Draw over image using custom font
ImageDrawTextEx(&parrots, (Vector2){ 20.0f, 20.0f }, font, "[Parrots font drawing]", (float)font.baseSize, 0.0f, RED);
ImageDrawTextEx(&parrots, (Vector2){ 20.0f, 20.0f }, font, "[Parrots font drawing]", (float)font.baseSize, 0.0f, RL_RED);
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
@ -51,20 +51,20 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
if (!showFont)
{
// Draw texture with text already drawn inside
DrawTextureV(texture, position, WHITE);
DrawTextureV(texture, position, RL_WHITE);
// Draw text directly using sprite font
DrawTextEx(font, "[Parrots font drawing]", (Vector2){ position.x + 20,
position.y + 20 + 280 }, (float)font.baseSize, 0.0f, WHITE);
position.y + 20 + 280 }, (float)font.baseSize, 0.0f, RL_WHITE);
}
else DrawTexture(font.texture, screenWidth/2 - font.texture.width/2, 50, BLACK);
else DrawTexture(font.texture, screenWidth/2 - font.texture.width/2, 50, RL_BLACK);
DrawText("PRESS SPACE to SEE USED SPRITEFONT ", 290, 420, 10, DARKGRAY);
DrawText("PRESS SPACE to SEE USED SPRITEFONT ", 290, 420, 10, RL_DARKGRAY);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -36,11 +36,11 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2, WHITE);
DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2, RL_WHITE);
DrawText("this IS a texture!", 360, 370, 10, GRAY);
DrawText("this IS a texture!", 360, 370, 10, RL_GRAY);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -100,7 +100,7 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(DARKGRAY);
ClearBackground(RL_DARKGRAY);
BeginBlendMode(blending);
@ -115,10 +115,10 @@ int main()
EndBlendMode();
DrawText("PRESS SPACE to CHANGE BLENDING MODE", 180, 20, 20, BLACK);
DrawText("PRESS SPACE to CHANGE BLENDING MODE", 180, 20, 20, RL_BLACK);
if (blending == BLEND_ALPHA) DrawText("ALPHA BLENDING", 290, screenHeight - 40, 20, BLACK);
else DrawText("ADDITIVE BLENDING", 280, screenHeight - 40, 20, RAYWHITE);
if (blending == BLEND_ALPHA) DrawText("ALPHA BLENDING", 290, screenHeight - 40, 20, RL_BLACK);
else DrawText("ADDITIVE BLENDING", 280, screenHeight - 40, 20, RL_RAYWHITE);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -42,8 +42,8 @@ int main()
{
for (int x = 0; x < width; x++)
{
if (((x/32+y/32)/1)%2 == 0) pixels[y*height + x] = ORANGE;
else pixels[y*height + x] = GOLD;
if (((x/32+y/32)/1)%2 == 0) pixels[y*height + x] = RL_ORANGE;
else pixels[y*height + x] = RL_GOLD;
}
}
@ -68,16 +68,16 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawTexture(checked, screenWidth/2 - checked.width/2, screenHeight/2 - checked.height/2, Fade(WHITE, 0.5f));
DrawTexture(fudesumi, 430, -30, WHITE);
DrawTexture(checked, screenWidth/2 - checked.width/2, screenHeight/2 - checked.height/2, Fade(RL_WHITE, 0.5f));
DrawTexture(fudesumi, 430, -30, RL_WHITE);
DrawText("CHECKED TEXTURE ", 84, 100, 30, BROWN);
DrawText("GENERATED by CODE", 72, 164, 30, BROWN);
DrawText("and RAW IMAGE LOADING", 46, 226, 30, BROWN);
DrawText("CHECKED TEXTURE ", 84, 100, 30, RL_BROWN);
DrawText("GENERATED by CODE", 72, 164, 30, RL_BROWN);
DrawText("and RAW IMAGE LOADING", 46, 226, 30, RL_BROWN);
DrawText("(c) Fudesumi sprite by Eiden Marsal", 310, screenHeight - 20, 10, BROWN);
DrawText("(c) Fudesumi sprite by Eiden Marsal", 310, screenHeight - 20, 10, RL_BROWN);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -64,25 +64,25 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawTexture(scarfy, 15, 40, WHITE);
DrawRectangleLines(15, 40, scarfy.width, scarfy.height, LIME);
DrawRectangleLines(15 + frameRec.x, 40 + frameRec.y, frameRec.width, frameRec.height, RED);
DrawTexture(scarfy, 15, 40, RL_WHITE);
DrawRectangleLines(15, 40, scarfy.width, scarfy.height, RL_LIME);
DrawRectangleLines(15 + frameRec.x, 40 + frameRec.y, frameRec.width, frameRec.height, RL_RED);
DrawText("FRAME SPEED: ", 165, 210, 10, DARKGRAY);
DrawText(FormatText("%02i FPS", framesSpeed), 575, 210, 10, DARKGRAY);
DrawText("PRESS RIGHT/LEFT KEYS to CHANGE SPEED!", 290, 240, 10, DARKGRAY);
DrawText("FRAME SPEED: ", 165, 210, 10, RL_DARKGRAY);
DrawText(FormatText("%02i FPS", framesSpeed), 575, 210, 10, RL_DARKGRAY);
DrawText("PRESS RIGHT/LEFT KEYS to CHANGE SPEED!", 290, 240, 10, RL_DARKGRAY);
for (int i = 0; i < MAX_FRAME_SPEED; i++)
{
if (i < framesSpeed) DrawRectangle(250 + 21*i, 205, 20, 20, RED);
DrawRectangleLines(250 + 21*i, 205, 20, 20, MAROON);
if (i < framesSpeed) DrawRectangle(250 + 21*i, 205, 20, 20, RL_RED);
DrawRectangleLines(250 + 21*i, 205, 20, 20, RL_MAROON);
}
DrawTextureRec(scarfy, frameRec, position, WHITE); // Draw part of the texture
DrawTextureRec(scarfy, frameRec, position, RL_WHITE); // Draw part of the texture
DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, GRAY);
DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, RL_GRAY);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -52,19 +52,19 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
// NOTE: Using DrawTexturePro() we can easily rotate and scale the part of the texture we draw
// sourceRec defines the part of the texture we use for drawing
// destRec defines the rectangle where our texture part will fit (scaling it to fit)
// origin defines the point of the texture used as reference for rotation and scaling
// rotation defines the texture rotation (using origin as rotation point)
DrawTexturePro(scarfy, sourceRec, destRec, origin, (float)rotation, WHITE);
DrawTexturePro(scarfy, sourceRec, destRec, origin, (float)rotation, RL_WHITE);
DrawLine((int) destRec.x, 0, (int) destRec.x, screenHeight, GRAY);
DrawLine(0, (int)destRec.y, screenWidth, (int)destRec.y, GRAY);
DrawLine((int) destRec.x, 0, (int) destRec.x, screenHeight, RL_GRAY);
DrawLine(0, (int)destRec.y, screenWidth, (int)destRec.y, RL_GRAY);
DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, GRAY);
DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, RL_GRAY);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -47,11 +47,11 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2, WHITE);
DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2, RL_WHITE);
DrawText("this IS a texture loaded from an image!", 300, 370, 10, GRAY);
DrawText("this IS a texture loaded from an image!", 300, 370, 10, RL_GRAY);
EndDrawing();
//----------------------------------------------------------------------------------