14 #ifndef STENCILATTRIB_H 15 #define STENCILATTRIB_H 36 enum StencilRenderState {
37 SRS_front_comparison_function,
38 SRS_front_stencil_fail_operation,
39 SRS_front_stencil_pass_z_fail_operation,
40 SRS_front_stencil_pass_z_pass_operation,
46 SRS_back_comparison_function,
47 SRS_back_stencil_fail_operation,
48 SRS_back_stencil_pass_z_fail_operation,
49 SRS_back_stencil_pass_z_pass_operation,
58 enum StencilComparisonFunction {
60 SCF_less_than = M_less,
62 SCF_less_than_or_equal = M_less_equal,
63 SCF_greater_than = M_greater,
64 SCF_not_equal = M_not_equal,
65 SCF_greater_than_or_equal = M_greater_equal,
66 SCF_always = M_always,
69 enum StencilOperation {
76 SO_increment_saturate,
77 SO_decrement_saturate,
85 PandaCompareFunc front_comparison_function,
86 StencilOperation stencil_fail_operation,
87 StencilOperation stencil_pass_z_fail_operation,
88 StencilOperation front_stencil_pass_z_pass_operation,
89 unsigned int reference,
90 unsigned int read_mask,
91 unsigned int write_mask);
96 PandaCompareFunc front_comparison_function,
97 StencilOperation stencil_fail_operation,
98 StencilOperation stencil_pass_z_fail_operation,
99 StencilOperation front_stencil_pass_z_pass_operation,
100 unsigned int reference,
101 unsigned int read_mask,
102 unsigned int write_mask,
103 PandaCompareFunc back_comparison_function,
104 StencilOperation back_stencil_fail_operation,
105 StencilOperation back_stencil_pass_z_fail_operation,
106 StencilOperation back_stencil_pass_z_pass_operation);
110 PandaCompareFunc front_comparison_function,
111 StencilOperation stencil_fail_operation,
112 StencilOperation stencil_pass_z_fail_operation,
113 StencilOperation front_stencil_pass_z_pass_operation,
114 unsigned int reference,
115 unsigned int read_mask,
116 unsigned int write_mask,
118 unsigned int clear_value);
123 PandaCompareFunc front_comparison_function,
124 StencilOperation stencil_fail_operation,
125 StencilOperation stencil_pass_z_fail_operation,
126 StencilOperation front_stencil_pass_z_pass_operation,
127 unsigned int reference,
128 unsigned int read_mask,
129 unsigned int write_mask,
130 PandaCompareFunc back_comparison_function,
131 StencilOperation back_stencil_fail_operation,
132 StencilOperation back_stencil_pass_z_fail_operation,
133 StencilOperation back_stencil_pass_z_pass_operation,
135 unsigned int clear_value);
137 INLINE
unsigned int get_render_state(StencilRenderState render_state_identifier)
const;
140 static const char *stencil_render_state_name_array [SRS_total];
142 virtual void output(std::ostream &out)
const;
145 virtual int compare_to_impl(
const RenderAttrib *other)
const;
146 virtual size_t get_hash_impl()
const;
149 unsigned int _stencil_render_states [SRS_total];
152 static int get_class_slot() {
155 virtual int get_slot()
const {
156 return get_class_slot();
158 MAKE_PROPERTY(class_slot, get_class_slot);
161 static void register_with_read_factory();
172 static void init_type() {
173 RenderAttrib::init_type();
175 RenderAttrib::get_class_type());
179 return get_class_type();
181 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
185 static int _attrib_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.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
static int register_slot(TypeHandle type_handle, int sort, RenderAttrib *default_attrib)
Adds the indicated TypeHandle to the registry, if it is not there already, and returns a unique slot ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 ...