|
|
@ -108,8 +108,8 @@ int main(void) |
|
|
|
|
|
|
|
// Draw rectangle box with rounded corners using shader |
|
|
|
Rectangle rec = { 50, 70, 110, 60 }; |
|
|
|
DrawRectangleLines(rec.x - 20, rec.y - 20, rec.width + 40, rec.height + 40, DARKGRAY); |
|
|
|
DrawText("Rounded rectangle", rec.x - 20, rec.y - 35, 10, DARKGRAY); |
|
|
|
DrawRectangleLines(p">(int)rec.x - 20, (int)rec.y - 20, p">(int)rec.width + 40, (int)rec.height + 40, DARKGRAY); |
|
|
|
DrawText("Rounded rectangle", p">(int)rec.x - 20, (int)rec.y - 35, 10, DARKGRAY); |
|
|
|
|
|
|
|
// Flip Y axis to match shader coordinate system |
|
|
|
rec.y = screenHeight - rec.y - rec.height; |
|
|
@ -128,8 +128,8 @@ int main(void) |
|
|
|
|
|
|
|
// Draw rectangle shadow using shader |
|
|
|
rec = (Rectangle){ 50, 200, 110, 60 }; |
|
|
|
DrawRectangleLines(rec.x - 20, rec.y - 20, rec.width + 40, rec.height + 40, DARKGRAY); |
|
|
|
DrawText("Rounded rectangle shadow", rec.x - 20, rec.y - 35, 10, DARKGRAY); |
|
|
|
DrawRectangleLines(p">(int)rec.x - 20, (int)rec.y - 20, p">(int)rec.width + 40, (int)rec.height + 40, DARKGRAY); |
|
|
|
DrawText("Rounded rectangle shadow", p">(int)rec.x - 20, (int)rec.y - 35, 10, DARKGRAY); |
|
|
|
|
|
|
|
rec.y = screenHeight - rec.y - rec.height; |
|
|
|
SetShaderValue(shader, roundedRectangle.rectangleLoc, (float[]){ rec.x, rec.y, rec.width, rec.height }, SHADER_UNIFORM_VEC4); |
|
|
@ -147,8 +147,8 @@ int main(void) |
|
|
|
|
|
|
|
// Draw rectangle's border using shader |
|
|
|
rec = (Rectangle){ 50, 330, 110, 60 }; |
|
|
|
DrawRectangleLines(rec.x - 20, rec.y - 20, rec.width + 40, rec.height + 40, DARKGRAY); |
|
|
|
DrawText("Rounded rectangle border", rec.x - 20, rec.y - 35, 10, DARKGRAY); |
|
|
|
DrawRectangleLines(p">(int)rec.x - 20, (int)rec.y - 20, p">(int)rec.width + 40, (int)rec.height + 40, DARKGRAY); |
|
|
|
DrawText("Rounded rectangle border", p">(int)rec.x - 20, (int)rec.y - 35, 10, DARKGRAY); |
|
|
|
|
|
|
|
rec.y = screenHeight - rec.y - rec.height; |
|
|
|
SetShaderValue(shader, roundedRectangle.rectangleLoc, (float[]){ rec.x, rec.y, rec.width, rec.height }, SHADER_UNIFORM_VEC4); |
|
|
@ -166,8 +166,8 @@ int main(void) |
|
|
|
|
|
|
|
// Draw one more rectangle with all three colors |
|
|
|
rec = (Rectangle){ 240, 80, 500, 300 }; |
|
|
|
DrawRectangleLines(rec.x - 30, rec.y - 30, rec.width + 60, rec.height + 60, DARKGRAY); |
|
|
|
DrawText("Rectangle with all three combined", rec.x - 30, rec.y - 45, 10, DARKGRAY); |
|
|
|
DrawRectangleLines(p">(int)rec.x - 30, (int)rec.y - 30, p">(int)rec.width + 60, (int)rec.height + 60, DARKGRAY); |
|
|
|
DrawText("Rectangle with all three combined", p">(int)rec.x - 30, (int)rec.y - 45, 10, DARKGRAY); |
|
|
|
|
|
|
|
rec.y = screenHeight - rec.y - rec.height; |
|
|
|
SetShaderValue(shader, roundedRectangle.rectangleLoc, (float[]){ rec.x, rec.y, rec.width, rec.height }, SHADER_UNIFORM_VEC4); |
|
|
|