This commit is contained in:
jonathan santis 2024-11-27 09:01:07 +01:00
parent d368a4c09a
commit 785f129312
2 changed files with 8 additions and 13 deletions

View File

@ -29,8 +29,8 @@ test "random" {
} }
} }
} }
const screenWidth = 800; const screenWidth = 1200;
const screenHeight = 450; const screenHeight = 800;
const Particle = struct { const Particle = struct {
const Self = @This(); const Self = @This();
@ -151,11 +151,9 @@ fn rectangle(x : u16,y : u16,width : u16,height : u16) rl.Rectangle
} }
pub fn main() anyerror!void { pub fn main() anyerror!void {
// Initialization
//--------------------------------------------------------------------------------------
const rect2 = rl.Rectangle{ .x = @as(f32, @floatFromInt(10)), .y = @as(f32, @floatFromInt(10)), .width = @as(f32, @floatFromInt(300)), .height = @as(f32, @floatFromInt(100)) }; const rect2 = rectangle(10,10,300,100);
const rect3 = rl.Rectangle{ .x = @as(f32, @floatFromInt(10)), .y = @as(f32, @floatFromInt(150)), .width = @as(f32, @floatFromInt(600)), .height = @as(f32, @floatFromInt(10)) }; const rect3 = rectangle(10,150,600,10);
const rect4 = rectangle(10,170,600,10); const rect4 = rectangle(10,170,600,10);
const rect5 = rectangle(10,190,600,10); const rect5 = rectangle(10,190,600,10);
var msg_res : i32=-1; var msg_res : i32=-1;
@ -178,7 +176,7 @@ pub fn main() anyerror!void {
defer rl.closeWindow(); // Close window and OpenGL context defer rl.closeWindow(); // Close window and OpenGL context
var texture : rl.Texture2D = undefined; var texture : rl.Texture2D = undefined;
const image : rl.Image = rl.loadImage("resources/test_64.png"); const image : rl.Image = rl.loadImage("resources/blut.png");
if(image.width > 0) if(image.width > 0)
{ {
texture = rl.loadTextureFromImage(image); texture = rl.loadTextureFromImage(image);
@ -204,8 +202,6 @@ pub fn main() anyerror!void {
.a = 255, .a = 255,
}); });
if(state != 0){ if(state != 0){
msg_res = rg.guiMessageBox(rect2, "Title", "question?", "Nice;Cool"); msg_res = rg.guiMessageBox(rect2, "Title", "question?", "Nice;Cool");
if(msg_res > -1){ if(msg_res > -1){
@ -222,9 +218,9 @@ pub fn main() anyerror!void {
else =>{}, else =>{},
} }
} }
_ = rg.guiSlider(rect3,"0","5000",&value,ItoF(0),ItoF(500)); _ = rg.guiSlider(rect3,"0","500",&value,ItoF(0),ItoF(500));
_ = rg.guiSlider(rect4,"0","10",&value2,ItoF(0),ItoF(3)); _ = rg.guiSlider(rect4,"-3","3",&value2,ItoF(-3),ItoF(3));
_ = rg.guiSlider(rect5,"0","10",&value3,ItoF(0),ItoF(3)); _ = rg.guiSlider(rect5,"-3","3",&value3,ItoF(-3),ItoF(3));
if(rl.isMouseButtonDown(rl.MouseButton.mouse_button_left)) if(rl.isMouseButtonDown(rl.MouseButton.mouse_button_left))
{ {
@ -232,7 +228,6 @@ pub fn main() anyerror!void {
} }
emitter.update(texture); emitter.update(texture);
} }
} }

Binary file not shown.