50 lines
1.0 KiB
C++
50 lines
1.0 KiB
C++
#ifndef TEXTURE2D_H
|
|
#define TEXTURE2D_H
|
|
|
|
#include <string>
|
|
|
|
#include "render/render_shared.h"
|
|
|
|
class TexturesManager;
|
|
|
|
class Texture2D
|
|
{
|
|
friend class TexturesManager;
|
|
public:
|
|
static Texture2D* Create();
|
|
|
|
public:
|
|
Texture2D();
|
|
~Texture2D();
|
|
|
|
void CreateBlackTexture(int width, int height, int channels);
|
|
void CreateWhiteTexture(int width, int height, int channels);
|
|
void CreateGrayTexture(int width, int height, int channels);
|
|
void CreateTexture_Generator(int width, int height, int channels, int color);
|
|
void CreateFromExistedData(void* data, int width, int height, int channels);
|
|
void CreateFromFile(const char* filename);
|
|
|
|
void CreateRaw(void* data, int width, int height, PixelFormat pf);
|
|
|
|
void GenerateMipmaps();
|
|
|
|
void Bind();
|
|
|
|
void SetWrapS(TextureWrap wrap);
|
|
void SetWrapT(TextureWrap wrap);
|
|
void SetMin(TextureFilter filter);
|
|
void SetMag(TextureFilter filter);
|
|
|
|
uint GetHandle() { return m_handle; }
|
|
|
|
private:
|
|
std::string m_textureFileName;
|
|
PixelFormat m_pf;
|
|
int m_width;
|
|
int m_height;
|
|
int m_channels;
|
|
uint m_handle;
|
|
};
|
|
|
|
#endif // !TEXTURE2D_H
|