SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Sleak::RenderEngine::OpenGLCubemapTexture Class Reference

OpenGL cubemap texture, loadable from six face images, a panorama, or a procedural gradient. More...

#include <OpenGLCubemapTexture.hpp>

Inheritance diagram for Sleak::RenderEngine::OpenGLCubemapTexture:

Public Member Functions

 OpenGLCubemapTexture ()
 ~OpenGLCubemapTexture () override
void Bind (uint32_t slot=0) const override
 Binds the cubemap to a texture unit.
TextureFormat GetFormat () const override
GLuint GetGLTexture () const
uint32_t GetHeight () const override
TextureType GetType () const override
uint32_t GetWidth () const override
bool LoadCubemap (const std::array< std::string, 6 > &facePaths)
 Load 6 face images: +X, -X, +Y, -Y, +Z, -Z.
bool LoadEquirectangular (const std::string &path, uint32_t faceSize=512)
 Load from a single equirectangular panorama and convert to cubemap.
bool LoadFromFile (const std::string &filePath) override
 Unused for cubemaps; always returns false, load via LoadCubemap/LoadEquirectangular instead.
bool LoadFromMemory (const void *data, uint32_t width, uint32_t height, TextureFormat format) override
 Unused for cubemaps; always returns false, load via LoadCubemap/LoadEquirectangular instead.
bool LoadGradient (float topR, float topG, float topB, float midR, float midG, float midB, float botR, float botG, float botB, uint32_t resolution=64)
 Generate a procedural gradient cubemap (top/mid/bottom colors).
void SetFilter (TextureFilter filter) override
void SetWrapMode (TextureWrapMode wrapMode) override
void Unbind () const override
Public Member Functions inherited from Sleak::Texture
virtual ~Texture ()=default
virtual uint64_t GetImGuiTextureID () const
virtual float GetLodBias () const
virtual void SetLodBias (float bias)

Detailed Description

OpenGL cubemap texture, loadable from six face images, a panorama, or a procedural gradient.

Definition at line 14 of file OpenGLCubemapTexture.hpp.

Constructor & Destructor Documentation

◆ OpenGLCubemapTexture()

Sleak::RenderEngine::OpenGLCubemapTexture::OpenGLCubemapTexture ( )

Definition at line 10 of file OpenGLCubemapTexture.cpp.

◆ ~OpenGLCubemapTexture()

Sleak::RenderEngine::OpenGLCubemapTexture::~OpenGLCubemapTexture ( )
override

Definition at line 12 of file OpenGLCubemapTexture.cpp.

Member Function Documentation

◆ Bind()

void Sleak::RenderEngine::OpenGLCubemapTexture::Bind ( uint32_t slot = 0) const
overridevirtual

Binds the cubemap to a texture unit.

Implements Sleak::Texture.

Definition at line 275 of file OpenGLCubemapTexture.cpp.

◆ GetFormat()

TextureFormat Sleak::RenderEngine::OpenGLCubemapTexture::GetFormat ( ) const
inlineoverridevirtual

Implements Sleak::Texture.

Definition at line 47 of file OpenGLCubemapTexture.hpp.

◆ GetGLTexture()

GLuint Sleak::RenderEngine::OpenGLCubemapTexture::GetGLTexture ( ) const
inline

Definition at line 50 of file OpenGLCubemapTexture.hpp.

◆ GetHeight()

uint32_t Sleak::RenderEngine::OpenGLCubemapTexture::GetHeight ( ) const
inlineoverridevirtual

Implements Sleak::Texture.

Definition at line 46 of file OpenGLCubemapTexture.hpp.

◆ GetType()

TextureType Sleak::RenderEngine::OpenGLCubemapTexture::GetType ( ) const
inlineoverridevirtual

Implements Sleak::Texture.

Definition at line 48 of file OpenGLCubemapTexture.hpp.

◆ GetWidth()

uint32_t Sleak::RenderEngine::OpenGLCubemapTexture::GetWidth ( ) const
inlineoverridevirtual

Implements Sleak::Texture.

Definition at line 45 of file OpenGLCubemapTexture.hpp.

◆ LoadCubemap()

bool Sleak::RenderEngine::OpenGLCubemapTexture::LoadCubemap ( const std::array< std::string, 6 > & facePaths)

Load 6 face images: +X, -X, +Y, -Y, +Z, -Z.

Definition at line 19 of file OpenGLCubemapTexture.cpp.

◆ LoadEquirectangular()

bool Sleak::RenderEngine::OpenGLCubemapTexture::LoadEquirectangular ( const std::string & path,
uint32_t faceSize = 512 )

Load from a single equirectangular panorama and convert to cubemap.

Definition at line 60 of file OpenGLCubemapTexture.cpp.

◆ LoadFromFile()

bool Sleak::RenderEngine::OpenGLCubemapTexture::LoadFromFile ( const std::string & filePath)
overridevirtual

Unused for cubemaps; always returns false, load via LoadCubemap/LoadEquirectangular instead.

Implements Sleak::Texture.

Definition at line 270 of file OpenGLCubemapTexture.cpp.

◆ LoadFromMemory()

bool Sleak::RenderEngine::OpenGLCubemapTexture::LoadFromMemory ( const void * data,
uint32_t width,
uint32_t height,
TextureFormat format )
overridevirtual

Unused for cubemaps; always returns false, load via LoadCubemap/LoadEquirectangular instead.

Implements Sleak::Texture.

Definition at line 264 of file OpenGLCubemapTexture.cpp.

◆ LoadGradient()

bool Sleak::RenderEngine::OpenGLCubemapTexture::LoadGradient ( float topR,
float topG,
float topB,
float midR,
float midG,
float midB,
float botR,
float botG,
float botB,
uint32_t resolution = 64 )

Generate a procedural gradient cubemap (top/mid/bottom colors).

Definition at line 208 of file OpenGLCubemapTexture.cpp.

◆ SetFilter()

void Sleak::RenderEngine::OpenGLCubemapTexture::SetFilter ( TextureFilter filter)
overridevirtual

Implements Sleak::Texture.

Definition at line 284 of file OpenGLCubemapTexture.cpp.

◆ SetWrapMode()

void Sleak::RenderEngine::OpenGLCubemapTexture::SetWrapMode ( TextureWrapMode wrapMode)
overridevirtual

Implements Sleak::Texture.

Definition at line 300 of file OpenGLCubemapTexture.cpp.

◆ Unbind()

void Sleak::RenderEngine::OpenGLCubemapTexture::Unbind ( ) const
overridevirtual

Implements Sleak::Texture.

Definition at line 280 of file OpenGLCubemapTexture.cpp.