1 #include "glfTexture3D.hh"
2 #include "glfException.hh"
3 #include <Base/Image/ImageIO.hh>
4 #include "glfFormatDB.hh"
9 glfTexture3D::glfTexture3D() :
27 GLenum wrapT, GLint textureNr)
37 GLenum internalFormat,
int mipmap)
45 GLenum type = GL_UNSIGNED_BYTE;
46 if (internalFormat == GL_DEPTH24_STENCIL8_EXT)
47 type = GL_UNSIGNED_INT_24_8_EXT;
49 glTexImage3D(
target_, mipmap, internalFormat, width, height, depth, 0,
52 GLF_THROW_ON_OPENGL_ERROR;
77 glTexSubImage3D(GL_TEXTURE_3D, 0,0,0,level, image.
GetWidth(), image.
GetHeight(), 1,
80 GLF_THROW_ON_OPENGL_ERROR;
EColorModel
These are the most often used color models.
void Bind() const
Binds the texture.
void SetWrapS(GLenum wrapS)
Sets the wrapping mode for the 1st texture coordinate.
unsigned int GetWidth() const
void SetMinFilter(GLenum minFilter)
Sets the minifying function.
const void * GetImageData() const
void SetWrapT(GLenum wrapT)
Sets the wrapping mode for the 2nd texture coordinate.
unsigned int GetHeight() const
enum EColorModel GetColorModel() const
void Set(GLenum minFilter=GL_NEAREST, GLenum magFilter=GL_NEAREST, GLenum wrapS=GL_CLAMP, GLenum wrapT=GL_CLAMP, GLint textureNr=GL_TEXTURE0)
Convenience wrapper.
enum EStorageType GetStorageType() const
void SetTextureNr(GLint textureNr)
Sets the OpenGL texture number (GL_TEXTURE0 - GL_TEXTURE[MaxTextureUnit-1]).
This is the base class for images in BIAS.
void Allocate3DImage(int width, int height, int depth, GLenum internalFormat, int mipmap=0)
void Upload2DImage(const BIAS::ImageBase &image, unsigned int level)
void SetMagFilter(GLenum magFilter)
Sets the magnification function.