24 #ifdef DO_MEMORY_USAGE 25 MemoryUsage::update_type(
this, get_class_type());
37 const TransformState *internal_transform) :
40 _internal_transform(internal_transform)
42 #ifdef DO_MEMORY_USAGE 43 MemoryUsage::update_type(
this, get_class_type());
55 _munger(copy._munger),
56 _munged_data(copy._munged_data),
58 _internal_transform(copy._internal_transform)
60 #ifdef DO_MEMORY_USAGE 61 MemoryUsage::update_type(
this, get_class_type());
73 _munger = copy._munger;
74 _munged_data = copy._munged_data;
76 _internal_transform = copy._internal_transform;
77 _draw_callback = copy._draw_callback;
91 gsg->clear_before_callback();
92 gsg->set_state_and_transform(_state, _internal_transform);
94 _draw_callback->do_callback(&cbdata);
97 gsg->clear_state_and_transform();
101 nassertv(_geom != (
Geom *)NULL);
102 gsg->set_state_and_transform(_state, _internal_transform);
103 draw_inline(gsg, force, current_thread);
117 bool resident =
true;
118 if (!_geom->request_resident()) {
121 if (!_munged_data->request_resident()) {
136 _draw_callback = draw_callback;
146 _sw_sprites_pcollector.flush_level();
157 INLINE
void CullableObject::
159 _geom->draw(gsg, _munger, _munged_data, force, current_thread);
167 INLINE CullableObject::SortPoints::
168 SortPoints(
const CullableObject::PointData *array) :
179 INLINE
bool CullableObject::SortPoints::
180 operator () (
unsigned short a,
unsigned short b)
const {
181 return _array[a]._dist > _array[b]._dist;
189 INLINE
bool CullableObject::SourceFormat::
190 operator < (
const CullableObject::SourceFormat &other)
const {
191 if (_format != other._format) {
192 return _format < other._format;
194 if (_sprite_texcoord != other._sprite_texcoord) {
195 return (
int)_sprite_texcoord < (int)other._sprite_texcoord;
197 if (_retransform_sprites != other._retransform_sprites) {
198 return (
int)_retransform_sprites < (int)other._retransform_sprites;
This specialization on CallbackData is passed when the callback is initiated from deep within the dra...
static void flush_level()
Flushes the PStatCollectors used during traversal.
void operator=(const CullableObject ©)
Copies the CullableObject.
bool request_resident() const
Returns true if all the data necessary to render this object is currently resident in memory...
void draw(GraphicsStateGuardianBase *gsg, bool force, Thread *current_thread)
Draws the cullable object on the GSG immediately, in the GSG's current state.
The smallest atom of cull.
CullableObject()
Creates an empty CullableObject whose pointers can be filled in later.
A container for geometry primitives.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
This is a generic object that can be assigned to a callback at various points in the rendering proces...
void set_draw_callback(CallbackObject *draw_callback)
Specifies a CallbackObject that will be responsible for drawing this object.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
A thread; that is, a lightweight process.
bool get_lost_state() const
Returns the lost_state flag.