glTexSubImage2D and power of 2

Started by
1 comment, last by CableGuy 15 years, 8 months ago
Ok, I'm trying my luck at a FreeType font renderer and I have a problem while packing the glyphs into a texture. I use glTexSubImage2D to upload each glyph into a big texture but when I use the glyph's actual size(not power of 2) the image gets distorted but when I expand it to the next power of 2 it is ok. So while this is not a big deal, looking at the OpenGL documentation provided with the MSDN it says nothing about the width and the height having to be power of 2 in glTexSubImage2D. So is this correct behavior or am I doing something wrong?
Advertisement
Are you using the GL_RGB8 format? It could be a case of
http://www.opengl.org/wiki/index.php/Common_Mistakes#Texture_Upload
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Thanks.

This topic is closed to new replies.

Advertisement