ishader.h
Go to the documentation of this file.00001 #ifndef ISHADER_H_
00002 #define ISHADER_H_
00003
00004 #include "texturelib.h"
00005
00006 typedef unsigned char BlendFactor;
00007 const BlendFactor BLEND_ZERO = 0;
00008 const BlendFactor BLEND_ONE = 1;
00009 const BlendFactor BLEND_SRC_COLOUR = 2;
00010 const BlendFactor BLEND_ONE_MINUS_SRC_COLOUR = 3;
00011 const BlendFactor BLEND_SRC_ALPHA = 4;
00012 const BlendFactor BLEND_ONE_MINUS_SRC_ALPHA = 5;
00013 const BlendFactor BLEND_DST_COLOUR = 6;
00014 const BlendFactor BLEND_ONE_MINUS_DST_COLOUR = 7;
00015 const BlendFactor BLEND_DST_ALPHA = 8;
00016 const BlendFactor BLEND_ONE_MINUS_DST_ALPHA = 9;
00017 const BlendFactor BLEND_SRC_ALPHA_SATURATE = 10;
00018
00019 class BlendFunc
00020 {
00021 public:
00022 BlendFunc (BlendFactor src, BlendFactor dst) :
00023 m_src(src), m_dst(dst)
00024 {
00025 }
00026 BlendFactor m_src;
00027 BlendFactor m_dst;
00028 };
00029
00030 class IShader
00031 {
00032 public:
00033
00034 enum EAlphaFunc
00035 {
00036 eAlways, eEqual, eLess, eGreater, eLEqual, eGEqual,
00037 };
00038
00039 enum ECull
00040 {
00041 eCullNone, eCullBack,
00042 };
00043
00044 virtual ~IShader ()
00045 {
00046 }
00047
00051 virtual void IncRef () = 0;
00052
00056 virtual void DecRef () = 0;
00057
00061 virtual qtexture_t* getTexture () const = 0;
00062
00066 virtual const char* getName () const = 0;
00067
00068 virtual bool IsInUse () const = 0;
00069
00070 virtual void SetInUse (bool bInUse) = 0;
00071
00075 virtual int getFlags () const = 0;
00076
00080 virtual float getTrans () const = 0;
00081
00085 virtual bool IsDefault () const = 0;
00086
00090 virtual void getAlphaFunc (EAlphaFunc *func, float *ref) = 0;
00091
00092 virtual BlendFunc getBlendFunc () const = 0;
00093
00097 virtual ECull getCull () = 0;
00098 };
00099
00100 #endif