Comments (6)
They are similar in purpose, but the differences are:
goxjs/gl
is more mature, complete, and well supported/maintained.- It is used by the google/gxui project, and more active projects. See its importers.
ajhager/webgl
was the first OpenGL library to offer a desktop and web backend.goxjs/gl
is a successor.
I initially forked ajhager/webgl
and maintained a more actively maintained fork at shurcooL/gogl
. That was the "first generation OpenGL library with multiple backends". However, it only had desktop and web backends, not mobile. Its API was very similar, but slightly different from golang.org/x/mobile/gl
package.
I eventually decided it'd be better to try to take golang.org/x/mobile/gl
API, and add WebGL support to it, therefore having desktop, OpenGL ES (mobile) and WebGL (web) support in one package.
The initial goal was to get that merged into golang.org/x/mobile/gl
itself. That is still planned to happen in the future, but it can't happen in the short term, so goxjs/gl
exists until that happens. Don't worry, it will only go away when it's easy to migrate to a better package without compromises.
I myself actively use and maintain this package, but I do not use ajhager/webgl
so it may be out of date. Still, goxjs/gl
owes its existance to ajhager/webgl
which was the first effort and working proof of concept.
from gl.
I tried some of the examples golang.org/x/mobile/gl
and it works on linux and android (not windows) and it also handle input handling like touch events without glfw.
I saw your example here https://github.com/shurcooL/play/blob/master/113/main.go and it uses glfw is that needed because I think the golang pkg uses EGL for input handling.
There is also the golang.org/x/mobile/exp/f32
whats the difference between that and this github.com/go-gl/mathgl/mgl32
as both seem to support vectors?
Also I'm planning to create a multi-platform game engine using the mobile pkg for all platforms(desktop, android, ios)? Will this package be enough? I don't want to have a dependecy on glfw also? I'm thinking of using the golang scenegraph golang.org/x/mobile/exp/sprite
as it seemlessly handles everything for me?
BTW I actually started off implementing it in libSDL2 but then thought of reconsidering it as go now has a lot of packages which are os independent.
from gl.
I tried some of the examples
golang.org/x/mobile/gl
and it works on linux and android (not windows) and it also handle input handling like touch events without glfw.
Yep. golang.org/x/mobile/gl
does not have Windows support at this time, but there's an issue open for it.
I saw your example here https://github.com/shurcooL/play/blob/master/113/main.go and it uses glfw is that needed because I think the golang pkg uses EGL for input handling.
That's a great basic example! See here for more projects that use this package.
This package is indeed meant primarily to be used with goxjs/glfw
library, as that provides cross-platform window and context creation, as well as user input. In theory it can work without glfw
, but I have no such known use cases.
There is also the
golang.org/x/mobile/exp/f32
whats the difference between that and thisgithub.com/go-gl/mathgl/mgl32
as both seem to support vectors?
go-gl/mathgl
is older and more feature complete. It's also pretty stable. x/mobile/exp/f32
is newer, it was created alongside with x/mobile/gl
and used there. It's documented to have unstable API and may change in the future.
It's up to you which you use. I'm currently using go-gl/mathgl
everywhere but it'd be great to see the two consolidate into one eventually in the future. It's unlikely to happen soon.
Also I'm planning to create a multi-platform game engine using the mobile pkg for all platforms(desktop, android, ios)? Will this package be enough? I don't want to have a dependecy on glfw also? I'm thinking of using the golang scenegraph
golang.org/x/mobile/exp/sprite
as it seemlessly handles everything for me?
If you have plans as ambitious as creating a game engine, I highly recommend trying both and becoming familiar with both this goxjs/gl
package, used in combination with goxjs/glfw
, as well as x/mobile/gl
and x/mobile/app
packages.
Each one is the best of its class, but they serve slighly different needs. The future long term goal is to merge both goxjs/gl
and x/mobile/gl
into one package. They already have the same API, so switching from one to the other is easy. The APIs of glfw
and app
are different, however.
goxjs/gl
is more multi-platform, it supports OS X, Linux, Windows, web browsers, and iOS/Android, but the iOS/Android support is untested and more out of date. Works well withglfw
-style API.x/mobile/gl
is the best iOS/Android OpenGL library, but it doesn't yet support Windows and doesn't yet support web browsers. Works well withapp
-style API but notglfw
at this time.
Again, the two gl
packages will be merged into one eventually in the future once all the necessary steps are complete, that is the goal. So which one you use until then is up to you, and you can switch between them easily.
from gl.
Also, are you familiar with some existing Go game engines? One example I know of is azul3d.org (/cc @slimsag). It has already made significant progress in many areas, but still has a work remaining. It already is cross-platform to some degree, and aims to support more platforms in future.
Perhaps you might like to join an existing project rather than starting fresh? Again, the choice is yours.
from gl.
Yeah I checked that out it seems good. There are 2 - 3 others which I saw but they aren't working completely yet. But my main target is android and iOS with a game engine with similar api to https://github.com/libgdx/libgdx so it would become easier to port games I have written from java to golang. I prefer libgdx as I already have extensive knowledge on using it and used in to make my own frameworks like https://github.com/pyros2097/Scene3d, https://github.com/pyros2097/Sink.
I guess some of the differences discussed here might need to go in the readme or maybe not.
Anyway Thanks!
from gl.
I'll close this because the question has been answered. :)
from gl.
Related Issues (20)
- Getting an error in go 1.5 HOT 1
- headless HOT 8
- Fails on Raspberry Pi (go1.5 linux/arm). HOT 11
- GetTexParameterfv, similar Get func arguments are not in line with OpenGL spec.
- go 1.6 cgocheck HOT 2
- JS TexImage2D produces TypeError HOT 6
- WebGL GetIntegerv: not yet tested [Confirmed Functional] HOT 2
- Unable to Get Current Frame Buffer In Webgl HOT 9
- Trying to cross compile on Mac to Windows, errors: HOT 1
- Plans for WebGL 2 HOT 3
- Can't get second attribute location HOT 4
- Supported OpenGL version HOT 4
- Attrib.Value is int for webgl and uint for opengl? HOT 5
- Update to newest "golang.org/x/mobile/gl" HOT 3
- README: stop suggesting GOARCH=js go get since it no longer works HOT 5
- Maintenance and Supersession HOT 1
- how do i use on android
- gl.Init called without a current context on Windows backend, and fails. HOT 10
- Potentially calling gl.Init too often when 2+ active windows/contexts on Windows. HOT 1
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 gl.