summaryrefslogtreecommitdiff
path: root/indra/llui/lllocalcliprect.h
diff options
context:
space:
mode:
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