Comments (4)
You are right, this is a zig C ABI problem. I can't really reproduce your situation as for me the code you sent doesn't draw at all, which is somewhat expected. Zig doesn't yet support passing structures between Zig and C, including both as arguments and in return values. These kinds of issues have partly been addressed in the Readme under Technical Restrictions and the workaround branch. The exact behaviour you want to achieve should be possible on that branch, but any raylib functions returning structs wont work.
Speaking of the workaround branch I'm currently trying to fix the projectSetup.sh over there and add a lib.zig similar to the one on the master branch.
EDIT: My bad, I just realised your source requires a tiles.bmp
which I obviously didn't have. However, trying your example with a different Image (a PNG, which shouldn't really matter) works on the workaround branch. I'm going to tidy up my local changes and push them in a bit.
from raylib-zig.
Shuould work now since 88c9614. Reopen if your issue persists.
from raylib-zig.
This issue gets weirder and weirder, the more I investigate. Both the draw functions work for me even on master. I do use -Dsystem-raylib=true
because building raylib on macOS is not supported yet, so that might be related. Additionally as described in my first comment, both draw calls shouldn't work because of the lack of C ABI support. Rectangle, Vector2 and Color are all <= 16 which means they should raise a compiler error.
from raylib-zig.
I can confirm the workaround fixes the problem which is great! Thanks for investigating this.
Not sure if you saw, but both draw functions work for me but only in debug builds. If I switch over to any of the 3 release modes the one with the embedded function fails. It's definitely weird.
from raylib-zig.
Related Issues (20)
- Technical Restrictions link on the README leads nowhere
- Building for WebAssembly HOT 7
- SetConfigFlags doesn't accept enum HOT 4
- `DrawTextEx` odd text size behaviour HOT 2
- Expose access to Raylibs compile-time config flags HOT 1
- Doesnt compile HOT 1
- Offer to help: raygui support HOT 7
- Support for Zig 0.11.x HOT 1
- No Autocomplete For Zig LSP HOT 3
- flags incorrectly converted in the python generator HOT 1
- Error in build.zig HOT 1
- loadFontFromMemory fontChars missing support for NULL
- Apps crash when functions that return arrays, return null pointers HOT 1
- Functions accepting slices sometimes redundantly also take their length
- Implement system-raylib flag HOT 2
- Tips on using with zigmod? HOT 1
- No implementation for adding Vectors ?? HOT 2
- Use OS specific path separators in `build.zig`, and remove comptime parameters in `getModule`. HOT 2
- Color pink is defined wrong
- how do I include other libs (web build) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raylib-zig.