❖
Monad Engine
da02fba2
>
Undercity Codex
_
Loading...
Searching...
No Matches
Texture.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <GL/glew.h>
4
#include <memory>
5
#include <string>
6
#include <unordered_map>
7
8
namespace
eng
9
{
10
class
Texture
11
{
12
public
:
13
Texture
(
int
width,
int
height,
int
numChannels,
unsigned
char
* data);
14
~Texture
();
15
GLuint
GetID
()
const
;
16
void
Init
(
int
width,
int
height,
int
numChannels,
unsigned
char
* data);
17
18
static
std::shared_ptr<Texture>
Load
(
const
std::string& path);
19
20
private
:
21
int
m_width = 0;
22
int
m_height = 0;
23
int
m_numChannels = 0;
24
GLuint
m_textureID = 0;
25
};
26
27
class
TextureManager
28
{
29
public
:
30
std::shared_ptr<Texture>
GetOrLoadTexture
(
const
std::string& path);
31
32
private
:
33
std::unordered_map<std::string, std::shared_ptr<Texture>> m_textures;
34
};
35
}
GLuint
unsigned int GLuint
Definition
GLForward.h:11
eng::TextureManager
Definition
Texture.h:28
eng::TextureManager::GetOrLoadTexture
std::shared_ptr< Texture > GetOrLoadTexture(const std::string &path)
Definition
Texture.cpp:78
eng::Texture
Definition
Texture.h:11
eng::Texture::GetID
GLuint GetID() const
Definition
Texture.cpp:23
eng::Texture::~Texture
~Texture()
Definition
Texture.cpp:15
eng::Texture::Load
static std::shared_ptr< Texture > Load(const std::string &path)
Definition
Texture.cpp:53
eng::Texture::Init
void Init(int width, int height, int numChannels, unsigned char *data)
Definition
Texture.cpp:28
eng
Definition
Application.cpp:4
docs
GD-Engine-lesson-5-2
engine
source
graphics
Texture.h
Generated by
1.9.8