1 #pragma once
2 
3 #include "texturelib.h"
4 #include "ishaderlayer.h"
5 
6 class IShader
7 {
8 	public:
9 
10 		enum EAlphaFunc
11 		{
12 			eAlways, eEqual, eLess, eGreater, eLEqual, eGEqual
13 		};
14 
15 		enum ECull
16 		{
17 			eCullNone, eCullBack
18 		};
19 
~IShader()20 		virtual ~IShader ()
21 		{
22 		}
23 
24 		/**
25 		 * Increment the number of references to this object
26 		 */
27 		virtual void IncRef () = 0;
28 
29 		/**
30 		 * Decrement the reference count
31 		 */
32 		virtual void DecRef () = 0;
33 
34 		/**
35 		 * get the texture pointer Radiant uses to represent this shader object
36 		 */
37 		virtual GLTexture* getTexture () const = 0;
38 
39 		/**
40 		 * get shader name
41 		 */
42 		virtual const std::string& getName () const = 0;
43 
44 		virtual bool isInUse () const = 0;
45 
46 		virtual void setInUse (bool inUse) = 0;
47 
48 		virtual bool isValid () const = 0;
49 
50 		virtual void setIsValid (bool isValid) = 0;
51 
52 		/**
53 		 * get the editor flags (QER_TRANS)
54 		 */
55 		virtual int getFlags () const = 0;
56 
57 		/**
58 		 * get the transparency value
59 		 */
60 		virtual float getTrans () const = 0;
61 
62 		/**
63 		 * test if it's a true shader, or a default shader created to wrap around a texture
64 		 */
65 		virtual bool isDefault () const = 0;
66 
67 		/**
68 		 * get the alphaFunc
69 		 */
70 		virtual void getAlphaFunc (EAlphaFunc *func, float* ref) = 0;
71 
72 		virtual BlendFunc getBlendFunc () const = 0;
73 
74 		virtual bool hasLayers() const = 0;
75 
76 		virtual void forEachLayer(const ShaderLayerCallback& layer) const = 0;
77 
78 		/**
79 		 * \brief
80 		 * Return a polygon offset if one is defined. The default is 0.
81 		 */
82 		float getPolygonOffset () const;
83 
84 		/**
85 		 * get the cull type
86 		 */
87 		virtual ECull getCull () = 0;
88 };
89