@@ -46,25 +46,25 @@ pub fn on_init() !void {
4646 const shader = delve .platform .graphics .Shader .initFromBuiltin (.{ .vertex_attributes = delve .graphics .mesh .getShaderAttributes () }, delve .shaders .default_mesh );
4747
4848 // Create some materials
49- material_frustum = delve .platform .graphics .Material .init (.{
49+ material_frustum = try delve .platform .graphics .Material .init (.{
5050 .shader = shader ,
5151 .texture_0 = delve .platform .graphics .createSolidTexture (0x66FFFFFF ),
5252 .cull_mode = .NONE ,
5353 .depth_write_enabled = false ,
5454 .blend_mode = .BLEND ,
5555 });
5656
57- material_cube = delve .platform .graphics .Material .init (.{
57+ material_cube = try delve .platform .graphics .Material .init (.{
5858 .shader = shader ,
5959 .texture_0 = delve .platform .graphics .tex_white ,
6060 });
6161
62- material_highlight = delve .platform .graphics .Material .init (.{
62+ material_highlight = try delve .platform .graphics .Material .init (.{
6363 .shader = shader ,
6464 .texture_0 = delve .platform .graphics .createSolidTexture (0xFF0000CC ),
6565 });
6666
67- material_hitpoint = delve .platform .graphics .Material .init (.{
67+ material_hitpoint = try delve .platform .graphics .Material .init (.{
6868 .shader = shader ,
6969 .texture_0 = delve .platform .graphics .createSolidTexture (0xFFFF0000 ),
7070 });
@@ -76,17 +76,17 @@ pub fn on_init() !void {
7676 camera .position = delve .math .Vec3 .new (0 , 30 , 32 );
7777 camera .pitch_angle = -50.0 ;
7878
79- cube_mesh = delve .graphics .mesh .createCube (delve .math .Vec3 .new (0 , 0 , 0 ), delve .math .Vec3 .new (1 , 1 , 1 ), delve .colors .white , & material_cube ) catch {
79+ cube_mesh = delve .graphics .mesh .createCube (delve .math .Vec3 .new (0 , 0 , 0 ), delve .math .Vec3 .new (1 , 1 , 1 ), delve .colors .white , material_cube ) catch {
8080 delve .debug .fatal ("Could not create cube mesh!" , .{});
8181 return ;
8282 };
8383
84- hit_mesh = delve .graphics .mesh .createCube (delve .math .Vec3 .new (0 , 0 , 0 ), delve .math .Vec3 .new (0.5 , 0.5 , 0.5 ), delve .colors .white , & material_cube ) catch {
84+ hit_mesh = delve .graphics .mesh .createCube (delve .math .Vec3 .new (0 , 0 , 0 ), delve .math .Vec3 .new (0.5 , 0.5 , 0.5 ), delve .colors .white , material_cube ) catch {
8585 delve .debug .fatal ("Could not create cube mesh!" , .{});
8686 return ;
8787 };
8888
89- ray_mesh = delve .graphics .mesh .createCube (delve .math .Vec3 .new (50 , 0 , 0 ), delve .math .Vec3 .new (100 , 0.1 , 0.1 ), delve .colors .red , & material_cube ) catch {
89+ ray_mesh = delve .graphics .mesh .createCube (delve .math .Vec3 .new (50 , 0 , 0 ), delve .math .Vec3 .new (100 , 0.1 , 0.1 ), delve .colors .red , material_cube ) catch {
9090 delve .debug .fatal ("Could not create cube mesh!" , .{});
9191 return ;
9292 };
@@ -129,10 +129,10 @@ pub fn on_draw() void {
129129 const rayhit = ray .intersectOrientedBoundingBox (bounds );
130130
131131 if (rayhit != null ) {
132- cube_mesh .drawWithMaterial (& material_highlight , view_mats , cube_model_matrix );
132+ cube_mesh .drawWithMaterial (material_highlight , view_mats , cube_model_matrix );
133133
134134 const hit_model_matrix = delve .math .Mat4 .translate (rayhit .? .hit_pos );
135- hit_mesh .drawWithMaterial (& material_hitpoint , view_mats , hit_model_matrix );
135+ hit_mesh .drawWithMaterial (material_hitpoint , view_mats , hit_model_matrix );
136136 } else {
137137 cube_mesh .draw (view_mats , cube_model_matrix );
138138 }
0 commit comments