Welcome to mirror list, hosted at ThFree Co, Russian Federation.

BL_Texture.h « Ketsji « gameengine « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 51bf7270d2d77372a1b3c95b80a279b147b760ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef __BL_TEXTURE_H__
#define __BL_TEXTURE_H__
#include <vector>
// --
struct Image;
struct EnvMap;
// --
#include "STR_String.h"

class BL_Texture
{
private:
	// -----------------------------------
	unsigned int*		mTexture;
	bool				mError;
	bool				mOk;
	bool				mNeedsDeleted;
	unsigned int		mType;
	STR_String			mName;
	static unsigned int mBlankTexture;
	std::vector<EnvMap*>mCubeMem;
	// -----------------------------------
	void InitNonPow2Tex(unsigned int *p,int x,int y,bool mipmap );
	void InitGLTex(unsigned int *p,int x,int y,bool mipmap );

public:
	BL_Texture();
	~BL_Texture( );
	
	operator const unsigned int () const;
	bool Ok();

	STR_String GetName() const;

	unsigned int GetTextureType() const;
	void	DeleteTex();
	bool	InitFromImage( Image *img, bool mipmap);
	bool	InitCubeMap( EnvMap *cubemap );
	// 
	bool	SetGLTex(unsigned int tex);

	void	PopCubeMap();
	bool	IsValid();
	void	Validate();
};

enum TexType{
	BL_TEX2D	= 1,
	BL_TEXCUBE	= 2
};


#endif//__BL_TEXTURE_H__