Panda3D
|
00001 // Filename: shaderAttrib.I 00002 // Created by: sshodhan (10Jul04) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: ShaderAttrib::Constructor 00018 // Access: Private 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE ShaderAttrib:: 00022 ShaderAttrib() : 00023 _shader(NULL), 00024 _shader_priority(0), 00025 _auto_shader(false), 00026 _has_shader(false), 00027 _flags(0), 00028 _has_flags(0), 00029 _instance_count(0) 00030 { 00031 } 00032 00033 //////////////////////////////////////////////////////////////////// 00034 // Function: ShaderAttrib::Copy Constructor 00035 // Access: Private 00036 // Description: 00037 //////////////////////////////////////////////////////////////////// 00038 INLINE ShaderAttrib:: 00039 ShaderAttrib(const ShaderAttrib ©) : 00040 _shader(copy._shader), 00041 _shader_priority(copy._shader_priority), 00042 _auto_shader(copy._auto_shader), 00043 _has_shader(copy._has_shader), 00044 _flags(copy._flags), 00045 _has_flags(copy._has_flags), 00046 _instance_count(copy._instance_count), 00047 _inputs(copy._inputs) 00048 { 00049 } 00050 00051 //////////////////////////////////////////////////////////////////// 00052 // Function: ShaderAttrib::has_shader 00053 // Access: Published 00054 // Description: If true, the shader field of this attribute overrides 00055 // the shader field of the parent attribute. 00056 //////////////////////////////////////////////////////////////////// 00057 INLINE bool ShaderAttrib:: 00058 has_shader() const { 00059 return _has_shader; 00060 } 00061 00062 //////////////////////////////////////////////////////////////////// 00063 // Function: ShaderAttrib::auto_shader 00064 // Access: Published 00065 // Description: If true, then this ShaderAttrib does not contain an 00066 // explicit shader - instead, it requests the automatic 00067 // generation of a shader. 00068 //////////////////////////////////////////////////////////////////// 00069 INLINE bool ShaderAttrib:: 00070 auto_shader() const { 00071 return _auto_shader; 00072 } 00073 00074 //////////////////////////////////////////////////////////////////// 00075 // Function: ShaderAttrib::get_shader_priority 00076 // Access: Published 00077 // Description: 00078 //////////////////////////////////////////////////////////////////// 00079 INLINE int ShaderAttrib:: 00080 get_shader_priority() const { 00081 return _shader_priority; 00082 } 00083 00084 //////////////////////////////////////////////////////////////////// 00085 // Function: ShaderAttrib::get_instance_count 00086 // Access: Published 00087 // Description: Returns the number of geometry instances. A value 00088 // of 0 means not to use instancing at all. 00089 //////////////////////////////////////////////////////////////////// 00090 INLINE int ShaderAttrib:: 00091 get_instance_count() const { 00092 return _instance_count; 00093 } 00094 00095 //////////////////////////////////////////////////////////////////// 00096 // Function: ShaderAttrib::get_flag 00097 // Access: Published 00098 // Description: 00099 //////////////////////////////////////////////////////////////////// 00100 INLINE bool ShaderAttrib:: 00101 get_flag(int index) const { 00102 return (_flags & (1<<index)) ? true:false; 00103 } 00104