GithubHelp home page GithubHelp logo

Comments (9)

gen2brain avatar gen2brain commented on May 26, 2024

Building for Android is supported, see here https://github.com/gen2brain/raylib-go/tree/master/examples/android/example . I am working on improved bootstrap script that should work (in theory at least) also on Windows and macOS.

Edit: Also see here for apk game example https://github.com/gen2brain/raylib-go/tree/master/examples/games/floppy

Emscripten is not supported. Maybe someday, if Go llvm support is matured, and also implemented for other platforms besides x86_64, so code can be compiled to bytecode, and then processed with emscripten, something like that I guess.

from raylib-go.

dbriemann avatar dbriemann commented on May 26, 2024

Wow fast reply!
Great to here that it works for Android already!

About the web target: have you considered using GopherJS instead of Emscripten? That's what all the other projects use to compile Go to Javascript. I don't really know how much work this would be though..

from raylib-go.

gen2brain avatar gen2brain commented on May 26, 2024

I have considered GopherJS, but it seems like a lot of work. raylib-go is wrapper around C library, with C code included in project. Other projects also use cgo where they need, i.e. GL, OpenAL, but have that better isolated. For raylib-go, a lot of parts will need to be rewritten in Go, and then exported back to C code, rlgl.c for example. Something can be done with tags probably, but still a lot of work.

Edit: if not clear, GopherJS doesn't work with cgo, only native Go code.

from raylib-go.

dbriemann avatar dbriemann commented on May 26, 2024

I had a gut feeling that cgo will be a problem there. I guess then the web target will have to wait :)
Thanks for all the info! Seems like I have to stick to other languages for now sadly.

from raylib-go.

 avatar commented on May 26, 2024

There is work happening for golang to support WASM. It's looking promising too.

You can currently mix golang and c code and have it compile with emscripten and gopherjs to work together.
Then when the WASM for golang is done, you can move to that.

Here is a good example of this which also has sound working.
https://github.com/naivesound/glitch
picodom is a fast small replacement for react vdom, and is c, but compiled to emscripten
then the golang stuff is compiled to gopherjs and it calls the JS of picodom.

this is not a perfect example, but it shows this works and that its a pretty good potential roadmap for us.

I have not had enough time to really dig into this further, but wanted to raise this.

Ans there is now cayley running 100% in the browser
https://discourse.cayley.io/t/cayley-issues/954

https://github.com/elliott5/cayley

from raylib-go.

gen2brain avatar gen2brain commented on May 26, 2024

@gedw99 I only now browsed through projects you linked. Not perfect, but i would like to try some combination of emscripten and gopherjs. Will need to investigate and see how everything can be combined of course. Thanks!

from raylib-go.

 avatar commented on May 26, 2024

no probs.

if you want to be on the tip here is he WASM for golang
https://github.com/neelance/go/tree/wasm-wip

from raylib-go.

gen2brain avatar gen2brain commented on May 26, 2024

Web target is now partially implemented, there are problems with _emscripten_set_main_loop() function, see #28 .

from raylib-go.

 avatar commented on May 26, 2024

@gen2brain thats great. Will have a look.

from raylib-go.

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.