Panda3D
 All Classes Functions Variables Enumerations
windowFramework.I
1 // Filename: windowFramework.I
2 // Created by: drose (02Apr02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: WindowFramework::get_panda_framework
18 // Access: Public
19 // Description: Returns a pointer to the associated PandaFramework
20 // object.
21 ////////////////////////////////////////////////////////////////////
24  return _panda_framework;
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: WindowFramework::get_graphics_window
29 // Access: Public
30 // Description: Returns a pointer to the underlying GraphicsWindow
31 // object, if it is in fact a window; or NULL if it is
32 // not.
33 ////////////////////////////////////////////////////////////////////
36  if (_window != (GraphicsOutput *)NULL &&
37  _window->is_of_type(GraphicsWindow::get_class_type())) {
38  return DCAST(GraphicsWindow, _window);
39  }
40  return NULL;
41 }
42 
43 ////////////////////////////////////////////////////////////////////
44 // Function: WindowFramework::get_graphics_output
45 // Access: Public
46 // Description: Returns a pointer to the underlying GraphicsOutput
47 // object
48 ////////////////////////////////////////////////////////////////////
51  return _window;
52 }
53 
54 ////////////////////////////////////////////////////////////////////
55 // Function: WindowFramework::get_num_cameras
56 // Access: Public
57 // Description: Returns the number of 3-d cameras associated with the
58 // window. A window usually has only one camera, but it
59 // may have multiple cameras if there are multiple
60 // display regions within the window.
61 ////////////////////////////////////////////////////////////////////
62 INLINE int WindowFramework::
63 get_num_cameras() const {
64  return _cameras.size();
65 }
66 
67 ////////////////////////////////////////////////////////////////////
68 // Function: WindowFramework::get_camera
69 // Access: Public
70 // Description: Returns the nth camera associated with the window.
71 ////////////////////////////////////////////////////////////////////
73 get_camera(int n) const {
74  nassertr(n >= 0 && n < (int)_cameras.size(), NULL);
75  return _cameras[n];
76 }
77 
78 ////////////////////////////////////////////////////////////////////
79 // Function: WindowFramework::get_display_region_2d
80 // Access: Public
81 // Description: Returns the default DisplayRegion created for the 2-d
82 // scene (render2d).
83 ////////////////////////////////////////////////////////////////////
86  return _display_region_2d;
87 }
88 
89 ////////////////////////////////////////////////////////////////////
90 // Function: WindowFramework::get_display_region_3d
91 // Access: Public
92 // Description: Returns the default DisplayRegion created for the 3-d
93 // scene (render).
94 ////////////////////////////////////////////////////////////////////
97  return _display_region_3d;
98 }
99 
100 ////////////////////////////////////////////////////////////////////
101 // Function: WindowFramework::get_anim_controls
102 // Access: Public
103 // Description: Returns the current state of the anim_controls flag.
104 ////////////////////////////////////////////////////////////////////
105 INLINE bool WindowFramework::
107  return _anim_controls_enabled;
108 }
109 
110 ////////////////////////////////////////////////////////////////////
111 // Function: WindowFramework::get_wireframe
112 // Access: Public
113 // Description: Returns the current state of the wireframe flag.
114 ////////////////////////////////////////////////////////////////////
115 INLINE bool WindowFramework::
116 get_wireframe() const {
117  return _wireframe_enabled;
118 }
119 
120 ////////////////////////////////////////////////////////////////////
121 // Function: WindowFramework::get_wireframe_filled
122 // Access: Public
123 // Description: Returns the current state of the wireframe_filled
124 // flag.
125 ////////////////////////////////////////////////////////////////////
126 INLINE bool WindowFramework::
128  return _wireframe_filled;
129 }
130 
131 ////////////////////////////////////////////////////////////////////
132 // Function: WindowFramework::get_texture
133 // Access: Public
134 // Description: Returns the current state of the texture flag.
135 ////////////////////////////////////////////////////////////////////
136 INLINE bool WindowFramework::
137 get_texture() const {
138  return _texture_enabled;
139 }
140 
141 ////////////////////////////////////////////////////////////////////
142 // Function: WindowFramework::get_two_sided
143 // Access: Public
144 // Description: Returns the current state of the two_sided flag.
145 ////////////////////////////////////////////////////////////////////
146 INLINE bool WindowFramework::
147 get_two_sided() const {
148  return _two_sided_enabled;
149 }
150 
151 ////////////////////////////////////////////////////////////////////
152 // Function: WindowFramework::get_one_sided_reverse
153 // Access: Public
154 // Description: Returns the current state of the one_sided_reverse flag.
155 ////////////////////////////////////////////////////////////////////
156 INLINE bool WindowFramework::
158  return _one_sided_reverse_enabled;
159 }
160 
161 ////////////////////////////////////////////////////////////////////
162 // Function: WindowFramework::get_lighting
163 // Access: Public
164 // Description: Returns the current state of the lighting flag.
165 ////////////////////////////////////////////////////////////////////
166 INLINE bool WindowFramework::
167 get_lighting() const {
168  return _lighting_enabled;
169 }
170 
171 ////////////////////////////////////////////////////////////////////
172 // Function: WindowFramework::get_perpixel
173 // Access: Public
174 // Description: Returns the current state of the perpixel flag.
175 ////////////////////////////////////////////////////////////////////
176 INLINE bool WindowFramework::
177 get_perpixel() const {
178  return _perpixel_enabled;
179 }
180 
181 ////////////////////////////////////////////////////////////////////
182 // Function: WindowFramework::get_background_type
183 // Access: Public
184 // Description: Returns the current background type setting.
185 ////////////////////////////////////////////////////////////////////
186 INLINE WindowFramework::BackgroundType WindowFramework::
188  return _background_type;
189 }
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.
bool get_anim_controls() const
Returns the current state of the anim_controls flag.
bool get_wireframe_filled() const
Returns the current state of the wireframe_filled flag.
bool get_texture() const
Returns the current state of the texture flag.
DisplayRegion * get_display_region_2d() const
Returns the default DisplayRegion created for the 2-d scene (render2d).
bool get_wireframe() const
Returns the current state of the wireframe flag.
A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive d...
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...
PandaFramework * get_panda_framework() const
Returns a pointer to the associated PandaFramework object.
bool get_lighting() const
Returns the current state of the lighting flag.
This is a base class for the various different classes that represent the result of a frame of render...
int get_num_cameras() const
Returns the number of 3-d cameras associated with the window.
A rectangular subregion within a window for rendering into.
Definition: displayRegion.h:61
This class serves to provide a high-level framework for basic applications that use Panda in simple w...
Camera * get_camera(int n) const
Returns the nth camera associated with the window.
bool get_two_sided() const
Returns the current state of the two_sided flag.
A node that can be positioned around in the scene graph to represent a point of view for rendering a ...
Definition: camera.h:37
bool get_one_sided_reverse() const
Returns the current state of the one_sided_reverse flag.
bool get_perpixel() const
Returns the current state of the perpixel flag.
GraphicsOutput * get_graphics_output() const
Returns a pointer to the underlying GraphicsOutput object.