19 #ifdef DO_MEMORY_USAGE 31 _geom(std::move(geom)),
32 _state(std::move(state)),
33 _internal_transform(std::move(internal_transform))
35 #ifdef DO_MEMORY_USAGE 46 _munged_data(copy._munged_data),
48 _internal_transform(copy._internal_transform)
50 #ifdef DO_MEMORY_USAGE 61 _munged_data = copy._munged_data;
63 _internal_transform = copy._internal_transform;
64 _draw_callback = copy._draw_callback;
73 if (_draw_callback !=
nullptr) {
75 gsg->clear_before_callback();
76 gsg->set_state_and_transform(_state, _internal_transform);
78 _draw_callback->do_callback(&cbdata);
81 gsg->clear_state_and_transform();
85 nassertv(_geom !=
nullptr);
86 gsg->set_state_and_transform(_state, _internal_transform);
99 if (!_geom->request_resident()) {
102 if (!_munged_data->request_resident()) {
123 _sw_sprites_pcollector.flush_level();
133 _geom->draw(gsg, _munged_data, force, current_thread);
141 gsg->clear_before_callback();
142 gsg->set_state_and_transform(_state, _internal_transform);
144 _draw_callback->do_callback(&cbdata);
147 gsg->clear_state_and_transform();
154 INLINE CullableObject::SortPoints::
155 SortPoints(
const CullableObject::PointData *array) :
164 INLINE
bool CullableObject::SortPoints::
165 operator () (
unsigned short a,
unsigned short b)
const {
166 return _array[a]._dist > _array[b]._dist;
172 INLINE
bool CullableObject::SourceFormat::
173 operator < (
const CullableObject::SourceFormat &other)
const {
174 if (_format != other._format) {
175 return _format < other._format;
177 if (_sprite_texcoord != other._sprite_texcoord) {
178 return (
int)_sprite_texcoord < (int)other._sprite_texcoord;
180 if (_retransform_sprites != other._retransform_sprites) {
181 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.
void draw_callback(GraphicsStateGuardianBase *gsg, bool force, Thread *current_thread)
Invokes the draw callback, assuming one is set.
bool request_resident() const
Returns true if all the data necessary to render this object is currently resident in memory.
void draw_inline(GraphicsStateGuardianBase *gsg, bool force, Thread *current_thread)
Draws the cullable object on the GSG immediately, in the GSG's current state.
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.
static void record_pointer(ReferenceCount *ptr)
Indicates that the given pointer has been recently allocated.