Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

GraphicsThreadingModel Class Reference

This represents the user's specification of how a particular frame is handled by the various threads. More...

#include <graphicsThreadingModel.h>

List of all members.

Public Member Functions

 GraphicsThreadingModel (const string &model=string())
 The threading model accepts a string representing the names of the two threads that will process cull and draw for the given window, separated by a slash.

 GraphicsThreadingModel (const GraphicsThreadingModel &copy)
void operator= (const GraphicsThreadingModel &copy)
string get_model () const
 Returns the string that describes the threading model.

const string & get_cull_name () const
 Returns the name of the thread that will handle culling in this model.

const string & get_draw_name () const
 Returns the name of the thread that will handle sending the actual graphics primitives to the graphics API in this model.

bool get_cull_sorting () const
 Returns true if the model involves a separate cull pass, or false if culling happens implicitly, at the same time as draw.

bool is_single_threaded () const
 Returns true if the threading model is a single-threaded model, or false if it involves threads.

bool is_default () const
 Returns true if the threading model is the default, cull-then-draw single-threaded model, or false otherwise.

void output (ostream &out) const

Private Attributes

string _cull_name
string _draw_name
bool _cull_sorting


Detailed Description

This represents the user's specification of how a particular frame is handled by the various threads.

Definition at line 36 of file graphicsThreadingModel.h.


Constructor & Destructor Documentation

GraphicsThreadingModel::GraphicsThreadingModel const string &  model = string()  ) 
 

The threading model accepts a string representing the names of the two threads that will process cull and draw for the given window, separated by a slash.

The names are completely arbitrary and are used only to differentiate threads. The two names may be the same, meaning the same thread, or each may be the empty string, which represents the previous thread.

Thus, for example, "cull/draw" indicates that the window will be culled in a thread called "cull", and drawn in a separate thread called "draw". "draw/draw" or simply "draw/" indicates the window will be culled and drawn in the same thread, "draw". On the other hand, "/draw" indicates the thread will be culled in the main, or app thread, and drawn in a separate thread named "draw". The empty string, "" or "/", indicates the thread will be culled and drawn in the main thread; that is to say, a single-process model.

Finally, if the threading model begins with a "-" character, then cull and draw are run simultaneously, in the same thread, with no binning or state sorting. It simplifies the cull process but it forces the scene to render in scene graph order; state sorting and alpha sorting is lost.

Definition at line 83 of file graphicsThreadingModel.cxx.

GraphicsThreadingModel::GraphicsThreadingModel const GraphicsThreadingModel &  copy  )  [inline]
 

Definition at line 32 of file graphicsThreadingModel.I.

References _cull_name, _cull_sorting, _draw_name, and INLINE.


Member Function Documentation

const string & GraphicsThreadingModel::get_cull_name  )  const [inline]
 

Returns the name of the thread that will handle culling in this model.

Definition at line 65 of file graphicsThreadingModel.I.

References _draw_name.

bool GraphicsThreadingModel::get_cull_sorting  )  const [inline]
 

Returns true if the model involves a separate cull pass, or false if culling happens implicitly, at the same time as draw.

Definition at line 99 of file graphicsThreadingModel.I.

References _cull_sorting, INLINE, and is_single_threaded().

const string & GraphicsThreadingModel::get_draw_name  )  const [inline]
 

Returns the name of the thread that will handle sending the actual graphics primitives to the graphics API in this model.

Definition at line 82 of file graphicsThreadingModel.I.

References _cull_name, _draw_name, and INLINE.

string GraphicsThreadingModel::get_model  )  const
 

Returns the string that describes the threading model.

See the constructor.

Definition at line 115 of file graphicsThreadingModel.cxx.

bool GraphicsThreadingModel::is_default  )  const [inline]
 

Returns true if the threading model is the default, cull-then-draw single-threaded model, or false otherwise.

Definition at line 133 of file graphicsThreadingModel.I.

bool GraphicsThreadingModel::is_single_threaded  )  const [inline]
 

Returns true if the threading model is a single-threaded model, or false if it involves threads.

Definition at line 116 of file graphicsThreadingModel.I.

References threading_model.

Referenced by get_cull_sorting().

void GraphicsThreadingModel::operator= const GraphicsThreadingModel &  copy  )  [inline]
 

Definition at line 48 of file graphicsThreadingModel.I.

References _cull_name, and INLINE.

void GraphicsThreadingModel::output ostream &  out  )  const [inline]
 

Definition at line 147 of file graphicsThreadingModel.I.


Member Data Documentation

string GraphicsThreadingModel::_cull_name [private]
 

Definition at line 52 of file graphicsThreadingModel.h.

Referenced by get_draw_name(), GraphicsThreadingModel(), and operator=().

bool GraphicsThreadingModel::_cull_sorting [private]
 

Definition at line 54 of file graphicsThreadingModel.h.

Referenced by get_cull_sorting(), and GraphicsThreadingModel().

string GraphicsThreadingModel::_draw_name [private]
 

Definition at line 53 of file graphicsThreadingModel.h.

Referenced by get_cull_name(), get_draw_name(), and GraphicsThreadingModel().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:51:26 2003 for Panda by doxygen1.3