summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <SmSpillaz@gmail.com>2010-05-08 11:38:50 +0800
committerSam Spilsbury <SmSpillaz@gmail.com>2010-05-08 11:38:50 +0800
commitff1d0b9f03fe020ad34aad0cea07fd2f102a3f0a (patch)
tree8a47fae3701da1c0c73f7e34c7f6f7d0616a4e64
parentd4cf913e5a8e75db1de6f5d2d3b4caf6e731ae8a (diff)
download3d-ff1d0b9f03fe020ad34aad0cea07fd2f102a3f0a.tar.gz
3d-ff1d0b9f03fe020ad34aad0cea07fd2f102a3f0a.tar.bz2
Added dynamic wrappable function enable/disable
-rw-r--r--src/3d.cpp30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/3d.cpp b/src/3d.cpp
index 8880567..d60f395 100644
--- a/src/3d.cpp
+++ b/src/3d.cpp
@@ -2,6 +2,25 @@
COMPIZ_PLUGIN_20090315 (td, TdPluginVTable);
+void
+setFunctions (bool enabled)
+{
+ TD_SCREEN (screen);
+
+ tds->gScreen->glPaintOutputSetEnabled (tds, enabled);
+ tds->gScreen->glApplyTransformSetEnabled (tds, enabled);
+ tds->cScreen->donePaintSetEnabled (tds, enabled);
+ tds->cubeScreen->cubePaintViewportSetEnabled (tds, enabled);
+ tds->cubeScreen->cubeShouldPaintViewportSetEnabled (tds, enabled);
+
+ foreach (CompWindow *w, screen->windows ())
+ {
+ TD_WINDOW (w);
+
+ tdw->gWindow->glPaintSetEnabled (tdw, enabled);
+ }
+}
+
bool
TdWindow::is3D ()
{
@@ -71,6 +90,7 @@ TdScreen::preparePaint (int msSinceLastPaint)
cScreen->preparePaint (msSinceLastPaint);
+ setFunctions (mActive);
cs->paintAllViewports (mActive);
}
@@ -548,9 +568,11 @@ TdScreen::TdScreen (CompScreen *screen) :
mCurrentScale (1.0f),
mBasicScale (1.0f)
{
- CompositeScreenInterface::setHandler (cScreen);
- GLScreenInterface::setHandler (gScreen);
- CubeScreenInterface::setHandler (cubeScreen);
+ CompositeScreenInterface::setHandler (cScreen, false);
+ GLScreenInterface::setHandler (gScreen, false);
+ CubeScreenInterface::setHandler (cubeScreen, false);
+
+ cScreen->preparePaintSetEnabled (this, true);
}
TdScreen::~TdScreen ()
@@ -565,7 +587,7 @@ TdWindow::TdWindow (CompWindow *window) :
mIs3D (false),
mDepth (0.0f)
{
- GLWindowInterface::setHandler (gWindow);
+ GLWindowInterface::setHandler (gWindow, false);
}
TdWindow::~TdWindow ()