-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
63 lines (50 loc) · 1.9 KB
/
Program.cs
File metadata and controls
63 lines (50 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using VeldridRaylib;
namespace VeldridRaylib
{
class Program
{
static void Main(string[] args)
{
// Initialize window
const int screenWidth = 800;
const int screenHeight = 450;
Raylib.InitWindow(screenWidth, screenHeight, "VeldridRaylib - Core API Demo");
Raylib.SetTargetFPS(60);
// Main game loop
while (!Raylib.WindowShouldClose())
{
// Update
// Handle input and game logic here
// Draw
Raylib.BeginDrawing();
Raylib.ClearBackground(Color.DarkGray);
// Draw some shapes to demonstrate the API
Raylib.DrawRectangle(100, 100, 200, 150, Color.Red);
Raylib.DrawCircle(400, 200, 50, Color.Blue);
Raylib.DrawLine(50, 50, 750, 400, Color.Green);
// Draw some pixels
for (int i = 0; i < 20; i++)
{
Raylib.DrawPixel(300 + i * 2, 300, Color.Yellow);
}
// Draw text (placeholder)
Raylib.DrawText("Hello VeldridRaylib!", 10, 10, 20, Color.White);
// Interactive elements
if (Raylib.IsKeyDown(KeyCode.Space))
{
Raylib.DrawCircle(400, 200, 80, Color.Magenta);
}
if (Raylib.IsKeyPressed(KeyCode.Enter))
{
Raylib.DrawRectangle(200, 200, 100, 100, Color.Cyan);
}
// Mouse interaction
var mousePos = Raylib.GetMousePosition();
Raylib.DrawCircle((int)mousePos.X, (int)mousePos.Y, 10, Color.White);
Raylib.EndDrawing();
}
// Cleanup
Raylib.CloseWindow();
}
}
}