Giter Site home page Giter Site logo

Comments (4)

Not-Nik avatar Not-Nik commented on May 14, 2024

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.

Not-Nik avatar Not-Nik commented on May 14, 2024

Shuould work now since 88c9614. Reopen if your issue persists.

from raylib-zig.

Not-Nik avatar Not-Nik commented on May 14, 2024

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.

anaanook avatar anaanook commented on May 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.