I am not sure what is happening. but from this code, I get this error.
pub fn start(this: *@This(), _controler: *con.newController()) !void {
_ = this; // autofix
rl.beginDrawing();
defer rl.endDrawing();
if (_controler.model.Textures2D.get("backround")) |br| {
//rl.drawTexture(br, 0, 0, rl.Color.white);
rl.drawTextureEx(br, rl.Vector2.init(0, 0), 0, 1.4, rl.Color.white);
} else {
const backround = try rl.Texture.init("src/assets/d95yko3-2f800ab5-9211-40e8-a8be-b0186dd6b23c.png");
try _controler.model.add2DTexture("backround", backround);
}
drawMenu(_controler);
}
FROM THE ERROR MES
view.zig:69:64: error: expected type 'raylib.Texture', found 'error{LoadFileData,LoadImageColors,LoadImagePalette,LoadFont,LoadFontData,LoadCodepoints,LoadMaterial,LoadMaterials,LoadModelAnimations,LoadShader,LoadImage,LoadModel,LoadTexture,LoadRenderTexture,LoadWave,LoadSound,LoadMusic,LoadAudioStream}!raylib.Texture'
try _controler.model.add2DTexture("backround", backround);
^~~~~~~~~
view.zig:69:64: note: cannot convert error union to payload type
view.zig:69:64: note: consider using 'try', 'catch', or 'if'
/home/jameson/.cache/zig/p/1220eedbc450fcfced1599d69f1e2c38b60af51616dbf724f6b9a8ed2c2a7c62cf9c/lib/raylib.zig:1182:28: note: struct declared here
pub const Texture = extern struct {
~~~~~~~^~~~~~
model.zig:69:81: note: parameter type declared here
pub fn add2DTexture(this: *@This(), name: *const [9:0]u8, _Texture2D: rl.Texture2D) !void {
~~^~~~~~~~~~
referenced by:
drawScreen: controller.zig:24:42
startApp: controller.zig:39:25
remaining reference traces hidden; use '-freference-trace' to see all reference traces
player.zig:153:52: error: enum 'raylib.KeyboardKey' has no member named 'key_e'
This same code works on MacOS and Windows, but I get this error when using Manjaro Linux.
first I am not sure how to proceed other than opening a bug report but I have no clue how to reproduce this. because when I try to recreate within a new project error unions work properly.