Robadob / sdl_exp

Low-level graphics engine built over SDL2
MIT License
1 stars 2 forks source link

Texture2D reload() with different sizes texture will break. #18

Closed Robadob closed 7 years ago

Robadob commented 8 years ago

Having updated 2D textures to use immutable storage, it becomes necessary to delete and regenerate the texture if you wish to resize it. As such large parts of the Texture class would benefit from being written to support this (perhaps sub-classing Texture with both Mutable and Immutable). At current it will just try and store the new image within the existing texture, likely erroring if the new image is bigger.

Personally I don't like the idea of deleting and recreating textures on a reload, however this wiki page suggests immutable textures are preferable (and alot of other mipmap stuff may have been deprecated).

Robadob commented 7 years ago

New incoming Texture removes texture reload.