Giter Site home page Giter Site logo

Building for WebAssembly about raylib-zig HOT 7 CLOSED

not-nik avatar not-nik commented on May 14, 2024
Building for WebAssembly

from raylib-zig.

Comments (7)

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

Should be possible, at least with some hacks. Raylib currently uses emscripten for web apps iirc. I'll check on this when I get back from vacation later this week.

from raylib-zig.

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

Currently not possible, since raylib's build.zig only offers support for Windows, Linux, macOS and *BSD. I have created an issue on its repository: raysan5/raylib#2884

from raylib-zig.

Akselmo avatar Akselmo commented on May 14, 2024

I'd also like to know. I would like to try Zig in a gamejam but I think WASM is essential for that.

Any news on this front?

from raylib-zig.

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

raylib now has support for building for emscripten since raysan5/raylib#2901 was merged, but Zig can't generate the required extra files that create the required JS functions (for OpenGL etc.) so at least the link step for the final "executable" has to be done with emscripten.

On the Zig side ziglang/zig#10836 tracks this issue.

from raylib-zig.

bluesillybeard avatar bluesillybeard commented on May 14, 2024

I was able to get it to work: https://github.com/bluesillybeard/ZigAndRaylibSetup

It's a hassle to set up and it's also pretty janky, but it does work.

Edit: Forgot to mention, I didn't use this wrapper, but instead used Raylib by itself

from raylib-zig.

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

If you can neatly integrate it into the current build script, don't hesitate to open a PR

from raylib-zig.

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

Fixed in #52

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.