Code:
if Format = GL_RGBA then
begin
if GL_SGIS_generate_mipmap then begin
// hardware-accelerated mipmap generation
glTexParameteri(pTarget, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexImage2d(pTarget, 0, GL_RGBA8, Width, Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pData);
end
else
begin
// software GLU-based mipmap generation
gluBuild2DMipmaps(pTarget, GL_RGBA8, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, pData);
end;
// Original code
//gluBuild2DMipmaps(pTarget, GL_RGBA8, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, pData)
end
else
begin
if GL_SGIS_generate_mipmap then begin
// hardware-accelerated mipmap generation
glTexParameteri(pTarget, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
glTexImage2d(pTarget, 0, GL_RGB8, Width, Height, 0, GL_RGB, GL_UNSIGNED_BYTE, pData);
end
else
begin
// software GLU-based mipmap generation
gluBuild2DMipmaps(pTarget, GL_RGB8, Width, Height, GL_RGB, GL_UNSIGNED_BYTE, pData);
end;
//Original code
//gluBuild2DMipmaps(pTarget, GL_RGB8, Width, Height, GL_RGB, GL_UNSIGNED_BYTE, pData);
end;
Any ideas on what I'm doing wrong?
Bookmarks