2-D texture More...
#include <glv_texture.h>
Public Member Functions | |
Texture2 (GLsizei width, GLsizei height, GLenum format=GL_RGB, GLenum type=GL_UNSIGNED_BYTE) | |
This constructor will allocate an internal pixel buffer. | |
Texture2 (GLsizei width, GLsizei height, GLvoid *pixels=0, GLenum format=GL_RGB, GLenum type=GL_UNSIGNED_BYTE, bool doesLoad=false) | |
Constructor. | |
template<class T > | |
T * | buffer () const |
Get pointer to local texture memory. | |
GLsizei | width () const |
Get width. | |
GLsizei | height () const |
Get height. | |
void | begin () const |
Bind self to current context. | |
void | end () const |
Binds default texture. | |
int | alloc (int w, int h) |
Allocate local texture memory. | |
void | dealloc () |
Free local texture memory. | |
Texture2 & | bind () |
Bind self to current context. | |
Texture2 & | draw (float ql, float qt, float qr, float qb, float tl=0, float tt=1, float tr=1, float tb=0) |
Texture2 & | create (GLsizei w, GLsizei h, GLvoid *pixels=0) |
Create new texture on graphics card. | |
Texture2 & | create () |
Reload texture onto GPU. | |
Texture2 & | send () |
Send pointed to pixels to GPU. | |
Texture2 & | format (GLenum v) |
Set the color format. | |
Texture2 & | type (GLenum v) |
Set the color data type. |
2-D texture
int glv::Texture2::alloc | ( | int | w, | |
int | h | |||
) |
Allocate local texture memory.
Returns total number of bytes allocated.
Texture2 & glv::Texture2::draw | ( | float | ql, | |
float | qt, | |||
float | qr, | |||
float | qb, | |||
float | tl = 0 , |
|||
float | tt = 1 , |
|||
float | tr = 1 , |
|||
float | tb = 0 | |||
) |
ql | Draw texture to rectangular quad |