15 #include "pandaFramework.h"
16 #include "pandaSystem.h"
18 #include "texturePool.h"
19 #include "multitexReducer.h"
20 #include "sceneGraphReducer.h"
21 #include "partGroup.h"
22 #include "cardMaker.h"
24 #include "virtualFileSystem.h"
30 #include "checkPandaVersion.h"
32 int main(
int argc,
char **argv) {
40 int hierarchy_match_flags = PartGroup::HMF_ok_part_extra |
41 PartGroup::HMF_ok_anim_extra;
53 loading_np = aspect_2d.attach_new_node(loading);
54 loading_np.set_scale(0.125f);
55 loading->set_text_color(1.0f, 1.0f, 1.0f, 1.0f);
56 loading->set_shadow_color(0.0f, 0.0f, 0.0f, 1.0f);
57 loading->set_shadow(0.04, 0.04);
58 loading->set_align(
TextNode::A_center);
59 loading->set_text("Loading...");
64 framework.do_frame(current_thread);
65 framework.do_frame(current_thread);
68 window->enable_keyboard();
69 window->setup_trackball();
70 framework.get_models().instance_to(window->get_render());
78 window->load_model(framework.get_models(), "panda-model.egg");
79 window->load_model(framework.get_models(), "panda-walk4.egg");
81 window->loop_animations(hierarchy_match_flags);
84 framework.get_models().prepare_scene(window->get_graphics_output()->get_gsg());
86 loading_np.remove_node();
88 window->center_trackball(framework.get_models());
89 window->set_anim_controls(true);
91 framework.enable_default_keys();
92 framework.main_loop();
93 framework.report_frame_rate(nout);
void close_framework()
Should be called at the end of an application to close Panda.
NodePath get_aspect_2d()
Returns the node under the 2-d scene graph that is scaled to suit the window's aspect ratio...
This encapsulates the data that is normally associated with a single window, or with a single display...
WindowFramework * open_window()
Opens a window on the default graphics pipe.
void open_framework(int &argc, char **&argv)
Should be called once at the beginning of the application to initialize Panda (and the framework) for...
A thread; that is, a lightweight process.
The primary interface to this module.
void set_window_title(const string &title)
Specifies the title that is set for all subsequently created windows.
This class serves to provide a high-level framework for basic applications that use Panda in simple w...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...