summaryrefslogtreecommitdiff
path: root/indra/llui/lllocalcliprect.h
diff options
context:
space:
mode:
authorRichard Linden <none@none>2010-07-27 10:30:17 -0700
committerRichard Linden <none@none>2010-07-27 10:30:17 -0700
commitb4dfa76c9de73c6bebf54d6112b699a1e654ba63 (patch)
tree72a2fcddec5d08ce9db9b97984b884bb0943e19f /indra/llui/lllocalcliprect.h
parentc8316be258cdf9252c2d1bec0f223bc4245ff205 (diff)
parent50d8cc6d377b90b27c57b390eb6626223a1685a7 (diff)
merge
Diffstat (limited to 'indra/llui/lllocalcliprect.h')
-rw-r--r--indra/llui/lllocalcliprect.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/indra/llui/lllocalcliprect.h b/indra/llui/lllocalcliprect.h
index cd0c55ca72..36413f1496 100644
--- a/indra/llui/lllocalcliprect.h
+++ b/indra/llui/lllocalcliprect.h
@@ -31,7 +31,9 @@
#ifndef LLLOCALCLIPRECT_H
#define LLLOCALCLIPRECT_H
+#include "llgl.h"
#include "llrect.h" // can't forward declare, it's templated
+#include <stack>
// Clip rendering to a specific rectangle using GL scissor
// Just create one of these on the stack:
@@ -39,15 +41,29 @@
// LLLocalClipRect(rect);
// draw();
// }
-class LLLocalClipRect
+class LLScreenClipRect
{
public:
- LLLocalClipRect(const LLRect& rect, BOOL enabled = TRUE);
- ~LLLocalClipRect();
+ LLScreenClipRect(const LLRect& rect, BOOL enabled = TRUE);
+ virtual ~LLScreenClipRect();
+
+private:
+ static void pushClipRect(const LLRect& rect);
+ static void popClipRect();
+ static void updateScissorRegion();
private:
- // implementation class
- class LLScreenClipRect* mScreenClipRect;
+ LLGLState mScissorState;
+ BOOL mEnabled;
+
+ static std::stack<LLRect> sClipRectStack;
+};
+
+class LLLocalClipRect : public LLScreenClipRect
+{
+public:
+ LLLocalClipRect(const LLRect& rect, BOOL enabled = TRUE);
+ ~LLLocalClipRect();
};
#endif