Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
Texture.cpp
Go to the documentation of this file.
2 
3 namespace Engine
4 {
5  Texture::Texture(const eastl::string& filename, int desiredChannels) : fileName(filename), dataSize()
6  {
7  }
8 
9  Texture::Texture(int width, int height) : dataSize(), texture(0), width(width), height(height)
10  {
11  }
12 
14  {
15  }
16 
17  uint64_t Texture::GetTexture() const
18  {
19  return texture;
20  }
21 
22  eastl::string Texture::GetFileName() const
23  {
24  return fileName;
25  }
26 
27  void Texture::CreateTextureWithData(stbi_uc* data, bool genMipMaps, TextureDataSize bytes, bool storage)
28  {
29  }
30 
32  {
33  if (mainColor != texture.mainColor) return false;
34  if (width != texture.width) return false;
35  if (height != texture.height) return false;
36  if (channels != texture.channels) return false;
37  if (this->texture != texture.texture) return false;
38  if (fileName != texture.fileName) return false;
39 
40  return false;
41  }
42 
44  {
45  if (mainColor != texture.mainColor) return true;
46  if (width != texture.width) return true;
47  if (height != texture.height) return true;
48  if (channels != texture.channels) return true;
49  if (this->texture != texture.texture) return true;
50  if (fileName != texture.fileName) return true;
51 
52  return false;
53  }
54 } //namespace Engine
This object is used to store information regarding a texture. NOTE: Only the resource manager is allo...
Definition: Texture.hpp:23
TextureDataSize dataSize
Definition: Texture.hpp:102
virtual void CreateTextureWithData(stbi_uc *data, bool genMipMaps, TextureDataSize bytes=TextureDataSize::U_CHAR, bool storage=false)
This method allows you to create a texture from RGBA provided data.
Definition: Texture.cpp:27
eastl::string fileName
Definition: Texture.hpp:101
bool operator==(const Texture &texture)
This method allows you to compare a texture against another texture.
Definition: Texture.cpp:31
bool operator!=(const Texture &texture)
This method allows you to compare a texture against another texture.
Definition: Texture.cpp:43
uint64_t texture
Definition: Texture.hpp:103
TextureDataSize
Definition: Texture.hpp:11
glm::vec4 mainColor
The color of this texture.
Definition: Texture.hpp:72
eastl::string GetFileName() const
This method allows you to retrieve the name of this texture.
Definition: Texture.cpp:22
virtual ~Texture()
Destructor of texture object.
Definition: Texture.cpp:13
uint64_t GetTexture() const
This method allows you to get the texture number assigned by the graphics API.
Definition: Texture.cpp:17