#include <texture.h>
Public Methods | |
texture (void) | |
Default Constructor. | |
texture (const texture &cpy) | |
Copy Constructor. | |
texture & | operator= (const texture &cpy) |
Assignment Operator. | |
void | set (GLuint handle, real_t aspect) |
Sets all aspects of the texture object. | |
operator GLuint (void) const | |
Cast to GLuint. | |
void | erase (void) |
Removes the texture from the OpenGL subsystem. | |
void | bind (void) const |
Binds the texture in OpenGL. | |
real_t | get_aspect (void) const |
Returns the aspect ratio of the image (width / height). | |
Static Public Methods | |
void | set_greyscale_format (GLenum format) |
What format OpenGL will load greyscale data in. | |
texture | load (const std::string &filename, bool build_mipmaps=true, GLfloat min_filter=GL_LINEAR_MIPMAP_LINEAR, GLfloat max_filter=GL_LINEAR) |
Loads the texture filename into the OpenGL subsystem. More... | |
texture | load (std::istream &stream, bool build_mipmaps=true, GLfloat min_filter=GL_LINEAR_MIPMAP_LINEAR, GLfloat max_filter=GL_LINEAR) |
Loads the stream as a texture into the OpenGL subsystem. More... | |
texture | load (image::image_t *img, bool build_mipmaps=true, GLfloat min_filter=GL_LINEAR_MIPMAP_LINEAR, GLfloat max_filter=GL_LINEAR) |
Loads the image_t* as a texture into the OpenGL subsystem. More... | |
Static Public Attributes | |
GLenum | s_greyscale_format = GL_LUMINANCE |
This object represents a texture loaded into the OpenGL subsystem. Using the object is as simple as:
//load the texture gl::texture tex = gl::texture::load( "filename" ); if( !tex ) { std::cerr << "could not load texture" << std::endl; } //use the texture glBindTexture( GL_TEXTURE_2D, tex ); // . . .
Definition at line 37 of file texture.h.
|
Loads the
Definition at line 81 of file texture.cpp. References image::image_t::BYTE, image::image_t::get_bpc, image::image_t::get_format, image::image_t::get_height, image::image_t::get_pixels, image::image_t::get_width, image::image_t::GREYSCALE, image::image_t::RGB, image::image_t::RGBA, and texture. |
|
Loads the
Definition at line 49 of file texture.cpp. References image::image_t::flip_horizontal, load, image::load, and texture. |
|
Loads the texture filename into the OpenGL subsystem.
Definition at line 18 of file texture.cpp. References image::image_t::flip_horizontal, image::load, and texture. Referenced by gl::ttf::load, and load. |