![]() |
Jopnal Engine
alpha 0.4
Simple Component Based 2D/3D Game Engine
|
#include <Cubemap.hpp>
Public Types | |
enum | Face { Face::Right, Face::Left, Face::Top, Face::Bottom, Face::Back, Face::Front, Face::First = Right } |
![]() | |
enum | Format { Format::None, Format::Alpha_UB_8, Format::RGB_UB_8, Format::RGBA_UB_8, Format::RGB_F_16, Format::RGBA_F_16, Format::Depth_US_16, Format::Depth_UI_24, Format::Stencil_UB_8, Format::DepthStencil_UI_24_B_8 } |
Public Member Functions | |
Cubemap (const std::string &name) | |
Constructor. More... | |
bool | load (const std::string &right, const std::string &left, const std::string &top, const std::string &bottom, const std::string &back, const std::string &front, const uint32 flags=0) |
Load a cube map from files. More... | |
bool | load (const glm::uvec2 &size, const Format format, const uint32 flags=0) |
Load an empty cube map. More... | |
bool | load (const std::string &path, const uint32 flags=0) |
Load from .dds file. More... | |
bool | load (const Image &image, const uint32 flags=0) |
Load cube map from compressed image containing a cube map (DXT1/3/5) More... | |
glm::uvec2 | getSize () const override |
Get the texture size. More... | |
unsigned int | getPixelDepth () const override |
Get the texture pixel depth. More... | |
![]() | |
Texture (const std::string &name, const unsigned int glTarget) | |
Constructor. More... | |
virtual | ~Texture () override=0 |
Virtual destructor. More... | |
void | destroy () |
Destroy this texture, erasing it from video memory. More... | |
bool | bind (const unsigned int texUnit=0) const |
Bind this texture. More... | |
void | unbind (const unsigned int texUnit=0) const |
Unbind a current texture. More... | |
bool | isValid () const |
Check if this texture is valid. More... | |
void | setSampler (const TextureSampler &sampler) |
Set a texture sampler. More... | |
void | removeSampler () |
Remove the bound texture sampler. More... | |
const TextureSampler * | getSampler () const |
Get the currently bound sampler. More... | |
Texture & | setFilterMode (const TextureSampler::Filter mode, const float param=1.f) |
Set the filtering mode. More... | |
Texture & | setRepeatMode (const TextureSampler::Repeat repeat) |
Set the repeating mode. More... | |
Texture & | setBorderColor (const Color &color) |
Set the border color. More... | |
TextureSampler::Filter | getFilterMode () const |
Get the filtering mode. More... | |
TextureSampler::Repeat | getRepeatMode () const |
Get the repeating mode. More... | |
float | getAnisotropyLevel () const |
Get the anisotropy level. More... | |
const Color & | getBorderColor () const |
Get the border color. More... | |
unsigned int | getHandle () const |
Get the OpenGL handle for this texture. More... | |
![]() | |
Resource (const std::string &name) | |
Constructor. More... | |
virtual | ~Resource ()=0 |
Virtual destructor. More... | |
const std::string & | getName () const |
Get the name of this resource. More... | |
void | setPersistence (const unsigned short level) |
Set the persistence level. More... | |
unsigned short | getPersistence () const |
Get the persistence level. More... | |
![]() | |
WeakReference< Resource > | getReference () const |
Get a weak reference to the bound object. More... | |
![]() | |
SerializeInfo () | |
void | setSerializePackage (const uint16 package) |
uint16 | getSerializePackage () const |
void | setShouldSerialize (const bool set) |
bool | shouldSerialize () const |
void | setLightSerializeable (const bool set) |
bool | isLightSerializeable () const |
Static Public Member Functions | |
static unsigned int | getMaximumSize () |
Get the maximum supported cube map size on this system. More... | |
static Cubemap & | getError () |
Get the error cube map. More... | |
static Cubemap & | getDefault () |
Get the default cube map. More... | |
![]() | |
static unsigned int | getMaxTextureUnits () |
Get the maximum texture units. More... | |
static void | setUnpackAlignment (const Format format) |
Set the pixel store alignment. More... | |
static bool | allowSRGB () |
Check is the sRGB color space is allowed. More... | |
static bool | allowGenMipmaps (const glm::uvec2 &size, const bool srgb) |
Check is automatic mipmap generation is allowed. More... | |
Additional Inherited Members | |
![]() | |
void | setAlphaSwizzle (const Format format) |
Set the swizzle mask for 8 bit textures. More... | |
![]() | |
Resource (const Resource &other, const std::string &newName) | |
Copy constructor. More... | |
![]() | |
SafeReferenceable (Resource *ref) | |
Constructor. More... | |
SafeReferenceable (SafeReferenceable< Resource > &&other) | |
Move constructor. More... | |
SafeReferenceable & | operator= (SafeReferenceable< Resource > &&other) |
Move assignment operator. More... | |
~SafeReferenceable () | |
Protected destructor. More... | |
![]() | |
static Format | getFormatFromDepth (const uint32 depth) |
Get the texture format from pixel depth. More... | |
static unsigned int | getDepthFromFormat (const Format format) |
Get the texture pixel depth from format. More... | |
![]() | |
Format | m_format |
Must be filled by derived classes during load() More... | |
Definition at line 35 of file Cubemap.hpp.
|
strong |
Cube map faces
Enumerator | |
---|---|
Right | |
Left | |
Top | |
Bottom | |
Back | |
Front | |
First |
Definition at line 41 of file Cubemap.hpp.
jop::Cubemap::Cubemap | ( | const std::string & | name | ) |
Constructor.
name | Name of this resource |
|
static |
Get the default cube map.
|
static |
Get the error cube map.
|
static |
Get the maximum supported cube map size on this system.
|
overridevirtual |
|
overridevirtual |
bool jop::Cubemap::load | ( | const std::string & | right, |
const std::string & | left, | ||
const std::string & | top, | ||
const std::string & | bottom, | ||
const std::string & | back, | ||
const std::string & | front, | ||
const uint32 | flags = 0 |
||
) |
Load a cube map from files.
right | Right side |
left | Left side |
top | Top side |
bottom | Bottom side |
back | Back side |
front | Front side |
flags | Texture flags |
Load an empty cube map.
size | The size of a single face |
format | The texture format |
flags | Texture flags |
bool jop::Cubemap::load | ( | const std::string & | path, |
const uint32 | flags = 0 |
||
) |
Load cube map from compressed image containing a cube map (DXT1/3/5)
Gets 6 faces from the compressed image and goes through them and their mipmaps.