Aded extra constructors to BlendFunc and Depth to help set them up convieniently.

Added a background quad to osghud.
This commit is contained in:
Robert Osfield
2003-05-06 18:04:27 +00:00
parent 06054d9520
commit fa0333b6fe
5 changed files with 92 additions and 34 deletions

View File

@@ -14,12 +14,17 @@
using namespace osg;
BlendFunc::BlendFunc()
BlendFunc::BlendFunc():
_source_factor(SRC_ALPHA),
_destination_factor(ONE_MINUS_SRC_ALPHA)
{
_source_factor = SRC_ALPHA;
_destination_factor = ONE_MINUS_SRC_ALPHA;
}
BlendFunc::BlendFunc(GLenum source, GLenum destination):
_source_factor(source),
_destination_factor(destination)
{
}
BlendFunc::~BlendFunc()
{

View File

@@ -14,16 +14,14 @@
using namespace osg;
Depth::Depth()
Depth::Depth(Function func,double zNear, double zFar,bool writeMask):
_func(func),
_zNear(zNear),
_zFar(zFar),
_depthWriteMask(writeMask)
{
_func = LESS;
_depthWriteMask = true;
_zNear = 0.0;
_zFar = 1.0;
}
Depth::~Depth()
{
}
@@ -31,7 +29,7 @@ Depth::~Depth()
void Depth::apply(State&) const
{
glDepthFunc((GLenum)_func);
glDepthMask((GLboolean)_depthWriteMask);
glDepthRange(_zNear,_zFar);
glDepthMask((GLboolean)_depthWriteMask);
}