jack-ji / jok Goto Github PK
View Code? Open in Web Editor NEWA minimal 2d/3d game framework for @ziglang.
License: MIT License
A minimal 2d/3d game framework for @ziglang.
License: MIT License
Right now, if I use any of the functions that use @splat
, it causes a compile error:
/home/mpokhil/Source/jok/src/j2d/Vector.zig:97:39: error: expected type 'u32', found 'type'
const result = self.data / @splat(f32, l);
^~~
referenced by:
move: /home/.../src/main.zig:63:30
update: /home/.../src/main.zig:146:13
remaining reference traces hidden; use '-freference-trace' to see all reference traces
/home/.../jok/src/j2d/Vector.zig:23:27: error: expected type 'u32', found 'type'
const result = @splat(f32, val);
Just changing all instance of @splat(f32, ...)
in jok.j2d.Vector
to @splat(2, ...)
works as expected.
Should I create a PR for this?
Not so sure how other engines/frameworks are dealing with high dpi. Hope someone can provide some clues.
the build.zig.zon here doesn't let this project compile
Using defer
on pairs of setup and cleanup is a common zig idiom, but since the end()
functions can error, its impossible right now.
Suggested refactor:
try
expressions to catch, save the error and return;begin()
try the end
error as the first thing;so it would be something like
+ var end_error: anyerror!void = {};
...
pub fn begin(opt: BeginOpt) !void {
+ try end_error;
....
}
...
-pub fn end() !void {
+pub fn end() void {
- try [expr];
+ [expr] catch |e| return end_error = e;
}
Gonna write down a PR, just thought it would be good to open an issue first.
Hi! I'm trying to compile the examples, but I'm getting:
PS D:\programming\__zig\jok> zig build hello
zig build-exe hello Debug native: error: error(compilation): clang failed with stderr: D:\programming\__zig\jok\src\deps\audio\c\sdl_impl.c:594:18: error: call to undeclared function 'ma_context_init__sdl'; ISO
C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
The SDL version I've setup is SDL2-devel-2.28.5-mingw
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.