|
GL++
0.1
OpenGL API C++ Wrapper
|
Object that represents an in-GPU texture. More...
#include <texture.hpp>
Public Member Functions | |
| texture (const texture_type &type) | |
| Construct an empty texture object. | |
| ~texture () | |
| Destroy and release resources of buffer. | |
| texture_type | type () const |
| Get the type of texture as defined in constructor. | |
| void | bind () const |
| Bind texture to its defined type target. | |
| void | define_data_2d (tex2d_update_target target, GLuint lvl, image_format internal_format, size_t width, size_t height, int border, pixel_format pix_form, tex_pixel_type pix_type, const void *pdata) |
| Specify a two-dimensional texture image. | |
| void | generate_mipmaps () |
| Generate mipmaps. | |
Set texture parameters | |
| void | set_border_color (GLfloat r, GLfloat g, GLfloat b, GLfloat a) |
| Define the border values that should be used for border texels. | |
| void | set_compare_mode (compare_mode cm) |
| Specifies the texture comparison mode for currently bound depth textures. | |
| void | set_compare_func (compare_func cf) |
| Specifies the comparison operator used when set_compare_mode() is set to REF_TO_TEXTURE. | |
| void | set_lod_bias (GLfloat bias) |
| Specifies a fixed bias value that is to be added to the level-of-detail parameter for the texture before texture sampling. | |
| void | set_min_filter (min_filter_type mf) |
| Specify the minifying function. | |
| void | set_mag_filter (mag_filter_type mf) |
| Specify the magnification function. | |
| void | set_min_lod (GLfloat lod) |
| Sets the minimum level-of-detail parameter. | |
| void | set_max_lod (GLfloat lod) |
| Sets the maximum level-of-detail parameter. | |
| void | set_base_level (GLint lvl) |
| Specifies the index of the lowest defined mipmap level. | |
| void | set_max_level (GLint lvl) |
| Sets the index of the highest defined mipmap level. | |
| void | set_swizzle (swizzle_type r, swizzle_type g, swizzle_type b, swizzle_type a) |
| Sets the swizzle that will be applied to the components of a texel before it is returned to the shader. | |
| void | set_wrap_s (wrap_type ws) |
| Sets the wrap parameter for texture coordinate s. | |
| void | set_wrap_t (wrap_type wt) |
| Sets the wrap parameter for texture coordinate t. | |
| void | set_wrap_r (wrap_type wr) |
| Sets the wrap parameter for texture coordinate r. | |
| GLint | get_base_level () const |
| Returns the single-valued base texture mipmap level. | |
| GLint | get_max_level () const |
| Returns the single-valued maximum texture mipmap array level. | |
| void | get_border_color (GLfloat *rgba) const |
| Returns four integer or floating-point numbers that comprise the RGBA color of the texture border. | |
| void | get_border_color (GLfloat &r, GLfloat &g, GLfloat &b, GLfloat &a) const |
| Returns four integer or floating-point numbers that comprise the RGBA color of the texture border. | |
| compare_mode | get_compare_mode () const |
| Returns the comparison mode. | |
| compare_func | get_compare_func () const |
| Returns the comparison functions when comparison mode is set to REF_TO_TEXTURE. | |
| GLfloat | get_min_lod () const |
| Gets the minimum level-of-detail parameter. | |
| GLfloat | get_max_lod () const |
| Gets the maximum level-of-detail parameter. | |
| void | get_swizzle (swizzle_type &r, swizzle_type &g, swizzle_type &b, swizzle_type &a) const |
| Gets the swizzle that will be applied to the components of a texel before it is returned to the shader. | |
| wrap_type | get_wrap_s () const |
| Sets the wrap parameter for texture coordinate s. | |
| wrap_type | get_wrap_t () const |
| Sets the wrap parameter for texture coordinate t. | |
| wrap_type | get_wrap_r () const |
| Sets the wrap parameter for texture coordinate r. | |
| bool | is_immutable_format () const |
| Returns true if the texture has an immutable format. | |
Public Member Functions inherited from glpp::named_object< GLuint > | |
| name_type | object_name () const |
| Return the name of object (handle) | |
Public Member Functions inherited from glpp::noncopyable | |
| noncopyable (noncopyable &) | |
| noncopyable & | operator= (noncopyable &) |
Protected Types | |
| enum | param_type |
Protected Member Functions | |
| void | initialize () |
| Generic initialize function. | |
Protected Attributes | |
| texture_type | m_tex_type |
| OpenGL texture type. | |
Protected Attributes inherited from glpp::named_object< GLuint > | |
| GLuint | m_gl_name |
| Stored object name. | |
Additional Inherited Members | |
Public Types inherited from glpp::named_object< GLuint > | |
| typedef GLuint | name_type |
| Type of the name. | |
Object that represents an in-GPU texture.
| glpp::texture::texture | ( | const texture_type & | type | ) |
Construct an empty texture object.
http://www.opengl.org/sdk/docs/man4/xhtml/glGenTextures.xml
| type | Is the type of this texture. |
| glpp::texture::~texture | ( | ) |
Destroy and release resources of buffer.
http://www.opengl.org/sdk/docs/man4/xhtml/glDeleteTextures.xml
|
inline |
Bind texture to its defined type target.
| void glpp::texture::define_data_2d | ( | tex2d_update_target | target, |
| GLuint | lvl, | ||
| image_format | internal_format, | ||
| size_t | width, | ||
| size_t | height, | ||
| int | border, | ||
| pixel_format | pix_form, | ||
| tex_pixel_type | pix_type, | ||
| const void * | pdata | ||
| ) |
Specify a two-dimensional texture image.
| void glpp::texture::generate_mipmaps | ( | ) |
Generate mipmaps.
http://www.opengl.org/sdk/docs/man4/xhtml/glGenerateMipmap.xml
| void glpp::texture::set_base_level | ( | GLint | lvl | ) |
Specifies the index of the lowest defined mipmap level.
This is an integer value. The initial value is 0.
| void glpp::texture::set_max_level | ( | GLint | lvl | ) |
Sets the index of the highest defined mipmap level.
This is an integer value. The initial value is 1000.
| void glpp::texture::set_max_lod | ( | GLfloat | lod | ) |
Sets the maximum level-of-detail parameter.
The initial value is 1000.
| void glpp::texture::set_min_lod | ( | GLfloat | lod | ) |
Sets the minimum level-of-detail parameter.
The initial value is -1000.