starting to make render's interface

This commit is contained in:
Dana Jansens 2003-01-18 04:31:16 +00:00
parent e3eeac5b6e
commit 02066c5d0b
6 changed files with 23 additions and 4 deletions

View file

@ -6,6 +6,7 @@
#include "rendercontrol.hh" #include "rendercontrol.hh"
#include "truerendercontrol.hh" #include "truerendercontrol.hh"
#include "rendertexture.hh"
#include "display.hh" #include "display.hh"
#include "screeninfo.hh" #include "screeninfo.hh"

View file

@ -11,6 +11,7 @@ namespace otk {
class ScreenInfo; class ScreenInfo;
class Surface; class Surface;
class RenderTexture;
class RenderControl { class RenderControl {
protected: protected:
@ -66,7 +67,8 @@ public:
static RenderControl *getRenderControl(int screen); static RenderControl *getRenderControl(int screen);
virtual void render(Surface *sf) = 0; virtual void drawBackground(Surface *sf,
const RenderTexture &texture) const = 0;
}; };
} }

View file

@ -1,5 +1,6 @@
#include "otk.hh" #include "otk.hh"
#include "rendercontrol.hh" #include "rendercontrol.hh"
#include "rendertexture.hh"
#include <stdio.h> #include <stdio.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
@ -15,7 +16,9 @@ int main(int argc, char **argv)
otk::RenderControl *rc = otk::RenderControl::getRenderControl(0); otk::RenderControl *rc = otk::RenderControl::getRenderControl(0);
rc->render(&foo); otk::RenderTexture tex;
rc->drawBackground(&foo, tex);
XSetWindowBackgroundPixmap(**otk::display, foo.window(), foo.pixmap()); XSetWindowBackgroundPixmap(**otk::display, foo.window(), foo.pixmap());
XClearWindow(**otk::display, foo.window()); XClearWindow(**otk::display, foo.window());

12
otk/rendertexture.hh Normal file
View file

@ -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

View file

@ -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); assert(sf);

View file

@ -17,7 +17,7 @@ public:
TrueRenderControl(const ScreenInfo *screen); TrueRenderControl(const ScreenInfo *screen);
virtual ~TrueRenderControl(); virtual ~TrueRenderControl();
virtual void render(Surface *sf); virtual void drawBackground(Surface *sf, const RenderTexture &texture) const;
}; };
} }