ofDoc > gl > ofTexture

ofTexturefile

ofTexture is used to create OpenGL textures that live on your graphics card (GPU). While you can certainly use ofTexture directly to manipulate and textures, more often ofTexture will be used internally by classes like ofImage or ofVideoGrabber. That said, ofImage and other classes that use ofTexture internally often provide access to the ofTexture.

ofTexture allows use of non-power of 2 textures in OpenGL and has a set of functions simplify the process of transfering pixel data to and from the GPU in various formats.

Users must allocate the texture before drawing it or loading data into it.

Global texture settings

ofSetTextureWrap () Use member method ofTexture::setTextureWrap() instead.
ofGetUsingCustomTextureWrap () Use member method ofTexture::setTextureWrap() instead.
ofRestoreTextureWrap () Use member method ofTexture::setTextureWrap() instead.
ofSetMinMagFilters () Use member method ofTexture::setTextureMinMagFilter() instead.
ofGetUsingCustomMinMagFilters () Use member method ofTexture::setTextureMinMagFilter() instead.
ofRestoreMinMagFilters () Use member method ofTexture::setTextureMinMagFilter() instead.

Enums

Functions

ofTextureclass

A wrapper class for an OpenGL texture.

Construction and allocation

bAllocated () Use isAllocated instead

Update texture

clear ()

Drawing

draw ()
getQuad ()
bind ()
unbind ()

Size and coordinates

Texture settings

Read pixel data

copyTo ()

Texture data

Mipmapping

Functions

draw ()