glgl

module
v0.0.0-...-a2463fe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2024 License: MIT

README

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
}

Directories

Path Synopsis
examples
hellocompute
This program adds a uniform value to an array using a compute shader.
This program adds a uniform value to an array using a compute shader.
pipecompute
This program takes input array and a add scalar and writes the result of adding them to a new output array.
This program takes input array and a add scalar and writes the result of adding them to a new output array.
sdf
This program takes input array and a add scalar and writes the result of adding them to a new output array.
This program takes input array and a add scalar and writes the result of adding them to a new output array.
mat
md1
package md1 implements basic 1D math useful for 3D graphics applications.
package md1 implements basic 1D math useful for 3D graphics applications.
md2
md3
package md3 is a 32bit 3D math package based around the Vec type.
package md3 is a 32bit 3D math package based around the Vec type.
ms1
package ms1 implements basic 1D math useful for 3D graphics applications.
package ms1 implements basic 1D math useful for 3D graphics applications.
ms2
ms3
package ms3 is a 32bit 3D math package based around the Vec type.
package ms3 is a 32bit 3D math package based around the Vec type.
v4.6-core

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL