Renderer: Add mipmaps generation support
This commit is contained in:
@@ -24,6 +24,8 @@ namespace Nz::GL
|
||||
Texture(Texture&&) noexcept = default;
|
||||
~Texture() = default;
|
||||
|
||||
inline void GenerateMipmap();
|
||||
|
||||
inline TextureTarget GetTarget() const;
|
||||
|
||||
inline void SetParameterf(GLenum pname, GLfloat param);
|
||||
|
||||
@@ -7,6 +7,13 @@
|
||||
|
||||
namespace Nz::GL
|
||||
{
|
||||
inline void Texture::GenerateMipmap()
|
||||
{
|
||||
const Context& context = EnsureDeviceContext();
|
||||
context.BindTexture(m_target, m_objectId);
|
||||
context.glGenerateMipmap(ToOpenGL(m_target));
|
||||
}
|
||||
|
||||
inline TextureTarget Texture::GetTarget() const
|
||||
{
|
||||
return m_target;
|
||||
|
||||
Reference in New Issue
Block a user