mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Allow Shader parameter in ShaderAttrib::make
This commit is contained in:
parent
0e1f261ca5
commit
cc35d0dd41
@ -52,13 +52,18 @@ make_off() {
|
|||||||
// set.
|
// set.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
CPT(RenderAttrib) ShaderAttrib::
|
CPT(RenderAttrib) ShaderAttrib::
|
||||||
make() {
|
make(const Shader *shader) {
|
||||||
static CPT(RenderAttrib) _null_attrib;
|
static CPT(RenderAttrib) _null_attrib;
|
||||||
if (_null_attrib == 0) {
|
if (_null_attrib == 0) {
|
||||||
ShaderAttrib *attrib = new ShaderAttrib;
|
ShaderAttrib *attrib = new ShaderAttrib;
|
||||||
_null_attrib = return_new(attrib);
|
_null_attrib = return_new(attrib);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shader == NULL) {
|
||||||
return _null_attrib;
|
return _null_attrib;
|
||||||
|
} else {
|
||||||
|
return DCAST(ShaderAttrib, _null_attrib)->set_shader(shader);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -43,7 +43,7 @@ private:
|
|||||||
INLINE ShaderAttrib(const ShaderAttrib ©);
|
INLINE ShaderAttrib(const ShaderAttrib ©);
|
||||||
|
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
static CPT(RenderAttrib) make();
|
static CPT(RenderAttrib) make(const Shader *shader = NULL);
|
||||||
static CPT(RenderAttrib) make_off();
|
static CPT(RenderAttrib) make_off();
|
||||||
static CPT(RenderAttrib) make_default();
|
static CPT(RenderAttrib) make_default();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user