Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
Texture.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Engine/api.hpp"
4 #include <ThirdParty/glm/glm/glm.hpp>
5 #include <ThirdParty/stb/stb_image.h>
6 #include <ThirdParty/EASTL-master/include/EASTL/string.h>
7 
8 namespace Engine
9 {
10 
11  enum class TextureDataSize {
12  U_CHAR = 0,
13  S_CHAR,
14  U_SHORT,
15  S_SHORT,
16  U_INT,
17  S_INT
18  };
19 
24  {
25  private:
26  friend class ResourceManager;
27  friend class Skeleton;
28 #ifdef USING_OPENGL
29  friend class OpenGLTexture;
30 #endif
31 #ifdef USING_VULKAN
32  friend class VulkanTexture;
33 #endif
34  Texture(int width, int height);
40 
44  public:
45  virtual ~Texture();
46  public:
52  uint64_t GetTexture() const;
53 
58  eastl::string GetFileName()const;
59 
67  virtual void CreateTextureWithData(stbi_uc* data, bool genMipMaps, TextureDataSize bytes = TextureDataSize::U_CHAR, bool storage = false);
68 
72  glm::vec4 mainColor = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f);
73 
75  //unsigned char* pixelData;
80  int getWidth() const { return width; }
85  int getHeight() const { return height; }
86 
92  bool operator==(const Texture& texture);
98  bool operator!=(const Texture& texture);
99  protected:
100 
101  eastl::string fileName;
103  uint64_t texture = 0;
104  int width = 0;
105  int height = 0;
106  int channels = 0;
107 
113  explicit Texture(const eastl::string& filename, int desiredChannels = 4);
114  };
115 } //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
#define ENGINE_API
Definition: api.hpp:25
This class is used to create models, load in meshes and textures. NOTE: Only the Engine is allowed to...
int getHeight() const
This method allows you to get the height of this texture.
Definition: Texture.hpp:85
eastl::string fileName
Definition: Texture.hpp:101
int getWidth() const
temp for vulkan
Definition: Texture.hpp:80
TextureDataSize
Definition: Texture.hpp:11