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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErwin Coumans <blender@erwincoumans.com>2006-02-13 08:45:32 +0300
committerErwin Coumans <blender@erwincoumans.com>2006-02-13 08:45:32 +0300
commite4790aef46f7ca0b4ab01c34f043be9e7b1fa7f1 (patch)
tree0d83145e454cc7b5947ec657dbd9e415aac9d809 /source/gameengine/Ketsji/BL_Texture.h
parent6c325d74f534d259820c2b2d94d5b73b3acf0a35 (diff)
Improved OpenGL Shader Language support for game engine. The python interface is much simplified. Drawback is that scripts need to be updated next release. Testfiles:
http://www.continuousphysics.com/ftp/pub/test/index.php?dir=blender/&file=demos-2.42.zip patch by Charlie Carley (snailrose @ elysiun.com)
Diffstat (limited to 'source/gameengine/Ketsji/BL_Texture.h')
-rw-r--r--source/gameengine/Ketsji/BL_Texture.h62
1 files changed, 45 insertions, 17 deletions
diff --git a/source/gameengine/Ketsji/BL_Texture.h b/source/gameengine/Ketsji/BL_Texture.h
index 51bf7270d2d..2df14580e65 100644
--- a/source/gameengine/Ketsji/BL_Texture.h
+++ b/source/gameengine/Ketsji/BL_Texture.h
@@ -1,9 +1,20 @@
#ifndef __BL_TEXTURE_H__
#define __BL_TEXTURE_H__
+
#include <vector>
+#include <map>
+
+#include "MT_Matrix4x4.h"
+#include "KX_Camera.h"
+
// --
struct Image;
struct EnvMap;
+class BL_Material;
+class RTData;
+class RAS_Rect;
+class RAS_ICanvas;
+
// --
#include "STR_String.h"
@@ -11,14 +22,13 @@ class BL_Texture
{
private:
// -----------------------------------
- unsigned int* mTexture;
+ unsigned int mTexture;
bool mError;
bool mOk;
bool mNeedsDeleted;
unsigned int mType;
STR_String mName;
- static unsigned int mBlankTexture;
- std::vector<EnvMap*>mCubeMem;
+ int mUnit;
// -----------------------------------
void InitNonPow2Tex(unsigned int *p,int x,int y,bool mipmap );
void InitGLTex(unsigned int *p,int x,int y,bool mipmap );
@@ -27,27 +37,45 @@ public:
BL_Texture();
~BL_Texture( );
- operator const unsigned int () const;
+ //operator const unsigned int () const;
bool Ok();
+ int GetUnit() {return mUnit;}
+ void SetUnit(int unit) {mUnit = unit;}
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();
-};
+ void DeleteTex();
-enum TexType{
- BL_TEX2D = 1,
- BL_TEXCUBE = 2
+ bool InitFromImage(int unit, Image *img, bool mipmap);
+ bool InitCubeMap(int unit,EnvMap *cubemap );
+
+ bool IsValid();
+ void Validate();
+
+ static void ActivateFirst();
+ static void DisableAllTextures();
+ static void ActivateUnit(int unit);
+ static int GetMaxUnits();
+ static int GetPow2(int x);
+
+ /** todo
+ void CreateRenderTexture(RAS_Rect r, RTData d);
+ void ReadDepth(RAS_Rect r, RTData d);
+ static void BeginDepth(RAS_ICanvas *can, RTData d);
+ static void EndDepth(RAS_ICanvas *can,RTData d);
+ void SetDepthMapping(MT_Matrix4x4& p, MT_Matrix4x4& m);
+ */
+
+ void ActivateTexture();
+ void SetMapping(int mode);
+ void DisableUnit();
+ void setTexEnv(BL_Material *mat, bool modulate=false);
};
+/* Render to texture support, managed by the scene
+ TODO
+*/
+
#endif//__BL_TEXTURE_H__