14#ifndef WINDOWFRAMEWORK_H
15#define WINDOWFRAMEWORK_H
51class EXPCL_FRAMEWORK WindowFramework :
public TypedWritableReferenceCount {
53 WindowFramework(PandaFramework *panda_framework);
54 WindowFramework(
const WindowFramework ©,
DisplayRegion *display_region);
57 virtual ~WindowFramework();
91 int argc,
char *argv[],
int first_arg = 1);
93 const pvector<Filename> &files);
97 PartGroup::HMF_ok_part_extra |
98 PartGroup::HMF_ok_anim_extra);
105 enum BackgroundType {
119 WindowFramework *
split_window(SplitType split_type = ST_default);
146 void create_anim_controls();
147 void destroy_anim_controls();
148 void update_anim_controls();
150 void setup_shuttle_button(
const std::string &label,
int index,
151 EventHandler::EventCallbackFunction *func);
155 void forward_button();
157 static AsyncTask::DoneStatus st_update_anim_controls(
GenericAsyncTask *task,
void *data);
159 static void st_back_button(
const Event *,
void *data);
160 static void st_pause_button(
const Event *,
void *data);
161 static void st_play_button(
const Event *,
void *data);
162 static void st_forward_button(
const Event *,
void *data);
165 PandaFramework *_panda_framework;
171 typedef pvector< PT(
Camera) > Cameras;
180 bool _anim_controls_enabled;
199 bool _wireframe_enabled;
200 bool _wireframe_filled;
201 bool _texture_enabled;
202 bool _two_sided_enabled;
203 bool _one_sided_reverse_enabled;
204 bool _lighting_enabled;
205 bool _perpixel_enabled;
210 BackgroundType _background_type;
212 static PT(
TextFont) _shuttle_controls_font;
218 static void init_type() {
219 TypedWritableReferenceCount::init_type();
221 TypedWritableReferenceCount::get_class_type());
224 return get_class_type();
226 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
231 friend class PandaFramework;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A light source that seems to illuminate all points in space at once.
This is a named collection of AnimControl pointers.
A node that can be positioned around in the scene graph to represent a point of view for rendering a ...
A light shining from infinitely far away in a particular direction, like sunlight.
A rectangular subregion within a window for rendering into.
A named event, possibly with parameters.
The name of a file, such as a texture file or an Egg file.
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
static const FrameBufferProperties & get_default()
Returns a FrameBufferProperties structure with all of the default values filled in according to the u...
This is a special TextNode that automatically updates itself with the current frame rate.
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...
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...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
This is a particular kind of PGItem that draws a little bar with a slider that moves from left to rig...
This class serves to provide a high-level framework for basic applications that use Panda in simple w...
A basic node of the scene graph or data graph.
This is a special TextNode that automatically updates itself with output from a SceneGraphAnalyzer in...
An encapsulation of a font; i.e.
The primary interface to this module.
Trackball acts like Performer in trackball mode.
TypeHandle is the identifier used to differentiate C++ class types.
void set_wireframe(bool enable, bool filled=false)
Forces wireframe state (true) or restores default rendering (false).
NodePath make_camera()
Makes a new 3-d camera for the window.
NodePath load_default_model(const NodePath &parent)
Loads our favorite blue triangle.
void setup_trackball()
Sets up the mouse to trackball around the camera.
NodePath get_aspect_2d()
Returns the node under the 2-d scene graph that is scaled to suit the window's aspect ratio.
WindowFramework * split_window(SplitType split_type=ST_default)
Divides the window into two display regions, each of which gets its own trackball and keyboard events...
bool get_lighting() const
Returns the current state of the lighting flag.
bool get_wireframe() const
Returns the current state of the wireframe flag.
void stagger_animations()
Walks through all the animations that were bound by loop_animations() and staggers their play rate sl...
int get_num_cameras() const
Returns the number of 3-d cameras associated with the window.
NodePath get_button_thrower()
Returns the node in the data graph corresponding to the ButtonThrower object associated with this win...
bool get_texture() const
Returns the current state of the texture flag.
void set_one_sided_reverse(bool enable)
Toggles one-sided reverse mode.
NodePath get_render_2d()
Returns the root of the 2-d scene graph.
DisplayRegion * get_display_region_3d() const
Returns the default DisplayRegion created for the 3-d scene (render).
BackgroundType get_background_type() const
Returns the current background type setting.
void loop_animations(int hierarchy_match_flags=PartGroup::HMF_ok_part_extra|PartGroup::HMF_ok_anim_extra)
Looks for characters and their matching animation files in the scene graph; binds and loops any match...
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 enable_keyboard()
Creates a ButtonThrower to listen to button presses and throw them as events.
NodePath get_render()
Returns the root of the 3-d scene graph.
void center_trackball(const NodePath &object)
Centers the trackball on the indicated object, and scales the trackball motion suitably.
NodePath get_mouse()
Returns the node in the data graph corresponding to the mouse associated with this window.
bool get_anim_controls() const
Returns the current state of the anim_controls flag.
void set_anim_controls(bool enable)
Creates an onscreen animation slider for frame-stepping through the animations.
PandaFramework * get_panda_framework() const
Returns a pointer to the associated PandaFramework object.
void adjust_dimensions()
Reevaluates the dimensions of the window, presumably after the window has been resized by the user or...
Camera * get_camera(int n) const
Returns the nth camera associated with the window.
bool load_models(const NodePath &parent, int argc, char *argv[], int first_arg=1)
Loads up all the model files listed in the indicated argument list.
DisplayRegion * get_display_region_2d() const
Returns the default DisplayRegion created for the 2-d scene (render2d).
NodePath get_camera_group()
Returns the node above the collection of 3-d cameras in the scene graph.
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,...
NodePath get_pixel_2d()
Returns a special root that uses units in pixels that are relative to the window.
bool get_wireframe_filled() const
Returns the current state of the wireframe_filled flag.
static TextFont * get_shuttle_controls_font()
Returns a font that contains the shuttle controls icons.
GraphicsWindow * get_graphics_window() const
Returns a pointer to the underlying GraphicsWindow object, if it is in fact a window; or NULL if it i...
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).
NodePath load_model(const NodePath &parent, Filename filename)
Loads up the indicated model and returns the new NodePath, or the empty NodePath if the model could n...
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...
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
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.