Merge branch 'raysan5:master' into master
This commit is contained in:
commit
12bf30ce04
156 changed files with 211 additions and 208 deletions
|
@ -15,9 +15,9 @@
|
|||
|
||||
static void DrawTextCenter(const char *text, int x, int y, int fontSize, Color color)
|
||||
{
|
||||
Vector2 size = MeasureTextEx(GetFontDefault(), text, fontSize, 3);
|
||||
Vector2 size = MeasureTextEx(GetFontDefault(), text, (float)fontSize, 3);
|
||||
Vector2 pos = (Vector2){x - size.x/2, y - size.y/2 };
|
||||
DrawTextEx(GetFontDefault(), text, pos, fontSize, 3, color);
|
||||
DrawTextEx(GetFontDefault(), text, pos, (float)fontSize, 3, color);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
|
@ -86,11 +86,11 @@ int main(void)
|
|||
const int minTextSpace = 30;
|
||||
int last_text_x = -minTextSpace;
|
||||
for (int i = cellSize; i < GetRenderWidth(); i += cellSize, odd = !odd) {
|
||||
int x = ((float)i) / dpiScale.x;
|
||||
int x = (int)(((float)i) / dpiScale.x);
|
||||
if (odd) {
|
||||
DrawRectangle(x, pixelGridTop, cellSizePx, pixelGridBottom-pixelGridTop, CLITERAL(Color){ 0, 121, 241, 100 });
|
||||
DrawRectangle(x, pixelGridTop, (int)cellSizePx, pixelGridBottom-pixelGridTop, CLITERAL(Color){ 0, 121, 241, 100 });
|
||||
}
|
||||
DrawLine(x, pixelGridTop, ((float)i) / dpiScale.x, pixelGridLabelY - 10, GRAY);
|
||||
DrawLine(x, pixelGridTop, (int)(((float)i) / dpiScale.x), pixelGridLabelY - 10, GRAY);
|
||||
if (x - last_text_x >= minTextSpace) {
|
||||
DrawTextCenter(TextFormat("%d", i), x, pixelGridLabelY, 12, LIGHTGRAY);
|
||||
last_text_x = x;
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
GLFW_ICON ICON "raylib.ico"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION 1,0,0,0
|
||||
PRODUCTVERSION 1,0,0,0
|
||||
FILEVERSION 5,5,0,0
|
||||
PRODUCTVERSION 5,5,0,0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
//BLOCK "080904E4" // English UK
|
||||
BLOCK "040904E4" // English US
|
||||
//BLOCK "080904E4" // English UK
|
||||
BLOCK "040904E4" // English US
|
||||
BEGIN
|
||||
VALUE "CompanyName", "raylib technologies"
|
||||
VALUE "FileDescription", "raylib example"
|
||||
VALUE "FileVersion", "1.0"
|
||||
VALUE "CompanyName", "raylib technologies"
|
||||
VALUE "FileDescription", "raylib application (www.raylib.com)"
|
||||
VALUE "FileVersion", "5.5.0"
|
||||
VALUE "InternalName", "raylib-example"
|
||||
VALUE "LegalCopyright", "(c) 2025 raylib technologies (@raylibtech)"
|
||||
//VALUE "OriginalFilename", "raylib_app.exe"
|
||||
VALUE "LegalCopyright", "(c) 2025 Ramon Santamaria (@raysan5)"
|
||||
VALUE "OriginalFilename", "raylib-example"
|
||||
VALUE "ProductName", "raylib-example"
|
||||
VALUE "ProductVersion", "1.0"
|
||||
VALUE "ProductVersion", "5.5.0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
//VALUE "Translation", 0x809, 1252 // English UK
|
||||
VALUE "Translation", 0x409, 1252 // English US
|
||||
//VALUE "Translation", 0x809, 1252 // English UK
|
||||
VALUE "Translation", 0x409, 1252 // English US
|
||||
END
|
||||
END
|
||||
|
|
|
@ -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((int)rec.x - 20, (int)rec.y - 20, (int)rec.width + 40, (int)rec.height + 40, DARKGRAY);
|
||||
DrawText("Rounded rectangle", (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((int)rec.x - 20, (int)rec.y - 20, (int)rec.width + 40, (int)rec.height + 40, DARKGRAY);
|
||||
DrawText("Rounded rectangle shadow", (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((int)rec.x - 20, (int)rec.y - 20, (int)rec.width + 40, (int)rec.height + 40, DARKGRAY);
|
||||
DrawText("Rounded rectangle border", (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((int)rec.x - 30, (int)rec.y - 30, (int)rec.width + 60, (int)rec.height + 60, DARKGRAY);
|
||||
DrawText("Rectangle with all three combined", (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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue