Supermodel/Src/Graphics/New3D/Texture.h

43 lines
1.1 KiB
C
Raw Normal View History

#ifndef _TEXTURE_H_
#define _TEXTURE_H_
#include "Types.h"
2020-07-31 19:18:51 +00:00
#include <GL/glew.h>
namespace New3D {
class Texture
{
public:
Texture();
~Texture();
UINT32 UploadTexture (const UINT16* src, UINT8* scratch, int format, int x, int y, int width, int height);
void DeleteTexture ();
void BindTexture ();
void GetCoordinates (UINT16 uIn, UINT16 vIn, float uvScale, float& uOut, float& vOut);
void GetDetails (int& x, int&y, int& width, int& height, int& format);
2016-06-10 11:29:20 +00:00
bool Compare (int x, int y, int width, int height, int format);
bool CheckMapPos (int ax1, int ax2, int ay1, int ay2); //check to see if textures overlap
static void GetCoordinates(int width, int height, UINT16 uIn, UINT16 vIn, float uvScale, float& uOut, float& vOut);
private:
void CreateTextureObject(int format, int x, int y, int width, int height);
void UploadTextureMip(int level, const UINT16* src, UINT8* scratch, int format, int x, int y, int width, int height);
void Reset();
int m_x;
int m_y;
int m_width;
int m_height;
int m_format;
GLuint m_textureID;
};
} // New3D
#endif