A video series where I teach programming via game projects. We do some software rendering, some SDL2, simplex noise, 2d rpgs, and some 3d opengl.
Create a simple cross-platform desktop game with Go
11–20 of 23 posts
Re: Create a simple cross-platform desktop game with Go
#12Interesting, though what this actually does is run a local webserver so I assume it would be even simpler to just open the default web browser pointed to the local server? But then you start thinking that sound output could also be handled via the audio API and one could even play this remotely. So what you created is a webapp? Why even run it locally at all then... just some thoughts. Still a cool idea to circumvent…
Re: Create a simple cross-platform desktop game with Go
#13I've been tinkering with writing a simple game in Golang as well. I don't think it's a good idea to lob in an entire web browser for a game, though. I've been using the go-gl stack: https://github.com/go-gl They have a wrapper for GLFW and OpenGL, I've been using GLES2 which has good compatability with everything. You have to be prepared to learn how to write shaders and use OpenGL, though, so it can be a bit intimid…
Re: Create a simple cross-platform desktop game with Go
#14I've been tinkering with writing a simple game in Golang as well. I don't think it's a good idea to lob in an entire web browser for a game, though. I've been using the go-gl stack: https://github.com/go-gl They have a wrapper for GLFW and OpenGL, I've been using GLES2 which has good compatability with everything. You have to be prepared to learn how to write shaders and use OpenGL, though, so it can be a bit intimid…
If you are doing 2d you can also do quite well with just the SDL2 wrapper. That gives you enough to do cross platform sound, input, and putting textures on the screen with alpha blending and bilinear interp. So its enough to make mario/ultima/baldurs gate/ style things.
Re: Create a simple cross-platform desktop game with Go
#15Interesting, though what this actually does is run a local webserver so I assume it would be even simpler to just open the default web browser pointed to the local server? But then you start thinking that sound output could also be handled via the audio API and one could even play this remotely. So what you created is a webapp? Why even run it locally at all then... just some thoughts. Still a cool idea to circumvent…
Webview author here. It does not require local web server actually, it allows to inject js, css, HTML in runtime and bind go structs to is objects through the API, so the result is a self contained web app with no server. Although using a local web server may be more convenient to most web developers.
Re: Create a simple cross-platform desktop game with Go
#16No need for HTML/js and API is pretty simple
Re: Create a simple cross-platform desktop game with Go
#17Earlier quoted context omitted.
Webview author here. It does not require local web server actually, it allows to inject js, css, HTML in runtime and bind go structs to is objects through the API, so the result is a self contained web app with no server. Although using a local web server may be more convenient to most web developers.
Why IE and not Edge for Windows?
Re: Create a simple cross-platform desktop game with Go
#18Re: Create a simple cross-platform desktop game with Go
#19Re: Create a simple cross-platform desktop game with Go
#20See also https://github.com/oakmound/oak if you are interested in a pure-Go library (i.e. one which doesn't need cgo) with no HTML & JS dependencies. (Disclaimer: haven't used it so not sure what's the status; but reportedly it's been used by its author to write a game.)