Added default values to the TexEnvCombine constructor.

This commit is contained in:
Robert Osfield 2002-08-19 19:53:34 +00:00
parent 41db2e08d0
commit 7a0f041a15
2 changed files with 60 additions and 45 deletions

View File

@ -113,11 +113,11 @@ class SG_EXPORT TexEnvCombine : public StateAttribute
SUBTRACT = GL_SUBTRACT_ARB SUBTRACT = GL_SUBTRACT_ARB
}; };
void setCombineRGB(CombineParam cm) { _combine_RGB = cm; } void setCombineRGB(GLint cm) { _combine_RGB = cm; }
void setCombineAlpha(CombineParam cm) { _combine_Alpha = cm; } void setCombineAlpha(GLint cm) { _combine_Alpha = cm; }
CombineParam getCombineRGB() const { return _combine_RGB; } GLint getCombineRGB() const { return _combine_RGB; }
CombineParam getCombineAlpha() const { return _combine_Alpha; } GLint getCombineAlpha() const { return _combine_Alpha; }
enum SourceParam enum SourceParam
{ {
@ -127,21 +127,21 @@ class SG_EXPORT TexEnvCombine : public StateAttribute
PREVIOUS = GL_PREVIOUS_ARB PREVIOUS = GL_PREVIOUS_ARB
}; };
void setSource0_RGB(SourceParam sp) { _source0_RGB = sp; } void setSource0_RGB(GLint sp) { _source0_RGB = sp; }
void setSource1_RGB(SourceParam sp) { _source1_RGB = sp; } void setSource1_RGB(GLint sp) { _source1_RGB = sp; }
void setSource2_RGB(SourceParam sp) { _source2_RGB = sp; } void setSource2_RGB(GLint sp) { _source2_RGB = sp; }
void setSource0_Alpha(SourceParam sp) { _source0_Alpha = sp; } void setSource0_Alpha(GLint sp) { _source0_Alpha = sp; }
void setSource1_Alpha(SourceParam sp) { _source1_Alpha = sp; } void setSource1_Alpha(GLint sp) { _source1_Alpha = sp; }
void setSource2_Alpha(SourceParam sp) { _source2_Alpha = sp; } void setSource2_Alpha(GLint sp) { _source2_Alpha = sp; }
SourceParam getSource0_RGB() const { return _source0_RGB; } GLint getSource0_RGB() const { return _source0_RGB; }
SourceParam getSource1_RGB() const { return _source1_RGB; } GLint getSource1_RGB() const { return _source1_RGB; }
SourceParam getSource2_RGB() const { return _source2_RGB; } GLint getSource2_RGB() const { return _source2_RGB; }
SourceParam getSource0_Alpha() const { return _source0_Alpha; } GLint getSource0_Alpha() const { return _source0_Alpha; }
SourceParam getSource1_Alpha() const { return _source1_Alpha; } GLint getSource1_Alpha() const { return _source1_Alpha; }
SourceParam getSource2_Alpha() const { return _source2_Alpha; } GLint getSource2_Alpha() const { return _source2_Alpha; }
enum OperandParam enum OperandParam
{ {
@ -151,21 +151,21 @@ class SG_EXPORT TexEnvCombine : public StateAttribute
ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA
}; };
void setOperand0_RGB(OperandParam op) { _operand0_RGB = op; } void setOperand0_RGB(GLint op) { _operand0_RGB = op; }
void setOperand1_RGB(OperandParam op) { _operand1_RGB = op; } void setOperand1_RGB(GLint op) { _operand1_RGB = op; }
void setOperand2_RGB(OperandParam op) { _operand2_RGB = op; } void setOperand2_RGB(GLint op) { _operand2_RGB = op; }
void setOperand0_Alpha(OperandParam op) { _operand0_Alpha = op; } void setOperand0_Alpha(GLint op) { _operand0_Alpha = op; }
void setOperand1_Alpha(OperandParam op) { _operand1_Alpha = op; } void setOperand1_Alpha(GLint op) { _operand1_Alpha = op; }
void setOperand2_Alpha(OperandParam op) { _operand2_Alpha = op; } void setOperand2_Alpha(GLint op) { _operand2_Alpha = op; }
OperandParam getOperand0_RGB() const { return _operand0_RGB; } GLint getOperand0_RGB() const { return _operand0_RGB; }
OperandParam getOperand1_RGB() const { return _operand1_RGB; } GLint getOperand1_RGB() const { return _operand1_RGB; }
OperandParam getOperand2_RGB() const { return _operand2_RGB; } GLint getOperand2_RGB() const { return _operand2_RGB; }
OperandParam getOperand0_Alpha() const { return _operand0_Alpha; } GLint getOperand0_Alpha() const { return _operand0_Alpha; }
OperandParam getOperand1_Alpha() const { return _operand1_Alpha; } GLint getOperand1_Alpha() const { return _operand1_Alpha; }
OperandParam getOperand2_Alpha() const { return _operand2_Alpha; } GLint getOperand2_Alpha() const { return _operand2_Alpha; }
void setScale_RGB(float scale) { _scale_RGB = scale; } void setScale_RGB(float scale) { _scale_RGB = scale; }
@ -185,26 +185,26 @@ class SG_EXPORT TexEnvCombine : public StateAttribute
virtual ~TexEnvCombine(); virtual ~TexEnvCombine();
CombineParam _combine_RGB; GLint _combine_RGB;
CombineParam _combine_Alpha; GLint _combine_Alpha;
SourceParam _source0_RGB; GLint _source0_RGB;
SourceParam _source1_RGB; GLint _source1_RGB;
SourceParam _source2_RGB; GLint _source2_RGB;
SourceParam _source0_Alpha; GLint _source0_Alpha;
SourceParam _source1_Alpha; GLint _source1_Alpha;
SourceParam _source2_Alpha; GLint _source2_Alpha;
OperandParam _operand0_RGB; GLint _operand0_RGB;
OperandParam _operand1_RGB; GLint _operand1_RGB;
OperandParam _operand2_RGB; GLint _operand2_RGB;
OperandParam _operand0_Alpha; GLint _operand0_Alpha;
OperandParam _operand1_Alpha; GLint _operand1_Alpha;
OperandParam _operand2_Alpha; GLint _operand2_Alpha;
float _scale_RGB; float _scale_RGB;

View File

@ -3,12 +3,27 @@
using namespace osg; using namespace osg;
TexEnvCombine::TexEnvCombine() TexEnvCombine::TexEnvCombine():
_combine_RGB(GL_MODULATE),
_combine_Alpha(GL_MODULATE),
_source0_RGB(GL_TEXTURE),
_source1_RGB(GL_PREVIOUS_ARB),
_source2_RGB(GL_CONSTANT_ARB),
_source0_Alpha(GL_TEXTURE),
_source1_Alpha(GL_PREVIOUS_ARB),
_source2_Alpha(GL_CONSTANT_ARB),
_operand0_RGB(GL_SRC_COLOR),
_operand1_RGB(GL_SRC_COLOR),
_operand2_RGB(GL_SRC_ALPHA),
_operand0_Alpha(GL_SRC_ALPHA),
_operand1_Alpha(GL_SRC_ALPHA),
_operand2_Alpha(GL_SRC_ALPHA),
_scale_RGB(1.0),
_scale_Alpha(1.0),
_constantColor(0.0f,0.0f,0.0f,0.0f)
{ {
_constantColor.set(0.0f,0.0f,0.0f,0.0f);
} }
TexEnvCombine::~TexEnvCombine() TexEnvCombine::~TexEnvCombine()
{ {
} }