examples: Use decl literals (#221)

This commit is contained in:
Mike Will 2025-03-12 16:21:15 -04:00 committed by GitHub
parent 03ec79ef85
commit d4fc514d54
Failed to generate hash of commit
37 changed files with 323 additions and 323 deletions

View file

@ -27,7 +27,7 @@ pub fn main() anyerror!void {
spacing += @as(i32, @intFromFloat(buildings[i].width));
buildColors[i] = rl.Color.init(
buildColors[i] = .init(
@as(u8, @intCast(rl.getRandomValue(200, 240))),
@as(u8, @intCast(rl.getRandomValue(200, 240))),
@as(u8, @intCast(rl.getRandomValue(200, 250))),
@ -36,8 +36,8 @@ pub fn main() anyerror!void {
}
var camera = rl.Camera2D{
.target = rl.Vector2.init(player.x + 20, player.y + 20),
.offset = rl.Vector2.init(screenWidth / 2, screenHeight / 2),
.target = .init(player.x + 20, player.y + 20),
.offset = .init(screenWidth / 2, screenHeight / 2),
.rotation = 0,
.zoom = 1,
};
@ -58,7 +58,7 @@ pub fn main() anyerror!void {
}
// Camera target follows player
camera.target = rl.Vector2.init(player.x + 20, player.y + 20);
camera.target = .init(player.x + 20, player.y + 20);
// Camera rotation controls
if (rl.isKeyDown(.a)) {
@ -87,51 +87,51 @@ pub fn main() anyerror!void {
rl.beginDrawing();
defer rl.endDrawing();
rl.clearBackground(rl.Color.ray_white);
rl.clearBackground(.ray_white);
{
camera.begin();
defer camera.end();
rl.drawRectangle(-6000, 320, 13000, 8000, rl.Color.dark_gray);
rl.drawRectangle(-6000, 320, 13000, 8000, .dark_gray);
for (buildings, 0..) |building, i| {
rl.drawRectangleRec(building, buildColors[i]);
}
rl.drawRectangleRec(player, rl.Color.red);
rl.drawRectangleRec(player, .red);
rl.drawLine(
@as(i32, @intFromFloat(camera.target.x)),
-screenHeight * 10,
@as(i32, @intFromFloat(camera.target.x)),
screenHeight * 10,
rl.Color.green,
.green,
);
rl.drawLine(
-screenWidth * 10,
@as(i32, @intFromFloat(camera.target.y)),
screenWidth * 10,
@as(i32, @intFromFloat(camera.target.y)),
rl.Color.green,
.green,
);
}
rl.drawText("SCREEN AREA", 640, 10, 20, rl.Color.red);
rl.drawText("SCREEN AREA", 640, 10, 20, .red);
rl.drawRectangle(0, 0, screenWidth, 5, rl.Color.red);
rl.drawRectangle(0, 5, 5, screenHeight - 10, rl.Color.red);
rl.drawRectangle(screenWidth - 5, 5, 5, screenHeight - 10, rl.Color.red);
rl.drawRectangle(0, screenHeight - 5, screenWidth, 5, rl.Color.red);
rl.drawRectangle(0, 0, screenWidth, 5, .red);
rl.drawRectangle(0, 5, 5, screenHeight - 10, .red);
rl.drawRectangle(screenWidth - 5, 5, 5, screenHeight - 10, .red);
rl.drawRectangle(0, screenHeight - 5, screenWidth, 5, .red);
rl.drawRectangle(10, 10, 250, 113, rl.Color.sky_blue.fade(0.5));
rl.drawRectangleLines(10, 10, 250, 113, rl.Color.blue);
rl.drawRectangle(10, 10, 250, 113, .fade(.sky_blue, 0.5));
rl.drawRectangleLines(10, 10, 250, 113, .blue);
rl.drawText("Free 2d camera controls:", 20, 20, 10, rl.Color.black);
rl.drawText("- Right/Left to move Offset", 40, 40, 10, rl.Color.dark_gray);
rl.drawText("- Mouse Wheel to Zoom in-out", 40, 60, 10, rl.Color.dark_gray);
rl.drawText("- A / S to Rotate", 40, 80, 10, rl.Color.dark_gray);
rl.drawText("- R to reset Zoom and Rotation", 40, 100, 10, rl.Color.dark_gray);
rl.drawText("Free 2d camera controls:", 20, 20, 10, .black);
rl.drawText("- Right/Left to move Offset", 40, 40, 10, .dark_gray);
rl.drawText("- Mouse Wheel to Zoom in-out", 40, 60, 10, .dark_gray);
rl.drawText("- A / S to Rotate", 40, 80, 10, .dark_gray);
rl.drawText("- R to reset Zoom and Rotation", 40, 100, 10, .dark_gray);
//----------------------------------------------------------------------------------
}
}

View file

@ -91,7 +91,7 @@ pub fn main() anyerror!void {
rl.beginDrawing();
defer rl.endDrawing();
rl.clearBackground(rl.Color.ray_white);
rl.clearBackground(.ray_white);
{
camera.begin();
@ -103,14 +103,14 @@ pub fn main() anyerror!void {
rl.drawGrid(100, 50);
rl.gl.rlPopMatrix();
rl.drawCircle(screenWidth / 2, screenHeight / 2, 50, rl.Color.maroon);
rl.drawCircle(screenWidth / 2, screenHeight / 2, 50, .maroon);
}
rl.drawText("[1][2] Select mouse zoom mode (Wheel or Move)", 20, 20, 20, rl.Color.dark_gray);
rl.drawText("[1][2] Select mouse zoom mode (Wheel or Move)", 20, 20, 20, .dark_gray);
if (zoomMode == 0) {
rl.drawText("Mouse right button drag to move, mouse wheel to zoom", 20, 50, 20, rl.Color.dark_gray);
rl.drawText("Mouse right button drag to move, mouse wheel to zoom", 20, 50, 20, .dark_gray);
} else {
rl.drawText("Mouse right button drag to move, mouse press and move to zoom", 20, 50, 20, rl.Color.dark_gray);
rl.drawText("Mouse right button drag to move, mouse press and move to zoom", 20, 50, 20, .dark_gray);
}
//----------------------------------------------------------------------------------

View file

@ -14,9 +14,9 @@ pub fn main() anyerror!void {
defer rl.closeWindow(); // Close window and OpenGL context
var camera = rl.Camera3D{
.position = rl.Vector3.init(4, 2, 4),
.target = rl.Vector3.init(0, 1.8, 0),
.up = rl.Vector3.init(0, 1, 0),
.position = .init(4, 2, 4),
.target = .init(0, 1.8, 0),
.up = .init(0, 1, 0),
.fovy = 60,
.projection = .perspective,
};
@ -27,12 +27,12 @@ pub fn main() anyerror!void {
for (0..heights.len) |i| {
heights[i] = @as(f32, @floatFromInt(rl.getRandomValue(1, 12)));
positions[i] = rl.Vector3.init(
positions[i] = .init(
@as(f32, @floatFromInt(rl.getRandomValue(-15, 15))),
heights[i] / 2.0,
@as(f32, @floatFromInt(rl.getRandomValue(-15, 15))),
);
colors[i] = rl.Color.init(
colors[i] = .init(
@as(u8, @intCast(rl.getRandomValue(20, 255))),
@as(u8, @intCast(rl.getRandomValue(10, 55))),
30,
@ -56,31 +56,31 @@ pub fn main() anyerror!void {
rl.beginDrawing();
defer rl.endDrawing();
rl.clearBackground(rl.Color.ray_white);
rl.clearBackground(.ray_white);
{
camera.begin();
defer camera.end();
// Draw ground
rl.drawPlane(rl.Vector3.init(0, 0, 0), rl.Vector2.init(32, 32), rl.Color.light_gray);
rl.drawCube(rl.Vector3.init(-16.0, 2.5, 0.0), 1.0, 5.0, 32.0, rl.Color.blue); // Draw a blue wall
rl.drawCube(rl.Vector3.init(16.0, 2.5, 0.0), 1.0, 5.0, 32.0, rl.Color.lime); // Draw a green wall
rl.drawCube(rl.Vector3.init(0.0, 2.5, 16.0), 32.0, 5.0, 1.0, rl.Color.gold); // Draw a yellow wall
rl.drawPlane(.init(0, 0, 0), .init(32, 32), .light_gray);
rl.drawCube(.init(-16.0, 2.5, 0.0), 1.0, 5.0, 32.0, .blue); // Draw a blue wall
rl.drawCube(.init(16.0, 2.5, 0.0), 1.0, 5.0, 32.0, .lime); // Draw a green wall
rl.drawCube(.init(0.0, 2.5, 16.0), 32.0, 5.0, 1.0, .gold); // Draw a yellow wall
// Draw some cubes around
for (heights, 0..) |height, i| {
rl.drawCube(positions[i], 2.0, height, 2.0, colors[i]);
rl.drawCubeWires(positions[i], 2.0, height, 2.0, rl.Color.maroon);
rl.drawCubeWires(positions[i], 2.0, height, 2.0, .maroon);
}
}
rl.drawRectangle(10, 10, 220, 70, rl.Color.sky_blue.fade(0.5));
rl.drawRectangleLines(10, 10, 220, 70, rl.Color.blue);
rl.drawRectangle(10, 10, 220, 70, .fade(.sky_blue, 0.5));
rl.drawRectangleLines(10, 10, 220, 70, .blue);
rl.drawText("First person camera default controls:", 20, 20, 10, rl.Color.black);
rl.drawText("- Move with keys: W, A, S, D", 40, 40, 10, rl.Color.dark_gray);
rl.drawText("- Mouse move to look around", 40, 60, 10, rl.Color.dark_gray);
rl.drawText("First person camera default controls:", 20, 20, 10, .black);
rl.drawText("- Move with keys: W, A, S, D", 40, 40, 10, .dark_gray);
rl.drawText("- Mouse move to look around", 40, 60, 10, .dark_gray);
//----------------------------------------------------------------------------------
}
}

View file

@ -16,9 +16,9 @@ pub fn main() anyerror!void {
// Define the camera to look into our 3d world
var camera = rl.Camera{
.position = rl.Vector3.init(10, 10, 10),
.target = rl.Vector3.init(0, 0, 0),
.up = rl.Vector3.init(0, 1, 0),
.position = .init(10, 10, 10),
.target = .init(0, 0, 0),
.up = .init(0, 1, 0),
.fovy = 45,
.projection = .perspective,
};
@ -36,7 +36,7 @@ pub fn main() anyerror!void {
camera.update(.free);
if (rl.isKeyPressed(.z)) {
camera.target = rl.Vector3.init(0, 0, 0);
camera.target = .init(0, 0, 0);
}
//-----------------------------------------------------------------------------
@ -45,25 +45,25 @@ pub fn main() anyerror!void {
rl.beginDrawing();
defer rl.endDrawing();
rl.clearBackground(rl.Color.ray_white);
rl.clearBackground(.ray_white);
{
camera.begin();
defer camera.end();
rl.drawCube(cubePosition, 2, 2, 2, rl.Color.red);
rl.drawCubeWires(cubePosition, 2, 2, 2, rl.Color.maroon);
rl.drawCube(cubePosition, 2, 2, 2, .red);
rl.drawCubeWires(cubePosition, 2, 2, 2, .maroon);
rl.drawGrid(10, 1);
}
rl.drawRectangle(10, 10, 320, 93, rl.Color.fade(rl.Color.sky_blue, 0.5));
rl.drawRectangleLines(10, 10, 320, 93, rl.Color.blue);
rl.drawRectangle(10, 10, 320, 93, .fade(.sky_blue, 0.5));
rl.drawRectangleLines(10, 10, 320, 93, .blue);
rl.drawText("Free camera default controls:", 20, 20, 10, rl.Color.black);
rl.drawText("- Mouse Wheel to Zoom in-out", 40, 40, 10, rl.Color.dark_gray);
rl.drawText("- Mouse Wheel Pressed to Pan", 40, 60, 10, rl.Color.dark_gray);
rl.drawText("- Z to zoom to (0, 0, 0)", 40, 80, 10, rl.Color.dark_gray);
rl.drawText("Free camera default controls:", 20, 20, 10, .black);
rl.drawText("- Mouse Wheel to Zoom in-out", 40, 40, 10, .dark_gray);
rl.drawText("- Mouse Wheel Pressed to Pan", 40, 60, 10, .dark_gray);
rl.drawText("- Z to zoom to (0, 0, 0)", 40, 80, 10, .dark_gray);
//-----------------------------------------------------------------------------
}
}

View file

@ -11,9 +11,9 @@ pub fn main() anyerror!void {
// Define the camera to look into our 3d world
var camera = rl.Camera{
.position = rl.Vector3.init(10, 10, 10),
.target = rl.Vector3.init(0, 0, 0),
.up = rl.Vector3.init(0, 1, 0),
.position = .init(10, 10, 10),
.target = .init(0, 0, 0),
.up = .init(0, 1, 0),
.fovy = 45,
.projection = .perspective,
};
@ -44,8 +44,8 @@ pub fn main() anyerror!void {
// Check collision between ray and box
collision = rl.getRayCollisionBox(ray, rl.BoundingBox{
.max = rl.Vector3.init(cubePosition.x - cubeSize.x / 2, cubePosition.y - cubeSize.y / 2, cubePosition.z - cubeSize.z / 2),
.min = rl.Vector3.init(cubePosition.x + cubeSize.x / 2, cubePosition.y + cubeSize.y / 2, cubePosition.z + cubeSize.z / 2),
.max = .init(cubePosition.x - cubeSize.x / 2, cubePosition.y - cubeSize.y / 2, cubePosition.z - cubeSize.z / 2),
.min = .init(cubePosition.x + cubeSize.x / 2, cubePosition.y + cubeSize.y / 2, cubePosition.z + cubeSize.z / 2),
});
} else collision.hit = false;
}
@ -56,33 +56,33 @@ pub fn main() anyerror!void {
rl.beginDrawing();
defer rl.endDrawing();
rl.clearBackground(rl.Color.ray_white);
rl.clearBackground(.ray_white);
{
camera.begin();
defer camera.end();
if (collision.hit) {
rl.drawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, rl.Color.red);
rl.drawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, rl.Color.maroon);
rl.drawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, .red);
rl.drawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, .maroon);
rl.drawCubeWires(cubePosition, cubeSize.x + 0.2, cubeSize.y + 0.2, cubeSize.z + 0.2, rl.Color.green);
rl.drawCubeWires(cubePosition, cubeSize.x + 0.2, cubeSize.y + 0.2, cubeSize.z + 0.2, .green);
} else {
rl.drawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, rl.Color.gray);
rl.drawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, rl.Color.dark_gray);
rl.drawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, .gray);
rl.drawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, .dark_gray);
}
rl.drawRay(ray, rl.Color.maroon);
rl.drawRay(ray, .maroon);
rl.drawGrid(10, 1);
}
rl.drawText("Try clicking on the box with your mouse!", 240, 10, 20, rl.Color.dark_gray);
rl.drawText("Try clicking on the box with your mouse!", 240, 10, 20, .dark_gray);
if (collision.hit) {
rl.drawText("BOX SELECTED", @divTrunc((screenWidth - rl.measureText("BOX SELECTED", 30)), 2), screenHeight * 0.1, 30, rl.Color.green);
rl.drawText("BOX SELECTED", @divTrunc((screenWidth - rl.measureText("BOX SELECTED", 30)), 2), screenHeight * 0.1, 30, .green);
}
rl.drawText("Right click mouse to toggle camera controls", 10, 430, 10, rl.Color.gray);
rl.drawText("Right click mouse to toggle camera controls", 10, 430, 10, .gray);
rl.drawFPS(10, 10);
}

View file

@ -85,18 +85,18 @@ pub fn main() anyerror!void {
rl.beginDrawing();
defer rl.endDrawing();
rl.clearBackground(rl.Color.ray_white);
rl.clearBackground(.ray_white);
switch (current_screen) {
.logo => {
// TODO: Draw `logo` state here!
rl.drawText("LOGO SCREEN", 20, 20, 40, rl.Color.light_gray);
rl.drawText("LOGO SCREEN", 20, 20, 40, .light_gray);
rl.drawText(
"WAIT for 2 SECONDS...",
290,
220,
20,
rl.Color.gray,
.gray,
);
},
.title => {
@ -106,21 +106,21 @@ pub fn main() anyerror!void {
0,
screen_width,
screen_height,
rl.Color.green,
.green,
);
rl.drawText(
"TITLE SCREEN",
20,
20,
40,
rl.Color.dark_green,
.dark_green,
);
rl.drawText(
"PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN",
120,
220,
20,
rl.Color.dark_green,
.dark_green,
);
},
.gameplay => {
@ -130,15 +130,15 @@ pub fn main() anyerror!void {
0,
screen_width,
screen_height,
rl.Color.purple,
.purple,
);
rl.drawText("GAMEPLAY SCREEN", 20, 20, 40, rl.Color.maroon);
rl.drawText("GAMEPLAY SCREEN", 20, 20, 40, .maroon);
rl.drawText(
"PRESS ENTER or TAP to JUMP to ENDING SCREEN",
130,
220,
20,
rl.Color.maroon,
.maroon,
);
},
.ending => {
@ -148,21 +148,21 @@ pub fn main() anyerror!void {
0,
screen_width,
screen_height,
rl.Color.blue,
.blue,
);
rl.drawText(
"ENDING SCREEN",
20,
20,
40,
rl.Color.dark_blue,
.dark_blue,
);
rl.drawText(
"PRESS ENTER or TAP to RETURN to TITLE SCREEN",
120,
220,
20,
rl.Color.dark_blue,
.dark_blue,
);
},
}

View file

@ -26,9 +26,9 @@ pub fn main() anyerror!void {
rl.beginDrawing();
defer rl.endDrawing();
rl.clearBackground(rl.Color.white);
rl.clearBackground(.white);
rl.drawText("Congrats! You created your first window!", 190, 200, 20, rl.Color.light_gray);
rl.drawText("Congrats! You created your first window!", 190, 200, 20, .light_gray);
//----------------------------------------------------------------------------------
}
}

View file

@ -47,8 +47,8 @@ fn updateDrawFrame() void {
rl.beginDrawing();
defer rl.endDrawing();
rl.clearBackground(rl.Color.white);
rl.clearBackground(.white);
rl.drawText("Congrats! You created your first window!", 190, 200, 20, rl.Color.light_gray);
rl.drawText("Congrats! You created your first window!", 190, 200, 20, .light_gray);
//----------------------------------------------------------------------------------
}

View file

@ -40,11 +40,11 @@ pub fn main() anyerror!void {
rl.beginDrawing();
defer rl.endDrawing();
rl.clearBackground(rl.Color.ray_white);
rl.clearBackground(.ray_white);
rl.drawText("move the ball with arrow keys", 10, 10, 20, rl.Color.dark_gray);
rl.drawText("move the ball with arrow keys", 10, 10, 20, .dark_gray);
rl.drawCircleV(ballPosition, 50, rl.Color.maroon);
rl.drawCircleV(ballPosition, 50, .maroon);
//----------------------------------------------------------------------------------
}
}

View file

@ -26,11 +26,11 @@ pub fn main() anyerror!void {
ballPosition.y = @as(f32, @floatFromInt(rl.getMouseY()));
if (rl.isMouseButtonPressed(.left)) {
ballColor = rl.Color.maroon;
ballColor = .maroon;
} else if (rl.isMouseButtonPressed(.middle)) {
ballColor = rl.Color.lime;
ballColor = .lime;
} else if (rl.isMouseButtonPressed(.right)) {
ballColor = rl.Color.dark_blue;
ballColor = .dark_blue;
}
//----------------------------------------------------------------------------------
@ -39,11 +39,11 @@ pub fn main() anyerror!void {
rl.beginDrawing();
defer rl.endDrawing();
rl.clearBackground(rl.Color.ray_white);
rl.clearBackground(.ray_white);
rl.drawCircleV(ballPosition, 40, ballColor);
rl.drawText("move ball with mouse and click mouse button to change color", 10, 10, 20, rl.Color.dark_gray);
rl.drawText("move ball with mouse and click mouse button to change color", 10, 10, 20, .dark_gray);
//----------------------------------------------------------------------------------
}
}

View file

@ -30,18 +30,18 @@ pub fn main() anyerror!void {
rl.beginDrawing();
defer rl.endDrawing();
rl.clearBackground(rl.Color.white);
rl.clearBackground(.white);
rl.drawRectangle(screenWidth / 2 - 40, @as(i32, @intFromFloat(boxPositionY)), 80, 80, rl.Color.maroon);
rl.drawRectangle(screenWidth / 2 - 40, @as(i32, @intFromFloat(boxPositionY)), 80, 80, .maroon);
rl.drawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, rl.Color.gray);
rl.drawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, .gray);
rl.drawText(
rl.textFormat("Box position Y: %03i", .{@as(i32, @intFromFloat(boxPositionY))}),
10,
40,
20,
rl.Color.light_gray,
.light_gray,
);
//----------------------------------------------------------------------------------
}

View file

@ -26,16 +26,16 @@ pub fn main() anyerror!void {
//----------------------------------------------------------------------------------
ballPosition = rl.getMousePosition();
ballColor = rl.Color.beige;
ballColor = .beige;
if (rl.isMouseButtonDown(.left)) {
ballColor = rl.Color.maroon;
ballColor = .maroon;
}
if (rl.isMouseButtonDown(.middle)) {
ballColor = rl.Color.lime;
ballColor = .lime;
}
if (rl.isMouseButtonDown(.right)) {
ballColor = rl.Color.dark_blue;
ballColor = .dark_blue;
}
if (rl.isMouseButtonPressed(.left)) {
@ -58,7 +58,7 @@ pub fn main() anyerror!void {
rl.beginDrawing();
defer rl.endDrawing();
rl.clearBackground(rl.Color.ray_white);
rl.clearBackground(.ray_white);
const nums = [_]i32{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
for (nums) |i| {
@ -68,13 +68,13 @@ pub fn main() anyerror!void {
if ((touchPosition.x >= 0) and (touchPosition.y >= 0)) {
// Draw circle and touch index number
rl.drawCircleV(touchPosition, 34, rl.Color.orange);
rl.drawCircleV(touchPosition, 34, .orange);
rl.drawText(
rl.textFormat("%d", .{i}),
@as(i32, @intFromFloat(touchPosition.x)) - 10,
@as(i32, @intFromFloat(touchPosition.y)) - 70,
40,
rl.Color.black,
.black,
);
}
}
@ -82,8 +82,8 @@ pub fn main() anyerror!void {
// Draw the normal mouse location
rl.drawCircleV(ballPosition, 30 + (touchCounter * 3), ballColor);
rl.drawText("move ball with mouse and click mouse button to change color", 10, 10, 20, rl.Color.dark_gray);
rl.drawText("touch the screen at multiple locations to get multiple balls", 10, 30, 20, rl.Color.dark_gray);
rl.drawText("move ball with mouse and click mouse button to change color", 10, 10, 20, .dark_gray);
rl.drawText("touch the screen at multiple locations to get multiple balls", 10, 30, 20, .dark_gray);
//----------------------------------------------------------------------------------
}
}

View file

@ -149,17 +149,17 @@ pub fn main() anyerror!void {
defer rl.endDrawing();
if (rl.isWindowState(rl.ConfigFlags { .window_transparent = true })) {
rl.clearBackground(rl.Color.blank);
} else rl.clearBackground(rl.Color.ray_white);
rl.clearBackground(.blank);
} else rl.clearBackground(.ray_white);
rl.drawCircleV(ball_position, ball_radius, rl.Color.maroon);
rl.drawCircleV(ball_position, ball_radius, .maroon);
rl.drawRectangleLinesEx(
rl.Rectangle.init(0, 0, @floatFromInt(rl.getScreenWidth()), @floatFromInt(rl.getScreenHeight())),
.init(0, 0, @floatFromInt(rl.getScreenWidth()), @floatFromInt(rl.getScreenHeight())),
4,
rl.Color.ray_white,
.ray_white,
);
rl.drawCircleV(rl.getMousePosition(), 10, rl.Color.dark_blue);
rl.drawCircleV(rl.getMousePosition(), 10, .dark_blue);
rl.drawFPS(10, 10);
@ -168,7 +168,7 @@ pub fn main() anyerror!void {
10,
40,
10,
rl.Color.green,
.green,
);
// Draw window state info
@ -177,7 +177,7 @@ pub fn main() anyerror!void {
10,
60,
10,
rl.Color.gray,
.gray,
);
rl.drawText(
rl.textFormat("[F] flag_fullscreen_mode: %d", .{
@ -186,7 +186,7 @@ pub fn main() anyerror!void {
10,
80,
10,
rl.Color.lime,
.lime,
);
rl.drawText(
rl.textFormat("[R] flag_window_resizable: %d", .{
@ -195,7 +195,7 @@ pub fn main() anyerror!void {
10,
100,
10,
rl.Color.lime,
.lime,
);
rl.drawText(
rl.textFormat("[D] flag_window_undecorated: %d", .{
@ -204,7 +204,7 @@ pub fn main() anyerror!void {
10,
120,
10,
rl.Color.lime,
.lime,
);
rl.drawText(
rl.textFormat("[H] flag_window_hidden: %d", .{
@ -213,7 +213,7 @@ pub fn main() anyerror!void {
10,
140,
10,
rl.Color.lime,
.lime,
);
rl.drawText(
rl.textFormat("[N] flag_window_minimized: %d", .{
@ -222,7 +222,7 @@ pub fn main() anyerror!void {
10,
160,
10,
rl.Color.lime,
.lime,
);
rl.drawText(
rl.textFormat("[M] flag_window_maximized: %d", .{
@ -231,7 +231,7 @@ pub fn main() anyerror!void {
10,
180,
10,
rl.Color.lime,
.lime,
);
rl.drawText(
rl.textFormat("[U] flag_window_unfocused: %d", .{
@ -240,7 +240,7 @@ pub fn main() anyerror!void {
10,
200,
10,
rl.Color.lime,
.lime,
);
rl.drawText(
rl.textFormat("[T] flag_window_topmost: %d", .{
@ -249,7 +249,7 @@ pub fn main() anyerror!void {
10,
220,
10,
rl.Color.lime,
.lime,
);
rl.drawText(
rl.textFormat("[A] flag_window_always_run: %d", .{
@ -258,7 +258,7 @@ pub fn main() anyerror!void {
10,
240,
10,
rl.Color.lime,
.lime,
);
rl.drawText(
rl.textFormat("[V] flag_vsync_hint: %d", .{
@ -267,7 +267,7 @@ pub fn main() anyerror!void {
10,
260,
10,
rl.Color.lime,
.lime,
);
rl.drawText(
@ -275,7 +275,7 @@ pub fn main() anyerror!void {
10,
300,
10,
rl.Color.gray,
.gray,
);
rl.drawText(
rl.textFormat("flag_window_highdpi: %d", .{
@ -284,7 +284,7 @@ pub fn main() anyerror!void {
10,
320,
10,
rl.Color.lime,
.lime,
);
rl.drawText(
rl.textFormat("flag_window_transparent: %d", .{
@ -293,7 +293,7 @@ pub fn main() anyerror!void {
10,
340,
10,
rl.Color.lime,
.lime,
);
rl.drawText(
rl.textFormat("flag_msaa_4x_hint: %d", .{
@ -302,7 +302,7 @@ pub fn main() anyerror!void {
10,
360,
10,
rl.Color.lime,
.lime,
);
}
// ---------------------------------------------------------------------