Allow Shader parameter in ShaderAttrib::make

This commit is contained in:
rdb 2014-07-03 19:14:36 +00:00
parent 0e1f261ca5
commit cc35d0dd41
2 changed files with 9 additions and 4 deletions

View File

@ -52,13 +52,18 @@ make_off() {
// set.
////////////////////////////////////////////////////////////////////
CPT(RenderAttrib) ShaderAttrib::
make() {
make(const Shader *shader) {
static CPT(RenderAttrib) _null_attrib;
if (_null_attrib == 0) {
ShaderAttrib *attrib = new ShaderAttrib;
_null_attrib = return_new(attrib);
}
return _null_attrib;
if (shader == NULL) {
return _null_attrib;
} else {
return DCAST(ShaderAttrib, _null_attrib)->set_shader(shader);
}
}
////////////////////////////////////////////////////////////////////

View File

@ -43,7 +43,7 @@ private:
INLINE ShaderAttrib(const ShaderAttrib &copy);
PUBLISHED:
static CPT(RenderAttrib) make();
static CPT(RenderAttrib) make(const Shader *shader = NULL);
static CPT(RenderAttrib) make_off();
static CPT(RenderAttrib) make_default();