A 2D texture. More...
#include <Texture2D.h>
Public Member Functions | |
Texture2D (int w, int h, TextureInternalFormat tf, TextureFormat f, PixelType t, const Parameters ¶ms, const Buffer::Parameters &s, const Buffer &pixels) | |
Creates a new 2D texture. | |
virtual | ~Texture2D () |
Destroys this 2D texture. | |
int | getWidth () |
Returns the width of this texture. | |
int | getHeight () |
Returns the height of this texture. | |
void | setImage (int w, int h, TextureFormat f, PixelType t, const Buffer &pixels) |
Replaces the content of this texture. | |
void | setSubImage (int level, int x, int y, int w, int h, TextureFormat f, PixelType t, const Buffer::Parameters &s, const Buffer &pixels) |
Replaces a part of the content of this texture. | |
void | setCompressedSubImage (int level, int x, int y, int w, int h, int s, const Buffer &pixels) |
Replaces a part of the content of this texture. | |
Protected Member Functions | |
Texture2D () | |
Creates a new unitialized 2D texture. | |
Texture2D (int target) | |
Creates a new unintialized 2D texture. | |
void | init (int w, int h, TextureInternalFormat tf, TextureFormat f, PixelType t, const Parameters ¶ms, const Buffer::Parameters &s, const Buffer &pixels) |
Initializes this texture. | |
Protected Attributes | |
int | w |
The width of this texture. | |
int | h |
The height of this texture. |
A 2D texture.
ork::Texture2D::Texture2D | ( | int | w, | |
int | h, | |||
TextureInternalFormat | tf, | |||
TextureFormat | f, | |||
PixelType | t, | |||
const Parameters & | params, | |||
const Buffer::Parameters & | s, | |||
const Buffer & | pixels | |||
) |
Creates a new 2D texture.
w | the width of this texture in pixels. | |
h | the height of this texture in pixels. | |
tf | texture data format on GPU. | |
f | the texture components in 'pixels'. | |
t | the type of each component in 'pixels'. | |
params | optional additional texture parameters. | |
s | optional pixel storage parameters for 'pixels'. | |
pixels | the pixels to be written into this texture. |
virtual ork::Texture2D::~Texture2D | ( | ) | [virtual] |
Destroys this 2D texture.
ork::Texture2D::Texture2D | ( | ) | [protected] |
Creates a new unitialized 2D texture.
ork::Texture2D::Texture2D | ( | int | target | ) | [protected] |
Creates a new unintialized 2D texture.
target | a texture type (2D, 2DArray, etc). |
int ork::Texture2D::getHeight | ( | ) |
Returns the height of this texture.
int ork::Texture2D::getWidth | ( | ) |
Returns the width of this texture.
void ork::Texture2D::init | ( | int | w, | |
int | h, | |||
TextureInternalFormat | tf, | |||
TextureFormat | f, | |||
PixelType | t, | |||
const Parameters & | params, | |||
const Buffer::Parameters & | s, | |||
const Buffer & | pixels | |||
) | [protected] |
Initializes this texture.
w | the width of this texture in pixels. | |
h | the height of this texture in pixels. | |
tf | texture data format on GPU. | |
f | the texture components in 'pixels'. | |
t | the type of each component in 'pixels'. | |
params | optional additional texture parameters. | |
s | optional pixel storage parameters for 'pixels'. | |
pixels | the pixels to be written into this texture. |
void ork::Texture2D::setCompressedSubImage | ( | int | level, | |
int | x, | |||
int | y, | |||
int | w, | |||
int | h, | |||
int | s, | |||
const Buffer & | pixels | |||
) |
Replaces a part of the content of this texture.
level | the LOD level to be changed. | |
x | lower left corner of the part to be replaced, in pixels. | |
y | lower left corner of the part to be replaced, in pixels. | |
w | the width of the part to be replaced, in pixels. | |
h | the height of the part to be replaced, in pixels. | |
s | the size of 'pixels' in bytes. | |
pixels | the pixels to be written into this texture LOD level. |
void ork::Texture2D::setImage | ( | int | w, | |
int | h, | |||
TextureFormat | f, | |||
PixelType | t, | |||
const Buffer & | pixels | |||
) |
Replaces the content of this texture.
w | the width of the new texture content, in pixels. | |
h | the height of the new texture content, in pixels. | |
f | the texture components in 'pixels'. | |
t | the type of each component in 'pixels'. | |
pixels | the pixels to be written into this texture. |
void ork::Texture2D::setSubImage | ( | int | level, | |
int | x, | |||
int | y, | |||
int | w, | |||
int | h, | |||
TextureFormat | f, | |||
PixelType | t, | |||
const Buffer::Parameters & | s, | |||
const Buffer & | pixels | |||
) |
Replaces a part of the content of this texture.
level | the LOD level to be changed. | |
x | lower left corner of the part to be replaced, in pixels. | |
y | lower left corner of the part to be replaced, in pixels. | |
w | the width of the part to be replaced, in pixels. | |
h | the height of the part to be replaced, in pixels. | |
f | the texture components in 'pixels'. | |
t | the type of each component in 'pixels'. | |
s | optional pixel storage parameters for 'pixels'. | |
pixels | the pixels to be written into this texture LOD level. |
int ork::Texture2D::h [protected] |
The height of this texture.
int ork::Texture2D::w [protected] |
The width of this texture.