37 #ifndef H_OGF_RENDERER_CONTEXT_TEXTURE_H
38 #define H_OGF_RENDERER_CONTEXT_TEXTURE_H
115 GLint filtering = GL_LINEAR,
116 GLint wrapping = GL_CLAMP_TO_EDGE
138 GLint filtering = GL_LINEAR,
139 GLint wrapping = GL_CLAMP_TO_EDGE
174 GLint get_filtering()
const {
182 void set_filtering(GLint filtering);
188 GLint get_wrapping()
const {
196 void set_wrapping(GLint wrapping) {
197 wrapping_ = wrapping;
268 GLint& internal_format,
277 GLUPtextureType type_;
Some utility functions for OpenGL graphics.
Base class for reference-counted objects.
ComponentEncoding
Indicates the datatype used to encode each component of the colors.
ColorEncoding
Indicates how colors are encoded within the image.
static bool get_GL_formats(Image::ColorEncoding color_encoding, Image::ComponentEncoding component_encoding, GLint &internal_format, GLenum &format, GLenum &type)
Gets the parameters for specifying OpenGL textures from Image color encoding and component encoding.
~Texture()
Texture destructor.
void create_from_image(const Image *image, GLint filtering=GL_LINEAR, GLint wrapping=GL_CLAMP_TO_EDGE)
Creates a texture from an image.
index_t width() const
Gets the width.
void bind()
Binds the texture to its texture target.
index_t depth() const
Gets the height.
void create_from_data_1d(Memory::pointer ptr, Image::ColorEncoding color_encoding, Image::ComponentEncoding component_encoding, index_t width)
Initializes texture data for a 1d texture.
void unbind()
Unbinds the texture from its texture target.
void create_from_data(Memory::pointer ptr, Image::ColorEncoding color_encoding, Image::ComponentEncoding component_encoding, index_t width, index_t height, index_t depth=1, GLint filtering=GL_LINEAR, GLint wrapping=GL_CLAMP_TO_EDGE)
Creates a texture from raw data.
void create_from_data_3d(Memory::pointer ptr, Image::ColorEncoding color_encoding, Image::ComponentEncoding component_encoding, index_t width, index_t height, index_t depth)
Initializes texture data for a 2d texture.
GLuint id() const
Gets the id of the texture.
void create_from_data_2d(Memory::pointer ptr, Image::ColorEncoding color_encoding, Image::ComponentEncoding component_encoding, index_t width, index_t height)
Initializes texture data for a 2d texture.
index_t height() const
Gets the height.
Texture()
Texture constructor.
void reset_id()
Resets the id of this texture.
index_t dimension() const
Gets the dimension of the texture.
byte * pointer
Pointer to unsigned byte(s)
geo_index_t index_t
The type for storing and manipulating indices.
Global Graphite namespace.
Definitions common to all include files in the renderer library.