mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Allow Shader parameter in ShaderAttrib::make
This commit is contained in:
parent
0e1f261ca5
commit
cc35d0dd41
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -43,10 +43,10 @@ private:
|
||||
INLINE ShaderAttrib(const ShaderAttrib ©);
|
||||
|
||||
PUBLISHED:
|
||||
static CPT(RenderAttrib) make();
|
||||
static CPT(RenderAttrib) make(const Shader *shader = NULL);
|
||||
static CPT(RenderAttrib) make_off();
|
||||
static CPT(RenderAttrib) make_default();
|
||||
|
||||
|
||||
enum {
|
||||
F_disable_alpha_write = 0, // Suppress writes to color buffer alpha channel.
|
||||
F_subsume_alpha_test = 1, // Shader promises to subsume the alpha test using TEXKILL
|
||||
|
Loading…
x
Reference in New Issue
Block a user