49 _event_handler(*
EventHandler::get_global_event_handler()),
53 _made_default_pipe =
false;
54 _window_title = string();
58 _wireframe_enabled =
false;
59 _texture_enabled =
true;
60 _two_sided_enabled =
false;
61 _lighting_enabled =
false;
62 _perpixel_enabled =
false;
63 _background_type = WindowFramework::BT_default;
64 _default_keys_enabled =
false;
98 #elif defined(HAVE_DX9)
101 #elif defined(HAVE_TINYDISPLAY)
102 extern EXPCL_TINYDISPLAY
void init_libtinydisplay();
103 init_libtinydisplay();
135 if (garbage_collect_states) {
141 if (!playback_session.empty()) {
145 _recorder->
begin_playback(Filename::from_os_specific(playback_session));
151 }
else if (!record_session.empty()) {
155 _recorder->
begin_record(Filename::from_os_specific(record_session));
185 if (_engine !=
nullptr) {
186 _engine->remove_all_windows();
190 _event_handler.remove_all_hooks();
195 _made_default_pipe =
false;
196 _default_pipe.clear();
200 _wireframe_enabled =
false;
201 _two_sided_enabled =
false;
202 _lighting_enabled =
false;
203 _default_keys_enabled =
false;
223 nassertr(_is_open,
nullptr);
224 if (!_made_default_pipe) {
226 _made_default_pipe =
true;
228 return _default_pipe;
241 Mouses::iterator mi = _mouses.
find(window);
242 if (mi != _mouses.end()) {
248 if (window->
is_of_type(GraphicsWindow::get_class_type())) {
255 if (recorder !=
nullptr) {
258 mouse = mouse.attach_new_node(mouse_recorder);
263 _mouses[window] = mouse;
274 Mouses::iterator mi = _mouses.
find(window);
275 if (mi != _mouses.end()) {
276 (*mi).second.remove_node();
287define_key(
const string &event_name,
const string &description,
288 EventHandler::EventCallbackFunction *function,
290 if (_event_handler.has_hook(event_name)) {
294 KeyDefinitions::iterator di;
295 di = _key_definitions.begin();
296 while (di != _key_definitions.end() && (*di)._event_name != event_name) {
299 if (di != _key_definitions.end()) {
300 _key_definitions.erase(di);
305 _event_handler.add_hook(event_name, function, data);
307 if (!description.empty()) {
308 KeyDefinition keydef;
309 keydef._event_name = event_name;
310 keydef._description = description;
311 _key_definitions.push_back(keydef);
325 if (!_window_title.empty()) {
339 if (pipe ==
nullptr) {
351 for (
int i = 0; i < num_pipe_types; i++) {
353 if (pipe_type != _default_pipe->get_type()) {
354 PT(
GraphicsPipe) new_pipe = selection->make_pipe(pipe_type);
355 if (new_pipe !=
nullptr) {
359 _default_pipe = new_pipe;
379 nassertr(_is_open,
nullptr);
384 int flags = GraphicsPipe::BF_require_window;
385 if (window_type ==
"offscreen") {
386 flags = GraphicsPipe::BF_refuse_window;
402 if (pipe ==
nullptr) {
404 if (pipe ==
nullptr) {
410 nassertr(_is_open,
nullptr);
411 PT(WindowFramework) wf = make_window_framework();
421 _engine->open_windows();
422 if (win !=
nullptr && !win->
is_valid()) {
424 _engine->remove_window(win);
429 if (win ==
nullptr) {
431 framework_cat.error()
432 <<
"Unable to create window.\n";
436 _windows.push_back(wf);
447 for (n = 0; n < (int)_windows.size(); n++) {
448 if (_windows[n]->get_graphics_output() == win) {
463 for (n = 0; n < (int)_windows.size(); n++) {
464 if (_windows[n] == wf) {
478 nassertv(n >= 0 && n < (
int)_windows.size());
479 WindowFramework *wf = _windows[n];
482 if (win !=
nullptr) {
483 _engine->remove_window(win);
487 _windows.erase(_windows.begin() + n);
495 Windows::iterator wi;
496 for (wi = _windows.begin(); wi != _windows.end(); ++wi) {
497 WindowFramework *wf = (*wi);
500 if (win !=
nullptr) {
501 _engine->remove_window(win);
508 for (mi = _mouses.begin(); mi != _mouses.end(); ++mi) {
509 (*mi).second.remove_node();
522 Windows::const_iterator wi;
523 for (wi = _windows.begin(); wi != _windows.end(); ++wi) {
524 WindowFramework *wf = (*wi);
540 if (_models.is_empty()) {
552 double delta = now - _start_time;
555 int num_frames = frame_count - _frame_count;
556 if (num_frames > 0) {
557 out << num_frames <<
" frames in " << delta <<
" seconds.\n";
558 double fps = ((double)num_frames) / delta;
559 out << fps <<
" fps average (" << 1000.0 / fps <<
"ms)\n";
577 Windows::iterator wi;
578 for (wi = _windows.begin(); wi != _windows.end(); ++wi) {
579 WindowFramework *wf = (*wi);
583 _wireframe_enabled = enable;
591 Windows::iterator wi;
592 for (wi = _windows.begin(); wi != _windows.end(); ++wi) {
593 WindowFramework *wf = (*wi);
597 _texture_enabled = enable;
605 Windows::iterator wi;
606 for (wi = _windows.begin(); wi != _windows.end(); ++wi) {
607 WindowFramework *wf = (*wi);
611 _two_sided_enabled = enable;
619 Windows::iterator wi;
620 for (wi = _windows.begin(); wi != _windows.end(); ++wi) {
621 WindowFramework *wf = (*wi);
625 _lighting_enabled = enable;
633 Windows::iterator wi;
634 for (wi = _windows.begin(); wi != _windows.end(); ++wi) {
635 WindowFramework *wf = (*wi);
639 _perpixel_enabled = enable;
647 Windows::iterator wi;
648 for (wi = _windows.begin(); wi != _windows.end(); ++wi) {
649 WindowFramework *wf = (*wi);
653 _background_type = type;
673 for (
int i = 0; i < num_children; i++) {
697 for (
int i = 0; i < num_children; i++) {
713 if (!_highlight.is_empty()) {
714 framework_cat.info(
false) << _highlight <<
"\n";
715 _highlight.show_bounds();
716 _highlight.set_render_mode_filled_wireframe(LColor(1.0f, 0.0f, 0.0f, 1.0f), 200);
725 if (!_highlight.is_empty()) {
726 _highlight.hide_bounds();
727 _highlight.clear_render_mode();
738 if (!_default_keys_enabled) {
739 do_enable_default_keys();
740 _default_keys_enabled =
true;
751 nassertr(_is_open,
false);
774make_window_framework() {
789 if (print_pipe_types) {
793 _default_pipe = selection->make_default_pipe();
795 if (_default_pipe ==
nullptr) {
796 nout <<
"No graphics pipe is available!\n"
797 <<
"Your Config.prc file must name at least one valid panda display\n"
798 <<
"library via load-display or aux-display.\n";
806do_enable_default_keys() {
840 bool any_text =
false;
841 if (!_screenshot_text.is_empty()) {
842 _screenshot_text.remove_node();
846 if (!_help_text.is_empty()) {
847 _help_text.remove_node();
860 if (event->get_num_parameters() == 1) {
863 DCAST_INTO_V(wf, param.
get_ptr());
867 PandaFramework *self = (PandaFramework *)data;
872 while (window_index != -1) {
881 self->_engine->open_windows();
885 self->_exit_flag =
true;
895 PandaFramework *self = (PandaFramework *)data;
905 if (event->get_num_parameters() == 1) {
908 DCAST_INTO_V(wf, param.
get_ptr());
925 if (event->get_num_parameters() == 1) {
928 DCAST_INTO_V(wf, param.
get_ptr());
939 if (event->get_num_parameters() == 1) {
942 DCAST_INTO_V(wf, param.
get_ptr());
953 if (event->get_num_parameters() == 1) {
956 DCAST_INTO_V(wf, param.
get_ptr());
967 if (event->get_num_parameters() == 1) {
970 DCAST_INTO_V(wf, param.
get_ptr());
981 if (event->get_num_parameters() == 1) {
984 DCAST_INTO_V(wf, param.
get_ptr());
996 if (event->get_num_parameters() == 1) {
999 DCAST_INTO_V(wf, param.
get_ptr());
1001 PandaFramework *self = (PandaFramework *)data;
1016 if (event->get_num_parameters() == 1) {
1018 WindowFramework *wf;
1019 DCAST_INTO_V(wf, param.
get_ptr());
1030 PandaFramework *self = (PandaFramework *)data;
1048 PandaFramework *self = (PandaFramework *)data;
1064 PandaFramework *self = (PandaFramework *)data;
1080 PandaFramework *self = (PandaFramework *)data;
1098 PandaFramework *self = (PandaFramework *)data;
1113 PandaFramework *self = (PandaFramework *)data;
1129 PandaFramework *self = (PandaFramework *)data;
1145 PandaFramework *self = (PandaFramework *)data;
1152 nassertv(index >= 0);
1153 int sibling = index - 1;
1167 PandaFramework *self = (PandaFramework *)data;
1174 nassertv(index >= 0);
1176 int sibling = index + 1;
1177 if (sibling < num_children) {
1190 nout <<
"Connecting to stats host" << std::endl;
1191 PStatClient::connect();
1193 nout <<
"Stats host not supported." << std::endl;
1202 PandaFramework *self = (PandaFramework *)data;
1204 if (event->get_num_parameters() == 1) {
1206 WindowFramework *wf;
1207 DCAST_INTO_V(wf, param.
get_ptr());
1209 if (self->clear_text()) {
1211 self->_engine->render_frame();
1216 if (filename.empty()) {
1217 text =
"Screenshot failed";
1226 self->_screenshot_text =
NodePath(text_node);
1227 text_node->set_align(TextNode::A_center);
1228 text_node->set_shadow_color(0.0f, 0.0f, 0.0f, 1.0f);
1232 self->_screenshot_text.set_pos(0.0, 0.0, -0.7);
1234 std::cout <<
"Screenshot saved: " + output_text +
"\n";
1239 task->set_delay(3.0);
1240 self->_task_mgr.
add(task);
1249 if (event->get_num_parameters() == 1) {
1251 WindowFramework *wf;
1252 DCAST_INTO_V(wf, param.
get_ptr());
1255 case WindowFramework::BT_other:
1256 case WindowFramework::BT_none:
1259 case WindowFramework::BT_white:
1274 PandaFramework *self = (PandaFramework *)data;
1275 if (event->get_num_parameters() == 1) {
1277 WindowFramework *wf;
1278 DCAST_INTO_V(wf, param.
get_ptr());
1282 if (!self->_help_text.
is_empty()) {
1288 std::ostringstream help;
1289 KeyDefinitions::const_iterator ki;
1290 for (ki = self->_key_definitions.begin();
1291 ki != self->_key_definitions.end();
1293 const KeyDefinition &keydef = (*ki);
1294 help << keydef._event_name <<
"\t" << keydef._description <<
"\n";
1297 string help_text = help.str();
1300 self->_help_text =
NodePath(text_node);
1301 text_node->set_align(TextNode::A_left);
1302 text_node->set_shadow_color(0.0f, 0.0f, 0.0f, 1.0f);
1308 PN_stdfloat height = frame[3] - frame[2];
1309 PN_stdfloat scale = std::min(0.06, 1.8 / height);
1312 PN_stdfloat pos_scale = scale / -2.0;
1313 self->_help_text.set_pos((frame[0] + frame[1]) * pos_scale,
1315 (frame[2] + frame[3]) * pos_scale);
1327 PandaFramework *self = (PandaFramework *)data;
1328 if (event->get_num_parameters() == 1) {
1334 DCAST_INTO_V(win, param.
get_ptr());
1338 if (window_index == -1) {
1339 framework_cat.debug()
1340 <<
"Ignoring message from unknown window.\n";
1346 while (window_index != -1) {
1356 framework_cat.info()
1357 <<
"Last window was closed by user.\n";
1358 self->_exit_flag =
true;
1362 for (
int n = 0; n < (int)self->_windows.size(); n++) {
1363 if (self->_windows[n]->get_graphics_output() == win) {
1364 self->_windows[n]->adjust_dimensions();
1378 PandaFramework *self = (PandaFramework *)data;
1383 return AsyncTask::DS_cont;
1391 PandaFramework *self = (PandaFramework *)data;
1393 throw_event(
"NewFrame");
1396 return AsyncTask::DS_cont;
1404 PandaFramework *self = (PandaFramework *)data;
1411 if (engine !=
nullptr) {
1412 engine->render_frame();
1413 return AsyncTask::DS_cont;
1415 return AsyncTask::DS_done;
1425 PandaFramework *self = (PandaFramework *)data;
1427 if (self->_recorder !=
nullptr) {
1428 self->_recorder->record_frame();
1431 return AsyncTask::DS_cont;
1440 PandaFramework *self = (PandaFramework *)data;
1442 if (self->_recorder !=
nullptr) {
1443 self->_recorder->play_frame();
1446 return AsyncTask::DS_cont;
1454 PandaFramework *self = (PandaFramework *)data;
1457 return AsyncTask::DS_cont;
1469 return AsyncTask::DS_cont;
A class to manage a loose queue of isolated tasks, which can be performed either synchronously (in th...
bool remove(AsyncTask *task)
Removes the indicated task from the active queue.
void add(AsyncTask *task)
Adds the indicated task to the active queue.
AsyncTaskCollection find_tasks(const std::string &name) const
Returns the list of tasks found with the indicated name.
get_frame_time
Returns the time in seconds as of the last time tick() was called (typically, this will be as of the ...
get_frame_count
Returns the number of times tick() has been called since the ClockObject was created,...
static ClockObject * get_global_clock()
Returns a pointer to the global ClockObject.
This object supervises the traversal of the data graph and the moving of data from one DataNode to it...
void traverse(PandaNode *node)
Starts the traversal of the data graph at the indicated root node.
A class to monitor events from the C++ side of things.
void process_events()
The main processing loop of the EventHandler.
An optional parameter associated with an event.
TypedWritableReferenceCount * get_ptr() const
Retrieves a pointer to the actual value stored in the parameter.
A named event, possibly with parameters.
get_cwd
Returns the name of the current working directory.
The name of a file, such as a texture file or an Egg file.
Associates a generic C-style function pointer with an AsyncTask object.
This class is the main interface to controlling the render process.
This is a base class for the various different classes that represent the result of a frame of render...
Filename save_screenshot_default(const std::string &prefix="screenshot")
Saves a screenshot of the region to a default filename, and returns the filename, or empty string if ...
bool is_valid() const
Returns true if the output is fully created and ready for rendering, false otherwise.
This maintains a list of GraphicsPipes by type that are available for creation.
get_pipe_type
Returns the nth type of GraphicsPipe available through this interface.
static GraphicsPipeSelection * get_global_ptr()
Returns a pointer to the one global GraphicsPipeSelection object.
void print_pipe_types() const
Writes a list of the currently known GraphicsPipe types to nout, for the user's information.
void load_aux_modules()
Loads all the modules named in the aux-display Configrc variable, making as many graphics pipes as po...
get_num_pipe_types
Returns the number of different types of GraphicsPipes that are available to create through this inte...
An object to create GraphicsOutputs that share a particular 3-D API.
Encapsulates all the communication with a particular instance of a given rendering backend.
A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive d...
Specifies parameters that may be passed to the loader.
Reads the mouse and/or keyboard data sent from a GraphicsWindow, and transmits it down the data graph...
This object records any data generated by a particular MouseAndKeyboard node on the datagraph for a s...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
int get_num_children(Thread *current_thread=Thread::get_current_thread()) const
Returns the number of children of the referenced node.
void show()
Undoes the effect of a previous hide() on this node: makes the referenced node (and the entire subgra...
NodePath find(const std::string &path) const
Searches for a node below the referenced node that matches the indicated string.
void hide()
Makes the referenced node (and the entire subgraph below this node) invisible to all cameras.
void remove_node(Thread *current_thread=Thread::get_current_thread())
Disconnects the referenced node from the scene graph.
bool is_empty() const
Returns true if the NodePath contains no nodes.
PandaNode * node() const
Returns the referenced node of the path.
void reparent_to(const NodePath &other, int sort=0, Thread *current_thread=Thread::get_current_thread())
Removes the referenced node of the NodePath from its current parent and attaches it to the referenced...
void ls() const
Lists the hierarchy at and below the referenced node.
NodePath get_child(int n, Thread *current_thread=Thread::get_current_thread()) const
Returns a NodePath representing the nth child of the referenced node.
bool is_hidden(DrawMask camera_mask=PandaNode::get_overall_bit()) const
Returns true if the referenced node is hidden from the indicated camera(s) either directly,...
PointerTo< BoundingVolume > get_bounds(Thread *current_thread=Thread::get_current_thread()) const
Returns a newly-allocated bounding volume containing the bottom node and all of its descendants.
NodePath attach_new_node(PandaNode *node, int sort=0, Thread *current_thread=Thread::get_current_thread()) const
Attaches a new node, with or without existing parents, to the scene graph below the referenced node o...
has_parent
Returns true if the referenced node has a parent; i.e.
get_parent
Returns the NodePath to the parent of the referenced node: that is, this NodePath,...
void set_scale(PN_stdfloat scale)
Sets the scale component of the transform, leaving translation and rotation untouched.
NodePath get_hidden_ancestor(DrawMask camera_mask=PandaNode::get_overall_bit(), Thread *current_thread=Thread::get_current_thread()) const
Returns the NodePath at or above the referenced node that is hidden to the indicated camera(s),...
static int hide_collision_solids(NodePath node)
Hides any collision solids, or occluders, which are visible in the indicated scene graph.
bool get_perpixel() const
Returns the current state of the perpixel flag.
RecorderController * get_recorder() const
Returns the RecorderController that has been associated with the PandaFramework, if any,...
static void event_window_event(const Event *, void *data)
Default handler for window events: window resized or closed, etc.
void set_background_type(WindowFramework::BackgroundType type)
Sets the background type of all windows.
void close_window(int n)
Closes the nth window and removes it from the list.
void remove_mouse(const GraphicsOutput *window)
Removes the mouse that may have been created by an earlier call to get_mouse().
static AsyncTask::DoneStatus task_event(GenericAsyncTask *task, void *data)
Called once per frame to process the pending events.
const NodePath & get_data_root() const
Returns the root of the data graph.
int find_window(const GraphicsOutput *win) const
Returns the index of the first WindowFramework object found that references the indicated GraphicsOut...
bool get_texture() const
Returns the current state of the texture flag.
void clear_highlight()
Unhighlights the currently highlighted node, if any.
static void event_S(const Event *, void *data)
Default handler for shift-S key: activate stats.
void set_two_sided(bool enable)
Sets the two_sided state on all windows.
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...
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.
GraphicsPipe * get_default_pipe()
Returns the default pipe.
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...
static void event_t(const Event *, void *data)
Default handler for t key: toggle texture.
WindowFramework * open_window()
Opens a window on the default graphics pipe.
static int show_collision_solids(NodePath node)
Shows any collision solids, or occluders, which are directly hidden in the indicated scene graph.
static void event_B(const Event *, void *data)
Default handler for shift-B key: describe the bounding volume of the currently selected object,...
void enable_default_keys()
Sets callbacks on the event handler to handle all of the normal viewer keys, like t to toggle texture...
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,...
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.
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.
WindowFramework::BackgroundType get_background_type() const
Returns the current background type setting.
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.
void open_framework()
Should be called once at the beginning of the application to initialize Panda (and the framework) for...
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.
void reset_frame_rate()
Resets the frame rate computation.
static void event_f(const Event *, void *data)
Default handler for f key: report and reset frame rate.
const NodePath & get_highlight() const
Returns the currently highlighted node, if any, or an empty NodePath if no node is highlighted.
void report_frame_rate(std::ostream &out) const
Reports the currently measured average frame rate to the indicated ostream.
static AsyncTask::DoneStatus task_clear_text(GenericAsyncTask *task, void *data)
Called once to remove the screenshot text from onscreen.
static void event_i(const Event *, void *data)
Default handler for i key: invert one-sided faces.
static void event_a(const Event *, void *data)
Default handler for a key: toggle the animation controls.
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 ...
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.
void set_wireframe(bool enable)
Sets the wireframe state on all windows.
static void event_f9(const Event *, void *data)
Default handler for f9 key: take screenshot.
GraphicsEngine * get_graphics_engine()
Returns the GraphicsEngine that is used to render all the windows in the framework.
static void event_question(const Event *event, void *data)
Default handler for ?
static void event_C(const Event *, void *data)
Default handler for shift-C key: toggle the showing of collision solids.
NodePath & get_models()
Returns the root of the scene graph normally reserved for parenting models and such.
void main_loop()
Called to yield control to the panda framework.
bool all_windows_closed() const
Returns true if all of the opened windows have been closed by the user, false otherwise.
static void event_h(const Event *, void *data)
Default handler for h key: toggle highlight mode.
virtual void get_default_window_props(WindowProperties &props)
Fills in the indicated window properties structure according to the normal window properties for this...
void set_texture(bool enable)
Sets the texture state on all windows.
static void event_comma(const Event *, void *data)
Default handler for comma key: rotate background color.
bool get_wireframe() const
Returns the current state of the wireframe flag.
void close_all_windows()
Closes all currently open windows and empties the list of windows.
static void event_w(const Event *, void *data)
Default handler for w key: toggle wireframe.
bool get_two_sided() const
Returns the current state of the two_sided flag.
static void event_p(const Event *, void *data)
Default handler for p key: toggle per-pixel lighting.
static void event_l(const Event *, void *data)
Default handler for l key: toggle lighting.
void set_lighting(bool enable)
Sets the lighting state on all windows.
static void event_b(const Event *, void *data)
Default handler for b key: toggle backface (two-sided rendering).
void set_perpixel(bool enable)
Sets the perpixel state on all windows.
NodePath get_mouse(GraphicsOutput *window)
Returns a NodePath to the MouseAndKeyboard associated with the indicated GraphicsWindow object.
void set_highlight(const NodePath &node)
Sets the indicated node (normally a node within the get_models() tree) up as the highlighted node.
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.
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 s...
static AsyncTask::DoneStatus task_garbage_collect(GenericAsyncTask *task, void *data)
This task is created automatically if garbage_collect_states is true.
void close_framework()
Should be called at the end of an application to close Panda.
virtual bool do_frame(Thread *current_thread)
Renders one frame and performs all associated processing.
static AsyncTask::DoneStatus task_igloop(GenericAsyncTask *task, void *data)
Called once per frame to render the scene.
bool get_lighting() const
Returns the current state of the lighting flag.
bool has_highlight() const
Returns true if any node is highlighted, false otherwise.
int find_child(PandaNode *node, Thread *current_thread=Thread::get_current_thread()) const
Returns the index of the indicated child node, if it is a child, or -1 if it is not.
get_child
Returns the nth child node of this node.
get_num_children
Returns the number of child nodes this node has.
This object manages the process of recording the user's runtime inputs to a bam file so that the sess...
bool begin_playback(const Filename &filename)
Begins playing back data from the indicated filename.
void add_recorder(const std::string &name, RecorderBase *recorder)
Adds the named recorder to the set of recorders that are in use.
bool begin_record(const Filename &filename)
Begins recording data to the indicated filename.
static int garbage_collect()
Performs a garbage-collection cycle.
A handy class that can scrub over a scene graph and collect interesting statistics on it.
void add_node(PandaNode *node)
Adds a new node to the set of data for analysis.
void write(std::ostream &out, int indent_level=0) const
Describes all the data collected.
set_text
Changes the text that is stored in the encoder.
The primary interface to this module.
LVecBase4 get_frame_actual() const
Returns the actual dimensions of the frame around the text.
set_shadow
Specifies that the text should be drawn with a shadow, by creating a second copy of the text and offs...
A thread; that is, a lightweight process.
get_current_thread
Returns a pointer to the currently-executing Thread object.
static void prepare_for_exit()
Should be called by the main thread just before exiting the program, this blocks until any remaining ...
TypeHandle is the identifier used to differentiate C++ class types.
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
This encapsulates the data that is normally associated with a single window, or with a single display...
void set_wireframe(bool enable, bool filled=false)
Forces wireframe state (true) or restores default rendering (false).
NodePath get_aspect_2d()
Returns the node under the 2-d scene graph that is scaled to suit the window's aspect ratio.
bool get_lighting() const
Returns the current state of the lighting flag.
bool get_wireframe() const
Returns the current state of the wireframe flag.
bool get_texture() const
Returns the current state of the texture flag.
void set_one_sided_reverse(bool enable)
Toggles one-sided reverse mode.
BackgroundType get_background_type() const
Returns the current background type setting.
void set_two_sided(bool enable)
Forces two-sided rendering (true) or restores default rendering (false).
bool get_one_sided_reverse() const
Returns the current state of the one_sided_reverse flag.
void set_texture(bool enable)
Forces textures off (false) or restores default rendering (true).
void next_anim_control()
Rotates the animation controls through all of the available animations.
bool get_two_sided() const
Returns the current state of the two_sided flag.
void center_trackball(const NodePath &object)
Centers the trackball on the indicated object, and scales the trackball motion suitably.
bool get_perpixel() const
Returns the current state of the perpixel flag.
void set_background_type(BackgroundType type)
Sets the background of the window to one of the pre-canned background types (or to BT_other,...
bool get_wireframe_filled() const
Returns the current state of the wireframe_filled flag.
void set_lighting(bool enable)
Turns lighting on (true) or off (false).
void set_perpixel(bool enable)
Turns per-pixel lighting on (true) or off (false).
GraphicsOutput * get_graphics_output() const
Returns a pointer to the underlying GraphicsOutput object.
A container for the various kinds of properties we might ask to have on a graphics window before we o...
void add_properties(const WindowProperties &other)
Sets any properties that are explicitly specified in other on this object.
set_title
Specifies the title that should be assigned to the window.
get_default
Returns the "default" WindowProperties.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void init_libchar()
Initializes the library.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void init_libpnmimagetypes()
Initializes the library.
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.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void init_libpandadx9()
Initializes the library.
void init_libpandaegg()
Initializes the library.
void init_libpandagl()
Initializes the library.
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.