mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 23:19:19 +02:00
handle both old- and new-style mipmap generation
This commit is contained in:
@@ -1004,6 +1004,10 @@ opengl_texture::create( bool const Static ) {
|
|||||||
|
|
||||||
auto blocksize_it = precompressed_formats.find(internal_format);
|
auto blocksize_it = precompressed_formats.find(internal_format);
|
||||||
|
|
||||||
|
if ( data_mapcount == 1 && !glGenerateMipmap ) {
|
||||||
|
glTexParameteri(target, GL_GENERATE_MIPMAP, GL_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
for( int maplevel = 0; maplevel < data_mapcount; ++maplevel ) {
|
for( int maplevel = 0; maplevel < data_mapcount; ++maplevel ) {
|
||||||
|
|
||||||
if (blocksize_it != precompressed_formats.end())
|
if (blocksize_it != precompressed_formats.end())
|
||||||
@@ -1034,8 +1038,7 @@ opengl_texture::create( bool const Static ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( data_mapcount == 1 ) {
|
if ( data_mapcount == 1 && glGenerateMipmap ) {
|
||||||
// fill missing mipmaps if needed
|
|
||||||
glGenerateMipmap(target);
|
glGenerateMipmap(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user