15 #ifndef STENCILATTRIB_H 16 #define STENCILATTRIB_H 18 #include "pandabase.h" 19 #include "renderAttrib.h" 39 enum StencilRenderState {
40 SRS_front_comparison_function,
41 SRS_front_stencil_fail_operation,
42 SRS_front_stencil_pass_z_fail_operation,
43 SRS_front_stencil_pass_z_pass_operation,
49 SRS_back_comparison_function,
50 SRS_back_stencil_fail_operation,
51 SRS_back_stencil_pass_z_fail_operation,
52 SRS_back_stencil_pass_z_pass_operation,
61 enum StencilComparisonFunction {
63 SCF_less_than = M_less,
65 SCF_less_than_or_equal = M_less_equal,
66 SCF_greater_than = M_greater,
67 SCF_not_equal = M_not_equal,
68 SCF_greater_than_or_equal = M_greater_equal,
69 SCF_always = M_always,
72 enum StencilOperation {
79 SO_increment_saturate,
80 SO_decrement_saturate,
88 PandaCompareFunc front_comparison_function,
89 StencilOperation stencil_fail_operation,
90 StencilOperation stencil_pass_z_fail_operation,
91 StencilOperation front_stencil_pass_z_pass_operation,
92 unsigned int reference,
93 unsigned int read_mask,
94 unsigned int write_mask);
99 PandaCompareFunc front_comparison_function,
100 StencilOperation stencil_fail_operation,
101 StencilOperation stencil_pass_z_fail_operation,
102 StencilOperation front_stencil_pass_z_pass_operation,
103 unsigned int reference,
104 unsigned int read_mask,
105 unsigned int write_mask,
106 PandaCompareFunc back_comparison_function,
107 StencilOperation back_stencil_fail_operation,
108 StencilOperation back_stencil_pass_z_fail_operation,
109 StencilOperation back_stencil_pass_z_pass_operation);
113 PandaCompareFunc front_comparison_function,
114 StencilOperation stencil_fail_operation,
115 StencilOperation stencil_pass_z_fail_operation,
116 StencilOperation front_stencil_pass_z_pass_operation,
117 unsigned int reference,
118 unsigned int read_mask,
119 unsigned int write_mask,
121 unsigned int clear_value);
126 PandaCompareFunc front_comparison_function,
127 StencilOperation stencil_fail_operation,
128 StencilOperation stencil_pass_z_fail_operation,
129 StencilOperation front_stencil_pass_z_pass_operation,
130 unsigned int reference,
131 unsigned int read_mask,
132 unsigned int write_mask,
133 PandaCompareFunc back_comparison_function,
134 StencilOperation back_stencil_fail_operation,
135 StencilOperation back_stencil_pass_z_fail_operation,
136 StencilOperation back_stencil_pass_z_pass_operation,
138 unsigned int clear_value);
140 INLINE
unsigned int get_render_state(StencilRenderState render_state_identifier)
const;
143 static const char *stencil_render_state_name_array [SRS_total];
145 virtual void output(ostream &out)
const;
148 virtual int compare_to_impl(
const RenderAttrib *other)
const;
149 virtual size_t get_hash_impl()
const;
152 unsigned int _stencil_render_states [SRS_total];
155 static int get_class_slot() {
158 virtual int get_slot()
const {
159 return get_class_slot();
163 static void register_with_read_factory();
174 static void init_type() {
175 RenderAttrib::init_type();
176 register_type(_type_handle,
"StencilAttrib",
177 RenderAttrib::get_class_type());
178 _attrib_slot =
register_slot(_type_handle, 100, make_default);
181 return get_class_type();
183 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
187 static int _attrib_slot;
190 #include "stencilAttrib.I" static int register_slot(TypeHandle type_handle, int sort, RenderAttribRegistry::MakeDefaultFunc *make_default_func)
Adds the indicated TypeHandle to the registry, if it is not there already, and returns a unique slot ...
This is the base class for a number of render attributes (other than transform) that may be set on sc...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Base class for objects that can be written to and read from Bam files.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
A StencilAttrib is a collection of all stencil render states.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...