This object is used to store information regarding a texture. NOTE: Only the resource manager is allowed to create this object.
More...
#include <Texture.hpp>
|
| glm::vec4 | mainColor = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f) |
| | The color of this texture. More...
|
| |
|
| | Texture (const eastl::string &filename, int desiredChannels=4) |
| | Creates a texture by loading the data from a texture file. This method used stb_image to load the image. More...
|
| |
This object is used to store information regarding a texture. NOTE: Only the resource manager is allowed to create this object.
Definition at line 23 of file Texture.hpp.
| Engine::Texture::~Texture |
( |
| ) |
|
|
virtual |
Destructor of texture object.
Definition at line 13 of file Texture.cpp.
| Engine::Texture::Texture |
( |
const eastl::string & |
filename, |
|
|
int |
desiredChannels = 4 |
|
) |
| |
|
explicitprotected |
Creates a texture by loading the data from a texture file. This method used stb_image to load the image.
- Parameters
-
| filename | This is the name of the texture you want to load. NOTE: The texture needs to be in the folder 'Resources/Textures/' (It can be in a subfolder, as long as it's in the Textures folder). And the extension type needs to be added as well. |
| desiredChannels | The amount of desired channels for this texture. This value is 4 by default. |
Definition at line 5 of file Texture.cpp.
This method allows you to create a texture from RGBA provided data.
- Parameters
-
| data | The data of this texture. |
| genMipMaps | This bool defines if this texture should generate mip maps. |
| bytes | The number of bytes per color. Default is 1 (single char) |
| storage | Used by Vulkan only. Defines if you want to use VK_IMAGE_USAGE_STORAGE_BIT or VK_IMAGE_USAGE_SAMPLED_BIT. |
Definition at line 27 of file Texture.cpp.
| eastl::string Engine::Texture::GetFileName |
( |
| ) |
const |
This method allows you to retrieve the name of this texture.
- Returns
- Returns the name of this texture as a std::string.
Definition at line 22 of file Texture.cpp.
| int Engine::Texture::getHeight |
( |
| ) |
const |
|
inline |
This method allows you to get the height of this texture.
- Returns
- Returns the height of this texture as an int.
Definition at line 85 of file Texture.hpp.
| uint64_t Engine::Texture::GetTexture |
( |
| ) |
const |
This method allows you to get the texture number assigned by the graphics API.
Get the texture ID in OpenGL
- Returns
- Returns the texture number as un uint64_t.
Definition at line 17 of file Texture.cpp.
| int Engine::Texture::getWidth |
( |
| ) |
const |
|
inline |
temp for vulkan
This method allows you to get the width of this texture.
- Returns
- Returns the width of this texture as an int.
Definition at line 80 of file Texture.hpp.
| bool Engine::Texture::operator!= |
( |
const Texture & |
texture | ) |
|
This method allows you to compare a texture against another texture.
- Parameters
-
| texture | The texture you want to compare against. |
- Returns
- Returns true if the textures are not equal to each other otherwise it returns false.
Definition at line 43 of file Texture.cpp.
| bool Engine::Texture::operator== |
( |
const Texture & |
texture | ) |
|
This method allows you to compare a texture against another texture.
- Parameters
-
| texture | The texture you want to compare against. |
- Returns
- Returns true if both textures are equal to each other otherwise it returns false.
Definition at line 31 of file Texture.cpp.
| int Engine::Texture::channels = 0 |
|
protected |
| eastl::string Engine::Texture::fileName |
|
protected |
| int Engine::Texture::height = 0 |
|
protected |
| glm::vec4 Engine::Texture::mainColor = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f) |
The color of this texture.
Definition at line 72 of file Texture.hpp.
| uint64_t Engine::Texture::texture = 0 |
|
protected |
| int Engine::Texture::width = 0 |
|
protected |
The documentation for this class was generated from the following files: