Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Engine
Texture
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
23
class
ENGINE_API
Texture
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
;
102
TextureDataSize
dataSize
;
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
Engine::Texture
This object is used to store information regarding a texture. NOTE: Only the resource manager is allo...
Definition:
Texture.hpp:23
Engine::TextureDataSize::U_SHORT
Engine::Texture::dataSize
TextureDataSize dataSize
Definition:
Texture.hpp:102
Engine::TextureDataSize::U_CHAR
ENGINE_API
#define ENGINE_API
Definition:
api.hpp:25
Engine::TextureDataSize::S_SHORT
Engine::TextureDataSize::S_INT
Engine
Definition:
Skeleton.cpp:15
api.hpp
Engine::ResourceManager
This class is used to create models, load in meshes and textures. NOTE: Only the Engine is allowed to...
Definition:
ResourceManager.hpp:16
Engine::Texture::getHeight
int getHeight() const
This method allows you to get the height of this texture.
Definition:
Texture.hpp:85
Engine::Texture::fileName
eastl::string fileName
Definition:
Texture.hpp:101
Engine::Texture::getWidth
int getWidth() const
temp for vulkan
Definition:
Texture.hpp:80
Engine::TextureDataSize
TextureDataSize
Definition:
Texture.hpp:11
Engine::TextureDataSize::S_CHAR
Engine::Skeleton
Definition:
Skeleton.hpp:17
Engine::TextureDataSize::U_INT
Generated by
1.8.11