Skip to content

jphsd/glui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Image Display For Go

This package wraps the Go port of the C implementation of GLFW in some boilerplate to make displaying an image on the screen almost trivial.

The version of OpenGL used is 4.1 and the boilerplate includes the necessary shaders to perform the rendering.

See glui/cmd/image.go for a simple example of reading an image and displaying it in a window.

$ go run image.go <your image here - most image types supported>

The glui/cmd/images.go version takes multiple images on the command line and rotates through them. This example also demonstrates attaching a call back for character processing - hitting ESC will close the window.

Functions are included to allow you to create new windows with a backing image, set that image to some other image and a loop function (which actually does the rendering). The loop function can take a zero argument function that will be called once per loop iteration. In addition to handling the window rendering, the loop function also handles any call backs registered on the windows.

Finally, the events.c program provided in the C implementation of GLFW has been ported over to Go and is in glui/cmd/events.go.

$ go run events.go

This will dump out all the event types, for which call backs can be registered, to the terminal. It doesn't utilize the glui package itself.

About

Convenience wrapper around GLFW for image display

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages