GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - go-gl/glow: Go binding generator for OpenGL

BranchesTags
Open more actions menu

Latest commit

 

History

307 Commits
307 Commits

Folders and files

NameName
Last commit message
Last commit date
tmpl
tmpl
 
 
xml
xml
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
docs.go
docs.go
 
 
download.go
download.go
 
 
enums.go
enums.go
 
 
example.json
example.json
 
 
functions.go
functions.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
main.go
main.go
 
 
overload.go
overload.go
 
 
package.go
package.go
 
 
spec.go
spec.go
 
 
spec_test.go
spec_test.go
 
 
type.go
type.go
 
 
type_test.go
type_test.go
 
 
util.go
util.go
 
 
util_test.go
util_test.go
 
 
version.go
version.go
 
 
version_test.go
version_test.go
 
 

Repository files navigation

Glow

Glow is an OpenGL binding generator for Go. Glow parses the OpenGL XML API registry and the EGL XML API registry to produce a machine-generated cgo bridge between Go functions and native OpenGL functions. Glow is a fork of GoGL2.

Features:

  • Go functions that mirror the C specification using Go types.
  • Support for multiple OpenGL APIs (GL/GLES/EGL/WGL/GLX/EGL), versions, and profiles.
  • Support for extensions (including debug callbacks).
  • Support for overloads to provide Go functions with different parameter signatures.

See the open issues for caveats about the current state of the implementation.

Generated Packages

Generated OpenGL binding packages are available in the go-gl/gl repository.

Overloads

See subdirectory xml/overload for examples. The motivation here is to provide Go functions with different parameter signatures of existing OpenGL functions.

For example, glVertexAttribPointer(..., void *) cannot be used with gl.VertexAttribPointer(..., unsafe.Pointer) when using arbitrary offset values. The checkptr safeguard will abort the program when doing so. Overloads allow the creation of an additional gl.VertexAttribPointerWithOffset(..., uintptr), which calls the original OpenGL function with appropriate casts.

Custom Packages

If the prebuilt, go-gettable packages are not suitable for your needs you can build your own. For example,

go get github.com/go-gl/glow
cd $GOPATH/src/github.com/go-gl/glow
go build
./glow download
./glow generate -api=gl -version=3.3 -profile=core -remext=GL_ARB_cl_event
go install ./gl-core/3.3/gl

NOTE: You will have to provide a GitHub token (personal access or OAuth2 token) to update the XML specification files.

A few notes about the flags to generate:

  • api: One of gl, gles1, gles2, egl, wgl, or glx.
  • version: The API version to generate. The all pseudo-version includes all functions and enumerations for the specified API.
  • profile: For gl packages with version 3.2 or higher, core or compatibility (explanation).
  • xml: The XML directory.
  • tmpl: The template directory.
  • out: The output directory for generated files.
  • addext: If non-empty, a regular expression describing which extensions to include in addition to those supported by the selected profile. Empty by default, including nothing additional. Takes precedence over explicit removal.
  • remext: If non-empty, a regular expression describing which extensions to exclude. Empty by default, excluding nothing.
  • restrict: A JSON file that explicitly lists what enumerations / functions that Glow should generate (see example.json).
  • lenientInit: Flag to disable strict function availability checks at Init time. By default if any non-extension function pointer cannot be loaded then initialization fails; when this flag is set initialization will succeed with missing functions. Note that on some platforms unavailable functions will load successfully even but fail upon invocation so check against the OpenGL context what is supported.

About

Go binding generator for OpenGL

Resources

Readme
MIT license
Activity
Custom properties

Stars

269 stars

Watchers

10 watching

Forks

26 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.