mtOpenGL

package module
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFbo

func CreateFbo(colorTex, depthTex *uint32, width, height int32, multisampling bool, samples int32, isFloatingPoint bool, mipmapLevels int32) uint32

func CreateFboWithExistingTextures

func CreateFboWithExistingTextures(colorTex, depthTex *uint32, texType uint32) uint32

func CreateLightFbo

func CreateLightFbo(colorTex, depthTex *uint32, width, height int32, multisampling bool, samples int32) uint32

Some internal format changes, like only having the RG channels but with higher 32F precision.

func CreateTexture

func CreateTexture(width, height int32, internalFormat, format, internalType uint32, multisampling bool, samples, mipmapLevels int32) uint32

func FreeGLBuffer added in v1.5.0

func FreeGLBuffer(buffer *MeshBuffer)

func GenerateBufferFromLines2D added in v1.5.0

func GenerateBufferFromLines2D(bufferObject *MeshBuffer, points []mgl32.Vec2, indices []uint32)

func GenerateBufferFromTriangles2D added in v1.5.0

func GenerateBufferFromTriangles2D(bufferObject *MeshBuffer, points []mgl32.Vec2)

func NewComputeProgram

func NewComputeProgram(computeShaderName string) (uint32, error)

func NewProgram

func NewProgram(vertexShaderName, geometryShaderName, tessControlShaderName, tessEvalShaderName, fragmentShaderName string) (uint32, error)

Mostly taken from the Demo. But compiling and linking shaders just should be done like this anyways.

Types

type ImageTexture

type ImageTexture struct {
	TextureHandle uint32
	TextureSize   mgl32.Vec2
}

func CreateImageTexture

func CreateImageTexture(imageName string, isRepeating bool) ImageTexture

type MeshBuffer added in v1.5.0

type MeshBuffer struct {
	// Important geometry attributes
	ArrayBuffer  uint32
	VertexBuffer uint32
	VertexCount  int32
	IndexBuffer  uint32
	IndexCount   int32
}

type PngImage

type PngImage struct {
	Img image.Image
}

func LoadImage

func LoadImage(file string) (PngImage, error)

func (*PngImage) RGBAAt

func (png *PngImage) RGBAAt(x, y int, flippedY bool) (float32, float32, float32, float32)

func (*PngImage) RangeX

func (png *PngImage) RangeX() int

func (*PngImage) RangeY

func (png *PngImage) RangeY() int

Jump to

Keyboard shortcuts

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