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
CubeMap Class Reference

#include <CubeMap.hpp>

Inheritance diagram for CubeMap:
Texture OpenGLObject

Public Member Functions

 CubeMap ()=default
 
 CubeMap (PixelType pixelType)
 
void load (const std::array< std::string, 6 > &paths, bool generateMipmaps=true)
 Order : XPOS, XNEG, YPOS, YNEG, ZPOS, ZNEG. More...
 
void create (size_t width, size_t height, GLenum internalFormat)
 
void create (void *data, size_t width, size_t height, int compCount, bool generateMipmaps=true)
 
void create (const std::array< void *, 6 > &data, size_t width, size_t height, int compCount, bool generateMipmaps=true)
 
void create (void *data, size_t width, size_t height, GLint internalFormat, GLenum format, bool generateMipmaps=true)
 
void create (const std::array< void *, 6 > &data, size_t width, size_t height, 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
 
virtual void dump (const std::string &path) const override
 Saves the texture as a png at path. More...
 
- 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...
 
- 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...
 

Constructor & Destructor Documentation

CubeMap::CubeMap ( )
default
CubeMap::CubeMap ( PixelType  pixelType)

Member Function Documentation

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

Reimplemented from Texture.

void CubeMap::create ( size_t  width,
size_t  height,
GLenum  internalFormat 
)
void CubeMap::create ( void *  data,
size_t  width,
size_t  height,
int  compCount,
bool  generateMipmaps = true 
)
void CubeMap::create ( const std::array< void *, 6 > &  data,
size_t  width,
size_t  height,
int  compCount,
bool  generateMipmaps = true 
)
void CubeMap::create ( void *  data,
size_t  width,
size_t  height,
GLint  internalFormat,
GLenum  format,
bool  generateMipmaps = true 
)
void CubeMap::create ( const std::array< void *, 6 > &  data,
size_t  width,
size_t  height,
GLint  internalFormat,
GLenum  format,
bool  generateMipmaps = true 
)
void CubeMap::dump ( const std::string &  path) const
overridevirtual

Saves the texture as a png at path.

Parameters
pathPath of the created file.

Reimplemented from Texture.

virtual GLuint CubeMap::getBound ( unsigned int  unit = 0) const
inlineoverridevirtual
Parameters
unitTexture unit
Returns
Currently bound texture at unit.

Implements Texture.

void CubeMap::load ( const std::array< std::string, 6 > &  paths,
bool  generateMipmaps = true 
)

Order : XPOS, XNEG, YPOS, YNEG, ZPOS, ZNEG.

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

Reimplemented from Texture.


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