Skip to content

Commit

Permalink
libgui|GLTarget: Querying currently used area of the target
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Dec 21, 2013
1 parent c6f4d05 commit 5772da8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doomsday/libgui/include/de/gui/gltarget.h
Expand Up @@ -301,6 +301,13 @@ class LIBGUI_PUBLIC GLTarget : public Asset
Rectangleui const &activeRect() const;
bool hasActiveRect() const;

/**
* Returns the area of the target currently in use. This is the full area
* of the target, if there is no active rectangle specified. Otherwise
* some sub-area of the target is returned.
*/
Rectangleui rectInUse() const;

private:
DENG2_PRIVATE(d)
};
Expand Down
9 changes: 9 additions & 0 deletions doomsday/libgui/src/gltarget.cpp
Expand Up @@ -708,4 +708,13 @@ bool GLTarget::hasActiveRect() const
return !d->activeRect.isNull();
}

Rectangleui GLTarget::rectInUse() const
{
if(hasActiveRect())
{
return activeRect();
}
return Rectangleui::fromSize(size());
}

} // namespace de

0 comments on commit 5772da8

Please sign in to comment.