texture

package
v0.0.0-...-00121b1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package texture provides classes for creating and storing images and textures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Texture

type Texture struct {
	// contains filtered or unexported fields
}

Texture holds no to several images.

func Make

func Make(width, height int, internalformat int32, format, pixelType uint32, data unsafe.Pointer, min, mag, s, t int32) Texture

Make creates a texture the given width and height. Internalformat, format and pixelType specifed the layout of the data. Data is pointing to the data that is going to be uploaded. Min and mag specify the behaviour when down and upscaling the texture. S and t specify the behaviour at the borders of the image.

func Make3D

func Make3D(width, height, depth, internalformat int32, format, pixelType uint32, data unsafe.Pointer, min, mag, s, t, r int32) Texture

Make3D constructs a 3D texture of the width and height of each image per slice and depth describing the number of slices. Internalformat, format and pixelType specifed the layout of the data. Data is pointing to the data that is going to be uploaded. The data layout is slices first then rows and lastly columns. Min and mag specify the behaviour when down and upscaling the texture. S and t specify the behaviour at the borders of the image. r specified the behaviour between the slices.

func Make3DFromData

func Make3DFromData(data []uint8, width, height, slices int, internalformat int32, format uint32) (Texture, error)

Make3DFromImage creates a 3D texture with the data of the 3D image.

func Make3DFromImage

func Make3DFromImage(image3d *image3d.Image3D, internalformat int32, format uint32) (Texture, error)

Make3DFromImage creates a 3D texture with the data of the 3D image.

func Make3DFromPath

func Make3DFromPath(paths []string, internalformat int32, format uint32) (Texture, error)

Make3DFromPaths creates a 3D texture with the data of the images specifed by the provided paths.

func MakeColor

func MakeColor(width, height int) Texture

MakeColorTexture creates a color texture of the specified size.

func MakeColorMultisample

func MakeColorMultisample(width, height, samples int) Texture

MakeColorMultisampleTexture creates a multisample color texture of the given width and height and the number of samples that should be used.

func MakeCubeMap

func MakeCubeMap(right, left, top, bottom, front, back string, inside bool) (Texture, error)

MakeCupeMapTexture creates a cube map with the images specfied from the path. For usage with skyboxes where textures are on the inside of the cube, set the inside parameter to true to flip all textures horizontally, otherwise set this parameter to false.

func MakeDepth

func MakeDepth(width, height int) Texture

MakeDepthTexture creates a depth texture of the specfied size.

func MakeDepthMultisample

func MakeDepthMultisample(width, height, samples int) Texture

MakeDepthMultisampleTexture creates a multisample depth texture of the given width and height and the number of samples that should be used.

func MakeEmpty

func MakeEmpty() Texture

MakeEmptyTexture creates a Texture with no image data.

func MakeFromData

func MakeFromData(data []uint8, width, height int, internalformat int32, format uint32) (Texture, error)

MakeFromData creates a texture

func MakeFromImage

func MakeFromImage(image *image2d.Image2D, internalformat int32, format uint32) Texture

MakeFromImage grabs the dimensions and information from the image

func MakeFromPath

func MakeFromPath(path string, internalformat int32, format uint32) (Texture, error)

MakeFromPath creates a texture with the image data specifed in path.

func MakeMultisample

func MakeMultisample(width, height, samples int, format uint32, min, mag, s, t int32) Texture

MakeMultisampleTexture creates a multisample texture of the given width and height and the number of samples that should be used. Internalformat, format and pixelType specifed the layout of the data. Data is pointing to the data that is going to be uploaded. Min and mag specify the behaviour when down and upscaling the texture. S and t specify the behaviour at the borders of the image.

func (*Texture) Bind

func (tex *Texture) Bind(index uint32)

Bind makes the texure available at the specified position.

func (*Texture) Delete

func (tex *Texture) Delete()

Delete destroys the Texture.

func (*Texture) GenMipmap

func (tex *Texture) GenMipmap()

GenMipmap generates mipmap levels. Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the GL_LINEAR criterion to produce a texture value.

func (*Texture) GenMipmapNearest

func (tex *Texture) GenMipmapNearest()

GenMipmap generates mipmap levels. Chooses the mipmap that most closely matches the size of the pixel being textured and uses the GL_LINEAR criterion to produce a texture value.

func (*Texture) GetHandle

func (tex *Texture) GetHandle() uint32

GetHandle returns the OpenGL of this texture.

func (*Texture) Replace

func (tex *Texture) Replace(width, height int, internalformat int32, format, pixelType uint32, data unsafe.Pointer)

func (*Texture) SetWrap1D

func (tex *Texture) SetWrap1D(s int32)

Sets the behavior at the 1D texure borders

func (*Texture) SetWrap2D

func (tex *Texture) SetWrap2D(s, t int32)

Sets the behavior at the 2D texure borders

func (*Texture) SetWrap3D

func (tex *Texture) SetWrap3D(s, t, r int32)

Sets the behavior at the 3D texure borders

func (*Texture) Unbind

func (tex *Texture) Unbind()

Unbind makes the texture unavailable for reading.

Jump to

Keyboard shortcuts

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