Skip to content
/ glgl Public

OpenGL bindings for Go that are in the goldilocks level of abstraction zone.

License

Notifications You must be signed in to change notification settings

soypat/glgl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

glgl

OpenGL bindings for Go that are in the goldilocks level of abstraction zone.

WIP.

Highlight #1

Excellent documentation. Well suited to learn OpenGL without the pain. More consistent and precise naming, i.e. "Packing" is much more precise than OpenGL's Size parameter for AttributePointer functions since Size does not refer to a size in bytes but rather the amount of packed types at the attribute location

// AttribLayout is a low level configuration struct
// for adding vertex buffers attribute layouts to a vertex array object.
type AttribLayout struct {
	// The OpenGL program identifier.
	Program Program
	// Type is a OpenGL enum representing the underlying type. Valid types include
	// gl.FLOAT, gl.UNSIGNED_INT, gl.UNSIGNED_BYTE, gl.BYTE etc.
	Type Type
	// Name is the identifier of the attribute in the
	// vertex shader source code finished with a null terminator.
	Name string
	// Packing is a value between 1 and 4 and represents how many
	// of the type are present at the attribute location.
	//
	// Example:
	// When working with a vec3 attribute in the shader source code
	// with a gl.Float type, then the Packing is 3 since there are
	// 3 floats packed at each attribute location.
	Packing int
	// Stride is the distance in bytes between attributes in the buffer.
	Stride int
	// Offset is the starting offset with which to start
	// traversing the vertex buffer.
	Offset int
	// specifies whether fixed-point data values should be normalized (when true)
	// or converted directly as fixed-point values (when false) when they are accessed.
	// Usually left as false?
	Normalize bool
}

About

OpenGL bindings for Go that are in the goldilocks level of abstraction zone.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages