1use ry_gfx::{ColorRydit, Key, RyditGfx};
5
6fn main() {
7 println!("=== RYDIT-GFX v0.1.0 ===");
8 println!("Rust = Arquitecto, Raylib = Pincel\n");
9
10 let mut gfx = RyditGfx::new("RyDit v0.0.7 - rydit-gfx", 800, 600);
12 gfx.set_target_fps(60);
13
14 println!("[RUST] Ventana creada, iniciando game loop...\n");
15
16 let mut frame = 0;
18 while !gfx.should_close() {
19 frame += 1;
20
21 let escape_pressed = gfx.is_key_pressed(Key::Escape);
23
24 {
26 let mut d = gfx.begin_draw();
27
28 d.clear(ColorRydit::Negro);
30
31 let radius = 50 + (frame % 20);
33 d.draw_circle(400, 300, radius, ColorRydit::Rojo);
34
35 d.draw_rectangle(100, 100, 100, 100, ColorRydit::Verde);
37
38 d.draw_line(0, 0, 800, 600, ColorRydit::Azul);
40
41 d.draw_text(
43 "RyDit v0.0.7 - rydit-gfx",
44 250,
45 50,
46 20,
47 ColorRydit::Amarillo,
48 );
49 d.draw_text(
50 "Rust = Arquitecto, Raylib = Pincel",
51 220,
52 80,
53 16,
54 ColorRydit::Blanco,
55 );
56 d.draw_text("Presiona ESC para salir", 280, 550, 16, ColorRydit::Blanco);
57
58 }
60
61 if escape_pressed {
63 println!("\n[RUST] Decidiendo cerrar en frame {}...", frame);
64 break;
65 }
66 }
67
68 println!("\n[RUST] Juego terminado. ¡Éxito!");
69}