Comments (5)
Hi, at the moment that is not possible. At some point I would like to try it, but probably not soon.
from canvas.
I'm just new to webassembly and only have read about GO, sorry if don't really understand the languages yet.
Maybe I was a bit strict with 'directly'.
Can you create a Webassembly with this library to create a canvas and then in one JS call draw that entire canvas in the DOM?
from canvas.
No worries. So this library doesn't do anything with HTML or JS at the moment, it is pure Go and uses the system OpenGL driver to render. This is not available in a Webassembly context, so it won't work there. To make it work would require a separate implementation for Webassembly, which would be possible but I just have not started it yet.
from canvas.
Okay clear and thank you. I read into GO a couple of hours yesterday and it looks really cool!
I found that they now have https://golang.org/pkg/syscall/js/
This basically let's you import the DOM objects and directly call the JS functions and therefor also Canvas objects which solves the problem I had with Emscripten.
I would like to check if I understand it correctly now.
-
If you would've used WebGL instead of OpenGL it did work in Webassembly right?
-
With this library it only works if you compile it for that specific OS platform. So if I want to run it on Linux I have to use a Linux compiler, Windows a Windows compiler and Android/iOS "The GO Mobile" project?
Thanks in advance
from canvas.
Sure thing.
-
Yes, that would have worked. Although of course with Webassembly you have access to the 2D Canvas as well, so it could have used that directly. I used OpenGL here only because I didn't really see an alternative, and the whole reason I wanted this library was that I used the canvas a lot but preferred to use Go rather than JS
-
The library is pure Go, but you will need to supply an OpenGL context. The code that does that will probably have to be compiled on the specific platform, just as you said. But I'm not sure, the go-sdl project for example seems to include precompiled libraries, so it may be possible to cross compile for all platforms using that. I must admit I'm not sure about this though.
from canvas.
Related Issues (20)
- Error building on macOS HOT 3
- Hello, world demo inconsistent HOT 2
- [suggestion] gomobile display RegisterFilter HOT 1
- Is there any plan to support Ellipse for Path2D? HOT 1
- Flickering when using glfwcanvas HOT 3
- Memory Leak in DrawImage() HOT 1
- How to convert canvas to png? HOT 2
- Slow text rendering? HOT 3
- MacOs canvas ratio problem HOT 2
- Blank red screen macOS HOT 1
- Pixelated text HOT 4
- Improper canvas size when using scaled resolutions on macOS HOT 1
- What's the proper way to use RGBA for something like SetFillStyle? HOT 2
- how I should compile on windows? HOT 2
- Failed to compile vertex shader HOT 7
- How to save canvas as png with transparent background HOT 1
- Call CreateWindow function failed on WSL2 HOT 3
- Is there a plan for when the missing features will be supported?
- support font.Face drawing // font fallbacks
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 canvas.