14 #ifndef GRAPHICSENGINE_H 15 #define GRAPHICSENGINE_H 60 MAKE_PROPERTY(threading_model, get_threading_model, set_threading_model);
62 INLINE
const ReMutex &get_render_lock()
const;
63 MAKE_PROPERTY(render_lock, get_render_lock);
65 INLINE
void set_auto_flip(
bool auto_flip);
66 INLINE
bool get_auto_flip()
const;
67 MAKE_PROPERTY(auto_flip, get_auto_flip, set_auto_flip);
69 INLINE
void set_portal_cull(
bool value);
70 INLINE
bool get_portal_cull()
const;
71 MAKE_PROPERTY(portal_cull, get_portal_cull, set_portal_cull);
73 INLINE
void set_default_loader(
Loader *loader);
74 INLINE
Loader *get_default_loader()
const;
75 MAKE_PROPERTY(default_loader, get_default_loader, set_default_loader);
78 const std::string &name,
int sort,
86 const std::string &name,
int sort,
87 int x_size,
int y_size);
89 const std::string &name,
int sort,
90 int x_size,
int y_size);
92 const std::string &name,
int sort,
93 int x_size,
int y_size);
97 BLOCKING
void remove_all_windows();
98 void reset_all_windows(
bool swapchain);
100 bool is_empty()
const;
101 int get_num_windows()
const;
103 MAKE_SEQ(get_windows, get_num_windows, get_window);
104 MAKE_SEQ_PROPERTY(windows, get_num_windows, get_window);
106 BLOCKING
void render_frame();
107 BLOCKING
void open_windows();
108 BLOCKING
void sync_frame();
109 BLOCKING
void ready_flip();
110 BLOCKING
void flip_frame();
113 void dispatch_compute(
const LVecBase3i &work_groups,
133 void texture_uploaded(
Texture *tex);
144 static bool scene_root_func(
const PandaNode *node);
145 bool is_scene_root(
const PandaNode *node);
149 void cull_and_draw_together(Windows wlist,
Thread *current_thread);
153 void cull_to_bins(Windows wlist,
Thread *current_thread);
157 void draw_bins(
const Windows &wlist,
Thread *current_thread);
158 void make_contexts(
const Windows &wlist,
Thread *current_thread);
160 void process_events(
const Windows &wlist,
Thread *current_thread);
161 void ready_flip_windows(
const Windows &wlist,
Thread *current_thread);
162 void flip_windows(
const Windows &wlist,
Thread *current_thread);
163 void do_sync_frame(
Thread *current_thread);
164 void do_ready_flip(
Thread *current_thread);
165 void do_flip_frame(
Thread *current_thread);
176 void do_resort_windows();
177 void terminate_threads(
Thread *current_thread);
181 typedef std::map<TypeHandle, PStatCollector> CyclerTypeCounters;
182 CyclerTypeCounters _all_cycler_types;
183 CyclerTypeCounters _dirty_cycler_types;
184 static void pstats_count_cycler_type(
TypeHandle type,
int count,
void *data);
185 static void pstats_count_dirty_cycler_type(
TypeHandle type,
int count,
void *data);
188 static const RenderState *get_invert_polygon_state();
265 class WindowRenderer {
267 WindowRenderer(
const std::string &name);
272 void resort_windows();
280 bool any_done_gsgs()
const;
289 Windows _pending_close;
296 class RenderThread :
public Thread,
public WindowRenderer {
299 virtual void thread_main();
305 ThreadState _thread_state;
312 LVecBase3i _work_groups;
316 WindowRenderer *get_window_renderer(
const std::string &name,
int pipeline_stage);
320 bool _windows_sorted;
323 Mutex _new_windows_lock;
324 unsigned int _window_sort_index;
328 typedef pmap<std::string, PT(RenderThread) > Threads;
332 bool _portal_enabled;
333 PT(
Loader) _default_loader;
340 FlipState _flip_state;
342 bool _singular_warning_last_frame;
343 bool _singular_warning_this_frame;
348 class LoadedTexture {
354 LoadedTextures _loaded_textures;
355 Mutex _loaded_textures_lock;
416 friend class WindowRenderer;
A basic node of the scene graph or data graph.
Encapsulates the data from a DisplayRegion, pre-fetched for one stage of the pipeline.
This is our own Panda specialization on the default STL map.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A convenient class for loading models from disk, in bam or egg format (or any of a number of other fo...
A lightweight reentrant mutex.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A standard mutex, or mutual exclusion lock.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A specialization of ordered_vector that emulates a standard STL set: one copy of each element is allo...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is our own Panda specialization on the default STL vector.
A condition variable, usually used to communicate information about changing state to a thread that i...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A lightweight class that represents a single element that may be timed and/or counted via stats.
A container for the various kinds of properties we might ask to have on a graphics window before we o...
This defines the abstract interface for an object that receives Geoms identified by the CullTraverser...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An object to create GraphicsOutputs that share a particular 3-D API.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a base class for the various different classes that represent the result of a frame of render...
This represents the user's specification of how a particular frame is handled by the various threads.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
This class manages a staged pipeline of data, for instance the render pipeline, so that each stage of...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This stores the result of a BinCullHandler traversal: an ordered collection of CullBins,...
A base class for all things that want to be reference-counted.
A thread; that is, a lightweight process.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Encapsulates all the communication with a particular instance of a given rendering backend.
A rectangular subregion within a window for rendering into.
This is our own Panda specialization on the default STL set.
This class is the main interface to controlling the render process.
TypeHandle is the identifier used to differentiate C++ class types.
This is a sequence number that increments monotonically.
This object holds the camera position, etc., and other general setup information for rendering a part...
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...