OpenGL: use sized texture internal formats
Maybe this is pedantic but I read it’s best to explicitly set the desired component size. Also append “_ARB” to float texture formats since those need an extension in GL 2.1.
This commit is contained in:
@@ -640,12 +640,12 @@ static void init_internal_icons(void)
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, icongltex.id);
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, b32buf->x, b32buf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, b32buf->rect);
|
||||
glTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA, b16buf->x, b16buf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, b16buf->rect);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, b32buf->x, b32buf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, b32buf->rect);
|
||||
glTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA8, b16buf->x, b16buf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, b16buf->rect);
|
||||
|
||||
while (b16buf->x > 1) {
|
||||
ImBuf *nbuf = IMB_onehalf(b16buf);
|
||||
glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA, nbuf->x, nbuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, nbuf->rect);
|
||||
glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA8, nbuf->x, nbuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, nbuf->rect);
|
||||
level++;
|
||||
IMB_freeImBuf(b16buf);
|
||||
b16buf = nbuf;
|
||||
|
Reference in New Issue
Block a user