glcxx: A Modern C++ Interface to OpenGL Object Management
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
glcxx::Texture Class Reference

C++ wrapper for an OpenGL texture object. More...

#include <Texture.hpp>

Public Member Functions

 Texture ()
 Construct and allocate an OpenGL texture object.
 
 ~Texture ()
 Destroy the texture object.
 
GLuint id () const
 Get the texture object's ID. More...
 
void bind (GLenum target) const
 Bind the texture object.
 

Static Public Member Functions

static std::shared_ptr< Texturecreate ()
 Factory method to construct a Texture. More...
 
static uint32_t next_power_of_2 (uint32_t n)
 Return the lowest power-of-2 integer greater than or equal to n. More...
 

Protected Member Functions

void allocate ()
 Allocate the OpenGL texture object.
 

Protected Attributes

GLuint m_id
 The texture object's ID.
 

Detailed Description

C++ wrapper for an OpenGL texture object.

Member Function Documentation

static std::shared_ptr<Texture> glcxx::Texture::create ( )
inlinestatic

Factory method to construct a Texture.

Returns
std::shared_ptr to the created Texture.
GLuint glcxx::Texture::id ( ) const
inline

Get the texture object's ID.

Returns
The texture object's ID.
uint32_t glcxx::Texture::next_power_of_2 ( uint32_t  n)
static

Return the lowest power-of-2 integer greater than or equal to n.

Parameters
nMinimum bound for return value.
Returns
Lowest power-of-2 integer greater than or equal to n.

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