14 #ifndef SRC_TEXTURE2D_H_
15 #define SRC_TEXTURE2D_H_
47 Texture2D(GLenum wrapMode=GL_REPEAT, GLenum filterMode=GL_LINEAR);
124 const unsigned char * data_ubyte_;
125 const float * data_float_;
129 bool handleMemInternally_;
Represents a 4-component (R,G,B,A) color, stored internally in a float array to be compatable with Op...
A wrapper around a 2D texture that supports loading images from files or setting texture color data d...
bool UpdateFromBytes(const unsigned char *data)
This function may be called to re-read the texture data from an array formated the same as in InitFro...
bool initialized() const
Returns true if the texture data has been successfully transferred to OpenGL.
GLenum wrap_mode() const
Returns an enumerated constant for the OpenGL wrap mode used by the texture.
Color Pixel(int x, int y) const
Returns the color at the specified pixel. The top left corner of the image is (0,0) and the bottom ri...
int height() const
Returns the height in pixels of the texture.
int width() const
Returns the width in pixels of the texture.
void set_filter_mode(GLenum filterMode)
Uses the OpenGL texture filter mode arguments.
bool InitFromFile(const std::string &filename)
Call this from within the InitOpenGL() function since it will initialize not just the Texture2D's int...
Texture2D(GLenum wrapMode=GL_REPEAT, GLenum filterMode=GL_LINEAR)
Creates an empty texture. Optional parameters can be provided to set the texture wrap mode and filter...
void set_wrap_mode(GLenum wrapMode)
Uses the OpenGL texture wrap mode arguments.
bool InitFromBytes(int width, int height, const unsigned char *data)
Call this from within the InitOpenGL() function since it will initialize not just the Texture2D's int...
GLuint opengl_id() const
Returns the unsigned int used as the texture handle by OpenGL.
bool UpdateFromFloats(const float *data)
This function may be called to re-read the texture data from an array formated the same as in InitFro...
bool InitFromFloats(int width, int height, const float *data)
Call this from within the InitOpenGL() function since it will initialize not just the Texture2D's int...
GLenum filter_mode() const
Returns an enumerated constant for the OpenGL filter mode used by the texture.
Namespace for the MinGfx Toolkit.