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

GraphicsEngine Class Reference

#include <graphicsEngine.h>

List of all members.

Private Types

typedef pset< PT(GraphicsWindowWindows )
typedef pset< PT(GraphicsStateGuardianGSGs )
typedef pmap< string, PT(RenderThreadThreads )
enum  ThreadState {
  TS_wait, TS_do_frame, TS_do_flip, TS_do_release,
  TS_terminate
}
enum  FlipState { FS_draw, FS_sync, FS_flip }

Private Member Functions

 ~GraphicsEngine ()
void set_frame_buffer_properties (const FrameBufferProperties &properties)
FrameBufferProperties get_frame_buffer_properties () const
void set_threading_model (const GraphicsThreadingModel &threading_model)
GraphicsThreadingModel get_threading_model () const
INLINE void set_auto_flip (bool auto_flip)
INLINE bool get_auto_flip () const
INLINE PT (GraphicsStateGuardian) make_gsg(GraphicsPipe *pipe)
 PT (GraphicsStateGuardian) make_gsg(GraphicsPipe *pipe
INLINE GraphicsWindowmake_window (GraphicsPipe *pipe, GraphicsStateGuardian *gsg)
GraphicsWindowmake_window (GraphicsPipe *pipe, GraphicsStateGuardian *gsg, const GraphicsThreadingModel &threading_model)
bool remove_window (GraphicsWindow *window)
void remove_all_windows ()
bool is_empty () const
void render_frame ()
void sync_frame ()
void flip_frame ()
void render_subframe (GraphicsStateGuardian *gsg, DisplayRegion *dr, bool cull_sorting)
void cull_and_draw_together (const Windows &wlist)
void cull_and_draw_together (GraphicsStateGuardian *gsg, DisplayRegion *dr)
void cull_bin_draw (const Windows &wlist)
void cull_bin_draw (GraphicsStateGuardian *gsg, DisplayRegion *dr)
void process_events (const GraphicsEngine::Windows &wlist)
void flip_windows (const GraphicsEngine::Windows &wlist)
void do_sync_frame ()
void do_flip_frame ()
INLINE void close_gsg (GraphicsPipe *pipe, GraphicsStateGuardian *gsg)
 PT (SceneSetup) setup_scene(const NodePath &camera
void do_cull (CullHandler *cull_handler, SceneSetup *scene_setup, GraphicsStateGuardian *gsg)
void do_draw (CullResult *cull_result, SceneSetup *scene_setup, GraphicsStateGuardian *gsg, DisplayRegion *dr)
bool setup_gsg (GraphicsStateGuardian *gsg, SceneSetup *scene_setup)
void do_remove_window (GraphicsWindow *window)
void terminate_threads ()
WindowRendererget_window_renderer (const string &name)

Private Attributes

PUBLISHED __pad0__: GraphicsEngine(Pipeline *pipeline = NULL)
const FrameBufferPropertiesproperties
const FrameBufferProperties
const GraphicsThreadingModel
threading_model
GraphicsStateGuardiangsg
Pipeline_pipeline
Windows _windows
WindowRenderer _app
Threads _threads
FrameBufferProperties _frame_buffer_properties
GraphicsThreadingModel _threading_model
bool _auto_flip
FlipState _flip_state
Mutex _lock

Static Private Attributes

PStatCollector _cull_pcollector
PStatCollector _draw_pcollector

Friends

class WindowRenderer


Member Typedef Documentation

typedef pset< PT(GraphicsStateGuardian) GraphicsEngine::GSGs) [private]
 

Definition at line 91 of file graphicsEngine.h.

typedef pmap<string, PT(RenderThread) GraphicsEngine::Threads) [private]
 

Definition at line 167 of file graphicsEngine.h.

typedef pset< PT(GraphicsWindow) GraphicsEngine::Windows) [private]
 

Definition at line 90 of file graphicsEngine.h.


Member Enumeration Documentation

enum GraphicsEngine::FlipState [private]
 

Enumeration values:
FS_draw 
FS_sync 
FS_flip 

Definition at line 173 of file graphicsEngine.h.

enum GraphicsEngine::ThreadState [private]
 

Enumeration values:
TS_wait 
TS_do_frame 
TS_do_flip 
TS_do_release 
TS_terminate 

Definition at line 142 of file graphicsEngine.h.


Constructor & Destructor Documentation

GraphicsEngine::~GraphicsEngine  )  [private]
 

Definition at line 78 of file graphicsEngine.cxx.

References remove_all_windows().


Member Function Documentation

INLINE void GraphicsEngine::close_gsg GraphicsPipe pipe,
GraphicsStateGuardian gsg
[private]
 

Referenced by GraphicsEngine::WindowRenderer::do_close(), and GraphicsEngine::WindowRenderer::do_frame().

void GraphicsEngine::cull_and_draw_together GraphicsStateGuardian gsg,
DisplayRegion dr
[private]
 

Definition at line 449 of file graphicsEngine.cxx.

References GraphicsStateGuardian::begin_scene(), GraphicsStateGuardian::clear(), do_cull(), GraphicsStateGuardian::end_scene(), DisplayRegion::get_camera(), ClearableRegion::is_any_clear_active(), NULL, GraphicsStateGuardian::pop_display_region(), GraphicsStateGuardian::prepare_display_region(), PT(), GraphicsStateGuardian::push_display_region(), and setup_gsg().

void GraphicsEngine::cull_and_draw_together const Windows wlist  )  [private]
 

Definition at line 423 of file graphicsEngine.cxx.

References GraphicsWindow::begin_frame(), GraphicsWindow::clear(), GraphicsWindow::end_frame(), GraphicsWindow::get_display_region(), GraphicsWindow::get_gsg(), GraphicsWindow::get_num_display_regions(), GraphicsWindow::is_active(), and win.

Referenced by GraphicsEngine::WindowRenderer::do_frame(), and render_subframe().

void GraphicsEngine::cull_bin_draw GraphicsStateGuardian gsg,
DisplayRegion dr
[private]
 

Definition at line 508 of file graphicsEngine.cxx.

References do_cull(), do_draw(), DisplayRegion::get_camera(), NULL, and PT().

void GraphicsEngine::cull_bin_draw const Windows wlist  )  [private]
 

Definition at line 479 of file graphicsEngine.cxx.

References GraphicsWindow::begin_frame(), GraphicsWindow::clear(), GraphicsWindow::end_frame(), GraphicsWindow::get_display_region(), GraphicsWindow::get_gsg(), GraphicsWindow::get_num_display_regions(), GraphicsWindow::is_active(), and win.

Referenced by GraphicsEngine::WindowRenderer::do_frame(), and render_subframe().

void GraphicsEngine::do_cull CullHandler cull_handler,
SceneSetup scene_setup,
GraphicsStateGuardian gsg
[private]
 

Definition at line 696 of file graphicsEngine.cxx.

References _cull_pcollector, DCAST, GraphicsStateGuardian::depth_offset_decals(), Camera::get_camera_mask(), SceneSetup::get_camera_node(), SceneSetup::get_camera_transform(), GeometricBoundingVolume::get_class_type(), SceneSetup::get_lens(), TransformState::get_mat(), SceneSetup::get_scene_root(), NULL, PT(), CullTraverser::set_camera_mask(), CullTraverser::set_cull_handler(), CullTraverser::set_depth_offset_decals(), CullTraverser::set_scene(), CullTraverser::set_view_frustum(), and CullTraverser::traverse().

Referenced by cull_and_draw_together(), and cull_bin_draw().

void GraphicsEngine::do_draw CullResult cull_result,
SceneSetup scene_setup,
GraphicsStateGuardian gsg,
DisplayRegion dr
[private]
 

Definition at line 735 of file graphicsEngine.cxx.

References _draw_pcollector, GraphicsStateGuardian::begin_scene(), GraphicsStateGuardian::clear(), CullResult::draw(), GraphicsStateGuardian::end_scene(), ClearableRegion::is_any_clear_active(), GraphicsStateGuardian::pop_display_region(), GraphicsStateGuardian::prepare_display_region(), GraphicsStateGuardian::push_display_region(), and setup_gsg().

Referenced by cull_bin_draw().

void GraphicsEngine::do_flip_frame  )  [private]
 

Definition at line 599 of file graphicsEngine.cxx.

References _app, GraphicsEngine::RenderThread::_cv, GraphicsEngine::RenderThread::_cv_mutex, _flip_state, GraphicsEngine::RenderThread::_thread_state, _threads, GraphicsEngine::WindowRenderer::do_flip(), FS_draw, FS_flip, FS_sync, Mutex::lock(), Mutex::release(), ConditionVar::signal(), TS_do_flip, and TS_wait.

Referenced by flip_frame(), and render_frame().

void GraphicsEngine::do_remove_window GraphicsWindow window  )  [private]
 

Definition at line 796 of file graphicsEngine.cxx.

References _app, _threads, GraphicsEngine::WindowRenderer::do_pending(), GraphicsWindow::get_pipe(), NULL, PT(), and GraphicsEngine::WindowRenderer::remove_window().

Referenced by remove_all_windows(), and remove_window().

void GraphicsEngine::do_sync_frame  )  [private]
 

Definition at line 577 of file graphicsEngine.cxx.

References GraphicsEngine::RenderThread::_cv_mutex, _flip_state, _threads, FS_draw, FS_sync, Mutex::lock(), and Mutex::release().

Referenced by sync_frame().

void GraphicsEngine::flip_frame  )  [private]
 

Definition at line 380 of file graphicsEngine.cxx.

References _flip_state, _lock, do_flip_frame(), and FS_flip.

void GraphicsEngine::flip_windows const GraphicsEngine::Windows wlist  )  [private]
 

Definition at line 558 of file graphicsEngine.cxx.

References GraphicsWindow::begin_flip(), GraphicsWindow::end_flip(), and win.

Referenced by GraphicsEngine::WindowRenderer::do_flip().

INLINE bool GraphicsEngine::get_auto_flip  )  const [private]
 

FrameBufferProperties GraphicsEngine::get_frame_buffer_properties  )  const [private]
 

Definition at line 102 of file graphicsEngine.cxx.

References _frame_buffer_properties, and _lock.

GraphicsThreadingModel GraphicsEngine::get_threading_model  )  const [private]
 

Definition at line 138 of file graphicsEngine.cxx.

References _lock, and _threading_model.

GraphicsEngine::WindowRenderer * GraphicsEngine::get_window_renderer const string &  name  )  [private]
 

Definition at line 873 of file graphicsEngine.cxx.

References _app, _lock, _threads, PT(), and TP_normal.

Referenced by make_window().

bool GraphicsEngine::is_empty  )  const [private]
 

Definition at line 296 of file graphicsEngine.cxx.

References _windows.

GraphicsWindow * GraphicsEngine::make_window GraphicsPipe pipe,
GraphicsStateGuardian gsg,
const GraphicsThreadingModel threading_model
[private]
 

Definition at line 186 of file graphicsEngine.cxx.

References _app, GraphicsEngine::WindowRenderer::_cdraw, GraphicsEngine::WindowRenderer::_cull, GraphicsEngine::WindowRenderer::_draw, _lock, GraphicsEngine::WindowRenderer::_window, _windows, GraphicsEngine::WindowRenderer::add_gsg(), GraphicsEngine::WindowRenderer::add_window(), GraphicsThreadingModel::get_draw_name(), GraphicsStateGuardian::get_pipe(), GraphicsStateGuardian::get_threading_model(), get_window_renderer(), NULL, PT(), and threading_model.

INLINE GraphicsWindow* GraphicsEngine::make_window GraphicsPipe pipe,
GraphicsStateGuardian gsg
[private]
 

Referenced by WindowFramework::open_window().

void GraphicsEngine::process_events const GraphicsEngine::Windows wlist  )  [private]
 

Definition at line 542 of file graphicsEngine.cxx.

References GraphicsWindow::process_events(), and win.

Referenced by GraphicsEngine::WindowRenderer::do_frame().

GraphicsEngine::PT SceneSetup   )  const [private]
 

GraphicsEngine::PT GraphicsStateGuardian   )  [private]
 

INLINE GraphicsEngine::PT GraphicsStateGuardian   )  [private]
 

Referenced by cull_and_draw_together(), cull_bin_draw(), do_cull(), do_remove_window(), get_window_renderer(), make_window(), GraphicsEngine::WindowRenderer::remove_window(), and remove_window().

void GraphicsEngine::remove_all_windows  )  [private]
 

Definition at line 275 of file graphicsEngine.cxx.

References _app, _windows, GraphicsEngine::WindowRenderer::do_close(), GraphicsEngine::WindowRenderer::do_release(), do_remove_window(), terminate_threads(), and win.

Referenced by PandaFramework::close_framework(), and ~GraphicsEngine().

bool GraphicsEngine::remove_window GraphicsWindow window  )  [private]
 

Definition at line 250 of file graphicsEngine.cxx.

References _lock, _windows, count, do_remove_window(), and PT().

Referenced by PandaFramework::close_all_windows(), and PandaFramework::close_window().

void GraphicsEngine::render_frame  )  [private]
 

Definition at line 307 of file graphicsEngine.cxx.

References _app, _auto_flip, GraphicsEngine::RenderThread::_cv, GraphicsEngine::RenderThread::_cv_mutex, _flip_state, _lock, _pipeline, GraphicsEngine::RenderThread::_thread_state, _threads, Pipeline::cycle(), do_flip_frame(), GraphicsEngine::WindowRenderer::do_frame(), FS_draw, FS_flip, ClockObject::get_global_clock(), Mutex::lock(), Mutex::release(), ConditionVar::signal(), ClockObject::tick(), TS_do_frame, and TS_wait.

Referenced by PandaFramework::do_frame().

void GraphicsEngine::render_subframe GraphicsStateGuardian gsg,
DisplayRegion dr,
bool  cull_sorting
[private]
 

Definition at line 404 of file graphicsEngine.cxx.

References cull_and_draw_together(), and cull_bin_draw().

Referenced by NonlinearImager::render_screen().

INLINE void GraphicsEngine::set_auto_flip bool  auto_flip  )  [private]
 

void GraphicsEngine::set_frame_buffer_properties const FrameBufferProperties properties  )  [private]
 

Definition at line 90 of file graphicsEngine.cxx.

References _frame_buffer_properties, and _lock.

void GraphicsEngine::set_threading_model const GraphicsThreadingModel threading_model  )  [private]
 

Definition at line 119 of file graphicsEngine.cxx.

References _lock, _threading_model, Thread::is_threading_supported(), and threading_model.

bool GraphicsEngine::setup_gsg GraphicsStateGuardian gsg,
SceneSetup scene_setup
[private]
 

Definition at line 762 of file graphicsEngine.cxx.

References SceneSetup::get_lens(), Lens::get_type(), GraphicsStateGuardian::get_type(), NULL, GraphicsStateGuardian::set_lens(), and GraphicsStateGuardian::set_scene().

Referenced by cull_and_draw_together(), and do_draw().

void GraphicsEngine::sync_frame  )  [private]
 

Definition at line 362 of file graphicsEngine.cxx.

References _flip_state, _lock, do_sync_frame(), and FS_draw.

void GraphicsEngine::terminate_threads  )  [private]
 

Definition at line 820 of file graphicsEngine.cxx.

References GraphicsEngine::RenderThread::_cv, GraphicsEngine::RenderThread::_cv_mutex, _lock, GraphicsEngine::RenderThread::_thread_state, _threads, Thread::join(), Mutex::lock(), Mutex::release(), ConditionVar::signal(), TS_do_release, TS_terminate, and TS_wait.

Referenced by remove_all_windows().


Friends And Related Function Documentation

friend class WindowRenderer [friend]
 

Definition at line 183 of file graphicsEngine.h.


Member Data Documentation

PUBLISHED GraphicsEngine::__pad0__ [private]
 

Definition at line 56 of file graphicsEngine.h.

WindowRenderer GraphicsEngine::_app [private]
 

Definition at line 166 of file graphicsEngine.h.

Referenced by do_flip_frame(), do_remove_window(), get_window_renderer(), make_window(), remove_all_windows(), and render_frame().

bool GraphicsEngine::_auto_flip [private]
 

Definition at line 171 of file graphicsEngine.h.

Referenced by render_frame().

PStatCollector GraphicsEngine::_cull_pcollector [static, private]
 

Referenced by do_cull().

PStatCollector GraphicsEngine::_draw_pcollector [static, private]
 

Referenced by do_draw().

FlipState GraphicsEngine::_flip_state [private]
 

Definition at line 178 of file graphicsEngine.h.

Referenced by do_flip_frame(), do_sync_frame(), flip_frame(), render_frame(), and sync_frame().

FrameBufferProperties GraphicsEngine::_frame_buffer_properties [private]
 

Definition at line 169 of file graphicsEngine.h.

Referenced by get_frame_buffer_properties(), and set_frame_buffer_properties().

Mutex GraphicsEngine::_lock [private]
 

Definition at line 179 of file graphicsEngine.h.

Referenced by flip_frame(), get_frame_buffer_properties(), get_threading_model(), get_window_renderer(), make_window(), remove_window(), render_frame(), set_frame_buffer_properties(), set_threading_model(), sync_frame(), and terminate_threads().

Pipeline* GraphicsEngine::_pipeline [private]
 

Definition at line 163 of file graphicsEngine.h.

Referenced by render_frame().

GraphicsThreadingModel GraphicsEngine::_threading_model [private]
 

Definition at line 170 of file graphicsEngine.h.

Referenced by get_threading_model(), and set_threading_model().

Threads GraphicsEngine::_threads [private]
 

Definition at line 168 of file graphicsEngine.h.

Referenced by do_flip_frame(), do_remove_window(), do_sync_frame(), get_window_renderer(), render_frame(), and terminate_threads().

Windows GraphicsEngine::_windows [private]
 

Definition at line 164 of file graphicsEngine.h.

Referenced by is_empty(), make_window(), remove_all_windows(), and remove_window().

GraphicsStateGuardian* GraphicsEngine::gsg [private]
 

Definition at line 106 of file graphicsEngine.h.

const FrameBufferProperties& GraphicsEngine::properties [private]
 

Definition at line 70 of file graphicsEngine.h.

const FrameBufferProperties const GraphicsThreadingModel& GraphicsEngine::threading_model [private]
 

Definition at line 70 of file graphicsEngine.h.


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 00:12:28 2003 for Panda by doxygen1.3