summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-01-18 04:31:16 +0000
committerDana Jansens <danakj@orodu.net>2003-01-18 04:31:16 +0000
commit02066c5d0b09ae49aa1f9b7193fb16f1ac7f6a37 (patch)
treeba1252cbcad2aa593283c08096c36ab24f4f12a6
parente3eeac5b6eee29009f3417f309a261d43fd39d27 (diff)
starting to make render's interface
-rw-r--r--otk/rendercontrol.cc1
-rw-r--r--otk/rendercontrol.hh4
-rw-r--r--otk/rendertest.cc5
-rw-r--r--otk/rendertexture.hh12
-rw-r--r--otk/truerendercontrol.cc3
-rw-r--r--otk/truerendercontrol.hh2
6 files changed, 23 insertions, 4 deletions
diff --git a/otk/rendercontrol.cc b/otk/rendercontrol.cc
index 1dd5704d..479de3d9 100644
--- a/otk/rendercontrol.cc
+++ b/otk/rendercontrol.cc
@@ -6,6 +6,7 @@
#include "rendercontrol.hh"
#include "truerendercontrol.hh"
+#include "rendertexture.hh"
#include "display.hh"
#include "screeninfo.hh"
diff --git a/otk/rendercontrol.hh b/otk/rendercontrol.hh
index 14c0e92c..c619597f 100644
--- a/otk/rendercontrol.hh
+++ b/otk/rendercontrol.hh
@@ -11,6 +11,7 @@ namespace otk {
class ScreenInfo;
class Surface;
+class RenderTexture;
class RenderControl {
protected:
@@ -66,7 +67,8 @@ public:
static RenderControl *getRenderControl(int screen);
- virtual void render(Surface *sf) = 0;
+ virtual void drawBackground(Surface *sf,
+ const RenderTexture &texture) const = 0;
};
}
diff --git a/otk/rendertest.cc b/otk/rendertest.cc
index 2cf63f37..b485d357 100644
--- a/otk/rendertest.cc
+++ b/otk/rendertest.cc
@@ -1,5 +1,6 @@
#include "otk.hh"
#include "rendercontrol.hh"
+#include "rendertexture.hh"
#include <stdio.h>
#include <X11/Xlib.h>
@@ -15,7 +16,9 @@ int main(int argc, char **argv)
otk::RenderControl *rc = otk::RenderControl::getRenderControl(0);
- rc->render(&foo);
+ otk::RenderTexture tex;
+
+ rc->drawBackground(&foo, tex);
XSetWindowBackgroundPixmap(**otk::display, foo.window(), foo.pixmap());
XClearWindow(**otk::display, foo.window());
diff --git a/otk/rendertexture.hh b/otk/rendertexture.hh
new file mode 100644
index 00000000..68f935dc
--- /dev/null
+++ b/otk/rendertexture.hh
@@ -0,0 +1,12 @@
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+#ifndef __rendertexture_hh
+#define __rendertexture_hh
+
+namespace otk {
+
+class RenderTexture {
+};
+
+}
+
+#endif // __rendertexture_hh
diff --git a/otk/truerendercontrol.cc b/otk/truerendercontrol.cc
index 95a0a416..e23b2ef6 100644
--- a/otk/truerendercontrol.cc
+++ b/otk/truerendercontrol.cc
@@ -102,7 +102,8 @@ static inline void renderPixel(XImage *im, unsigned char *dp,
}
}
-void TrueRenderControl::render(Surface *sf)
+void TrueRenderControl::drawBackground(Surface *sf,
+ const RenderTexture &texture) const
{
assert(sf);
diff --git a/otk/truerendercontrol.hh b/otk/truerendercontrol.hh
index 4012a008..af057be8 100644
--- a/otk/truerendercontrol.hh
+++ b/otk/truerendercontrol.hh
@@ -17,7 +17,7 @@ public:
TrueRenderControl(const ScreenInfo *screen);
virtual ~TrueRenderControl();
- virtual void render(Surface *sf);
+ virtual void drawBackground(Surface *sf, const RenderTexture &texture) const;
};
}