|
GlistEngine
|
#include <gTexture.h>


Public Types | |
| enum | TextureType : int { TEXTURETYPE_DIFFUSE = 0 , TEXTURETYPE_SPECULAR = 1 , TEXTURETYPE_NORMAL = 2 , TEXTURETYPE_HEIGHT = 3 , TEXTURETYPE_PBR_ALBEDO = 4 , TEXTURETYPE_PBR_ROUGHNESS = 5 , TEXTURETYPE_PBR_METALNESS = 6 , TEXTURETYPE_PBR_NORMAL = 7 , TEXTURETYPE_PBR_AO = 8 , TEXTURETYPE_COUNT } |
| enum | TextureWrap : int { TEXTUREWRAP_REPEAT = 0 , TEXTUREWRAP_CLAMP = 1 , TEXTUREWRAP_CLAMPTOEDGE = 2 , TEXTUREWRAP_NEAREST = 3 } |
| enum | TextureMagFilter : int { TEXTUREMINMAGFILTER_LINEAR = 0 , TEXTUREMINMAGFILTER_MIPMAPLINEAR = 1 , TEXTUREMINMAGFILTER_NEAREST = 2 , TEXTUREMINMAGFILTER_CLAMP = 3 } |
Public Member Functions | |
| gTexture () | |
| gTexture (int w, int h, int format=GL_RGBA, bool isFbo=false) | |
| gTexture (const gTexture &other) | |
| gTexture (gTexture &&other) noexcept | |
| gTexture & | operator= (const gTexture &other) |
| gTexture & | operator= (gTexture &&other) noexcept |
| virtual | ~gTexture () |
| virtual unsigned int | load (const std::string &fullPath) |
| unsigned int | loadTexture (const std::string &texturePath) |
| unsigned int | loadMask (const std::string &fullPath) |
| unsigned int | loadMaskTexture (const std::string &maskTexturePath) |
| void | bind () const |
| void | bind (int textureSlotNo) const |
| void | unbind () const |
| unsigned int | getId () const |
| bool | isHDR () const |
| unsigned int | getInternalFormat () const |
| unsigned int | getFormat () const |
| void | setType (TextureType textureType) |
| TextureType | getType () const |
| void | setWrapping (int wrapS, int wrapT) |
| void | setFiltering (int minFilter, int magFilter) |
| int | getWrapS () const |
| int | getWrapT () const |
| int | getFilterMin () const |
| int | getFilterMag () const |
| const std::string & | getTypeName () const |
| const std::string & | getFilename () const |
| const std::string & | getDir () const |
| const std::string & | getFullPath () const |
| int | getWidth () const |
| int | getHeight () const |
| int | getComponentNum () const |
| void | draw (int x, int y) |
| void | draw (int x, int y, int w, int h) |
| void | draw (int x, int y, int w, int h, float rotate) |
| void | draw (int x, int y, int w, int h, int pivotx, int pivoty, float rotate) |
| void | draw (glm::vec2 position, glm::vec2 size, float rotate=0.0f) |
| void | draw (glm::vec2 position, glm::vec2 size, glm::vec2 pivot, float rotate=0.0f) |
| void | drawSub (int x, int y, int sx, int sy, int sw, int sh) |
| void | drawSub (int x, int y, int w, int h, int sx, int sy, int sw, int sh) |
| void | drawSub (int x, int y, int w, int h, int sx, int sy, int sw, int sh, float rotate) |
| void | drawSub (int x, int y, int w, int h, int sx, int sy, int sw, int sh, int pivotx, int pivoty, float rotate) |
| void | drawSub (glm::vec2 pos, glm::vec2 size, glm::vec2 subpos, glm::vec2 subsize, float rotate=0.0f) |
| void | drawSub (glm::vec2 pos, glm::vec2 size, glm::vec2 subpos, glm::vec2 subsize, glm::vec2 pivot, float rotate=0.0f) |
| void | drawSub (const gRect &src, const gRect &dst, float rotate=0.f) |
| void | drawSub (const gRect &src, const gRect &dst, int pivotx, int pivoty, float rotate=0.f) |
| void | drawSub (const gRect &src, const gRect &dst, glm::vec2 pivot, float rotate=0.f) |
| unsigned int | setData (unsigned char *textureData, int width, int height, int componentNum, bool isMutable=false, bool isStbImage=false) |
| unsigned int | setDataHDR (float *textureData, int width, int height, int componentNum, bool isMutable=false, bool isStbImage=false) |
| void | setupRenderData () |
| void | cleanupData () |
| void | cleanupAll () |
| void | save (std::string fullpath) |
| void | saveTexture (std::string fileName) |
| unsigned char * | getData () |
Public Member Functions inherited from gRenderObject | |
| gRenderObject () | |
| int | getScreenWidth () |
| int | getScreenHeight () |
| void | pushMatrix () |
| void | popMatrix () |
Public Member Functions inherited from gObject | |
| gObject () | |
| void | logi (std::string message) |
| void | logd (std::string message) |
| void | logw (std::string message) |
| void | loge (std::string message) |
| void | logi (std::string tag, std::string message) |
| void | logd (std::string tag, std::string message) |
| void | logw (std::string tag, std::string message) |
| void | loge (std::string tag, std::string message) |
Static Public Member Functions | |
| static const std::string & | getTypeName (TextureType textureType) |
Static Public Member Functions inherited from gRenderObject | |
| static void | setScreenSize (int screenWidth, int screenHeight) |
| static void | setUnitScreenSize (int unitWidth, int unitHeight) |
| static void | setScreenScaling (int screenScaling) |
| static void | enableShadowMapping () |
| static void | disableShadowMapping () |
| static bool | isShadowMappingEnabled () |
| static gRenderer * | getRenderer () |
| static void | destroyRenderer () |
| static void | createRenderer () |
Static Public Member Functions inherited from gObject | |
| static std::string | gGetAppDir () |
| static std::string | gGetAssetsDir () |
| static void | gSetAssetsDir (std::string assetsDir) |
| static std::string | gGetFilesDir () |
| static std::string | gGetImagesDir () |
| static std::string | gGetFontsDir () |
| static std::string | gGetModelsDir () |
| static std::string | gGetTexturesDir () |
| static std::string | gGetShadersDir () |
| static std::string | gGetSoundsDir () |
| static std::string | gGetDatabasesDir () |
| static std::string | gGetVideosDir () |
| static void | setCurrentResolution (int scalingNo, int currentResolutionNo) |
Protected Member Functions | |
| void | setDataInternal (unsigned char *textureData, bool isMutable=false, bool isStbImage=false, bool clean=true) |
| void | setDataInternalHDR (float *textureData, bool isMutable=false, bool isStbImage=false, bool clean=true) |
| bool | isMutable () |
| void | swap (gTexture &other) noexcept |
| void | copyFrom (const gTexture &other) noexcept |
| std::string | getDirName (const std::string &fname) |
| std::string | getFileName (const std::string &fname) |
Protected Attributes | |
| std::string | fullpath |
| std::string | directory |
| unsigned int | id |
| unsigned int | internalformat |
| unsigned int | format |
| TextureType | type |
| std::string | path |
| int | width |
| int | height |
| int | componentnum |
| unsigned char * | data |
| bool | ismutable |
| bool | isstbimage |
| int | wraps |
| int | wrapt |
| int | filtermin |
| int | filtermag |
| bool | ishdr |
| float * | datahdr |
| bool | ismaskloaded |
| gTexture * | masktexture |
| bool | istextureallocated |
Additional Inherited Members | |
Static Public Attributes inherited from gObject | |
| static const int | LOGLEVEL_SILENT |
| static const int | LOGLEVEL_DEBUG |
| static const int | LOGLEVEL_INFO |
| static const int | LOGLEVEL_WARNING |
| static const int | LOGLEVEL_ERROR |
Static Protected Attributes inherited from gRenderObject | |
| static bool | isshadowmappingenabled |
Static Protected Attributes inherited from gObject | |
| static int | renderpassnum |
| static int | renderpassno |
| static int | releasescaling |
| static int | releaseresolution |
| enum gTexture::TextureMagFilter : int |
| enum gTexture::TextureType : int |
| enum gTexture::TextureWrap : int |
| gTexture::gTexture | ( | ) |
| gTexture::gTexture | ( | int | w, |
| int | h, | ||
| int | format = GL_RGBA, |
||
| bool | isFbo = false |
||
| ) |
| gTexture::gTexture | ( | const gTexture & | other | ) |
|
noexcept |
|
virtual |
| void gTexture::bind | ( | ) | const |
| void gTexture::bind | ( | int | textureSlotNo | ) | const |
| void gTexture::cleanupAll | ( | ) |
| void gTexture::cleanupData | ( | ) |
|
protectednoexcept |
| void gTexture::draw | ( | glm::vec2 | position, |
| glm::vec2 | size, | ||
| float | rotate = 0.0f |
||
| ) |
| void gTexture::draw | ( | glm::vec2 | position, |
| glm::vec2 | size, | ||
| glm::vec2 | pivot, | ||
| float | rotate = 0.0f |
||
| ) |
| void gTexture::draw | ( | int | x, |
| int | y | ||
| ) |
| void gTexture::draw | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h | ||
| ) |
| void gTexture::draw | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h, | ||
| float | rotate | ||
| ) |
| void gTexture::draw | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h, | ||
| int | pivotx, | ||
| int | pivoty, | ||
| float | rotate | ||
| ) |
| void gTexture::drawSub | ( | const gRect & | src, |
| const gRect & | dst, | ||
| glm::vec2 | pivot, | ||
| float | rotate = 0.f |
||
| ) |
| void gTexture::drawSub | ( | const gRect & | src, |
| const gRect & | dst, | ||
| int | pivotx, | ||
| int | pivoty, | ||
| float | rotate = 0.f |
||
| ) |
| void gTexture::drawSub | ( | glm::vec2 | pos, |
| glm::vec2 | size, | ||
| glm::vec2 | subpos, | ||
| glm::vec2 | subsize, | ||
| float | rotate = 0.0f |
||
| ) |
| void gTexture::drawSub | ( | glm::vec2 | pos, |
| glm::vec2 | size, | ||
| glm::vec2 | subpos, | ||
| glm::vec2 | subsize, | ||
| glm::vec2 | pivot, | ||
| float | rotate = 0.0f |
||
| ) |
| void gTexture::drawSub | ( | int | x, |
| int | y, | ||
| int | sx, | ||
| int | sy, | ||
| int | sw, | ||
| int | sh | ||
| ) |
| void gTexture::drawSub | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h, | ||
| int | sx, | ||
| int | sy, | ||
| int | sw, | ||
| int | sh | ||
| ) |
| void gTexture::drawSub | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h, | ||
| int | sx, | ||
| int | sy, | ||
| int | sw, | ||
| int | sh, | ||
| float | rotate | ||
| ) |
| void gTexture::drawSub | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h, | ||
| int | sx, | ||
| int | sy, | ||
| int | sw, | ||
| int | sh, | ||
| int | pivotx, | ||
| int | pivoty, | ||
| float | rotate | ||
| ) |
| int gTexture::getComponentNum | ( | ) | const |
| unsigned char * gTexture::getData | ( | ) |
| const std::string & gTexture::getDir | ( | ) | const |
|
protected |
| const std::string & gTexture::getFilename | ( | ) | const |
|
protected |
| int gTexture::getFilterMag | ( | ) | const |
| int gTexture::getFilterMin | ( | ) | const |
| unsigned int gTexture::getFormat | ( | ) | const |
| const std::string & gTexture::getFullPath | ( | ) | const |
| int gTexture::getHeight | ( | ) | const |
| unsigned int gTexture::getId | ( | ) | const |
| unsigned int gTexture::getInternalFormat | ( | ) | const |
| TextureType gTexture::getType | ( | ) | const |
| const std::string & gTexture::getTypeName | ( | ) | const |
|
static |
| int gTexture::getWidth | ( | ) | const |
| int gTexture::getWrapS | ( | ) | const |
| int gTexture::getWrapT | ( | ) | const |
| bool gTexture::isHDR | ( | ) | const |
|
protected |
|
virtual |
Reimplemented in gImage.
| unsigned int gTexture::loadMask | ( | const std::string & | fullPath | ) |
Loads the mask texture/image to be applied to this instance.
It requires full path of the texture/image file.
The texture/image might be stored anywhere on the hard disk or other storage devices out of the project folder.
| fullPath | The full path to the image or texture file. It should contain the full path of the folder where the image is located, the name of the image and its extension. It is case sensitive. |
| unsigned int gTexture::loadMaskTexture | ( | const std::string & | maskTexturePath | ) |
Loads the mask texture/image to be applied to this instance.
It requires the name of the texture/image file (ex: "mask.png").
The image might be stored anywhere on the hard disk or other storage devices out of the project folder.
Project's default folder for masks is ProjectLocation/assets/textures directory.
| maskTexturePath | The fullname of the texture/image stored under project's images folder. maskTexturePath should contain texture/image name and its extension. It is case sensitive. |
| unsigned int gTexture::loadTexture | ( | const std::string & | texturePath | ) |
| void gTexture::save | ( | std::string | fullpath | ) |
| void gTexture::saveTexture | ( | std::string | fileName | ) |
| unsigned int gTexture::setData | ( | unsigned char * | textureData, |
| int | width, | ||
| int | height, | ||
| int | componentNum, | ||
| bool | isMutable = false, |
||
| bool | isStbImage = false |
||
| ) |
| unsigned int gTexture::setDataHDR | ( | float * | textureData, |
| int | width, | ||
| int | height, | ||
| int | componentNum, | ||
| bool | isMutable = false, |
||
| bool | isStbImage = false |
||
| ) |
|
protected |
|
protected |
| void gTexture::setFiltering | ( | int | minFilter, |
| int | magFilter | ||
| ) |
| void gTexture::setType | ( | TextureType | textureType | ) |
| void gTexture::setupRenderData | ( | ) |
| void gTexture::setWrapping | ( | int | wrapS, |
| int | wrapT | ||
| ) |
|
protectednoexcept |
| void gTexture::unbind | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |