manati
12-15-2009, 10:53 PM
I have a large texture in memory (non-power of two),which I want to draw binding in card memory only one 512x512 texture which wil be updated according to the current draw area(due to memory,performance and compatibility issues)
My questions are:
1.Can I use glTexSubImage2D(...) for this purpose?
2.Can I replace the texture pixels with pixels from the large texture subarea without copying them to some temporary buffer?
Because according to glTexSubImage2D parameters seems like I can't do it...
void glTexSubImage2D( GLenum target, //=GL_TEXTURE_2D
GLint level, // = 0
GLint xoffset, // = 0 (of original texture)
GLint yoffset, // = 0 (of original texture)
GLsizei width, // = 512
GLsizei height, // = 512
GLenum format, // = GL_RGB
GLenum type,// = GL_UNSIGNED_BYTE
const GLvoid * data);// = new pixels but the expected size buffer is 512x512?
My questions are:
1.Can I use glTexSubImage2D(...) for this purpose?
2.Can I replace the texture pixels with pixels from the large texture subarea without copying them to some temporary buffer?
Because according to glTexSubImage2D parameters seems like I can't do it...
void glTexSubImage2D( GLenum target, //=GL_TEXTURE_2D
GLint level, // = 0
GLint xoffset, // = 0 (of original texture)
GLint yoffset, // = 0 (of original texture)
GLsizei width, // = 512
GLsizei height, // = 512
GLenum format, // = GL_RGB
GLenum type,// = GL_UNSIGNED_BYTE
const GLvoid * data);// = new pixels but the expected size buffer is 512x512?