Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/goxjs/gl
Go cross-platform OpenGL bindings.
https://github.com/goxjs/gl
opengl opengl-es webgl
Last synced: about 2 months ago
JSON representation
Go cross-platform OpenGL bindings.
- Host: GitHub
- URL: https://github.com/goxjs/gl
- Owner: goxjs
- License: bsd-3-clause
- Created: 2015-05-18T08:10:15.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-07-05T02:22:51.000Z (over 1 year ago)
- Last Synced: 2024-10-25T05:24:30.813Z (about 2 months ago)
- Topics: opengl, opengl-es, webgl
- Language: Go
- Homepage:
- Size: 104 KB
- Stars: 176
- Watchers: 15
- Forks: 26
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - goxjs/gl - Go cross-platform OpenGL bindings (OS X, Linux, Windows, browsers, iOS, Android). (OpenGL / HTTP Clients)
- zero-alloc-awesome-go - goxjs/gl - Go cross-platform OpenGL bindings (OS X, Linux, Windows, browsers, iOS, Android). (OpenGL / HTTP Clients)
- awesome-go - gl - Go cross-platform OpenGL bindings. - ★ 127 (OpenGL)
- awesome-go-extra - gl - platform OpenGL bindings.|158|21|8|2015-05-18T08:10:15Z|2021-01-04T18:53:21Z| (OpenGL / HTTP Clients)
- awesome-go-zh - goxjs/gl
README
gl
==[![Go Reference](https://pkg.go.dev/badge/github.com/goxjs/gl.svg)](https://pkg.go.dev/github.com/goxjs/gl)
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.Installation
------------```sh
go get github.com/goxjs/gl
```Usage
-----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.```Go
if err := glfw.Init(gl.ContextWatcher); err != nil {
// Handle error.
}
defer glfw.Terminate()
```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.```Go
window.MakeContextCurrent()
gl.ContextWatcher.OnMakeCurrent(nil)glfw.DetachCurrentContext()
gl.ContextWatcher.OnDetach()
```Directories
-----------| Path | Synopsis |
|---------------------------------------------------------|-----------------------------------------------------|
| [glutil](https://pkg.go.dev/github.com/goxjs/gl/glutil) | Package glutil implements OpenGL utility functions. |
| [test](https://pkg.go.dev/github.com/goxjs/gl/test) | Package test contains tests for goxjs/gl. |License
-------- [BSD-style License](LICENSE)