00001 // Filename: windowFramework.I 00002 // Created by: drose (02Apr02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: WindowFramework::get_panda_framework 00018 // Access: Public 00019 // Description: Returns a pointer to the associated PandaFramework 00020 // object. 00021 //////////////////////////////////////////////////////////////////// 00022 INLINE PandaFramework *WindowFramework:: 00023 get_panda_framework() const { 00024 return _panda_framework; 00025 } 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Function: WindowFramework::get_graphics_window 00029 // Access: Public 00030 // Description: Returns a pointer to the underlying GraphicsWindow 00031 // object, if it is in fact a window; or NULL if it is 00032 // not. 00033 //////////////////////////////////////////////////////////////////// 00034 INLINE GraphicsWindow *WindowFramework:: 00035 get_graphics_window() const { 00036 if (_window != (GraphicsOutput *)NULL && 00037 _window->is_of_type(GraphicsWindow::get_class_type())) { 00038 return DCAST(GraphicsWindow, _window); 00039 } 00040 return NULL; 00041 } 00042 00043 //////////////////////////////////////////////////////////////////// 00044 // Function: WindowFramework::get_graphics_output 00045 // Access: Public 00046 // Description: Returns a pointer to the underlying GraphicsOutput 00047 // object 00048 //////////////////////////////////////////////////////////////////// 00049 INLINE GraphicsOutput *WindowFramework:: 00050 get_graphics_output() const { 00051 return _window; 00052 } 00053 00054 //////////////////////////////////////////////////////////////////// 00055 // Function: WindowFramework::get_num_cameras 00056 // Access: Public 00057 // Description: Returns the number of 3-d cameras associated with the 00058 // window. A window usually has only one camera, but it 00059 // may have multiple cameras if there are multiple 00060 // display regions within the window. 00061 //////////////////////////////////////////////////////////////////// 00062 INLINE int WindowFramework:: 00063 get_num_cameras() const { 00064 return _cameras.size(); 00065 } 00066 00067 //////////////////////////////////////////////////////////////////// 00068 // Function: WindowFramework::get_camera 00069 // Access: Public 00070 // Description: Returns the nth camera associated with the window. 00071 //////////////////////////////////////////////////////////////////// 00072 INLINE Camera *WindowFramework:: 00073 get_camera(int n) const { 00074 nassertr(n >= 0 && n < (int)_cameras.size(), NULL); 00075 return _cameras[n]; 00076 } 00077 00078 //////////////////////////////////////////////////////////////////// 00079 // Function: WindowFramework::get_display_region_2d 00080 // Access: Public 00081 // Description: Returns the default DisplayRegion created for the 2-d 00082 // scene (render2d). 00083 //////////////////////////////////////////////////////////////////// 00084 INLINE DisplayRegion *WindowFramework:: 00085 get_display_region_2d() const { 00086 return _display_region_2d; 00087 } 00088 00089 //////////////////////////////////////////////////////////////////// 00090 // Function: WindowFramework::get_display_region_3d 00091 // Access: Public 00092 // Description: Returns the default DisplayRegion created for the 3-d 00093 // scene (render). 00094 //////////////////////////////////////////////////////////////////// 00095 INLINE DisplayRegion *WindowFramework:: 00096 get_display_region_3d() const { 00097 return _display_region_3d; 00098 } 00099 00100 //////////////////////////////////////////////////////////////////// 00101 // Function: WindowFramework::get_anim_controls 00102 // Access: Public 00103 // Description: Returns the current state of the anim_controls flag. 00104 //////////////////////////////////////////////////////////////////// 00105 INLINE bool WindowFramework:: 00106 get_anim_controls() const { 00107 return _anim_controls_enabled; 00108 } 00109 00110 //////////////////////////////////////////////////////////////////// 00111 // Function: WindowFramework::get_wireframe 00112 // Access: Public 00113 // Description: Returns the current state of the wireframe flag. 00114 //////////////////////////////////////////////////////////////////// 00115 INLINE bool WindowFramework:: 00116 get_wireframe() const { 00117 return _wireframe_enabled; 00118 } 00119 00120 //////////////////////////////////////////////////////////////////// 00121 // Function: WindowFramework::get_texture 00122 // Access: Public 00123 // Description: Returns the current state of the texture flag. 00124 //////////////////////////////////////////////////////////////////// 00125 INLINE bool WindowFramework:: 00126 get_texture() const { 00127 return _texture_enabled; 00128 } 00129 00130 //////////////////////////////////////////////////////////////////// 00131 // Function: WindowFramework::get_two_sided 00132 // Access: Public 00133 // Description: Returns the current state of the two_sided flag. 00134 //////////////////////////////////////////////////////////////////// 00135 INLINE bool WindowFramework:: 00136 get_two_sided() const { 00137 return _two_sided_enabled; 00138 } 00139 00140 //////////////////////////////////////////////////////////////////// 00141 // Function: WindowFramework::get_one_sided_reverse 00142 // Access: Public 00143 // Description: Returns the current state of the one_sided_reverse flag. 00144 //////////////////////////////////////////////////////////////////// 00145 INLINE bool WindowFramework:: 00146 get_one_sided_reverse() const { 00147 return _one_sided_reverse_enabled; 00148 } 00149 00150 //////////////////////////////////////////////////////////////////// 00151 // Function: WindowFramework::get_lighting 00152 // Access: Public 00153 // Description: Returns the current state of the lighting flag. 00154 //////////////////////////////////////////////////////////////////// 00155 INLINE bool WindowFramework:: 00156 get_lighting() const { 00157 return _lighting_enabled; 00158 } 00159 00160 //////////////////////////////////////////////////////////////////// 00161 // Function: WindowFramework::get_perpixel 00162 // Access: Public 00163 // Description: Returns the current state of the perpixel flag. 00164 //////////////////////////////////////////////////////////////////// 00165 INLINE bool WindowFramework:: 00166 get_perpixel() const { 00167 return _perpixel_enabled; 00168 } 00169 00170 //////////////////////////////////////////////////////////////////// 00171 // Function: WindowFramework::get_background_type 00172 // Access: Public 00173 // Description: Returns the current background type setting. 00174 //////////////////////////////////////////////////////////////////// 00175 INLINE WindowFramework::BackgroundType WindowFramework:: 00176 get_background_type() const { 00177 return _background_type; 00178 }