diff -Nauwr Irrlicht/CD3D8Driver.cpp IrrlichtK0.5/CD3D8Driver.cpp --- Irrlicht/CD3D8Driver.cpp 2005-05-25 18:43:26.000000000 +0200 +++ IrrlichtK0.5/CD3D8Driver.cpp 2005-05-26 22:53:19.000000000 +0200 @@ -327,9 +327,9 @@ //! applications must call this method before performing any rendering. returns false if failed. -bool CD3D8Driver::beginScene(bool backBuffer, bool zBuffer, SColor color) +bool CD3D8Driver::beginScene() { - CNullDriver::beginScene(backBuffer, zBuffer, color); + CNullDriver::beginScene(); HRESULT hr; if (!pID3DDevice) @@ -350,16 +350,16 @@ DWORD flags = 0; - if (backBuffer) + if (clearBackBuffer) flags |= D3DCLEAR_TARGET; - if (zBuffer) + if (clearZBuffer) flags |= D3DCLEAR_ZBUFFER; if (StencilBuffer) flags |= D3DCLEAR_STENCIL; - hr = pID3DDevice->Clear( 0, NULL, flags, color.color, 1.0, 0); + hr = pID3DDevice->Clear( 0, NULL, flags, backgroundColor.color, 1.0, 0); if (FAILED(hr)) os::Printer::log("DirectX8 clear failed.", ELL_WARNING); diff -Nauwr Irrlicht/CD3D8Driver.h IrrlichtK0.5/CD3D8Driver.h --- Irrlicht/CD3D8Driver.h 2005-05-25 18:43:26.000000000 +0200 +++ IrrlichtK0.5/CD3D8Driver.h 2005-05-26 12:42:51.000000000 +0200 @@ -37,7 +37,7 @@ virtual ~CD3D8Driver(); //! applications must call this method before performing any rendering. returns false if failed. - virtual bool beginScene(bool backBuffer, bool zBuffer, SColor color); + virtual bool beginScene(); //! applications must call this method after performing any rendering. returns false if failed. virtual bool endScene(); diff -Nauwr Irrlicht/CD3D9Driver.cpp IrrlichtK0.5/CD3D9Driver.cpp --- Irrlicht/CD3D9Driver.cpp 2005-05-25 18:43:26.000000000 +0200 +++ IrrlichtK0.5/CD3D9Driver.cpp 2005-05-26 22:53:39.000000000 +0200 @@ -342,9 +342,9 @@ //! applications must call this method before performing any rendering. returns false if failed. -bool CD3D9Driver::beginScene(bool backBuffer, bool zBuffer, SColor color) +bool CD3D9Driver::beginScene() { - CNullDriver::beginScene(backBuffer, zBuffer, color); + CNullDriver::beginScene(); HRESULT hr; if (!pID3DDevice) @@ -365,16 +365,16 @@ DWORD flags = 0; - if (backBuffer) + if (clearBackBuffer) flags |= D3DCLEAR_TARGET; - if (zBuffer) + if (clearZBuffer) flags |= D3DCLEAR_ZBUFFER; if (StencilBuffer) flags |= D3DCLEAR_STENCIL; - hr = pID3DDevice->Clear( 0, NULL, flags, color.color, 1.0, 0); + hr = pID3DDevice->Clear( 0, NULL, flags, backgroundColor.color, 1.0, 0); if (FAILED(hr)) os::Printer::log("DirectX9 clear failed.", ELL_WARNING); diff -Nauwr Irrlicht/CD3D9Driver.h IrrlichtK0.5/CD3D9Driver.h --- Irrlicht/CD3D9Driver.h 2005-05-25 18:43:26.000000000 +0200 +++ IrrlichtK0.5/CD3D9Driver.h 2005-05-26 12:43:08.000000000 +0200 @@ -30,7 +30,7 @@ virtual ~CD3D9Driver(); //! applications must call this method before performing any rendering. returns false if failed. - virtual bool beginScene(bool backBuffer, bool zBuffer, SColor color); + virtual bool beginScene(); //! applications must call this method after performing any rendering. returns false if failed. virtual bool endScene(); diff -Nauwr Irrlicht/CNullDriver.cpp IrrlichtK0.5/CNullDriver.cpp --- Irrlicht/CNullDriver.cpp 2005-05-25 18:43:26.000000000 +0200 +++ IrrlichtK0.5/CNullDriver.cpp 2005-05-26 22:21:44.000000000 +0200 @@ -33,7 +33,8 @@ //! constructor CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d& screenSize) : ScreenSize(screenSize), ViewPort(0,0,0,0), - FileSystem(io), PrimitivesDrawn(0), TextureCreationFlags(0) + FileSystem(io), PrimitivesDrawn(0), TextureCreationFlags(0), + clearBackBuffer(true), clearZBuffer(true), backgroundColor(0,100,100,100) { #ifdef _DEBUG setDebugName("CNullDriver"); @@ -106,7 +107,7 @@ //! applications must call this method before performing any rendering. returns false if failed. -bool CNullDriver::beginScene(bool backBuffer, bool zBuffer, SColor color) +bool CNullDriver::beginScene() { PrimitivesDrawn = 0; return true; diff -Nauwr Irrlicht/CNullDriver.h IrrlichtK0.5/CNullDriver.h --- Irrlicht/CNullDriver.h 2005-05-25 18:43:26.000000000 +0200 +++ IrrlichtK0.5/CNullDriver.h 2005-05-26 12:41:13.000000000 +0200 @@ -28,7 +28,7 @@ //! destructor virtual ~CNullDriver(); - virtual bool beginScene(bool backBuffer, bool zBuffer, SColor color); + virtual bool beginScene(); virtual bool endScene(); @@ -241,6 +241,20 @@ //! Returns pointer to the IGPUProgrammingServices interface. virtual IGPUProgrammingServices* getGPUProgrammingServices(); + //! set the clear backbuffer flag. this is as a replacement for the parameters in the beginscene-call + virtual void setClearBackBuffer(bool clearBackBuffer) + { + this->clearBackBuffer=clearBackBuffer; + } + void CNullDriver::setClearZBuffer(bool clearZBuffer) + { + this->clearZBuffer=clearZBuffer; + } + void CNullDriver::setBackgroundColor(SColor backgroundColor) + { + this->backgroundColor=backgroundColor; + } + //! Adds a new material renderer to the VideoDriver, using pixel and/or //! vertex shaders to render geometry. virtual s32 addShaderMaterial(const c8* vertexShaderProgram = 0, @@ -388,6 +397,12 @@ SColor FogColor; SExposedVideoData ExposedData; + + bool clearBackBuffer; + + bool clearZBuffer; + + SColor backgroundColor; }; } // end namespace video diff -Nauwr Irrlicht/COpenGLDriver.cpp IrrlichtK0.5/COpenGLDriver.cpp --- Irrlicht/COpenGLDriver.cpp 2005-05-25 18:43:26.000000000 +0200 +++ IrrlichtK0.5/COpenGLDriver.cpp 2005-05-26 13:47:23.000000000 +0200 @@ -482,22 +482,22 @@ //! clears the zbuffer -bool COpenGLDriver::beginScene(bool backBuffer, bool zBuffer, SColor color) +bool COpenGLDriver::beginScene() { - CNullDriver::beginScene(backBuffer, zBuffer, color); + CNullDriver::beginScene(); GLbitfield mask = 0; - if (backBuffer) + if (clearBackBuffer) { f32 inv = 1.0f / 255.0f; - glClearColor(color.getRed() * inv, color.getGreen() * inv, - color.getBlue() * inv, color.getAlpha() * inv); + glClearColor(backgroundColor.getRed() * inv, backgroundColor.getGreen() * inv, + backgroundColor.getBlue() * inv, backgroundColor.getAlpha() * inv); mask |= GL_COLOR_BUFFER_BIT; } - if (zBuffer) + if (clearZBuffer) { glDepthMask(GL_TRUE); mask |= GL_DEPTH_BUFFER_BIT; diff -Nauwr Irrlicht/COpenGLDriver.h IrrlichtK0.5/COpenGLDriver.h --- Irrlicht/COpenGLDriver.h 2005-05-25 18:43:26.000000000 +0200 +++ IrrlichtK0.5/COpenGLDriver.h 2005-05-26 12:42:31.000000000 +0200 @@ -57,7 +57,7 @@ virtual bool endScene(); //! clears the zbuffer - virtual bool beginScene(bool backBuffer, bool zBuffer, SColor color); + virtual bool beginScene(); //! sets transformation virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat); diff -Nauwr Irrlicht/CSoftwareDriver.cpp IrrlichtK0.5/CSoftwareDriver.cpp --- Irrlicht/CSoftwareDriver.cpp 2005-05-25 18:43:26.000000000 +0200 +++ IrrlichtK0.5/CSoftwareDriver.cpp 2005-05-26 12:51:58.000000000 +0200 @@ -227,14 +227,14 @@ //! clears the zbuffer -bool CSoftwareDriver::beginScene(bool backBuffer, bool zBuffer, SColor color) +bool CSoftwareDriver::beginScene() { - CNullDriver::beginScene(backBuffer, zBuffer, color); + CNullDriver::beginScene(); - if (backBuffer) - BackBuffer->fill(color.toA1R5G5B5()); + if (clearBackBuffer) + BackBuffer->fill(backgroundColor.toA1R5G5B5()); - if (ZBuffer && zBuffer) + if (ZBuffer && clearZBuffer) ZBuffer->clear(); return true; diff -Nauwr Irrlicht/CSoftwareDriver.h IrrlichtK0.5/CSoftwareDriver.h --- Irrlicht/CSoftwareDriver.h 2005-05-25 18:43:26.000000000 +0200 +++ IrrlichtK0.5/CSoftwareDriver.h 2005-05-26 12:42:04.000000000 +0200 @@ -43,7 +43,7 @@ virtual void setViewPort(const core::rect& area); //! clears the zbuffer - virtual bool beginScene(bool backBuffer, bool zBuffer, SColor color); + virtual bool beginScene(); //! draws an indexed triangle list virtual void drawIndexedTriangleList(const S3DVertex* vertices, s32 vertexCount, diff -Nauwr Irrlicht/include/IVideoDriver.h IrrlichtK0.5/include/IVideoDriver.h --- Irrlicht/include/IVideoDriver.h 2005-05-25 18:56:40.000000000 +0200 +++ IrrlichtK0.5/include/IVideoDriver.h 2005-05-26 12:38:04.000000000 +0200 @@ -123,7 +123,7 @@ \param zBuffer: Speciefies if the depth or z buffer should be cleared. It is not nesesarry to do so, if only 2d drawing is used. \return Returns false if failed. Begin Scene can clear the back- and the z-buffer. */ - virtual bool beginScene(bool backBuffer, bool zBuffer, SColor color) = 0; + virtual bool beginScene() = 0; //! Presents the rendered image on the screen. /** Applications must call this method after performing any rendering. @@ -709,6 +709,15 @@ videodriver does not support this. (For example the Software and the NULL device will always return 0) */ virtual IGPUProgrammingServices* getGPUProgrammingServices() = 0; + + //! set the clear backbuffer flag. This is as a replacement for the parameters in the beginscene-call + virtual void setClearBackBuffer(bool clearBackBuffer) = 0; + + //! set the clearZBuffer flag. This is a replacement for the parameters in the classic Irrlicht beginscene(...) function + virtual void setClearZBuffer(bool clearZBuffer) = 0; + + //! set the background color for the scene. This is a replacement for the parameters in the classic Irrlicht beginscene(...) function + virtual void setBackgroundColor(SColor backgroundColor) = 0; //! Clears the ZBuffer. /** Note that you usually need not to call this method,