summaryrefslogtreecommitdiff
path: root/src/photowheel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/photowheel.h')
-rw-r--r--src/photowheel.h123
1 files changed, 123 insertions, 0 deletions
diff --git a/src/photowheel.h b/src/photowheel.h
new file mode 100644
index 0000000..e5649d1
--- /dev/null
+++ b/src/photowheel.h
@@ -0,0 +1,123 @@
+/*
+ * Compiz cube gears plugin
+ *
+ * gears.c
+ *
+ * This is an example plugin to show how to render something inside
+ * of the transparent cube
+ *
+ * Copyright : (C) 2007 by Dennis Kasprzyk
+ * E-mail : onestone@opencompositing.org
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Based on glxgears.c:
+ * http://cvsweb.xfree86.org/cvsweb/xc/programs/glxgears/glxgears.c
+ */
+
+#include <cstdlib>
+#include <cstring>
+#include <cstdio>
+#include <signal.h>
+#include <unistd.h>
+#include <cmath>
+
+#include <core/core.h>
+#include <core/pluginclasshandler.h>
+#include <composite/composite.h>
+#include <opengl/opengl.h>
+#include <cube/cube.h>
+
+#include "photowheel_options.h"
+
+#define PI 3.14159
+
+class PhotowheelTexture
+{
+ public:
+
+ GLTexture::List tex;
+ GLuint dList;
+};
+
+class PhotowheelScreen :
+ public ScreenInterface,
+ public CompositeScreenInterface,
+ public GLScreenInterface,
+ public CubeScreenInterface,
+ public PluginClassHandler <PhotowheelScreen, CompScreen>,
+ public PhotowheelOptions
+{
+ public:
+
+ PhotowheelScreen (CompScreen *s);
+
+ ~PhotowheelScreen ();
+
+ CompScreen *screen;
+ CompositeScreen *cScreen;
+ GLScreen *gScreen;
+ CubeScreen *csScreen;
+
+ void
+ paramChange (CompOption*, Options);
+
+ void
+ capChange (CompOption*, Options);
+
+ void
+ textureChange (CompOption*, Options);
+
+ void
+ cubeClearTargetOutput (float, float);
+
+ void
+ cubePaintInside (const GLScreenPaintAttrib&,
+ const GLMatrix&,
+ CompOutput*,
+ int);
+
+ void
+ preparePaint (int);
+
+ void
+ donePaint ();
+
+ bool damage, firsttime, transformOrder, enableCull;
+
+ std::vector <PhotowheelTexture> photoTexture;
+
+ int n; /* how many sides on prism */
+ GLfloat l; /* how big is the prism */
+ GLfloat h; /* how high is the prism */
+ float rspeed; /* speed of rotation */
+
+ float xpos;
+ float ypos;
+ float zpos;
+
+ GLuint dList; /* caps */
+
+ float angle;
+};
+
+#define PHOTOWHEEL_SCREEN(s) \
+ PhotowheelScreen *ps = PhotowheelScreen::get (s);
+
+class PhotowheelPluginVTable :
+ public CompPlugin::VTableForScreen
+ <PhotowheelScreen>
+{
+ public:
+
+ bool init ();
+};