OpenGL: Implement textures
This commit is contained in:
@@ -40,6 +40,8 @@ namespace Nz
|
||||
|
||||
virtual bool Update(const void* ptr) = 0;
|
||||
|
||||
static inline unsigned int GetLevelSize(unsigned int size, unsigned int level);
|
||||
|
||||
Texture& operator=(const Texture&) = delete;
|
||||
Texture& operator=(Texture&&) = delete;
|
||||
};
|
||||
|
||||
@@ -7,6 +7,13 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
inline unsigned int Texture::GetLevelSize(unsigned int size, unsigned int level)
|
||||
{
|
||||
if (size == 0) // Possible dans le cas d'une image invalide
|
||||
return 0;
|
||||
|
||||
return std::max(size >> level, 1U);
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Renderer/DebugOff.hpp>
|
||||
|
||||
Reference in New Issue
Block a user