Panda3D
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
PandaFramework Class Reference

This class serves to provide a high-level framework for basic applications that use Panda in simple ways (like opening a window to view models, etc.). More...

#include "pandaFramework.h"

Public Member Functions

bool all_windows_closed () const
 Returns true if all of the opened windows have been closed by the user, false otherwise. More...
 
void clear_exit_flag ()
 Resets the exit flag after it has previously been set. More...
 
void clear_highlight ()
 Unhighlights the currently highlighted node, if any. More...
 
void close_all_windows ()
 Closes all currently open windows and empties the list of windows. More...
 
void close_framework ()
 Should be called at the end of an application to close Panda. More...
 
void close_window (int n)
 Closes the nth window and removes it from the list. More...
 
void close_window (WindowFramework *wf)
 Closes the indicated WindowFramework window and removes it from the list. More...
 
void define_key (const std::string &event_name, const std::string &description, EventHandler::EventCallbackFunction *function, void *data)
 Sets up a handler for the indicated key. More...
 
virtual bool do_frame (Thread *current_thread)
 Renders one frame and performs all associated processing. More...
 
void enable_default_keys ()
 Sets callbacks on the event handler to handle all of the normal viewer keys, like t to toggle texture, ESC or q to quit, etc. More...
 
int find_window (const GraphicsOutput *win) const
 Returns the index of the first WindowFramework object found that references the indicated GraphicsOutput pointer, or -1 if none do. More...
 
int find_window (const WindowFramework *wf) const
 Returns the index of the given WindowFramework object, or -1 if the object does not represent a window opened with this PandaFramework. More...
 
WindowFramework::BackgroundType get_background_type () const
 Returns the current background type setting. More...
 
const NodePathget_data_root () const
 Returns the root of the data graph. More...
 
GraphicsPipeget_default_pipe ()
 Returns the default pipe. More...
 
virtual void get_default_window_props (WindowProperties &props)
 Fills in the indicated window properties structure according to the normal window properties for this application. More...
 
EventHandlerget_event_handler ()
 Returns the EventHandler object that serves events in the framework. More...
 
GraphicsEngineget_graphics_engine ()
 Returns the GraphicsEngine that is used to render all the windows in the framework. More...
 
const NodePathget_highlight () const
 Returns the currently highlighted node, if any, or an empty NodePath if no node is highlighted. More...
 
bool get_lighting () const
 Returns the current state of the lighting flag. More...
 
NodePathget_models ()
 Returns the root of the scene graph normally reserved for parenting models and such. More...
 
NodePath get_mouse (GraphicsOutput *window)
 Returns a NodePath to the MouseAndKeyboard associated with the indicated GraphicsWindow object. More...
 
int get_num_windows () const
 Returns the number of windows that are currently open. More...
 
bool get_perpixel () const
 Returns the current state of the perpixel flag. More...
 
RecorderControllerget_recorder () const
 Returns the RecorderController that has been associated with the PandaFramework, if any, or NULL if none has (the normal case). More...
 
AsyncTaskManagerget_task_mgr ()
 Returns the Task Manager object that manages tasks in the framework. More...
 
bool get_texture () const
 Returns the current state of the texture flag. More...
 
bool get_two_sided () const
 Returns the current state of the two_sided flag. More...
 
WindowFrameworkget_window (int n) const
 Returns the nth window currently open. More...
 
bool get_wireframe () const
 Returns the current state of the wireframe flag. More...
 
bool has_highlight () const
 Returns true if any node is highlighted, false otherwise. More...
 
void main_loop ()
 Called to yield control to the panda framework. More...
 
void open_framework ()
 Should be called once at the beginning of the application to initialize Panda (and the framework) for use. More...
 
void open_framework (int &argc, char **&argv)
 
WindowFrameworkopen_window ()
 Opens a window on the default graphics pipe. More...
 
WindowFrameworkopen_window (GraphicsPipe *pipe, GraphicsStateGuardian *gsg=nullptr)
 Opens a new window on the indicated pipe, using the default parameters. More...
 
WindowFrameworkopen_window (const WindowProperties &props, int flags, GraphicsPipe *pipe=nullptr, GraphicsStateGuardian *gsg=nullptr)
 Opens a new window using the indicated properties. More...
 
void remove_mouse (const GraphicsOutput *window)
 Removes the mouse that may have been created by an earlier call to get_mouse(). More...
 
void report_frame_rate (std::ostream &out) const
 Reports the currently measured average frame rate to the indicated ostream. More...
 
void reset_frame_rate ()
 Resets the frame rate computation. More...
 
void set_background_type (WindowFramework::BackgroundType type)
 Sets the background type of all windows. More...
 
void set_exit_flag ()
 Sets the flag that indicates it is time for the application to exit. More...
 
void set_highlight (const NodePath &node)
 Sets the indicated node (normally a node within the get_models() tree) up as the highlighted node. More...
 
void set_lighting (bool enable)
 Sets the lighting state on all windows. More...
 
void set_perpixel (bool enable)
 Sets the perpixel state on all windows. More...
 
void set_recorder (RecorderController *recorder)
 Assigns a RecorderController with the PandaFramework. More...
 
void set_texture (bool enable)
 Sets the texture state on all windows. More...
 
void set_two_sided (bool enable)
 Sets the two_sided state on all windows. More...
 
void set_window_title (const std::string &title)
 Specifies the title that is set for all subsequently created windows. More...
 
void set_wireframe (bool enable)
 Sets the wireframe state on all windows. More...
 

Static Public Member Functions

static void event_a (const Event *, void *data)
 Default handler for a key: toggle the animation controls. More...
 
static void event_A (const Event *, void *data)
 Default handler for shift-A key: analyze the contents of the scene graph, or the highlighted node. More...
 
static void event_arrow_down (const Event *, void *data)
 Default handler for up arrow key: in highlight mode, move the highlight to the node's first child. More...
 
static void event_arrow_left (const Event *, void *data)
 Default handler for up arrow key: in highlight mode, move the highlight to the node's nearest sibling on the left. More...
 
static void event_arrow_right (const Event *, void *data)
 Default handler for up arrow key: in highlight mode, move the highlight to the node's nearest sibling on the right. More...
 
static void event_arrow_up (const Event *, void *data)
 Default handler for up arrow key: in highlight mode, move the highlight to the node's parent. More...
 
static void event_b (const Event *, void *data)
 Default handler for b key: toggle backface (two-sided rendering). More...
 
static void event_B (const Event *, void *data)
 Default handler for shift-B key: describe the bounding volume of the currently selected object, or the entire scene. More...
 
static void event_c (const Event *, void *data)
 Default handler for c key: center the trackball over the scene, or over the highlighted part of the scene. More...
 
static void event_C (const Event *, void *data)
 Default handler for shift-C key: toggle the showing of collision solids. More...
 
static void event_comma (const Event *, void *data)
 Default handler for comma key: rotate background color. More...
 
static void event_esc (const Event *, void *data)
 Default handler for ESC or q key: close the current window (and exit the application if that was the last window). More...
 
static void event_f (const Event *, void *data)
 Default handler for f key: report and reset frame rate. More...
 
static void event_f9 (const Event *, void *data)
 Default handler for f9 key: take screenshot. More...
 
static void event_h (const Event *, void *data)
 Default handler for h key: toggle highlight mode. More...
 
static void event_i (const Event *, void *data)
 Default handler for i key: invert one-sided faces. More...
 
static void event_l (const Event *, void *data)
 Default handler for l key: toggle lighting. More...
 
static void event_L (const Event *, void *data)
 Default handler for shift-L key: list the contents of the scene graph, or the highlighted node. More...
 
static void event_p (const Event *, void *data)
 Default handler for p key: toggle per-pixel lighting. More...
 
static void event_question (const Event *event, void *data)
 Default handler for ? key: show the available keys. More...
 
static void event_S (const Event *, void *data)
 Default handler for shift-S key: activate stats. More...
 
static void event_t (const Event *, void *data)
 Default handler for t key: toggle texture. More...
 
static void event_w (const Event *, void *data)
 Default handler for w key: toggle wireframe. More...
 
static void event_window_event (const Event *, void *data)
 Default handler for window events: window resized or closed, etc. More...
 
static int hide_collision_solids (NodePath node)
 Hides any collision solids, or occluders, which are visible in the indicated scene graph. More...
 
static int show_collision_solids (NodePath node)
 Shows any collision solids, or occluders, which are directly hidden in the indicated scene graph. More...
 
static AsyncTask::DoneStatus task_clear_screenshot_text (GenericAsyncTask *task, void *data)
 
static AsyncTask::DoneStatus task_clear_text (GenericAsyncTask *task, void *data)
 Called once to remove the screenshot text from onscreen. More...
 
static AsyncTask::DoneStatus task_data_loop (GenericAsyncTask *task, void *data)
 Called once per frame to process the data graph (which handles user input via the mouse and keyboard, etc.) More...
 
static AsyncTask::DoneStatus task_event (GenericAsyncTask *task, void *data)
 Called once per frame to process the pending events. More...
 
static AsyncTask::DoneStatus task_garbage_collect (GenericAsyncTask *task, void *data)
 This task is created automatically if garbage_collect_states is true. More...
 
static AsyncTask::DoneStatus task_igloop (GenericAsyncTask *task, void *data)
 Called once per frame to render the scene. More...
 
static AsyncTask::DoneStatus task_play_frame (GenericAsyncTask *task, void *data)
 Called once per frame to ask the recorder to play back the user input data, if enabled. More...
 
static AsyncTask::DoneStatus task_record_frame (GenericAsyncTask *task, void *data)
 Called once per frame to ask the recorder to record the user input data, if enabled. More...
 

Static Public Attributes

static LoaderOptions _loader_options
 

Friends

class WindowFramework
 

Detailed Description

This class serves to provide a high-level framework for basic applications that use Panda in simple ways (like opening a window to view models, etc.).

Definition at line 38 of file pandaFramework.h.

Member Function Documentation

◆ all_windows_closed()

bool PandaFramework::all_windows_closed ( ) const

Returns true if all of the opened windows have been closed by the user, false otherwise.

Definition at line 519 of file pandaFramework.cxx.

References WindowFramework::get_graphics_output(), and GraphicsOutput::is_valid().

◆ clear_exit_flag()

void PandaFramework::clear_exit_flag ( )
inline

Resets the exit flag after it has previously been set.

Definition at line 197 of file pandaFramework.I.

◆ clear_highlight()

void PandaFramework::clear_highlight ( )

Unhighlights the currently highlighted node, if any.

Definition at line 722 of file pandaFramework.cxx.

References NodePath::clear_render_mode(), NodePath::hide_bounds(), and NodePath::is_empty().

Referenced by set_highlight().

◆ close_all_windows()

void PandaFramework::close_all_windows ( )

Closes all currently open windows and empties the list of windows.

Definition at line 492 of file pandaFramework.cxx.

References WindowFramework::get_graphics_output().

Referenced by close_framework().

◆ close_framework()

void PandaFramework::close_framework ( )

Should be called at the end of an application to close Panda.

This is optional, as the destructor will do the same thing.

Definition at line 178 of file pandaFramework.cxx.

References close_all_windows(), Thread::prepare_for_exit(), and EventHandler::remove_all_hooks().

◆ close_window() [1/2]

void PandaFramework::close_window ( int  n)

Closes the nth window and removes it from the list.

Definition at line 475 of file pandaFramework.cxx.

Referenced by close_window().

◆ close_window() [2/2]

void PandaFramework::close_window ( WindowFramework wf)
inline

Closes the indicated WindowFramework window and removes it from the list.

Definition at line 85 of file pandaFramework.I.

References close_window(), and find_window().

◆ define_key()

void PandaFramework::define_key ( const std::string &  event_name,
const std::string &  description,
EventHandler::EventCallbackFunction *  function,
void *  data 
)

Sets up a handler for the indicated key.

When the key is pressed in a window, the given callback will be called. The description is a one-line description of the function of the key, for display to the user.

Definition at line 285 of file pandaFramework.cxx.

◆ do_frame()

bool PandaFramework::do_frame ( Thread current_thread)
virtual

Renders one frame and performs all associated processing.

Returns true if we should continue rendering, false if we should exit. This is normally called only from main_loop().

Definition at line 748 of file pandaFramework.cxx.

Referenced by main_loop().

◆ enable_default_keys()

void PandaFramework::enable_default_keys ( )

Sets callbacks on the event handler to handle all of the normal viewer keys, like t to toggle texture, ESC or q to quit, etc.

Definition at line 735 of file pandaFramework.cxx.

◆ event_a()

void PandaFramework::event_a ( const Event event,
void *  data 
)
static

Default handler for a key: toggle the animation controls.

Definition at line 1013 of file pandaFramework.cxx.

◆ event_A()

void PandaFramework::event_A ( const Event ,
void *  data 
)
static

Default handler for shift-A key: analyze the contents of the scene graph, or the highlighted node.

Definition at line 1077 of file pandaFramework.cxx.

◆ event_arrow_down()

void PandaFramework::event_arrow_down ( const Event ,
void *  data 
)
static

Default handler for up arrow key: in highlight mode, move the highlight to the node's first child.

Definition at line 1126 of file pandaFramework.cxx.

◆ event_arrow_left()

void PandaFramework::event_arrow_left ( const Event ,
void *  data 
)
static

Default handler for up arrow key: in highlight mode, move the highlight to the node's nearest sibling on the left.

Definition at line 1142 of file pandaFramework.cxx.

◆ event_arrow_right()

void PandaFramework::event_arrow_right ( const Event ,
void *  data 
)
static

Default handler for up arrow key: in highlight mode, move the highlight to the node's nearest sibling on the right.

Definition at line 1164 of file pandaFramework.cxx.

◆ event_arrow_up()

void PandaFramework::event_arrow_up ( const Event ,
void *  data 
)
static

Default handler for up arrow key: in highlight mode, move the highlight to the node's parent.

Definition at line 1110 of file pandaFramework.cxx.

◆ event_b()

void PandaFramework::event_b ( const Event event,
void *  data 
)
static

Default handler for b key: toggle backface (two-sided rendering).

Definition at line 936 of file pandaFramework.cxx.

◆ event_B()

void PandaFramework::event_B ( const Event ,
void *  data 
)
static

Default handler for shift-B key: describe the bounding volume of the currently selected object, or the entire scene.

Definition at line 1045 of file pandaFramework.cxx.

◆ event_c()

void PandaFramework::event_c ( const Event event,
void *  data 
)
static

Default handler for c key: center the trackball over the scene, or over the highlighted part of the scene.

Definition at line 993 of file pandaFramework.cxx.

◆ event_C()

void PandaFramework::event_C ( const Event ,
void *  data 
)
static

Default handler for shift-C key: toggle the showing of collision solids.

Definition at line 1027 of file pandaFramework.cxx.

◆ event_comma()

void PandaFramework::event_comma ( const Event event,
void *  data 
)
static

Default handler for comma key: rotate background color.

Definition at line 1246 of file pandaFramework.cxx.

◆ event_esc()

void PandaFramework::event_esc ( const Event event,
void *  data 
)
static

Default handler for ESC or q key: close the current window (and exit the application if that was the last window).

Definition at line 857 of file pandaFramework.cxx.

◆ event_f()

void PandaFramework::event_f ( const Event ,
void *  data 
)
static

Default handler for f key: report and reset frame rate.

Definition at line 892 of file pandaFramework.cxx.

◆ event_f9()

void PandaFramework::event_f9 ( const Event event,
void *  data 
)
static

Default handler for f9 key: take screenshot.

Definition at line 1199 of file pandaFramework.cxx.

◆ event_h()

void PandaFramework::event_h ( const Event ,
void *  data 
)
static

Default handler for h key: toggle highlight mode.

In this mode, you can walk the scene graph with the arrow keys to highlight different nodes.

Definition at line 1095 of file pandaFramework.cxx.

◆ event_i()

void PandaFramework::event_i ( const Event event,
void *  data 
)
static

Default handler for i key: invert one-sided faces.

Definition at line 950 of file pandaFramework.cxx.

◆ event_l()

void PandaFramework::event_l ( const Event event,
void *  data 
)
static

Default handler for l key: toggle lighting.

Definition at line 964 of file pandaFramework.cxx.

◆ event_L()

void PandaFramework::event_L ( const Event ,
void *  data 
)
static

Default handler for shift-L key: list the contents of the scene graph, or the highlighted node.

Definition at line 1061 of file pandaFramework.cxx.

◆ event_p()

void PandaFramework::event_p ( const Event event,
void *  data 
)
static

Default handler for p key: toggle per-pixel lighting.

Definition at line 978 of file pandaFramework.cxx.

◆ event_question()

void PandaFramework::event_question ( const Event event,
void *  data 
)
static

Default handler for ? key: show the available keys.

Definition at line 1271 of file pandaFramework.cxx.

◆ event_S()

void PandaFramework::event_S ( const Event ,
void *  data 
)
static

Default handler for shift-S key: activate stats.

Definition at line 1186 of file pandaFramework.cxx.

◆ event_t()

void PandaFramework::event_t ( const Event event,
void *  data 
)
static

Default handler for t key: toggle texture.

Definition at line 922 of file pandaFramework.cxx.

◆ event_w()

void PandaFramework::event_w ( const Event event,
void *  data 
)
static

Default handler for w key: toggle wireframe.

Definition at line 902 of file pandaFramework.cxx.

◆ event_window_event()

void PandaFramework::event_window_event ( const Event event,
void *  data 
)
static

Default handler for window events: window resized or closed, etc.

Definition at line 1324 of file pandaFramework.cxx.

◆ find_window() [1/2]

int PandaFramework::find_window ( const GraphicsOutput win) const

Returns the index of the first WindowFramework object found that references the indicated GraphicsOutput pointer, or -1 if none do.

Definition at line 443 of file pandaFramework.cxx.

Referenced by close_window().

◆ find_window() [2/2]

int PandaFramework::find_window ( const WindowFramework wf) const

Returns the index of the given WindowFramework object, or -1 if the object does not represent a window opened with this PandaFramework.

Definition at line 459 of file pandaFramework.cxx.

◆ get_background_type()

WindowFramework::BackgroundType PandaFramework::get_background_type ( ) const
inline

Returns the current background type setting.

Definition at line 136 of file pandaFramework.I.

◆ get_data_root()

const NodePath & PandaFramework::get_data_root ( ) const
inline

Returns the root of the data graph.

This is the graph of nodes that is traversed to control the inputs from user devices like the mouse and keyboard.

Definition at line 35 of file pandaFramework.I.

◆ get_default_pipe()

GraphicsPipe * PandaFramework::get_default_pipe ( )

Returns the default pipe.

This is the GraphicsPipe that all windows in the framework will be created on, unless otherwise specified in open_window(). It is usually the primary graphics interface on the local machine.

If the default pipe has not yet been created, this creates it.

The return value is the default pipe, or NULL if no default pipe could be created.

Definition at line 220 of file pandaFramework.cxx.

Referenced by open_window().

◆ get_default_window_props()

void PandaFramework::get_default_window_props ( WindowProperties props)
virtual

Fills in the indicated window properties structure according to the normal window properties for this application.

Definition at line 318 of file pandaFramework.cxx.

References WindowProperties::add_properties(), and WindowProperties::set_title.

◆ get_event_handler()

EventHandler & PandaFramework::get_event_handler ( )
inline

Returns the EventHandler object that serves events in the framework.

This is primarily used to dispatch on keypresses and such.

Definition at line 44 of file pandaFramework.I.

◆ get_graphics_engine()

GraphicsEngine * PandaFramework::get_graphics_engine ( )
inline

Returns the GraphicsEngine that is used to render all the windows in the framework.

Normally there's no reason for user code to mess with this.

Definition at line 19 of file pandaFramework.I.

References AsyncTaskManager::add(), and task_igloop().

◆ get_highlight()

const NodePath & PandaFramework::get_highlight ( ) const
inline

Returns the currently highlighted node, if any, or an empty NodePath if no node is highlighted.

Definition at line 153 of file pandaFramework.I.

◆ get_lighting()

bool PandaFramework::get_lighting ( ) const
inline

Returns the current state of the lighting flag.

Definition at line 120 of file pandaFramework.I.

◆ get_models()

NodePath & PandaFramework::get_models ( )

Returns the root of the scene graph normally reserved for parenting models and such.

This scene graph may be instanced to each window's render tree as the window is created.

Definition at line 537 of file pandaFramework.cxx.

References NodePath::is_empty().

◆ get_mouse()

NodePath PandaFramework::get_mouse ( GraphicsOutput window)

Returns a NodePath to the MouseAndKeyboard associated with the indicated GraphicsWindow object.

If there's not yet a mouse associated with the window, creates one.

This allows multiple WindowFramework objects that represent different display regions of the same GraphicsWindow to share the same mouse.

Definition at line 238 of file pandaFramework.cxx.

◆ get_num_windows()

int PandaFramework::get_num_windows ( ) const
inline

Returns the number of windows that are currently open.

Definition at line 68 of file pandaFramework.I.

◆ get_perpixel()

bool PandaFramework::get_perpixel ( ) const
inline

Returns the current state of the perpixel flag.

Definition at line 128 of file pandaFramework.I.

◆ get_recorder()

RecorderController * PandaFramework::get_recorder ( ) const
inline

Returns the RecorderController that has been associated with the PandaFramework, if any, or NULL if none has (the normal case).

If a RecorderController is associated, it will presumably be used for recording user input to a session file, or for playing back the user input from a previously-recorded session.

Definition at line 166 of file pandaFramework.I.

◆ get_task_mgr()

AsyncTaskManager & PandaFramework::get_task_mgr ( )
inline

Returns the Task Manager object that manages tasks in the framework.

Definition at line 52 of file pandaFramework.I.

◆ get_texture()

bool PandaFramework::get_texture ( ) const
inline

Returns the current state of the texture flag.

Definition at line 104 of file pandaFramework.I.

◆ get_two_sided()

bool PandaFramework::get_two_sided ( ) const
inline

Returns the current state of the two_sided flag.

Definition at line 112 of file pandaFramework.I.

◆ get_window()

WindowFramework * PandaFramework::get_window ( int  n) const
inline

Returns the nth window currently open.

Definition at line 76 of file pandaFramework.I.

◆ get_wireframe()

bool PandaFramework::get_wireframe ( ) const
inline

Returns the current state of the wireframe flag.

Definition at line 96 of file pandaFramework.I.

◆ has_highlight()

bool PandaFramework::has_highlight ( ) const
inline

Returns true if any node is highlighted, false otherwise.

Definition at line 144 of file pandaFramework.I.

References NodePath::is_empty().

◆ hide_collision_solids()

int PandaFramework::hide_collision_solids ( NodePath  node)
static

Hides any collision solids, or occluders, which are visible in the indicated scene graph.

Returns the number of nodes hidden.

Definition at line 659 of file pandaFramework.cxx.

References NodePath::get_num_children(), NodePath::hide(), NodePath::is_hidden(), TypedObject::is_of_type(), and NodePath::node().

◆ main_loop()

void PandaFramework::main_loop ( )

Called to yield control to the panda framework.

This function does not return until set_exit_flag() has been called.

Definition at line 761 of file pandaFramework.cxx.

References do_frame().

◆ open_framework() [1/2]

void PandaFramework::open_framework ( )

Should be called once at the beginning of the application to initialize Panda (and the framework) for use.

The command-line arguments should be passed in so Panda can remove any arguments that it recognizes as special control parameters.

Definition at line 85 of file pandaFramework.cxx.

References init_libpandagl().

Referenced by open_framework().

◆ open_framework() [2/2]

void PandaFramework::open_framework ( int &  argc,
char **&  argv 
)

Definition at line 169 of file pandaFramework.cxx.

References open_framework().

◆ open_window() [1/3]

WindowFramework * PandaFramework::open_window ( )

Opens a window on the default graphics pipe.

If the default graphics pipe can't open a window for some reason, automatically fails over to the next available graphics pipe, and updates _default_pipe accordingly. Returns NULL only if all graphics pipes fail.

Definition at line 335 of file pandaFramework.cxx.

References get_default_pipe(), GraphicsPipeSelection::get_global_ptr(), GraphicsPipeSelection::get_num_pipe_types, and GraphicsPipeSelection::load_aux_modules().

◆ open_window() [2/3]

WindowFramework * PandaFramework::open_window ( GraphicsPipe pipe,
GraphicsStateGuardian gsg = nullptr 
)

Opens a new window on the indicated pipe, using the default parameters.

Returns the new WindowFramework if successful, or NULL if not.

Definition at line 376 of file pandaFramework.cxx.

◆ open_window() [3/3]

WindowFramework * PandaFramework::open_window ( const WindowProperties props,
int  flags,
GraphicsPipe pipe = nullptr,
GraphicsStateGuardian gsg = nullptr 
)

Opens a new window using the indicated properties.

(You may initialize the properties to their default values by calling get_default_window_props() first.)

Returns the new WindowFramework if successful, or NULL if not.

Definition at line 398 of file pandaFramework.cxx.

References get_default_pipe().

◆ remove_mouse()

void PandaFramework::remove_mouse ( const GraphicsOutput window)

Removes the mouse that may have been created by an earlier call to get_mouse().

Definition at line 271 of file pandaFramework.cxx.

◆ report_frame_rate()

void PandaFramework::report_frame_rate ( std::ostream &  out) const

Reports the currently measured average frame rate to the indicated ostream.

Definition at line 548 of file pandaFramework.cxx.

References ClockObject::get_frame_count, ClockObject::get_frame_time, and ClockObject::get_global_clock().

◆ reset_frame_rate()

void PandaFramework::reset_frame_rate ( )

Resets the frame rate computation.

Definition at line 565 of file pandaFramework.cxx.

References ClockObject::get_frame_count, ClockObject::get_frame_time, and ClockObject::get_global_clock().

◆ set_background_type()

void PandaFramework::set_background_type ( WindowFramework::BackgroundType  type)

Sets the background type of all windows.

Definition at line 644 of file pandaFramework.cxx.

References WindowFramework::set_background_type().

◆ set_exit_flag()

void PandaFramework::set_exit_flag ( )
inline

Sets the flag that indicates it is time for the application to exit.

The application will actually exit at the end of the current frame.

Definition at line 189 of file pandaFramework.I.

◆ set_highlight()

void PandaFramework::set_highlight ( const NodePath node)

Sets the indicated node (normally a node within the get_models() tree) up as the highlighted node.

Certain operations affect the highlighted node only.

Definition at line 708 of file pandaFramework.cxx.

References clear_highlight(), NodePath::is_empty(), NodePath::set_render_mode_filled_wireframe(), and NodePath::show_bounds().

◆ set_lighting()

void PandaFramework::set_lighting ( bool  enable)

Sets the lighting state on all windows.

Definition at line 616 of file pandaFramework.cxx.

References WindowFramework::set_lighting().

◆ set_perpixel()

void PandaFramework::set_perpixel ( bool  enable)

Sets the perpixel state on all windows.

Definition at line 630 of file pandaFramework.cxx.

References WindowFramework::set_perpixel().

◆ set_recorder()

void PandaFramework::set_recorder ( RecorderController recorder)
inline

Assigns a RecorderController with the PandaFramework.

This should be called before any windows are opened. The subsequently opened windows will register their user inputs with the recorder.

If a RecorderController is associated, it will presumably be used for recording user input to a session file, or for playing back the user input from a previously-recorded session.

Definition at line 180 of file pandaFramework.I.

◆ set_texture()

void PandaFramework::set_texture ( bool  enable)

Sets the texture state on all windows.

Definition at line 588 of file pandaFramework.cxx.

References WindowFramework::set_texture().

◆ set_two_sided()

void PandaFramework::set_two_sided ( bool  enable)

Sets the two_sided state on all windows.

Definition at line 602 of file pandaFramework.cxx.

References WindowFramework::set_two_sided().

◆ set_window_title()

void PandaFramework::set_window_title ( const std::string &  title)
inline

Specifies the title that is set for all subsequently created windows.

Definition at line 60 of file pandaFramework.I.

◆ set_wireframe()

void PandaFramework::set_wireframe ( bool  enable)

Sets the wireframe state on all windows.

Definition at line 574 of file pandaFramework.cxx.

References WindowFramework::set_wireframe().

◆ show_collision_solids()

int PandaFramework::show_collision_solids ( NodePath  node)
static

Shows any collision solids, or occluders, which are directly hidden in the indicated scene graph.

Returns the number of nodes shown.

Definition at line 683 of file pandaFramework.cxx.

References NodePath::get_hidden_ancestor(), NodePath::get_num_children(), TypedObject::is_of_type(), NodePath::node(), and NodePath::show().

◆ task_clear_text()

AsyncTask::DoneStatus PandaFramework::task_clear_text ( GenericAsyncTask task,
void *  data 
)
static

Called once to remove the screenshot text from onscreen.

Definition at line 1451 of file pandaFramework.cxx.

◆ task_data_loop()

AsyncTask::DoneStatus PandaFramework::task_data_loop ( GenericAsyncTask task,
void *  data 
)
static

Called once per frame to process the data graph (which handles user input via the mouse and keyboard, etc.)

Definition at line 1375 of file pandaFramework.cxx.

◆ task_event()

AsyncTask::DoneStatus PandaFramework::task_event ( GenericAsyncTask task,
void *  data 
)
static

Called once per frame to process the pending events.

Definition at line 1388 of file pandaFramework.cxx.

◆ task_garbage_collect()

AsyncTask::DoneStatus PandaFramework::task_garbage_collect ( GenericAsyncTask task,
void *  data 
)
static

This task is created automatically if garbage_collect_states is true.

It calls the needed TransformState::garbage_collect() and RenderState::garbage_collect() methods each frame.

Definition at line 1464 of file pandaFramework.cxx.

◆ task_igloop()

AsyncTask::DoneStatus PandaFramework::task_igloop ( GenericAsyncTask task,
void *  data 
)
static

Called once per frame to render the scene.

Definition at line 1401 of file pandaFramework.cxx.

Referenced by get_graphics_engine().

◆ task_play_frame()

AsyncTask::DoneStatus PandaFramework::task_play_frame ( GenericAsyncTask task,
void *  data 
)
static

Called once per frame to ask the recorder to play back the user input data, if enabled.

Definition at line 1437 of file pandaFramework.cxx.

◆ task_record_frame()

AsyncTask::DoneStatus PandaFramework::task_record_frame ( GenericAsyncTask task,
void *  data 
)
static

Called once per frame to ask the recorder to record the user input data, if enabled.

Definition at line 1422 of file pandaFramework.cxx.


The documentation for this class was generated from the following files: