2016-03-21 04:10:14 +00:00
|
|
|
#ifndef _TEXTURE_H_
|
|
|
|
#define _TEXTURE_H_
|
|
|
|
|
|
|
|
#include "Types.h"
|
|
|
|
#include "Pkgs/glew.h" //arg
|
|
|
|
|
|
|
|
namespace New3D {
|
|
|
|
|
|
|
|
class Texture
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
Texture();
|
|
|
|
~Texture();
|
|
|
|
|
2018-10-13 13:29:45 +00:00
|
|
|
UINT32 UploadTexture (const UINT16* src, UINT8* scratch, int format, int x, int y, int width, int height);
|
2016-03-21 04:10:14 +00:00
|
|
|
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);
|
2016-11-22 20:30:10 +00:00
|
|
|
bool CheckMapPos (int ax1, int ax2, int ay1, int ay2); //check to see if textures overlap
|
2016-03-21 04:10:14 +00:00
|
|
|
|
2016-03-26 22:44:26 +00:00
|
|
|
static void GetCoordinates(int width, int height, UINT16 uIn, UINT16 vIn, float uvScale, float& uOut, float& vOut);
|
|
|
|
|
2016-03-21 04:10:14 +00:00
|
|
|
private:
|
|
|
|
|
2018-10-13 13:29:45 +00:00
|
|
|
void CreateTextureObject(int format, int x, int y, int width, int height);
|
2017-03-24 13:38:20 +00:00
|
|
|
void UploadTextureMip(int level, const UINT16* src, UINT8* scratch, int format, int x, int y, int width, int height);
|
2016-03-21 04:10:14 +00:00
|
|
|
void Reset();
|
|
|
|
|
|
|
|
int m_x;
|
|
|
|
int m_y;
|
|
|
|
int m_width;
|
|
|
|
int m_height;
|
|
|
|
int m_format;
|
|
|
|
GLuint m_textureID;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // New3D
|
|
|
|
|
|
|
|
#endif
|