/usr/include/cegui-0.8.7/CEGUI/RenderingWindow.h is in libcegui-mk2-dev 0.8.7-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | /***********************************************************************
created: Mon Jan 12 2009
author: Paul D Turner
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
***************************************************************************/
#ifndef _CEGUIRenderingWindow_h_
#define _CEGUIRenderingWindow_h_
#include "CEGUI/RenderingSurface.h"
#include "CEGUI/Vector.h"
#include "CEGUI/Quaternion.h"
#include "CEGUI/Size.h"
#include "CEGUI/Rect.h"
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable : 4251)
#endif
// Start of CEGUI namespace section
namespace CEGUI
{
/*!
\brief
RenderingWindow is a RenderingSurface that can be "drawn back" onto another
RenderingSurface and is primarily intended to be used as a kind of cache for
rendered imagery.
*/
class CEGUIEXPORT RenderingWindow : public RenderingSurface
{
public:
/*!
\brief
Constructor for RenderingWindow objects.
\param target
The TextureTarget based object that will be used as the target for
content rendering done by the RenderingWindow.
\param owner
The RenderingSurface object that will be our initial owner. This
RenderingSurface is also the target where our cached imagery will be
rendered back to.
\note
The TextureTarget \a target remains under it's original ownership, and
the RenderingSurface \a owner actually owns \e this object.
*/
RenderingWindow(TextureTarget& target, RenderingSurface& owner);
//! Destructor for RenderingWindow objects.
~RenderingWindow();
/*!
\brief
Set the clipping region that will be used when rendering the imagery
for this RenderingWindow back onto the RenderingSurface that owns it.
\note
This is not the clipping region used when rendering the queued geometry
\e onto the RenderingWindow, that still uses whatever regions are set
on the queued GeometryBuffer objects.
\param region
Rect object describing a rectangular clipping region.
\note
The region should be described as absolute pixel locations relative to
the screen or other root surface. The region should \e not be described
relative to the owner of the RenderingWindow.
*/
void setClippingRegion(const Rectf& region);
/*!
\brief
Set the two dimensional position of the RenderingWindow in pixels. The
origin is at the top-left corner.
\param position
Vector2 object describing the desired location of the RenderingWindow,
in pixels.
\note
This position is an absolute pixel location relative to the screen or
other root surface. It is \e not relative to the owner of the
RenderingWindow.
*/
void setPosition(const Vector2f& position);
/*!
\brief
Set the size of the RenderingWindow in pixels.
\param size
Size object that describes the desired size of the RenderingWindow, in
pixels.
*/
void setSize(const Sizef& size);
/*!
\brief
Set the rotation quaternion to be used when rendering the RenderingWindow
back onto it's owning RenderingSurface.
\param rotation
Quaternion object describing the rotation.
*/
void setRotation(const Quaternion& rotation);
/*!
\brief
Set the location of the pivot point around which the RenderingWindow
will be rotated.
\param pivot
Vector3 describing the three dimensional point around which the
RenderingWindow will be rotated.
*/
void setPivot(const Vector3f& pivot);
/*!
\brief
Return the current pixel position of the RenderingWindow. The origin is
at the top-left corner.
\return
Vector2 object describing the pixel position of the RenderingWindow.
\note
This position is an absolute pixel location relative to the screen or
other root surface. It is \e not relative to the owner of the
RenderingWindow.
*/
const Vector2f& getPosition() const;
/*!
\brief
Return the current size of the RenderingWindow in pixels.
\return
Size object describing the current pixel size of the RenderingWindow.
*/
const Sizef& getSize() const;
/*!
\brief
Return the current rotation being applied to the RenderingWindow
\return
Quaternion object describing the rotation for the RenderingWindow.
*/
const Quaternion& getRotation()const;
/*!
\brief
Return the rotation pivot point location for the RenderingWindow.
\return
Vector3 object describing the current location of the pivot point used
when rotating the RenderingWindow.
*/
const Vector3f& getPivot() const;
/*!
\brief
Return the TextureTarget object that is the target for content rendered
to this RenderingWindows. This is the same object passed into the
constructor.
\return
The TextureTarget object that receives the rendered output resulting
from geometry queued to this RenderingWindow.
*/
const TextureTarget& getTextureTarget() const;
TextureTarget& getTextureTarget();
/*!
\brief
Peform time based updated for the RenderingWindow.
\note
Currently this really only has meaning for RenderingWindow objects that
have RenderEffect objects set. Though this may not always be the case.
\param elapsed
float value describing the number of seconds that have passed since the
previous call to update.
*/
void update(const float elapsed);
/*!
\brief
Set the RenderEffect that should be used with the RenderingWindow. This
may be 0 to remove a previously set RenderEffect.
\note
Ownership of the RenderEffect does not change; the RenderingWindow will
not delete a RenderEffect assigned to it when the RenderingWindow is
destroyed.
*/
void setRenderEffect(RenderEffect* effect);
/*!
\brief
Return a pointer to the RenderEffect currently being used with the
RenderingWindow. A return value of 0 indicates that no RenderEffect
is being used.
\return
Pointer to the RenderEffect used with this RenderingWindow, or 0 for
none.
*/
RenderEffect* getRenderEffect();
/*!
\brief
generate geometry to be used when rendering back the RenderingWindow to
it's owning RenderingSurface.
\note
In normal usage you should never have to call this directly. There may
be certain cases where it might be useful to call this when using the
RenderEffect system.
*/
void realiseGeometry();
/*!
\brief
Mark the geometry used when rendering the RenderingWindow back to it's
owning RenderingSurface as invalid so that it gets regenerated on the
next rendering pass.
This is separate from the main invalidate() function because in most
cases invalidating the cached imagery will not require the potentially
expensive regeneration of the geometry for the RenderingWindow itself.
*/
void invalidateGeometry();
/*!
\brief
Return the RenderingSurface that owns the RenderingWindow. This is
also the RenderingSurface that will be used when the RenderingWindow
renders back it's cached imagery content.
\return
RenderingSurface object that owns, and is targetted by, the
RenderingWindow.
*/
const RenderingSurface& getOwner() const;
RenderingSurface& getOwner();
/*!
\brief
Fill in Vector2 object \a p_out with an unprojected version of the
point described by Vector2 \a p_in.
*/
void unprojectPoint(const Vector2f& p_in, Vector2f& p_out);
// overrides from base
void draw();
void invalidate();
bool isRenderingWindow() const;
protected:
//! default generates geometry to draw window as a single quad.
virtual void realiseGeometry_impl();
//! set a new owner for this RenderingWindow object
void setOwner(RenderingSurface& owner);
// friend is so that RenderingSurface can call setOwner to xfer ownership.
friend void RenderingSurface::transferRenderingWindow(RenderingWindow&);
//! holds ref to renderer
Renderer& d_renderer;
//! TextureTarget to draw to. Like d_target in base, but avoiding downcasts.
TextureTarget& d_textarget;
//! RenderingSurface that owns this object, we render back to this object.
RenderingSurface* d_owner;
//! GeometryBuffer that holds geometry for drawing this window.
GeometryBuffer* d_geometry;
//! indicates whether data in GeometryBuffer is up-to-date
bool d_geometryValid;
//! Position of this RenderingWindow
Vector2f d_position;
//! Size of this RenderingWindow
Sizef d_size;
//! Rotation for this RenderingWindow
Quaternion d_rotation;
//! Pivot point used for the rotation.
Vector3f d_pivot;
};
} // End of CEGUI namespace section
#if defined(_MSC_VER)
# pragma warning(pop)
#endif
#endif // end of guard _CEGUIRenderingWindow_h_
|