SenOGL  0.2
Library aiming to ease the use of OpenGL
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Texture3D Class Reference

Texture 2D. More...

#include <Texture3D.hpp>

Inheritance diagram for Texture3D:
Texture OpenGLObject

Public Member Functions

 Texture3D ()=default
 
 Texture3D (PixelType pixelType)
 
void create (const void *data, size_t width, size_t height, size_t depth, int compCount)
 
void create (const void *data, size_t width, size_t height, size_t depth, GLint internalFormat, GLenum format, bool generateMipmaps=true)
 
virtual void bind (unsigned int unit=0) const override
 
virtual void unbind (unsigned int unit=0) const override
 
virtual GLuint getBound (unsigned int unit=0) const override
 
- Public Member Functions inherited from Texture
 Texture (PixelType pixelType=PixelType::UnsignedByte)
 
 Texture (PixelType pixelType, GLuint handle)
 
 Texture (const Texture &)=default
 
 Texture (Texture &&)=default
 
Textureoperator= (const Texture &)=default
 
Textureoperator= (Texture &&)=default
 
virtual ~Texture ()
 
virtual void init () override
 Generates a OpenGL object name to manage. More...
 
virtual void cleanup () override
 Deletes the managed OpenGL object. More...
 
virtual bool isValid () const override
 Returns true if the object seems valid. More...
 
template<typename T >
void set (Parameter opt, T value) const
 
template<typename T >
void setI (Parameter opt, T value) const
 
void generateMipmaps () const
 
virtual void bindImage (GLuint unit, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format) const
 TODO. More...
 
virtual void dump (const std::string &path) const
 Saves the texture as a png at path. More...
 
- Public Member Functions inherited from OpenGLObject
 OpenGLObject ()
 
 OpenGLObject (GLuint handle)
 Constructs a instance managing an existing OpenGL Object. More...
 
 OpenGLObject (const OpenGLObject &)=default
 
 OpenGLObject (OpenGLObject &&)=default
 
OpenGLObjectoperator= (const OpenGLObject &)=default
 
OpenGLObjectoperator= (OpenGLObject &&)=default
 
virtual ~OpenGLObject ()
 
GLuint getName () const
 Returns OpenGL name of the object. More...
 
void setName (GLuint n)
 Sets the OpenGL name of the object managed by this instance /!\ Use with caution ! (assignment operator is probably what you're looking for) More...
 
 operator bool () const
 Syntactic sugar for isValid(). More...
 

Additional Inherited Members

- Public Types inherited from Texture
enum  Parameter : GLenum {
  Parameter::DepthStencilMode = GL_DEPTH_STENCIL_TEXTURE_MODE, Parameter::BaseLevel = GL_TEXTURE_BASE_LEVEL, Parameter::SwizzleR = GL_TEXTURE_SWIZZLE_R, Parameter::SwizzleG = GL_TEXTURE_SWIZZLE_G,
  Parameter::SwizzleB = GL_TEXTURE_SWIZZLE_B, Parameter::SwizzleA = GL_TEXTURE_SWIZZLE_A, Parameter::MinFilter = GL_TEXTURE_MIN_FILTER, Parameter::MagFilter = GL_TEXTURE_MAG_FILTER,
  Parameter::MinLoD = GL_TEXTURE_MIN_LOD, Parameter::MaxLoD = GL_TEXTURE_MAX_LOD, Parameter::LoDBias = GL_TEXTURE_LOD_BIAS, Parameter::WrapS = GL_TEXTURE_WRAP_S,
  Parameter::WrapT = GL_TEXTURE_WRAP_T, Parameter::WrapR = GL_TEXTURE_WRAP_R, Parameter::BorderColor = GL_TEXTURE_BORDER_COLOR, Parameter::CompareMode = GL_TEXTURE_COMPARE_MODE,
  Parameter::CompareFunc = GL_TEXTURE_COMPARE_FUNC
}
 
enum  PixelType : GLenum { PixelType::UnsignedByte = GL_UNSIGNED_BYTE, PixelType::UnsignedShort565 = GL_UNSIGNED_SHORT_5_6_5, PixelType::UnsignedShort4444 = GL_UNSIGNED_SHORT_4_4_4_4, PixelType::UnsignedShort5551 = GL_UNSIGNED_SHORT_5_5_5_1 }
 
- Static Public Member Functions inherited from Texture
static void activeUnit (unsigned int unit)
 
- Static Protected Member Functions inherited from Texture
static bool isTexture (GLuint name)
 
static GLenum getFormat (GLuint compCount)
 
static GLuint getCompCount (GLenum format)
 
- Protected Attributes inherited from Texture
PixelType _pixelType = PixelType::UnsignedByte
 
- Protected Attributes inherited from OpenGLObject
GLuint _handle
 OpenGL name of the managed object. More...
 

Detailed Description

Texture 2D.

Todo:

Add a LOT of options !

Change default parameters ?

Constructor & Destructor Documentation

Texture3D::Texture3D ( )
default
Texture3D::Texture3D ( PixelType  pixelType)
inline

Member Function Documentation

void Texture3D::bind ( unsigned int  unit = 0) const
overridevirtual

Reimplemented from Texture.

void Texture3D::create ( const void *  data,
size_t  width,
size_t  height,
size_t  depth,
int  compCount 
)
void Texture3D::create ( const void *  data,
size_t  width,
size_t  height,
size_t  depth,
GLint  internalFormat,
GLenum  format,
bool  generateMipmaps = true 
)
virtual GLuint Texture3D::getBound ( unsigned int  unit = 0) const
inlineoverridevirtual
Parameters
unitTexture unit
Returns
Currently bound texture at unit.

Implements Texture.

void Texture3D::unbind ( unsigned int  unit = 0) const
overridevirtual

Reimplemented from Texture.


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