Package gl is a Go cross-platform binding for OpenGL, with an OpenGL ES 2-like API. It supports: - macOS, Linux and Windows via OpenGL 2.1 backend, - iOS and Android via OpenGL ES 2.0 backend, - Modern Browsers (desktop and mobile) via WebGL 1.0 backend. This is a fork of golang.org/x/mobile/gl package with [CL 8793](https://go-review.googlesource.com/8793) merged in and Windows support added. This package is fully functional, but may eventually become superceded by the new x/mobile/gl plan. It will exist and be fully supported until it can be safely replaced by a better package. This OpenGL binding has a ContextWatcher, which implements [glfw.ContextWatcher](https://godoc.org/github.com/goxjs/glfw#ContextWatcher) interface. Recommended usage is with github.com/goxjs/glfw package, which accepts a ContextWatcher in its Init, and takes on the responsibility of notifying it when context is made current or detached. If you're not using a ContextWatcher-aware glfw library, you must call methods of gl.ContextWatcher yourself whenever you make a context current or detached.
This code launches a simple HTTP server to test the pre-built WASM bundle (This code was inspired by https://github.com/bobcob7/wasm-basic-triangle)
Package webgl provides bindings for WebGL via syscall/js.
Package gfx provides generic interfaces to GPU-based rendering techniques. This package is not useful by itself but instead part of a larger picture as this package provides generic interfaces and data types to modern graphics rendering API's such as OpenGL, OpenGL ES, WebGL, Direct3D, etc. The coordinate system used by this package is the right-handed Z up coordinate system unless explicitly specified otherwise. Texture coordinates do not follow OpenGL convention where the origin (0, 0) is the bottom-left, instead the origin (0, 0) is the top-left because: Go's image package uses top-left as the origin. If we followed OpenGL convention we would have to flip the image or texture coordinates on the CPU before upload to the GPU or in each shader.