Panda3D

pipeline.I

00001 // Filename: pipeline.I
00002 // Created by:  drose (21Feb02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: Pipeline::get_render_pipeline
00018 //       Access: Public, Static
00019 //  Description: Returns a pointer to the global render pipeline.
00020 ////////////////////////////////////////////////////////////////////
00021 INLINE Pipeline *Pipeline::
00022 get_render_pipeline() {
00023   if (_render_pipeline == (Pipeline *)NULL) {
00024     make_render_pipeline();
00025   }
00026   return _render_pipeline;
00027 }
00028 
00029 ////////////////////////////////////////////////////////////////////
00030 //     Function: Pipeline::set_min_stages
00031 //       Access: Public
00032 //  Description: Ensures that at least the indicated number of stages
00033 //               are in the pipeline.
00034 ////////////////////////////////////////////////////////////////////
00035 INLINE void Pipeline::
00036 set_min_stages(int min_stages) {
00037   set_num_stages(max(min_stages, get_num_stages()));
00038 }
00039 
00040 ////////////////////////////////////////////////////////////////////
00041 //     Function: Pipeline::get_num_stages
00042 //       Access: Public
00043 //  Description: Returns the number of stages required for the
00044 //               pipeline.
00045 ////////////////////////////////////////////////////////////////////
00046 INLINE int Pipeline::
00047 get_num_stages() const {
00048   return _num_stages;
00049 }
00050 
00051 #ifdef THREADED_PIPELINE
00052 ////////////////////////////////////////////////////////////////////
00053 //     Function: Pipeline::get_num_cyclers
00054 //       Access: Public
00055 //  Description: Returns the number of PipelineCyclers in the universe
00056 //               that reference this Pipeline object.
00057 ////////////////////////////////////////////////////////////////////
00058 INLINE int Pipeline::
00059 get_num_cyclers() const {
00060   ReMutexHolder holder(_lock);
00061   return _num_cyclers;
00062 }
00063 #endif  // THREADED_PIPELINE
00064 
00065 #ifdef THREADED_PIPELINE
00066 ////////////////////////////////////////////////////////////////////
00067 //     Function: Pipeline::get_num_dirty_cyclers
00068 //       Access: Public
00069 //  Description: Returns the number of PipelineCyclers in the universe
00070 //               that reference this Pipeline object and are currently
00071 //               marked "dirty"; that is, there is a difference in
00072 //               pointer value between some of their stages.
00073 ////////////////////////////////////////////////////////////////////
00074 INLINE int Pipeline::
00075 get_num_dirty_cyclers() const {
00076   ReMutexHolder holder(_lock);
00077   return _num_dirty_cyclers;
00078 }
00079 #endif  // THREADED_PIPELINE
00080 
 All Classes Functions Variables Enumerations