15 #define OSG_BLENDFUNC 1
17 #include <osg/StateAttribute>
19 #ifndef GL_VERSION_1_2
20 #define GL_CONSTANT_COLOR 0x8001
21 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
22 #define GL_CONSTANT_ALPHA 0x8003
23 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
24 #define GL_BLEND_COLOR 0x8005
27 #ifndef GL_VERSION_1_4
28 #define GL_BLEND_DST_RGB 0x80C8
29 #define GL_BLEND_SRC_RGB 0x80C9
30 #define GL_BLEND_DST_ALPHA 0x80CA
31 #define GL_BLEND_SRC_ALPHA 0x80CB
71 BlendFunc(GLenum source, GLenum destination);
72 BlendFunc(GLenum source, GLenum destination, GLenum source_alpha, GLenum destination_alpha);
77 _source_factor(trans._source_factor),
78 _destination_factor(trans._destination_factor),
79 _source_factor_alpha(trans._source_factor_alpha),
80 _destination_factor_alpha(trans._destination_factor_alpha) {}
107 DST_ALPHA = GL_DST_ALPHA,
108 DST_COLOR = GL_DST_COLOR,
110 ONE_MINUS_DST_ALPHA = GL_ONE_MINUS_DST_ALPHA,
111 ONE_MINUS_DST_COLOR = GL_ONE_MINUS_DST_COLOR,
112 ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA,
113 ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR,
114 SRC_ALPHA = GL_SRC_ALPHA,
115 SRC_ALPHA_SATURATE = GL_SRC_ALPHA_SATURATE,
116 SRC_COLOR = GL_SRC_COLOR,
126 _source_factor = source;
127 _destination_factor = destination;
128 _source_factor_alpha = source;
129 _destination_factor_alpha = destination;
132 inline void setFunction( GLenum source_rgb, GLenum destination_rgb, GLenum source_alpha, GLenum destination_alpha )
134 _source_factor = source_rgb;
135 _destination_factor = destination_rgb;
136 _source_factor_alpha = source_alpha;
137 _destination_factor_alpha = destination_alpha;
140 void setSource(GLenum source) { _source_factor = _source_factor_alpha = source; }
141 inline GLenum
getSource()
const {
return _source_factor; }
149 void setDestination(GLenum destination) { _destination_factor = _destination_factor_alpha = destination; }
158 virtual void apply(
State& state)
const;
void setSourceAlpha(GLenum source)
#define GL_ONE_MINUS_CONSTANT_COLOR
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
#define GL_CONSTANT_COLOR
virtual bool getModeUsage(StateAttribute::ModeUsage &usage) const
#define GL_ONE_MINUS_CONSTANT_ALPHA
void setSource(GLenum source)
virtual void usesMode(GLMode mode)=0
#define GL_CONSTANT_ALPHA
void setDestinationAlpha(GLenum destination)
void setFunction(GLenum source_rgb, GLenum destination_rgb, GLenum source_alpha, GLenum destination_alpha)
void setDestinationRGB(GLenum destination)
GLenum getSourceRGB() const
GLenum _destination_factor_alpha
GLenum _source_factor_alpha
void setDestination(GLenum destination)
GLenum _destination_factor
BlendFunc(const BlendFunc &trans, const CopyOp ©op=CopyOp::SHALLOW_COPY)
virtual int compare(const StateAttribute &sa) const
#define META_StateAttribute(library, name, type)
void setSourceRGB(GLenum source)
void setFunction(GLenum source, GLenum destination)
GLenum getDestinationAlpha() const
#define COMPARE_StateAttribute_Parameter(parameter)
GLenum getDestination() const
GLenum getDestinationRGB() const
GLenum getSourceAlpha() const