void allocate(const ofTextureData &textureData)
Allocate the texture using the given settings.
This is useful if you need manual control over loading a number of textures with the same settings. Make sure to set the texture data parameters first.
- Parameters
-
textureData | The settings to use when allocating the ofTexture. |
void allocate(const ofTextureData &textureData, int glFormat, int pixelType)
Allocate the texture using the given settings and custom format.
- Parameters
-
textureData | The settings to use when allocating the ofTexture. |
glFormat | GL texture format: GL_RGBA, GL_LUMINANCE, etc. |
pixelType | GL pixel type: GL_UNSIGNED_BYTE, GL_FLOAT, etc. |
void allocate(int w, int h, int glInternalFormat)
Allocate texture of a given size and format.
The width (w) and height (h) do not necessarily need to be powers of 2, but they do need to be large enough to contain the data you will upload to the texture.
The internal data type glFormat
describes how OpenGL will store this texture internally. For example, if you want a grayscale texture, you can use GL_LUMINANCE
. You can upload what ever type of data you want (using loadData()
) but internally, opengl will store the information as grayscale. Other types include: GL_RGB
, GL_RGBA
.
This method applies the currently set OF texture type and defaults to ARB rectangular textures if they are supported. (They are not supported on OpenGL ES).
- Parameters
-
w | Desired width in pixels. |
h | Desired height in pixels. |
glInternalFormat | OpenGL internal data format: GL_RGBA , GL_LUMINANCE , etc. |
void allocate(int w, int h, int glInternalFormat, int glFormat, int pixelType)
Allocate texture of a given size and format.
- See Also
- allocate(int w, int h, int glInternalFormat)
- Parameters
-
w | Desired width in pixels. |
h | Desired height in pixels. |
glInternalFormat | |
glFormat | |
pixelType | GL pixel type: GL_UNSIGNED_BYTE, GL_FLOAT, etc. |
void allocate(int w, int h, int glInternalFormat, bool bUseARBExtension)
Allocate texture of a given size and format. Specify texture type.
This allows to enable the ARBE extension for this texture. This will overide the default OF texture type, in case you need a square texture (GL_TEXTURE_2D
).
- Warning
- ARB textures are not available in OpenGL ES.
- See Also
- ofEnableArbTex()
-
allocate(int w, int h, int glInternalFormat)
- Parameters
-
w | Desired width in pixels. |
h | Desired height in pixels. |
glInternalFormat | |
bUseARBExtension | Set to true to use rectangular textures. |
void allocate(int w, int h, int glInternalFormat, bool bUseARBExtension, int glFormat, int pixelType)
Allocate texture of a given size, format, & type.
- See Also
- allocate(int w, int h, int glInternalFormat)
- Parameters
-
w | Desired width in pixels. |
h | Desired height in pixels. |
glInternalFormat | OpenGL data format: GL_RGBA , GL_LUMINANCE , etc. |
bUseARBExtension | Set to true to use rectangular textures. |
glFormat | The OpenGL format. |
pixelType | OpenGL pixel type: GL_UNSIGNED_BYTE , GL_FLOAT , etc. |
void allocate(const ofPixels &pix)
Allocate texture using an ofPixels instance.
Pixel type and OpenGL format are determined from pixel settings.
- Parameters
-
pix | Reference to ofPixels instance. |
void allocate(const ofPixels &pix, bool bUseARBExtension)
Allocate texture using an ofPixels instance and type.
This lets you overide the default OF texture type in case you need a square GL_TEXTURE_2D texture.
- Warning
- ARB textures are not available in OpenGL ES.
- See Also
- ofEnableArbTex()
-
allocate(const ofPixels& pix)
- Parameters
-
pix | Reference to ofPixels instance. |
bUseARBExtension | Set to true to use rectangular textures. |
void allocate(const ofShortPixels &pix)
void allocate(const ofShortPixels &pix, bool bUseARBExtension)
void allocate(const ofFloatPixels &pix)
void allocate(const ofFloatPixels &pix, bool bUseARBExtension)