globjects  2.0.0.690708773bba
Strict OpenGL objects wrapper.

Wraps OpenGL texture objects. A Texture provides both interfaces to bind them for the OpenGL pipeline: binding and bindless texture. Bindless textures are only available if the graphics driver supports them. More...

#include <globjects/include/globjects/Texture.h>

Inheritance diagram for globjects::Texture:
globjects::Object globjects::Instantiator< Texture >

Public Types

enum  BindlessImplementation { BindlessImplementation::DirectStateAccessARB, BindlessImplementation::DirectStateAccessEXT, BindlessImplementation::Legacy }
 
enum  StorageImplementation { StorageImplementation::DirectStateAccessARB, StorageImplementation::DirectStateAccessEXT, StorageImplementation::Legacy, StorageImplementation::Fallback }
 
- Public Types inherited from globjects::Object
enum  NameImplementation { NameImplementation::DebugKHR, NameImplementation::Legacy }
 

Public Member Functions

 Texture ()
 
 Texture (gl::GLenum target)
 
virtual ~Texture ()
 
virtual void accept (ObjectVisitor &visitor) override
 
void bind () const
 
void unbind () const
 
void bindActive (gl::GLenum texture) const
 
void bindActive (unsigned int index) const
 
void unbindActive (gl::GLenum texture) const
 
void unbindActive (unsigned int index) const
 
void setParameter (gl::GLenum name, gl::GLenum value)
 
void setParameter (gl::GLenum name, gl::GLint value)
 
void setParameter (gl::GLenum name, gl::GLfloat value)
 
void setParameter (gl::GLenum name, const glm::vec4 &value)
 
gl::GLint getParameter (gl::GLenum pname) const
 
gl::GLint getLevelParameter (gl::GLint level, gl::GLenum pname) const
 
void getImage (gl::GLint level, gl::GLenum format, gl::GLenum type, gl::GLvoid *image) const
 
std::vector< unsigned char > getImage (gl::GLint level, gl::GLenum format, gl::GLenum type) const
 
void getCompressedImage (gl::GLint lod, gl::GLvoid *image) const
 
std::vector< unsigned char > getCompressedImage (gl::GLint lod=0) const
 
gl::GLenum target () const
 
void image1D (gl::GLint level, gl::GLenum internalFormat, gl::GLsizei width, gl::GLint border, gl::GLenum format, gl::GLenum type, const gl::GLvoid *data)
 
void compressedImage1D (gl::GLint level, gl::GLenum internalFormat, gl::GLsizei width, gl::GLint border, gl::GLsizei imageSize, const gl::GLvoid *data)
 
void subImage1D (gl::GLint level, gl::GLint xOffset, gl::GLsizei width, gl::GLenum format, gl::GLenum type, const gl::GLvoid *data)
 
void image2D (gl::GLint level, gl::GLenum internalFormat, gl::GLsizei width, gl::GLsizei height, gl::GLint border, gl::GLenum format, gl::GLenum type, const gl::GLvoid *data)
 
void image2D (gl::GLint level, gl::GLenum internalFormat, const glm::ivec2 &size, gl::GLint border, gl::GLenum format, gl::GLenum type, const gl::GLvoid *data)
 
void compressedImage2D (gl::GLint level, gl::GLenum internalFormat, gl::GLsizei width, gl::GLsizei height, gl::GLint border, gl::GLsizei imageSize, const gl::GLvoid *data)
 
void compressedImage2D (gl::GLint level, gl::GLenum internalFormat, const glm::ivec2 &size, gl::GLint border, gl::GLsizei imageSize, const gl::GLvoid *data)
 
void subImage2D (gl::GLint level, gl::GLint xOffset, gl::GLint yOffset, gl::GLsizei width, gl::GLsizei height, gl::GLenum format, gl::GLenum type, const gl::GLvoid *data)
 
void subImage2D (gl::GLint level, const glm::ivec2 &offset, const glm::ivec2 &size, gl::GLenum format, gl::GLenum type, const gl::GLvoid *data)
 
void image3D (gl::GLint level, gl::GLenum internalFormat, gl::GLsizei width, gl::GLsizei height, gl::GLsizei depth, gl::GLint border, gl::GLenum format, gl::GLenum type, const gl::GLvoid *data)
 
void image3D (gl::GLint level, gl::GLenum internalFormat, const glm::ivec3 &size, gl::GLint border, gl::GLenum format, gl::GLenum type, const gl::GLvoid *data)
 
void compressedImage3D (gl::GLint level, gl::GLenum internalFormat, gl::GLsizei width, gl::GLsizei height, gl::GLsizei depth, gl::GLint border, gl::GLsizei imageSize, const gl::GLvoid *data)
 
void compressedImage3D (gl::GLint level, gl::GLenum internalFormat, const glm::ivec3 &size, gl::GLint border, gl::GLsizei imageSize, const gl::GLvoid *data)
 
void subImage3D (gl::GLint level, gl::GLint xOffset, gl::GLint yOffset, gl::GLint zOffset, gl::GLsizei width, gl::GLsizei height, gl::GLsizei depth, gl::GLenum format, gl::GLenum type, const gl::GLvoid *data)
 
void subImage3D (gl::GLint level, const glm::ivec3 &offset, const glm::ivec3 &size, gl::GLenum format, gl::GLenum type, const gl::GLvoid *data)
 
void image2DMultisample (gl::GLsizei samples, gl::GLenum internalFormat, gl::GLsizei width, gl::GLsizei height, gl::GLboolean fixedSamplesLocations)
 
void image2DMultisample (gl::GLsizei samples, gl::GLenum internalFormat, const glm::ivec2 &size, gl::GLboolean fixedSamplesLocations)
 
void image3DMultisample (gl::GLsizei samples, gl::GLenum internalFormat, gl::GLsizei width, gl::GLsizei height, gl::GLsizei depth, gl::GLboolean fixedSamplesLocations)
 
void image3DMultisample (gl::GLsizei samples, gl::GLenum internalFormat, const glm::ivec3 &size, gl::GLboolean fixedSamplesLocations)
 
void storage1D (gl::GLsizei levels, gl::GLenum internalFormat, gl::GLsizei width)
 
void storage2D (gl::GLsizei levels, gl::GLenum internalFormat, gl::GLsizei width, gl::GLsizei height)
 
void storage2D (gl::GLsizei levels, gl::GLenum internalFormat, const glm::ivec2 &size)
 
void storage3D (gl::GLsizei levels, gl::GLenum internalFormat, gl::GLsizei width, gl::GLsizei height, gl::GLsizei depth)
 
void storage3D (gl::GLsizei levels, gl::GLenum internalFormat, const glm::ivec3 &size)
 
void textureView (gl::GLuint originalTexture, gl::GLenum internalFormat, gl::GLuint minLevel, gl::GLuint numLevels, gl::GLuint minLayer, gl::GLuint numLayers)
 
void texBuffer (gl::GLenum internalFormat, Buffer *buffer)
 
void texBufferRange (gl::GLenum internalFormat, Buffer *buffer, gl::GLintptr offset, gl::GLsizeiptr size)
 
void clearImage (gl::GLint level, gl::GLenum format, gl::GLenum type, const void *data)
 
void clearImage (gl::GLint level, gl::GLenum format, gl::GLenum type, const glm::vec4 &value)
 
void clearImage (gl::GLint level, gl::GLenum format, gl::GLenum type, const glm::ivec4 &value)
 
void clearImage (gl::GLint level, gl::GLenum format, gl::GLenum type, const glm::uvec4 &value)
 
void clearSubImage (gl::GLint level, gl::GLint xOffset, gl::GLint yOffset, gl::GLint zOffset, gl::GLsizei width, gl::GLsizei height, gl::GLsizei depth, gl::GLenum format, gl::GLenum type, const void *data)
 
void clearSubImage (gl::GLint level, const glm::ivec3 &offset, const glm::ivec3 &size, gl::GLenum format, gl::GLenum type, const void *data)
 
void clearSubImage (gl::GLint level, const glm::ivec3 &offset, const glm::ivec3 &size, gl::GLenum format, gl::GLenum type, const glm::vec4 &value)
 
void clearSubImage (gl::GLint level, const glm::ivec3 &offset, const glm::ivec3 &size, gl::GLenum format, gl::GLenum type, const glm::ivec4 &value)
 
void clearSubImage (gl::GLint level, const glm::ivec3 &offset, const glm::ivec3 &size, gl::GLenum format, gl::GLenum type, const glm::uvec4 &value)
 
void invalidateImage (gl::GLint level) const
 
void invalidateSubImage (gl::GLint level, gl::GLint xoffset, gl::GLint yoffset, gl::GLint zoffset, gl::GLsizei width, gl::GLsizei height, gl::GLsizei depth)
 
void invalidateSubImage (gl::GLint level, const glm::ivec3 &offset, const glm::ivec3 size)
 
void bindImageTexture (gl::GLuint unit, gl::GLint level, gl::GLboolean layered, gl::GLint layer, gl::GLenum access, gl::GLenum format) const
 
void generateMipmap ()
 
void cubeMapImage (gl::GLint level, gl::GLenum internalFormat, gl::GLsizei width, gl::GLsizei height, gl::GLint border, gl::GLenum format, gl::GLenum type, const gl::GLvoid *data)
 
void cubeMapImage (gl::GLint level, gl::GLenum internalFormat, const glm::ivec2 &size, gl::GLint border, gl::GLenum format, gl::GLenum type, const gl::GLvoid *data)
 
TextureHandle textureHandle () const
 
TextureHandle textureHandle (Sampler *sampler) const
 
void pageCommitment (gl::GLint level, gl::GLint xOffset, gl::GLint yOffset, gl::GLint zOffset, gl::GLsizei width, gl::GLsizei height, gl::GLsizei depth, gl::GLboolean commit) const
 
void pageCommitment (gl::GLint level, const glm::ivec3 &offset, const glm::ivec3 &size, gl::GLboolean commit) const
 
virtual gl::GLenum objectType () const override
 
- Public Member Functions inherited from globjects::Object
gl::GLuint id () const
 
std::string name () const
 
void setName (const std::string &name)
 
bool hasName () const
 
bool isDefault () const
 
void detach ()
 

Static Public Member Functions

static void hintBindlessImplementation (BindlessImplementation impl)
 
static void hintStorageImplementation (StorageImplementation impl)
 
static std::unique_ptr< TexturefromId (gl::GLuint id, gl::GLenum target)
 
static std::unique_ptr< TexturecreateDefault ()
 
static std::unique_ptr< TexturecreateDefault (gl::GLenum target)
 
static void unbind (gl::GLenum target)
 
static void unbindImageTexture (gl::GLuint unit)
 
- Static Public Member Functions inherited from globjects::Object
static void hintNameImplementation (NameImplementation impl)
 
- Static Public Member Functions inherited from globjects::Instantiator< Texture >
static std::unique_ptr< Texturecreate (Args &&...args)
 
static std::unique_ptr< TexturefromId (gl::GLuint id, Args &&...args)
 

Protected Member Functions

 Texture (std::unique_ptr< IDResource > &&resource, gl::GLenum target)
 
- Protected Member Functions inherited from globjects::Object
 Object (std::unique_ptr< IDResource > &&resource)
 
virtual ~Object ()
 

Protected Attributes

gl::GLenum m_target
 
- Protected Attributes inherited from globjects::Object
std::unique_ptr< IDResourcem_resource
 
void * m_objectLabelState
 

Detailed Description

Wraps OpenGL texture objects. A Texture provides both interfaces to bind them for the OpenGL pipeline: binding and bindless texture. Bindless textures are only available if the graphics driver supports them.

See also
http://www.opengl.org/wiki/Texture
http://www.opengl.org/registry/specs/NV/bindless_texture.txt

Member Enumeration Documentation

Enumerator
DirectStateAccessARB 
DirectStateAccessEXT 
Legacy 
Enumerator
DirectStateAccessARB 
DirectStateAccessEXT 
Legacy 
Fallback 

Constructor & Destructor Documentation

globjects::Texture::Texture ( )
globjects::Texture::Texture ( gl::GLenum  target)
virtual globjects::Texture::~Texture ( )
virtual
globjects::Texture::Texture ( std::unique_ptr< IDResource > &&  resource,
gl::GLenum  target 
)
protected

Member Function Documentation

static void globjects::Texture::hintBindlessImplementation ( BindlessImplementation  impl)
static
static void globjects::Texture::hintStorageImplementation ( StorageImplementation  impl)
static
static std::unique_ptr<Texture> globjects::Texture::fromId ( gl::GLuint  id,
gl::GLenum  target 
)
static
static std::unique_ptr<Texture> globjects::Texture::createDefault ( )
static
static std::unique_ptr<Texture> globjects::Texture::createDefault ( gl::GLenum  target)
static
virtual void globjects::Texture::accept ( ObjectVisitor visitor)
overridevirtual

Implements globjects::Object.

void globjects::Texture::bind ( ) const
void globjects::Texture::unbind ( ) const
static void globjects::Texture::unbind ( gl::GLenum  target)
static
void globjects::Texture::bindActive ( gl::GLenum  texture) const
void globjects::Texture::bindActive ( unsigned int  index) const
void globjects::Texture::unbindActive ( gl::GLenum  texture) const
void globjects::Texture::unbindActive ( unsigned int  index) const
void globjects::Texture::setParameter ( gl::GLenum  name,
gl::GLenum  value 
)
void globjects::Texture::setParameter ( gl::GLenum  name,
gl::GLint  value 
)
void globjects::Texture::setParameter ( gl::GLenum  name,
gl::GLfloat  value 
)
void globjects::Texture::setParameter ( gl::GLenum  name,
const glm::vec4 &  value 
)
gl::GLint globjects::Texture::getParameter ( gl::GLenum  pname) const
gl::GLint globjects::Texture::getLevelParameter ( gl::GLint  level,
gl::GLenum  pname 
) const
void globjects::Texture::getImage ( gl::GLint  level,
gl::GLenum  format,
gl::GLenum  type,
gl::GLvoid *  image 
) const
std::vector<unsigned char> globjects::Texture::getImage ( gl::GLint  level,
gl::GLenum  format,
gl::GLenum  type 
) const
void globjects::Texture::getCompressedImage ( gl::GLint  lod,
gl::GLvoid *  image 
) const
std::vector<unsigned char> globjects::Texture::getCompressedImage ( gl::GLint  lod = 0) const
gl::GLenum globjects::Texture::target ( ) const
void globjects::Texture::image1D ( gl::GLint  level,
gl::GLenum  internalFormat,
gl::GLsizei  width,
gl::GLint  border,
gl::GLenum  format,
gl::GLenum  type,
const gl::GLvoid *  data 
)
void globjects::Texture::compressedImage1D ( gl::GLint  level,
gl::GLenum  internalFormat,
gl::GLsizei  width,
gl::GLint  border,
gl::GLsizei  imageSize,
const gl::GLvoid *  data 
)
void globjects::Texture::subImage1D ( gl::GLint  level,
gl::GLint  xOffset,
gl::GLsizei  width,
gl::GLenum  format,
gl::GLenum  type,
const gl::GLvoid *  data 
)
void globjects::Texture::image2D ( gl::GLint  level,
gl::GLenum  internalFormat,
gl::GLsizei  width,
gl::GLsizei  height,
gl::GLint  border,
gl::GLenum  format,
gl::GLenum  type,
const gl::GLvoid *  data 
)
void globjects::Texture::image2D ( gl::GLint  level,
gl::GLenum  internalFormat,
const glm::ivec2 &  size,
gl::GLint  border,
gl::GLenum  format,
gl::GLenum  type,
const gl::GLvoid *  data 
)
void globjects::Texture::compressedImage2D ( gl::GLint  level,
gl::GLenum  internalFormat,
gl::GLsizei  width,
gl::GLsizei  height,
gl::GLint  border,
gl::GLsizei  imageSize,
const gl::GLvoid *  data 
)
void globjects::Texture::compressedImage2D ( gl::GLint  level,
gl::GLenum  internalFormat,
const glm::ivec2 &  size,
gl::GLint  border,
gl::GLsizei  imageSize,
const gl::GLvoid *  data 
)
void globjects::Texture::subImage2D ( gl::GLint  level,
gl::GLint  xOffset,
gl::GLint  yOffset,
gl::GLsizei  width,
gl::GLsizei  height,
gl::GLenum  format,
gl::GLenum  type,
const gl::GLvoid *  data 
)
void globjects::Texture::subImage2D ( gl::GLint  level,
const glm::ivec2 &  offset,
const glm::ivec2 &  size,
gl::GLenum  format,
gl::GLenum  type,
const gl::GLvoid *  data 
)
void globjects::Texture::image3D ( gl::GLint  level,
gl::GLenum  internalFormat,
gl::GLsizei  width,
gl::GLsizei  height,
gl::GLsizei  depth,
gl::GLint  border,
gl::GLenum  format,
gl::GLenum  type,
const gl::GLvoid *  data 
)
void globjects::Texture::image3D ( gl::GLint  level,
gl::GLenum  internalFormat,
const glm::ivec3 &  size,
gl::GLint  border,
gl::GLenum  format,
gl::GLenum  type,
const gl::GLvoid *  data 
)
void globjects::Texture::compressedImage3D ( gl::GLint  level,
gl::GLenum  internalFormat,
gl::GLsizei  width,
gl::GLsizei  height,
gl::GLsizei  depth,
gl::GLint  border,
gl::GLsizei  imageSize,
const gl::GLvoid *  data 
)
void globjects::Texture::compressedImage3D ( gl::GLint  level,
gl::GLenum  internalFormat,
const glm::ivec3 &  size,
gl::GLint  border,
gl::GLsizei  imageSize,
const gl::GLvoid *  data 
)
void globjects::Texture::subImage3D ( gl::GLint  level,
gl::GLint  xOffset,
gl::GLint  yOffset,
gl::GLint  zOffset,
gl::GLsizei  width,
gl::GLsizei  height,
gl::GLsizei  depth,
gl::GLenum  format,
gl::GLenum  type,
const gl::GLvoid *  data 
)
void globjects::Texture::subImage3D ( gl::GLint  level,
const glm::ivec3 &  offset,
const glm::ivec3 &  size,
gl::GLenum  format,
gl::GLenum  type,
const gl::GLvoid *  data 
)
void globjects::Texture::image2DMultisample ( gl::GLsizei  samples,
gl::GLenum  internalFormat,
gl::GLsizei  width,
gl::GLsizei  height,
gl::GLboolean  fixedSamplesLocations 
)
void globjects::Texture::image2DMultisample ( gl::GLsizei  samples,
gl::GLenum  internalFormat,
const glm::ivec2 &  size,
gl::GLboolean  fixedSamplesLocations 
)
void globjects::Texture::image3DMultisample ( gl::GLsizei  samples,
gl::GLenum  internalFormat,
gl::GLsizei  width,
gl::GLsizei  height,
gl::GLsizei  depth,
gl::GLboolean  fixedSamplesLocations 
)
void globjects::Texture::image3DMultisample ( gl::GLsizei  samples,
gl::GLenum  internalFormat,
const glm::ivec3 &  size,
gl::GLboolean  fixedSamplesLocations 
)
void globjects::Texture::storage1D ( gl::GLsizei  levels,
gl::GLenum  internalFormat,
gl::GLsizei  width 
)
void globjects::Texture::storage2D ( gl::GLsizei  levels,
gl::GLenum  internalFormat,
gl::GLsizei  width,
gl::GLsizei  height 
)
void globjects::Texture::storage2D ( gl::GLsizei  levels,
gl::GLenum  internalFormat,
const glm::ivec2 &  size 
)
void globjects::Texture::storage3D ( gl::GLsizei  levels,
gl::GLenum  internalFormat,
gl::GLsizei  width,
gl::GLsizei  height,
gl::GLsizei  depth 
)
void globjects::Texture::storage3D ( gl::GLsizei  levels,
gl::GLenum  internalFormat,
const glm::ivec3 &  size 
)
void globjects::Texture::textureView ( gl::GLuint  originalTexture,
gl::GLenum  internalFormat,
gl::GLuint  minLevel,
gl::GLuint  numLevels,
gl::GLuint  minLayer,
gl::GLuint  numLayers 
)
void globjects::Texture::texBuffer ( gl::GLenum  internalFormat,
Buffer buffer 
)
void globjects::Texture::texBufferRange ( gl::GLenum  internalFormat,
Buffer buffer,
gl::GLintptr  offset,
gl::GLsizeiptr  size 
)
void globjects::Texture::clearImage ( gl::GLint  level,
gl::GLenum  format,
gl::GLenum  type,
const void *  data 
)
void globjects::Texture::clearImage ( gl::GLint  level,
gl::GLenum  format,
gl::GLenum  type,
const glm::vec4 &  value 
)
void globjects::Texture::clearImage ( gl::GLint  level,
gl::GLenum  format,
gl::GLenum  type,
const glm::ivec4 &  value 
)
void globjects::Texture::clearImage ( gl::GLint  level,
gl::GLenum  format,
gl::GLenum  type,
const glm::uvec4 &  value 
)
void globjects::Texture::clearSubImage ( gl::GLint  level,
gl::GLint  xOffset,
gl::GLint  yOffset,
gl::GLint  zOffset,
gl::GLsizei  width,
gl::GLsizei  height,
gl::GLsizei  depth,
gl::GLenum  format,
gl::GLenum  type,
const void *  data 
)
void globjects::Texture::clearSubImage ( gl::GLint  level,
const glm::ivec3 &  offset,
const glm::ivec3 &  size,
gl::GLenum  format,
gl::GLenum  type,
const void *  data 
)
void globjects::Texture::clearSubImage ( gl::GLint  level,
const glm::ivec3 &  offset,
const glm::ivec3 &  size,
gl::GLenum  format,
gl::GLenum  type,
const glm::vec4 &  value 
)
void globjects::Texture::clearSubImage ( gl::GLint  level,
const glm::ivec3 &  offset,
const glm::ivec3 &  size,
gl::GLenum  format,
gl::GLenum  type,
const glm::ivec4 &  value 
)
void globjects::Texture::clearSubImage ( gl::GLint  level,
const glm::ivec3 &  offset,
const glm::ivec3 &  size,
gl::GLenum  format,
gl::GLenum  type,
const glm::uvec4 &  value 
)
void globjects::Texture::invalidateImage ( gl::GLint  level) const
void globjects::Texture::invalidateSubImage ( gl::GLint  level,
gl::GLint  xoffset,
gl::GLint  yoffset,
gl::GLint  zoffset,
gl::GLsizei  width,
gl::GLsizei  height,
gl::GLsizei  depth 
)
void globjects::Texture::invalidateSubImage ( gl::GLint  level,
const glm::ivec3 &  offset,
const glm::ivec3  size 
)
void globjects::Texture::bindImageTexture ( gl::GLuint  unit,
gl::GLint  level,
gl::GLboolean  layered,
gl::GLint  layer,
gl::GLenum  access,
gl::GLenum  format 
) const
static void globjects::Texture::unbindImageTexture ( gl::GLuint  unit)
static
void globjects::Texture::generateMipmap ( )
void globjects::Texture::cubeMapImage ( gl::GLint  level,
gl::GLenum  internalFormat,
gl::GLsizei  width,
gl::GLsizei  height,
gl::GLint  border,
gl::GLenum  format,
gl::GLenum  type,
const gl::GLvoid *  data 
)
void globjects::Texture::cubeMapImage ( gl::GLint  level,
gl::GLenum  internalFormat,
const glm::ivec2 &  size,
gl::GLint  border,
gl::GLenum  format,
gl::GLenum  type,
const gl::GLvoid *  data 
)
TextureHandle globjects::Texture::textureHandle ( ) const
TextureHandle globjects::Texture::textureHandle ( Sampler sampler) const
void globjects::Texture::pageCommitment ( gl::GLint  level,
gl::GLint  xOffset,
gl::GLint  yOffset,
gl::GLint  zOffset,
gl::GLsizei  width,
gl::GLsizei  height,
gl::GLsizei  depth,
gl::GLboolean  commit 
) const
void globjects::Texture::pageCommitment ( gl::GLint  level,
const glm::ivec3 &  offset,
const glm::ivec3 &  size,
gl::GLboolean  commit 
) const
virtual gl::GLenum globjects::Texture::objectType ( ) const
overridevirtual

Implements globjects::Object.

Member Data Documentation

gl::GLenum globjects::Texture::m_target
protected

The documentation for this class was generated from the following file: