Documentation ¶
Overview ¶
Package texture provides classes for creating and storing images and textures.
Index ¶
- type Texture
- func Make(width, height int, internalformat int32, format, pixelType uint32, ...) Texture
- func Make3D(width, height, depth, internalformat int32, format, pixelType uint32, ...) Texture
- func Make3DFromData(data []uint8, width, height, slices int, internalformat int32, format uint32) (Texture, error)
- func Make3DFromImage(image3d *image3d.Image3D, internalformat int32, format uint32) (Texture, error)
- func Make3DFromPath(paths []string, internalformat int32, format uint32) (Texture, error)
- func MakeColor(width, height int) Texture
- func MakeColorMultisample(width, height, samples int) Texture
- func MakeCubeMap(right, left, top, bottom, front, back string, inside bool) (Texture, error)
- func MakeDepth(width, height int) Texture
- func MakeDepthMultisample(width, height, samples int) Texture
- func MakeEmpty() Texture
- func MakeFromData(data []uint8, width, height int, internalformat int32, format uint32) (Texture, error)
- func MakeFromImage(image *image2d.Image2D, internalformat int32, format uint32) Texture
- func MakeFromPath(path string, internalformat int32, format uint32) (Texture, error)
- func MakeMultisample(width, height, samples int, format uint32, min, mag, s, t int32) Texture
- func (tex *Texture) Bind(index uint32)
- func (tex *Texture) Delete()
- func (tex *Texture) GenMipmap()
- func (tex *Texture) GenMipmapNearest()
- func (tex *Texture) GetHandle() uint32
- func (tex *Texture) Replace(width, height int, internalformat int32, format, pixelType uint32, ...)
- func (tex *Texture) SetWrap1D(s int32)
- func (tex *Texture) SetWrap2D(s, t int32)
- func (tex *Texture) SetWrap3D(s, t, r int32)
- func (tex *Texture) Unbind()
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 ¶
Make3DFromPaths creates a 3D texture with the data of the images specifed by the provided paths.
func MakeColorMultisample ¶
MakeColorMultisampleTexture creates a multisample color texture of the given width and height and the number of samples that should be used.
func MakeCubeMap ¶
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 MakeDepthMultisample ¶
MakeDepthMultisampleTexture creates a multisample depth texture of the given width and height and the number of samples that should be used.
func MakeFromData ¶
func MakeFromData(data []uint8, width, height int, internalformat int32, format uint32) (Texture, error)
MakeFromData creates a texture
func MakeFromImage ¶
MakeFromImage grabs the dimensions and information from the image
func MakeFromPath ¶
MakeFromPath creates a texture with the image data specifed in path.
func MakeMultisample ¶
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) 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.