- Added clear buffer flags.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5151 dfc29bdd-3216-0410-991c-e03cc46cb475
master
nadro 2015-10-15 18:20:06 +00:00
parent 7f8604ca93
commit 07a7d9ee2e
83 changed files with 340 additions and 420 deletions

View File

@ -1,6 +1,7 @@
--------------------------
Changes in 1.9 (not yet released)
- Add clear buffer flags and marked some methods used for clear buffers as deprecated.
- Fix: CGUIImage no longer scales wrong when working with textures which don't have the original image size.
- Fix CSoftwareTexture2 calculation for OriginalSize of ITexture. It was returning the changed texture size instead of the original one before.
- Fix skinned meshes not playing their last frame. Also clarified animation documentation to describe current behavior more exactly.

View File

@ -215,7 +215,7 @@ int main()
the GUI Environment draw their content. With the endScene()
call everything is presented on the screen.
*/
driver->beginScene(true, true, SColor(255,100,101,140));
driver->beginScene(ECBF_COLOR | ECBF_DEPTH, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();

View File

@ -153,7 +153,7 @@ int main()
{
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(255,200,200,200));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,200,200,200));
smgr->drawAll();
driver->endScene();

View File

@ -243,7 +243,7 @@ int main()
u32 frames=0;
while(device->run())
{
driver->beginScene(true, true, video::SColor(0,100,100,100));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,100,100,100));
smgr->drawAll();

View File

@ -227,7 +227,7 @@ int main()
node->setPosition(nodePosition);
driver->beginScene(true, true, video::SColor(255,113,113,133));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133));
smgr->drawAll(); // draw the 3d scene
device->getGUIEnvironment()->drawAll(); // draw the gui environment (the logo)

View File

@ -289,7 +289,7 @@ int main()
while(device->run() && driver)
if (device->isWindowActive())
{
driver->beginScene(true, true, SColor(0,200,200,200));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200));
env->drawAll();

View File

@ -93,7 +93,7 @@ int main()
{
u32 time = device->getTimer()->getTime();
driver->beginScene(true, true, video::SColor(255,120,102,136));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,120,102,136));
/*
First, we draw 3 sprites, using the alpha channel we

View File

@ -245,7 +245,7 @@ int main()
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, 0);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0));
smgr->drawAll();
// Unlight any currently highlighted scene node

View File

@ -285,7 +285,7 @@ int main()
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, 0);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0));
smgr->drawAll();

View File

@ -997,7 +997,7 @@ int main(int argc, char* argv[])
if (Device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(150,50,50,50));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(150,50,50,50));
smgr->drawAll();
env->drawAll();

View File

@ -422,7 +422,7 @@ int main()
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(255,0,0,0));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0));
smgr->drawAll();
driver->endScene();

View File

@ -457,7 +457,7 @@ int main()
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, 0);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0));
smgr->drawAll();
env->drawAll();

View File

@ -252,7 +252,7 @@ int main()
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, 0 );
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0));
smgr->drawAll();
env->drawAll();

View File

@ -168,14 +168,14 @@ int main()
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, 0);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0));
if (renderTarget)
{
// draw scene into render target
// set render target texture
driver->setRenderTarget(renderTarget, 0, true, true, false, video::SColor(0, 0, 0, 255));
driver->setRenderTarget(renderTarget, 0, video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,255));
// make cube invisible and set fixed camera as active camera
test->setVisible(false);
@ -186,7 +186,7 @@ int main()
// set back old render target
// The buffer might have been distorted, so clear it
driver->setRenderTarget(0, 0, false, false, false, 0);
driver->setRenderTarget((video::IRenderTarget*)0, 0, 0, video::SColor(0));
// make the cube visible and set the user controlled camera as active one
test->setVisible(true);

View File

@ -214,12 +214,12 @@ int main()
while (device->run())
{
driver->beginScene(true, true, 0, videodata);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0), 1.f, 0, videodata);
smgr->drawAll();
driver->endScene();
if (key=='b')
{
driver->beginScene(true, true, 0xbbbbbbbb);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0xbbbbbbbb));
device->getGUIEnvironment()->drawAll();
driver->endScene();
}

View File

@ -153,7 +153,7 @@ int main(int argc, char** argv)
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(0,200,200,200));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,200,200,200));
smgr->drawAll();
driver->endScene();

View File

@ -349,7 +349,7 @@ int IRRCALLCONV main(int argc, char* argv[])
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(255,20,20,40));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,20,20,40));
smgr->drawAll();
gui->drawAll();
driver->endScene();

View File

@ -172,7 +172,7 @@ Sounds a little complicated, but you'll see it isn't:
{
//Set the viewpoint to the whole screen and begin scene
driver->setViewPort(rect<s32>(0,0,ResX,ResY));
driver->beginScene(true,true,SColor(255,100,100,100));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,100,100));
//If SplitScreen is used
if (SplitScreen)
{

View File

@ -268,7 +268,7 @@ int main()
// Turn lighting on and off depending on whether the left mouse button is down.
node->setMaterialFlag(video::EMF_LIGHTING, receiver.GetMouseState().LeftButtonDown);
driver->beginScene(true, true, video::SColor(255,113,113,133));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133));
smgr->drawAll(); // draw the 3d scene
driver->endScene();
}

View File

@ -362,7 +362,7 @@ Add several "zones". You could use this technique to light individual rooms, fo
while(device->run())
{
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();

View File

@ -1928,7 +1928,7 @@ void CQuake3EventHandler::Render()
if (anaglyph)
{
scene::ICameraSceneNode* cameraOld = Game->Device->getSceneManager()->getActiveCamera();
driver->beginScene(true, true, SColor(0,0,0,0));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,0,0,0));
driver->getOverrideMaterial().Material.ColorMask = ECP_NONE;
driver->getOverrideMaterial().EnableFlags = EMF_COLOR_MASK;
driver->getOverrideMaterial().EnablePasses = ESNRP_SKY_BOX +
@ -1937,7 +1937,7 @@ void CQuake3EventHandler::Render()
ESNRP_TRANSPARENT_EFFECT +
ESNRP_SHADOW;
Game->Device->getSceneManager()->drawAll();
driver->clearZBuffer();
driver->clearBuffers(video::ECBF_DEPTH, video::SColor(255,0,0,0));
const vector3df oldPosition = cameraOld->getPosition();
const vector3df oldTarget = cameraOld->getTarget();
@ -1965,7 +1965,7 @@ void CQuake3EventHandler::Render()
camera->setTarget(focusPoint);
Game->Device->getSceneManager()->drawAll();
driver->clearZBuffer();
driver->clearBuffers(video::ECBF_DEPTH, video::SColor(255, 0, 0, 0));
//Right eye...
move.setTranslation( vector3df(1.5f,0.0f,0.0f) );
@ -1999,7 +1999,7 @@ void CQuake3EventHandler::Render()
}
else
{
driver->beginScene(true, true, SColor(0,0,0,0));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,0,0,0));
Game->Device->getSceneManager()->drawAll();
}
Game->Device->getGUIEnvironment()->drawAll();

View File

@ -831,7 +831,7 @@ bool CApp::update()
// draw everything
video::SColor bkColor( skin->getColor(gui::EGDC_APP_WORKSPACE) );
videoDriver->beginScene(true, true, bkColor);
videoDriver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, bkColor);
smgr->drawAll();
guiEnv->drawAll();

View File

@ -411,7 +411,7 @@ int main(int argc, char* argv[])
mesh.init(hm, 50.f, yellow, driver);
}
driver->beginScene(true, true, SColor(0xff000000));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0xff000000));
smgr->drawAll();
driver->endScene();
}

View File

@ -529,7 +529,7 @@ int main()
context.update();
driver->beginScene(true, true, SColor(0,200,200,200));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200));
env->drawAll();

View File

@ -490,7 +490,7 @@ int main()
{
if (app.Device->isWindowActive())
{
app.Driver->beginScene(true, true, SColor(0,200,200,200));
app.Driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200));
app.Gui->drawAll();
app.Driver->endScene();
}

View File

@ -157,7 +157,7 @@ int main()
{
plane->setVisible(!receiver.IsKeyDown(irr::KEY_SPACE));
driver->beginScene(true, true, video::SColor(255,113,113,133));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133));
/*
First, we draw the scene, possibly without the occluded element. This is necessary
because we need the occluder to be drawn first. You can also use several scene

View File

@ -458,7 +458,7 @@ int main()
*/
recursive(5);
driver->beginScene(true, true, SColor(0,200,200,200));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200));
/*
If you want to profile only some lines and not a complete scope

View File

@ -105,7 +105,12 @@ void CDemo::run()
createParticleImpacts();
driver->beginScene(timeForThisScene != -1, true, backColor);
u16 clearFlag = video::ECBF_DEPTH;
if (timeForThisScene != -1)
clearFlag |= video::ECBF_COLOR;
driver->beginScene(clearFlag, backColor);
smgr->drawAll();
guienv->drawAll();

View File

@ -231,7 +231,7 @@ bool CMainMenu::run(bool& outFullscreen, bool& outMusic, bool& outShadows,
{
if (MenuDevice->isWindowActive())
{
driver->beginScene(false, true, video::SColor(0,0,0,0));
driver->beginScene(video::ECBF_DEPTH, video::SColor(0,0,0,0));
if (irrlichtBack)
driver->draw2DImage(irrlichtBack,

View File

@ -130,6 +130,15 @@ namespace video
ERT_AUX_BUFFER4
};
//! Enum for the flags of clear buffer
enum E_CLEAR_BUFFER_FLAG
{
ECBF_NONE = 0,
ECBF_COLOR = 1,
ECBF_DEPTH = 2,
ECBF_STENCIL = 4
};
//! Enum for the types of fog distributions to choose from
enum E_FOG_TYPE
{
@ -224,14 +233,10 @@ namespace video
//! Applications must call this method before performing any rendering.
/** This method can clear the back- and the z-buffer.
\param backBuffer Specifies if the back buffer should be
cleared, which means that the screen is filled with the color
specified. If this parameter is false, the back buffer will
not be cleared and the color parameter is ignored.
\param zBuffer Specifies if the depth buffer (z buffer) should
be cleared. It is not nesesarry to do so if only 2d drawing is
used.
\param color The color used for back buffer clearing
\param clearFlag The clear flags.
\param clearColor The clear color for the color buffer.
\param clearDepth The clear value for the depth buffer.
\param clearStencil The clear value for the stencil buffer.
\param videoData Handle of another window, if you want the
bitmap to be displayed on another window. If this is an empty
element, everything will be displayed in the default window.
@ -240,16 +245,28 @@ namespace video
rectangle of the area to be presented. Set to null to present
everything. Note: not implemented in all devices.
\return False if failed. */
virtual bool beginScene(bool backBuffer=true, bool zBuffer=true,
SColor color=SColor(255,0,0,0),
const SExposedVideoData& videoData=SExposedVideoData(),
core::rect<s32>* sourceRect=0) =0;
virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0,
const SExposedVideoData& videoData=SExposedVideoData(), core::rect<s32>* sourceRect = 0) = 0;
_IRR_DEPRECATED_ bool beginScene(bool backBuffer = true, bool zBuffer = true, SColor color = SColor(255,0,0,0),
const SExposedVideoData& videoData = SExposedVideoData(), core::rect<s32>* sourceRect = 0)
{
u16 flag = 0;
if (backBuffer)
flag |= ECBF_COLOR;
if (zBuffer)
flag |= ECBF_DEPTH;
return beginScene(flag, color, 1.f, 0, videoData, sourceRect);
}
//! Presents the rendered image to the screen.
/** Applications must call this method after performing any
rendering.
\return False if failed and true if succeeded. */
virtual bool endScene() =0;
virtual bool endScene() = 0;
//! Queries the features of the driver.
/** Returns true if a feature is available
@ -537,23 +554,22 @@ namespace video
\param activeTextureID Array of texture indices which should be active during
RTT process. If more than one ID will be apply, this render target will work
as a Multiple Render Target.
\param clearBackBuffer Clears the back buffer of the render
target with the clearColor parameter.
\param clearDepthBuffer Clears the depth buffer of the rendertarget.
\param clearStencilBuffer Clears the stencil buffer of the rendertarget.
\param clearColor The clear color for the render target.
\param clearFlag The clear flags.
\param clearColor The clear color for the color buffer.
\param clearDepth The clear value for the depth buffer.
\param clearStencil The clear value for the stencil buffer.
\return True if sucessful and false if not. */
virtual bool setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, bool clearBackBuffer,
bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor = video::SColor(255,0,0,0)) = 0;
virtual bool setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, u16 clearFlag,
SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0) = 0;
//! Set a render target.
bool setRenderTarget(IRenderTarget* target, u32 activeTextureID, bool clearBackBuffer, bool clearDepthBuffer,
bool clearStencilBuffer, SColor clearColor = video::SColor(255,0,0,0))
bool setRenderTarget(IRenderTarget* target, u32 activeTextureID, u16 clearFlag, SColor clearColor = SColor(255,0,0,0),
f32 clearDepth = 1.f, u8 clearStencil = 0)
{
core::array<u32> idArray(1);
idArray.push_back(activeTextureID);
return setRenderTarget(target, idArray, clearBackBuffer, clearDepthBuffer, clearStencilBuffer, clearColor);
return setRenderTarget(target, idArray, clearFlag, clearColor);
}
//! Sets a new render target.
@ -580,17 +596,27 @@ namespace video
IVideoDriver::addRenderTargetTexture(). If set to 0, it sets
the previous render target which was set before the last
setRenderTarget() call.
\param clearBackBuffer Clears the backbuffer of the render
target with the color parameter
\param clearZBuffer Clears the zBuffer of the rendertarget.
Note that because the frame buffer may share the zbuffer with
the rendertarget, its zbuffer might be partially cleared too
by this.
\param color The background color for the render target.
\param clearFlag The clear flags.
\param clearColor The clear color for the color buffer.
\param clearDepth The clear value for the depth buffer.
\param clearStencil The clear value for the stencil buffer.
\return True if sucessful and false if not. */
virtual bool setRenderTarget(video::ITexture* texture,
bool clearBackBuffer = true, bool clearZBuffer = true,
SColor color = video::SColor(0, 0, 0, 0)) = 0;
virtual bool setRenderTarget(ITexture* texture, u16 clearFlag, SColor clearColor = SColor(255,0,0,0),
f32 clearDepth = 1.f, u8 clearStencil = 0) = 0;
_IRR_DEPRECATED_ bool setRenderTarget(ITexture* texture, bool clearBackBuffer = true,
bool clearZBuffer = true, SColor color = SColor(255,0,0,0))
{
u16 flag = 0;
if (clearBackBuffer)
flag |= ECBF_COLOR;
if (clearZBuffer)
flag |= ECBF_DEPTH;
return setRenderTarget(texture, flag, color);
}
//! Sets a new viewport.
/** Every rendering operation is done into this new area.
@ -1345,7 +1371,24 @@ namespace video
virtual scene::IMeshManipulator* getMeshManipulator() =0;
//! Clear the color, depth and/or stencil buffers.
virtual void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color) = 0;
virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) = 0;
//! Clear the color, depth and/or stencil buffers.
_IRR_DEPRECATED_ void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
{
u16 flag = 0;
if (backBuffer)
flag |= ECBF_COLOR;
if (depthBuffer)
flag |= ECBF_DEPTH;
if (stencilBuffer)
flag |= ECBF_STENCIL;
clearBuffers(flag, color);
}
//! Clears the ZBuffer.
/** Note that you usually need not to call this method, as it
@ -1354,7 +1397,10 @@ namespace video
you have to render some special things, you can clear the
zbuffer during the rendering process with this method any time.
*/
_IRR_DEPRECATED_ virtual void clearZBuffer() = 0;
_IRR_DEPRECATED_ void clearZBuffer()
{
clearBuffers(ECBF_DEPTH, SColor(255,0,0,0), 1.f, 0);
}
//! Make a screenshot of the last rendered frame.
/** \return An image created from the last rendered frame. */

View File

@ -222,7 +222,7 @@ namespace irr
\code
while (device->run())
{
driver->beginScene(true, true, 0);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, 0);
smgr->drawAll();
driver->endScene();
}
@ -254,7 +254,7 @@ namespace irr
device->getTimer()->tick();
// draw engine picture
driver->beginScene(true, true, 0);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, 0);
smgr->drawAll();
driver->endScene();
}

View File

@ -256,7 +256,7 @@
* // draw everything
* while(device->run() && driver)
* {
* driver->beginScene(true, true, video::SColor(255,0,0,255));
* driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,255));
* scenemgr->drawAll();
* driver->endScene();
* }

View File

@ -493,12 +493,9 @@ bool CD3D9Driver::initDriver(HWND hwnd, bool pureSoftware)
return true;
}
//! applications must call this method before performing any rendering. returns false if failed.
bool CD3D9Driver::beginScene(bool backBuffer, bool zBuffer, SColor color,
const SExposedVideoData& videoData, core::rect<s32>* sourceRect)
bool CD3D9Driver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect<s32>* sourceRect)
{
CNullDriver::beginScene(backBuffer, zBuffer, color, videoData, sourceRect);
CNullDriver::beginScene(clearFlag, clearColor, clearDepth, clearStencil, videoData, sourceRect);
WindowId = (HWND)videoData.D3D9.HWnd;
SceneSourceRect = sourceRect;
@ -523,7 +520,7 @@ bool CD3D9Driver::beginScene(bool backBuffer, bool zBuffer, SColor color,
}
}
clearBuffers(backBuffer, zBuffer, false, color);
clearBuffers(clearFlag, clearColor, clearDepth, clearStencil);
hr = pID3DDevice->BeginScene();
if (FAILED(hr))
@ -535,8 +532,6 @@ bool CD3D9Driver::beginScene(bool backBuffer, bool zBuffer, SColor color,
return true;
}
//! applications must call this method after performing any rendering. returns false if failed.
bool CD3D9Driver::endScene()
{
CNullDriver::endScene();
@ -763,10 +758,7 @@ void CD3D9Driver::setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag,
CNullDriver::setTextureCreationFlag(flag, enabled);
}
//! set a render target
bool CD3D9Driver::setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, bool clearBackBuffer,
bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor)
bool CD3D9Driver::setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil)
{
if (target && target->getDriverType() != EDT_DIRECT3D9)
{
@ -882,7 +874,7 @@ bool CD3D9Driver::setRenderTarget(IRenderTarget* target, const core::array<u32>&
CurrentRenderTarget = target;
clearBuffers(clearBackBuffer, clearDepthBuffer, clearStencilBuffer, clearColor);
clearBuffers(clearFlag, clearColor, clearDepth, clearStencil);
return true;
}
@ -3156,24 +3148,22 @@ ITexture* CD3D9Driver::addRenderTargetTexture(const core::dimension2d<u32>& size
return tex;
}
//! Clear the color, depth and/or stencil buffers.
void CD3D9Driver::clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
void CD3D9Driver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil)
{
DWORD flags = 0;
DWORD internalFlag = 0;
if (backBuffer)
flags |= D3DCLEAR_TARGET;
if (flag & ECBF_COLOR)
internalFlag |= D3DCLEAR_TARGET;
if (depthBuffer)
flags |= D3DCLEAR_ZBUFFER;
if (flag & ECBF_DEPTH)
internalFlag |= D3DCLEAR_ZBUFFER;
if (stencilBuffer)
flags |= D3DCLEAR_STENCIL;
if (flag & ECBF_STENCIL)
internalFlag |= D3DCLEAR_STENCIL;
if (flags)
if (internalFlag)
{
HRESULT hr = pID3DDevice->Clear(0, NULL, flags, color.color, 1.0, 0);
HRESULT hr = pID3DDevice->Clear(0, NULL, internalFlag, color.color, depth, stencil);
if (FAILED(hr))
os::Printer::log("DIRECT3D9 clear failed.", ELL_WARNING);
@ -3181,16 +3171,6 @@ void CD3D9Driver::clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBu
}
//! Clears the ZBuffer.
void CD3D9Driver::clearZBuffer()
{
HRESULT hr = pID3DDevice->Clear( 0, NULL, D3DCLEAR_ZBUFFER, 0, 1.0, 0);
if (FAILED(hr))
os::Printer::log("CD3D9Driver clearZBuffer() failed.", ELL_WARNING);
}
//! Returns an image created from the last rendered frame.
IImage* CD3D9Driver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RENDER_TARGET target)
{

View File

@ -44,13 +44,9 @@ namespace video
//! destructor
virtual ~CD3D9Driver();
//! applications must call this method before performing any rendering. returns false if failed.
virtual bool beginScene(bool backBuffer=true, bool zBuffer=true,
SColor color=SColor(255,0,0,0),
const SExposedVideoData& videoData=SExposedVideoData(),
core::rect<s32>* sourceRect=0) _IRR_OVERRIDE_;
virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0,
const SExposedVideoData& videoData = SExposedVideoData(), core::rect<s32>* sourceRect = 0) _IRR_OVERRIDE_;
//! applications must call this method after performing any rendering. returns false if failed.
virtual bool endScene() _IRR_OVERRIDE_;
//! queries the features of the driver, returns true if feature is available
@ -62,9 +58,8 @@ namespace video
//! sets a material
virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_;
//! set a render target
virtual bool setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, bool clearBackBuffer,
bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor) _IRR_OVERRIDE_;
virtual bool setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, u16 clearFlag,
SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_;
//! sets a viewport
virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_;
@ -271,11 +266,7 @@ namespace video
virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_;
//! Clear the color, depth and/or stencil buffers.
virtual void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color) _IRR_OVERRIDE_;
//! Clears the ZBuffer.
virtual void clearZBuffer() _IRR_OVERRIDE_;
virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_;
//! Returns an image created from the last rendered frame.
virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_;

View File

@ -308,19 +308,13 @@ void CNullDriver::deleteAllTextures()
SharedDepthTextures.clear();
}
//! applications must call this method before performing any rendering. returns false if failed.
bool CNullDriver::beginScene(bool backBuffer, bool zBuffer, SColor color,
const SExposedVideoData& videoData, core::rect<s32>* sourceRect)
bool CNullDriver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect<s32>* sourceRect)
{
core::clearFPUException();
PrimitivesDrawn = 0;
return true;
}
//! applications must call this method after performing any rendering. returns false if failed.
bool CNullDriver::endScene()
{
FPSCounter.registerFrame(os::Timer::getRealTime(), PrimitivesDrawn);
@ -625,15 +619,12 @@ ITexture* CNullDriver::createDeviceDependentTexture(IImage* surface, const io::p
return new SDummyTexture(name);
}
//! set a render target
bool CNullDriver::setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, bool clearBackBuffer,
bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor)
bool CNullDriver::setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil)
{
return false;
}
bool CNullDriver::setRenderTarget(video::ITexture* texture, bool clearBackBuffer, bool clearZBuffer, SColor color)
bool CNullDriver::setRenderTarget(ITexture* texture, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil)
{
if (texture)
{
@ -663,11 +654,11 @@ bool CNullDriver::setRenderTarget(video::ITexture* texture, bool clearBackBuffer
SharedRenderTarget->setTexture(texture, depthTexture);
return IVideoDriver::setRenderTarget(SharedRenderTarget, 0, clearBackBuffer, clearZBuffer, clearZBuffer, color);
return IVideoDriver::setRenderTarget(SharedRenderTarget, 0, clearFlag, clearColor, clearDepth, clearStencil);
}
else
{
return IVideoDriver::setRenderTarget(NULL, 0, clearBackBuffer, clearZBuffer, false, color);
return IVideoDriver::setRenderTarget(NULL, 0, clearFlag, clearColor, clearDepth, clearStencil);
}
}
@ -2410,15 +2401,7 @@ ITexture* CNullDriver::addRenderTargetTexture(const core::dimension2d<u32>& size
return 0;
}
//! Clear the color, depth and/or stencil buffers.
void CNullDriver::clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
{
}
//! Clears the ZBuffer.
void CNullDriver::clearZBuffer()
void CNullDriver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil)
{
}

View File

@ -48,10 +48,8 @@ namespace video
//! destructor
virtual ~CNullDriver();
virtual bool beginScene(bool backBuffer=true, bool zBuffer=true,
SColor color=SColor(255,0,0,0),
const SExposedVideoData& videoData=SExposedVideoData(),
core::rect<s32>* sourceRect=0) _IRR_OVERRIDE_;
virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0,
const SExposedVideoData& videoData = SExposedVideoData(), core::rect<s32>* sourceRect = 0) _IRR_OVERRIDE_;
virtual bool endScene() _IRR_OVERRIDE_;
@ -100,14 +98,11 @@ namespace video
//! creates a Texture
virtual ITexture* addTexture(const core::dimension2d<u32>& size, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) _IRR_OVERRIDE_;
//! set a render target
virtual bool setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, bool clearBackBuffer,
bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor) _IRR_OVERRIDE_;
virtual bool setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, u16 clearFlag,
SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_;
//! set a render target
virtual bool setRenderTarget(video::ITexture* texture,
bool clearBackBuffer = true, bool clearZBuffer = true,
SColor color = video::SColor(0, 0, 0, 0)) _IRR_OVERRIDE_;
virtual bool setRenderTarget(ITexture* texture, u16 clearFlag, SColor clearColor = SColor(255,0,0,0),
f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_;
//! sets a viewport
virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_;
@ -593,11 +588,7 @@ namespace video
//! Returns a pointer to the mesh manipulator.
virtual scene::IMeshManipulator* getMeshManipulator() _IRR_OVERRIDE_;
//! Clear the color, depth and/or stencil buffers.
virtual void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color) _IRR_OVERRIDE_;
//! Clears the ZBuffer.
virtual void clearZBuffer() _IRR_OVERRIDE_;
virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_;
//! Returns an image created from the last rendered frame.
virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_;

View File

@ -804,8 +804,40 @@ void COpenGLDriver::createMaterialRenderers()
addAndDropMaterialRenderer(new COpenGLMaterialRenderer_ONETEXTURE_BLEND(this));
}
bool COpenGLDriver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect<s32>* sourceRect)
{
CNullDriver::beginScene(clearFlag, clearColor, clearDepth, clearStencil, videoData, sourceRect);
switch (DeviceType)
{
#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
case EIDT_WIN32:
changeRenderContext(videoData, Win32Device);
break;
#endif
#ifdef _IRR_COMPILE_WITH_X11_DEVICE_
case EIDT_X11:
changeRenderContext(videoData, X11Device);
break;
#endif
default:
changeRenderContext(videoData, (void*)0);
break;
}
#if defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
if (DeviceType == EIDT_SDL)
{
// todo: SDL sets glFrontFace(GL_CCW) after driver creation,
// it would be better if this was fixed elsewhere.
glFrontFace(GL_CW);
}
#endif
clearBuffers(clearFlag, clearColor, clearDepth, clearStencil);
return true;
}
//! presents the rendered scene on the screen, returns false if failed
bool COpenGLDriver::endScene()
{
CNullDriver::endScene();
@ -847,43 +879,6 @@ bool COpenGLDriver::endScene()
}
//! init call for rendering start
bool COpenGLDriver::beginScene(bool backBuffer, bool zBuffer, SColor color,
const SExposedVideoData& videoData, core::rect<s32>* sourceRect)
{
CNullDriver::beginScene(backBuffer, zBuffer, color, videoData, sourceRect);
switch (DeviceType)
{
#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
case EIDT_WIN32:
changeRenderContext(videoData, Win32Device);
break;
#endif
#ifdef _IRR_COMPILE_WITH_X11_DEVICE_
case EIDT_X11:
changeRenderContext(videoData, X11Device);
break;
#endif
default:
changeRenderContext(videoData, (void*)0);
break;
}
#if defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
if (DeviceType == EIDT_SDL)
{
// todo: SDL sets glFrontFace(GL_CCW) after driver creation,
// it would be better if this was fixed elsewhere.
glFrontFace(GL_CW);
}
#endif
clearBuffers(backBuffer, zBuffer, false, color);
return true;
}
//! Returns the transformation set by setTransform
const core::matrix4& COpenGLDriver::getTransform(E_TRANSFORMATION_STATE state) const
{
@ -4220,10 +4215,7 @@ u32 COpenGLDriver::getMaximalPrimitiveCount() const
return 0x7fffffff;
}
//! set a render target
bool COpenGLDriver::setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, bool clearBackBuffer,
bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor)
bool COpenGLDriver::setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil)
{
if (target && target->getDriverType() != EDT_OPENGL)
{
@ -4288,11 +4280,11 @@ bool COpenGLDriver::setRenderTarget(IRenderTarget* target, const core::array<u32
if (!supportForFBO)
{
clearBackBuffer = true;
clearDepthBuffer = true;
clearFlag |= ECBF_COLOR;
clearFlag |= ECBF_DEPTH;
}
clearBuffers(clearBackBuffer, clearDepthBuffer, clearStencilBuffer, clearColor);
clearBuffers(clearFlag, clearColor, clearDepth, clearStencil);
return true;
}
@ -4307,13 +4299,11 @@ const core::dimension2d<u32>& COpenGLDriver::getCurrentRenderTargetSize() const
return CurrentRenderTargetSize;
}
//! Clear the color, depth and/or stencil buffers.
void COpenGLDriver::clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
void COpenGLDriver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil)
{
GLbitfield mask = 0;
if (backBuffer)
if (flag & ECBF_COLOR)
{
BridgeCalls->setColorMask(true, true, true, true);
@ -4324,27 +4314,24 @@ void COpenGLDriver::clearBuffers(bool backBuffer, bool depthBuffer, bool stencil
mask |= GL_COLOR_BUFFER_BIT;
}
if (depthBuffer)
if (flag & ECBF_DEPTH)
{
BridgeCalls->setDepthMask(true);
glClearDepth(depth);
mask |= GL_DEPTH_BUFFER_BIT;
}
if (stencilBuffer)
if (flag & ECBF_STENCIL)
{
glClearStencil(stencil);
mask |= GL_STENCIL_BUFFER_BIT;
}
if (mask)
glClear(mask);
}
//! Clears the ZBuffer.
void COpenGLDriver::clearZBuffer()
{
clearBuffers(false, true, false, 0x0);
}
//! Returns an image created from the last rendered frame.
IImage* COpenGLDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RENDER_TARGET target)
{

View File

@ -74,13 +74,9 @@ namespace video
//! destructor
virtual ~COpenGLDriver();
//! clears the zbuffer
virtual bool beginScene(bool backBuffer=true, bool zBuffer=true,
SColor color=SColor(255,0,0,0),
const SExposedVideoData& videoData=SExposedVideoData(),
core::rect<s32>* sourceRect=0) _IRR_OVERRIDE_;
virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0,
const SExposedVideoData& videoData = SExposedVideoData(), core::rect<s32>* sourceRect = 0) _IRR_OVERRIDE_;
//! presents the rendered scene on the screen, returns false if failed
virtual bool endScene() _IRR_OVERRIDE_;
//! sets transformation
@ -359,15 +355,10 @@ namespace video
virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_;
//! set a render target
virtual bool setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, bool clearBackBuffer,
bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor) _IRR_OVERRIDE_;
virtual bool setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, u16 clearFlag,
SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_;
//! Clear the color, depth and/or stencil buffers.
virtual void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color) _IRR_OVERRIDE_;
//! Clears the ZBuffer.
virtual void clearZBuffer() _IRR_OVERRIDE_;
virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_;
//! Returns an image created from the last rendered frame.
virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_;

View File

@ -227,22 +227,17 @@ void CSoftwareDriver::setMaterial(const SMaterial& material)
}
}
//! clears the zbuffer
bool CSoftwareDriver::beginScene(bool backBuffer, bool zBuffer, SColor color,
const SExposedVideoData& videoData, core::rect<s32>* sourceRect)
bool CSoftwareDriver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect<s32>* sourceRect)
{
CNullDriver::beginScene(backBuffer, zBuffer, color, videoData, sourceRect);
CNullDriver::beginScene(clearFlag, clearColor, clearDepth, clearStencil, videoData, sourceRect);
WindowId=videoData.D3D9.HWnd;
SceneSourceRect = sourceRect;
clearBuffers(backBuffer, zBuffer, false, color);
clearBuffers(clearFlag, clearColor, clearDepth, clearStencil);
return true;
}
//! presents the rendered scene on the screen, returns false if failed
bool CSoftwareDriver::endScene()
{
CNullDriver::endScene();
@ -258,10 +253,7 @@ ITexture* CSoftwareDriver::createDeviceDependentTexture(IImage* surface, const i
return new CSoftwareTexture(surface, name, false, mipmapData);
}
//! set a render target
bool CSoftwareDriver::setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, bool clearBackBuffer,
bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor)
bool CSoftwareDriver::setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil)
{
if (target && target->getDriverType() != EDT_SOFTWARE)
{
@ -285,7 +277,7 @@ bool CSoftwareDriver::setRenderTarget(IRenderTarget* target, const core::array<u
setRenderTarget(BackBuffer);
}
clearBuffers(clearBackBuffer, clearDepthBuffer, clearStencilBuffer, clearColor);
clearBuffers(clearFlag, clearColor, clearDepth, clearStencil);
return true;
}
@ -912,22 +904,12 @@ ITexture* CSoftwareDriver::addRenderTargetTexture(const core::dimension2d<u32>&
return tex;
}
//! Clear the color, depth and/or stencil buffers.
void CSoftwareDriver::clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
void CSoftwareDriver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil)
{
if (backBuffer && RenderTargetSurface)
if ((flag & ECBF_COLOR) && RenderTargetSurface)
RenderTargetSurface->fill(color);
if (depthBuffer && ZBuffer)
ZBuffer->clear();
}
//! Clears the ZBuffer.
void CSoftwareDriver::clearZBuffer()
{
if (ZBuffer)
if ((flag & ECBF_DEPTH) && ZBuffer)
ZBuffer->clear();
}

View File

@ -36,20 +36,15 @@ namespace video
//! sets a material
virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_;
//! set a render target
virtual bool setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, bool clearBackBuffer,
bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor) _IRR_OVERRIDE_;
virtual bool setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, u16 clearFlag,
SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_;
//! sets a viewport
virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_;
//! clears the zbuffer
virtual bool beginScene(bool backBuffer=true, bool zBuffer=true,
SColor color=SColor(255,0,0,0),
const SExposedVideoData& videoData=SExposedVideoData(),
core::rect<s32>* sourceRect=0) _IRR_OVERRIDE_;
virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0,
const SExposedVideoData& videoData = SExposedVideoData(), core::rect<s32>* sourceRect = 0) _IRR_OVERRIDE_;
//! presents the rendered scene on the screen, returns false if failed
virtual bool endScene() _IRR_OVERRIDE_;
//! Only used by the internal engine. Used to notify the driver that
@ -111,11 +106,7 @@ namespace video
virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_;
//! Clear the color, depth and/or stencil buffers.
virtual void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color) _IRR_OVERRIDE_;
//! Clears the ZBuffer.
virtual void clearZBuffer() _IRR_OVERRIDE_;
virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_;
//! Returns an image created from the last rendered frame.
virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_;

View File

@ -390,24 +390,18 @@ void CBurningVideoDriver::setTransform(E_TRANSFORMATION_STATE state, const core:
}
}
//! clears the zbuffer
bool CBurningVideoDriver::beginScene(bool backBuffer, bool zBuffer,
SColor color, const SExposedVideoData& videoData,
core::rect<s32>* sourceRect)
bool CBurningVideoDriver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect<s32>* sourceRect)
{
CNullDriver::beginScene(backBuffer, zBuffer, color, videoData, sourceRect);
CNullDriver::beginScene(clearFlag, clearColor, clearDepth, clearStencil, videoData, sourceRect);
WindowId = videoData.D3D9.HWnd;
SceneSourceRect = sourceRect;
clearBuffers(backBuffer, zBuffer, false, color);
clearBuffers(clearFlag, clearColor, clearDepth, clearStencil);
memset ( TransformationFlag, 0, sizeof ( TransformationFlag ) );
return true;
}
//! presents the rendered scene on the screen, returns false if failed
bool CBurningVideoDriver::endScene()
{
CNullDriver::endScene();
@ -415,10 +409,7 @@ bool CBurningVideoDriver::endScene()
return Presenter->present(BackBuffer, WindowId, SceneSourceRect);
}
//! set a render target
bool CBurningVideoDriver::setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, bool clearBackBuffer,
bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor)
bool CBurningVideoDriver::setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil)
{
if (target && target->getDriverType() != EDT_BURNINGSVIDEO)
{
@ -442,7 +433,7 @@ bool CBurningVideoDriver::setRenderTarget(IRenderTarget* target, const core::arr
setRenderTarget(BackBuffer);
}
clearBuffers(clearBackBuffer, clearDepthBuffer, clearStencilBuffer, clearColor);
clearBuffers(clearFlag, clearColor, clearDepth, clearStencil);
return true;
}
@ -2236,29 +2227,19 @@ ITexture* CBurningVideoDriver::addRenderTargetTexture(const core::dimension2d<u3
return tex;
}
//! Clear the color, depth and/or stencil buffers.
void CBurningVideoDriver::clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
void CBurningVideoDriver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil)
{
if (backBuffer && RenderTargetSurface)
if ((flag & ECBF_COLOR) && RenderTargetSurface)
RenderTargetSurface->fill(color);
if (depthBuffer && DepthBuffer)
if ((flag & ECBF_DEPTH) && DepthBuffer)
DepthBuffer->clear();
if (stencilBuffer && StencilBuffer)
if ((flag & ECBF_STENCIL) && StencilBuffer)
StencilBuffer->clear();
}
//! Clears the DepthBuffer.
void CBurningVideoDriver::clearZBuffer()
{
if (DepthBuffer)
DepthBuffer->clear();
}
//! Returns an image created from the last rendered frame.
IImage* CBurningVideoDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RENDER_TARGET target)
{

View File

@ -39,20 +39,15 @@ namespace video
//! sets a material
virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_;
//! set a render target
virtual bool setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, bool clearBackBuffer,
bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor) _IRR_OVERRIDE_;
virtual bool setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, u16 clearFlag,
SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_;
//! sets a viewport
virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_;
//! clears the zbuffer
virtual bool beginScene(bool backBuffer=true, bool zBuffer=true,
SColor color=SColor(255,0,0,0),
const SExposedVideoData& videoData=SExposedVideoData(),
core::rect<s32>* sourceRect=0) _IRR_OVERRIDE_;
virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0,
const SExposedVideoData& videoData = SExposedVideoData(), core::rect<s32>* sourceRect = 0) _IRR_OVERRIDE_;
//! presents the rendered scene on the screen, returns false if failed
virtual bool endScene() _IRR_OVERRIDE_;
//! Only used by the internal engine. Used to notify the driver that
@ -136,11 +131,7 @@ namespace video
virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_;
//! Clear the color, depth and/or stencil buffers.
virtual void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color) _IRR_OVERRIDE_;
//! Clears the DepthBuffer.
virtual void clearZBuffer() _IRR_OVERRIDE_;
virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_;
//! Returns an image created from the last rendered frame.
virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_;

View File

@ -691,7 +691,7 @@ static bool draw2DImage4c(video::E_DRIVER_TYPE type)
driver->getMaterial2D().TextureLayer[0].BilinearFilter = true;
{
driver->beginScene(true, true, video::SColor(255,120,102,136));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,120,102,136));
driver->enableMaterial2D();
@ -822,7 +822,7 @@ static bool addBlend2d(video::E_DRIVER_TYPE type)
}
material2D.AntiAliasing=video::EAAM_FULL_BASIC;
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
smgr->drawAll();
driver->enableMaterial2D();
env->drawAll();
@ -871,7 +871,7 @@ static bool moreFilterTests(video::E_DRIVER_TYPE type)
driver->getMaterial2D().TextureLayer[0].TrilinearFilter=true;
{
driver->beginScene(true, true, irr::video::SColor(255,255,255,255));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, irr::video::SColor(255,255,255,255));
// all three logos should be with filtering
driver->enableMaterial2D();

View File

@ -52,7 +52,7 @@ static bool testLineRendering(video::E_DRIVER_TYPE type)
smgr->addCameraSceneNode(0, core::vector3df(0,30,-40), core::vector3df(0,5,0));
device->getTimer()->setTime(0); // scene has animations and current scene seems to be saved at that time
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
smgr->drawAll();
driver->draw3DBox(node->getBoundingBox(), video::SColor(0,255,0,0));
driver->draw2DLine(core::position2di(10,10), core::position2di(100,100), video::SColor(255,0,0,0));

View File

@ -52,7 +52,7 @@ bool b3dAnimation(void)
// Just jump to the last frame since that's all we're interested in.
device->run();
driver->beginScene(true, true, video::SColor(255, 60, 60, 60));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 60, 60, 60));
smgr->drawAll();
driver->endScene();
@ -73,7 +73,7 @@ bool b3dAnimation(void)
// Simple render call
device->run();
driver->beginScene(true, true, video::SColor(255, 60, 60, 60));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 60, 60, 60));
smgr->drawAll();
driver->endScene();

View File

@ -96,7 +96,7 @@ bool billboardSize(void)
bool result = false;
device->run();
driver->beginScene(true, true, video::SColor(255, 60, 60, 60));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 60, 60, 60));
smgr->drawAll();
driver->endScene();
@ -132,7 +132,7 @@ bool billboardOrientation(void)
bool result = false;
device->run();
driver->beginScene(true, true, video::SColor(255, 60, 60, 60));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 60, 60, 60));
smgr->drawAll();
driver->endScene();

View File

@ -25,7 +25,7 @@ bool burningsVideo(void)
bool result = false;
device->run();
if (driver->beginScene(true, true, video::SColor(0, 80, 80, 80)))
if (driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0, 80, 80, 80)))
{
smgr->drawAll();
driver->endScene();

View File

@ -42,7 +42,7 @@ bool testImageCreation()
}
}
driver->beginScene(true, true, video::SColor(255,255,0,255));//Backbuffer background is pink
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,0,255));//Backbuffer background is pink
driver->draw2DImage(tex, core::position2d<s32>(0,0), core::recti(0,0,32,32));
driver->draw2DImage(tex1, core::position2d<s32>(32,0));
@ -69,7 +69,7 @@ bool testImageFormats()
video::IVideoDriver* driver = device->getVideoDriver();
video::ITexture* tex=driver->getTexture("../media/water.jpg");
video::ITexture* tex1=driver->getTexture("media/grey.tga");
driver->beginScene(true, true);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0));
driver->draw2DImage(tex, core::position2d<s32>(0,0), core::recti(0,0,64,64));
driver->draw2DImage(tex1, core::position2d<s32>(0,64), core::recti(0,0,64,64));

View File

@ -36,14 +36,14 @@ bool testWithRenderTarget(video::E_DRIVER_TYPE driverType)
video::ITexture* tex=driver->getTexture("../media/water.jpg");
driver->beginScene(true, true, video::SColor(255,255,0,255));//Backbuffer background is pink
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,0,255));//Backbuffer background is pink
//draw the 256x256 water image on the rendertarget:
driver->setRenderTarget(renderTarget,0,true,true,false,video::SColor(255,0,0,255));//Rendertarget background is blue
driver->setRenderTarget(renderTarget,0,video::ECBF_COLOR|video::ECBF_DEPTH,video::SColor(255,0,0,255));//Rendertarget background is blue
driver->draw2DImage(tex, core::position2d<s32>(0,0), core::recti(0,0,32,32));
driver->setRenderTarget(0, 0, false, false, false);
driver->setRenderTarget((video::IRenderTarget*)0, 0, 0);
//draw the rendertarget on screen:
//this should normally draw a 64x64 image containing a 32x32 image in the top left corner
@ -76,7 +76,7 @@ bool testRectangles(video::E_DRIVER_TYPE driverType)
video::ITexture *tex=driver->getTexture("../media/fireball.bmp");
driver->beginScene(true, true, video::SColor(255,255,0,255));//Backbuffer background is pink
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,0,255));//Backbuffer background is pink
// draw normal, will be overdrwan in error case
driver->draw2DImage(tex, core::recti(68,32,132,96), core::recti(0,0,64,64));
@ -119,7 +119,7 @@ bool testWithPNG(video::E_DRIVER_TYPE driverType)
video::ITexture *tex=driver->getTexture("media/RedbrushAlpha-0.25.png");
driver->beginScene(true, true, video::SColor(255,40,40,255));//Backbuffer background is blue
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,40,40,255));//Backbuffer background is blue
driver->draw2DImage(tex, core::recti(0,0,160,120), core::recti(0,0,256,256), 0, 0, true);
driver->endScene();
@ -164,10 +164,10 @@ bool testExactPlacement(video::E_DRIVER_TYPE driverType)
video::ITexture* tex=driver->getTexture("../media/fireball.bmp");
driver->beginScene(true, true, video::SColor(255,40,40,255));//Backbuffer background is blue
driver->setRenderTarget(renderTarget, 0, true, true, true);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,40,40,255));//Backbuffer background is blue
driver->setRenderTarget(renderTarget, 0, video::ECBF_COLOR | video::ECBF_DEPTH);
driver->draw2DImage(tex, core::recti(0,0,32,32), core::recti(0,0,64,64));
driver->setRenderTarget(0, 0, false, false, false);
driver->setRenderTarget((video::IRenderTarget*)0, 0, 0);
driver->endScene();
video::IImage* img = driver->createImage(renderTargetTex, core::vector2di(), renderTargetTex->getSize());

View File

@ -34,7 +34,7 @@ static bool lineRender(E_DRIVER_TYPE driverType)
cube->setMaterialFlag(video::EMF_LIGHTING, false);
(void)smgr->addCameraSceneNode();
driver->beginScene(true, true, SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140));
smgr->drawAll();
// Test for benign handling of offscreen pixel values as well as onscreen ones.
@ -74,7 +74,7 @@ static bool pixelAccuracy(E_DRIVER_TYPE driverType)
device->getSceneManager()->addCameraSceneNode();
driver->beginScene(true, true, SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140));
u32 start=0;
for (u32 count=1; count<10; ++count)
{
@ -136,7 +136,7 @@ static bool drawLine(E_DRIVER_TYPE driverType)
device->getSceneManager()->addCameraSceneNode();
driver->beginScene(true, true, SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140));
// horizontal lines
for (u32 i=0; i<20; ++i)
{

View File

@ -18,7 +18,7 @@ bool testWithDriver(video::E_DRIVER_TYPE driverType)
logTestString("Testing driver %ls\n", driver->getName());
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
core::recti r;
r.UpperLeftCorner = core::position2di(1,1);

View File

@ -52,7 +52,7 @@ bool testWithDriver(video::E_DRIVER_TYPE driverType)
bool result = true;
for (u32 Type=scene::EPT_POINTS; Type <= scene::EPT_POINT_SPRITES; ++Type)
{
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
smgr->drawAll();
u32 primCount = 0;
switch (Type)

View File

@ -44,7 +44,7 @@ bool flyCircleAnimator(void)
bool result = false;
// Don't do device->run() since I need the time to remain at 0.
if (driver->beginScene(true, true, video::SColor(0, 80, 80, 80)))
if (driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0, 80, 80, 80)))
{
smgr->drawAll();
driver->endScene();

View File

@ -44,7 +44,7 @@ bool guiDisabledMenu(void)
(void)menu->OnEvent(event);
device->run();
driver->beginScene(true, true, video::SColor(150,50,50,50));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(150,50,50,50));
env->drawAll();
driver->endScene();

View File

@ -91,7 +91,7 @@ static bool loadScene(void)
bool result = false;
device->run();
device->getTimer()->setTime(666); // scene has animations and current scene seems to be saved at that time ... really - best result with just that number :-)
if (driver->beginScene(true, true, video::SColor(0, 80, 80, 80)))
if (driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0, 80, 80, 80)))
{
smgr->drawAll();
driver->endScene();

View File

@ -48,7 +48,7 @@ static bool runTestWithDriver(E_DRIVER_TYPE driverType)
(void)smgr->addCameraSceneNode(0, core::vector3df(0,0,0), core::vector3df(40,100,30));
driver->beginScene(true, true, video::SColor(255,255,255,0));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,255,0));
smgr->drawAll();
driver->endScene();

View File

@ -48,7 +48,7 @@ static bool testLightTypes(video::E_DRIVER_TYPE driverType)
light3->setLightType(video::ELT_DIRECTIONAL);
light1->getLightData().DiffuseColor.set(0,1,0);
driver->beginScene (true, true, 0);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0));
smgr->drawAll();
driver->endScene();

View File

@ -37,7 +37,7 @@ static bool doTestWith(E_DRIVER_TYPE driverType,
zeroTexels);
(void)smgr->addCameraSceneNode();
driver->beginScene(true, true, SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140));
smgr->drawAll();
driver->draw2DImage(Texture,

View File

@ -46,7 +46,7 @@ static bool polygonOffset(video::E_DRIVER_TYPE type)
plane->getMaterial(0).PolygonOffsetDirection=video::EPO_BACK;
plane->getMaterial(0).PolygonOffsetFactor=7;
driver->beginScene(true, true, video::SColor(255,113,113,133));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133));
smgr->drawAll();
driver->endScene();
bool result = takeScreenshotAndCompareAgainstReference(driver, "-polygonBack.png");
@ -56,7 +56,7 @@ static bool polygonOffset(video::E_DRIVER_TYPE type)
// test front plane to front
plane2->getMaterial(0).PolygonOffsetDirection=video::EPO_FRONT;
plane2->getMaterial(0).PolygonOffsetFactor=7;
driver->beginScene(true, true, video::SColor(255,113,113,133));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133));
smgr->drawAll();
driver->endScene();
result &= takeScreenshotAndCompareAgainstReference(driver, "-polygonFront.png");

View File

@ -41,7 +41,7 @@ bool testLastFrame()
node->setCurrentFrame((f32)(node->getEndFrame()));
node->setAnimationSpeed(0);
device->run();
driver->beginScene(true, true, video::SColor(255, 255, 255, 0));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 255, 255, 0));
smgr->drawAll();
driver->endScene();
if (mesh->getBoundingBox() != mesh->getMesh(node->getEndFrame())->getBoundingBox())
@ -103,7 +103,7 @@ bool testNormals()
node->setMD2Animation(scene::EMAT_STAND);
node->setAnimationSpeed(0);
device->run();
driver->beginScene(true, true, video::SColor(255, 255, 255, 0));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 255, 255, 0));
smgr->drawAll();
driver->endScene();
}

View File

@ -58,7 +58,7 @@ bool meshTransform(void)
// Just jump to the last frame since that's all we're interested in.
device->run();
driver->beginScene(true, true, SColor(255, 60, 60, 60));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255, 60, 60, 60));
smgr->drawAll();
driver->endScene();
@ -74,7 +74,7 @@ bool meshTransform(void)
// Just jump to the last frame since that's all we're interested in.
device->run();
driver->beginScene(true, true, SColor(255, 60, 60, 60));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255, 60, 60, 60));
smgr->drawAll();
driver->endScene();

View File

@ -68,11 +68,11 @@ static bool testWithDriver(video::E_DRIVER_TYPE driverType)
node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType);
device->getSceneManager()->addCameraSceneNode(0, core::vector3df(0,0,-10));
driver->beginScene(true, false, video::SColor(255, 0, 0, 0));
driver->beginScene(video::ECBF_COLOR, video::SColor(255, 0, 0, 0));
// render
driver->setRenderTarget(renderTarget, renderTargetID, true, true, false, video::SColor(255, 0, 0, 0));
driver->setRenderTarget(renderTarget, renderTargetID, video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0));
device->getSceneManager()->drawAll();
driver->setRenderTarget(0, renderTargetID, false, false, false, video::SColor(255, 0, 0, 0));
driver->setRenderTarget(0, renderTargetID, 0, video::SColor(255, 0, 0, 0));
// draw debug rt
driver->draw2DImage(renderTargetTex[0], core::position2d<s32>(0,0));
@ -83,12 +83,12 @@ static bool testWithDriver(video::E_DRIVER_TYPE driverType)
result = takeScreenshotAndCompareAgainstReference(driver, "-mrt.png");
driver->beginScene(true, false, video::SColor(255, 0, 0, 0));
driver->beginScene(video::ECBF_COLOR, video::SColor(255, 0, 0, 0));
// render
device->getSceneManager()->getActiveCamera()->setPosition(core::vector3df(0,0,-15));
driver->setRenderTarget(renderTarget, renderTargetID, true, true, false, video::SColor(255, 0, 0, 0));
driver->setRenderTarget(renderTarget, renderTargetID, video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0));
device->getSceneManager()->drawAll();
driver->setRenderTarget(0, renderTargetID, false, false, false, video::SColor(255, 0, 0, 0));
driver->setRenderTarget(0, renderTargetID, 0, video::SColor(255,0,0,0));
// draw debug rt
driver->draw2DImage(renderTargetTex[0], core::position2d<s32>(0,0));

View File

@ -36,7 +36,7 @@ static bool testOrthoCam(video::E_DRIVER_TYPE driverType)
light->setRadius(500.f);
light->getLightData().DiffuseColor.set(0,1,1);
device->getVideoDriver()->beginScene (true, true, 0);
device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0));
device->getSceneManager()->drawAll();
device->getVideoDriver()->endScene();
@ -74,7 +74,7 @@ static bool testOrthoStencil(video::E_DRIVER_TYPE driverType)
light->setRadius(500.f);
light->getLightData().DiffuseColor.set(0,1,1);
device->getVideoDriver()->beginScene (true, true, 0);
device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0));
device->getSceneManager()->drawAll();
device->getVideoDriver()->endScene();

View File

@ -72,7 +72,7 @@ static bool drawScaledOctree(void)
(void)smgr->addCameraSceneNode(0, core::vector3df(0,0,0), core::vector3df(40,100,30));
driver->beginScene(true, true, video::SColor(255,255,255,0));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,255,0));
smgr->drawAll();
driver->endScene();

View File

@ -25,7 +25,7 @@ static bool runTestWithDriver(E_DRIVER_TYPE driverType)
bool result = true;
driver->beginScene(true, false, SColor(255,0,0,0));
driver->beginScene(video::ECBF_COLOR, SColor(255,0,0,0));
SMaterial mat;
mat.MaterialType = EMT_SOLID;

View File

@ -43,7 +43,7 @@ static bool testWith2DImage(video::E_DRIVER_TYPE driverType)
video::SColor colors[4]={0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff};
//draw the image :
driver->beginScene (true, true, video::SColor (255, 200, 200, 200));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor (255, 200, 200, 200));
driver->draw2DImage (image,
core::rect < s32 >
(64 - image->getSize ().Width / 2,
@ -62,7 +62,7 @@ static bool testWith2DImage(video::E_DRIVER_TYPE driverType)
scene::ISceneNode *modelNode = smgr->addMeshSceneNode(modelMesh);
modelNode->setMaterialTexture (0, RTT_texture);
driver->beginScene (true, true, video::SColor (255, 200, 200, 200));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor (255, 200, 200, 200));
smgr->drawAll();
driver->endScene();
@ -72,7 +72,7 @@ static bool testWith2DImage(video::E_DRIVER_TYPE driverType)
//it's now fliped...
for (u32 i=0; i<10; ++i)
{
driver->beginScene (true, true, video::SColor (255, 200, 200, 200));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor (255, 200, 200, 200));
//draw img
driver->draw2DImage (image,
@ -189,10 +189,10 @@ bool rttAndZBuffer(video::E_DRIVER_TYPE driverType)
mesh->drop();
{
vd->beginScene(true, true, video::SColor(255, 0, 0, 0));
vd->setRenderTarget(renderTarget, 0, true, true, false);
vd->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 0, 0, 0));
vd->setRenderTarget(renderTarget, 0, video::ECBF_COLOR | video::ECBF_DEPTH);
sm->drawAll();
vd->setRenderTarget(0, 0, false, false, false);
vd->setRenderTarget((video::IRenderTarget*)0, 0, 0);
vd->setTransform(video::ETS_WORLD, core::IdentityMatrix);
vd->setTransform(video::ETS_VIEW, core::IdentityMatrix);
vd->setTransform(video::ETS_PROJECTION, core::IdentityMatrix);
@ -241,11 +241,11 @@ bool rttAndText(video::E_DRIVER_TYPE driverType)
stabilizeScreenBackground(driver);
driver->beginScene(true, true, video::SColor(255,255, 255, 255));
driver->setRenderTarget(renderTarget, 0, true, true, false, video::SColor(255,255,0,255));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255, 255, 255));
driver->setRenderTarget(renderTarget, 0, video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,0,255));
driver->draw2DImage(driver->getTexture("../media/fireball.bmp"), core::recti(0, 0, renderTargetTex->getSize().Width, renderTargetTex->getSize().Height), core::recti(0, 0, 64, 64));
guienv->getBuiltInFont()->draw(L"OMGGG =!", core::rect<s32>(120, 100, 256, 256), video::SColor(255, 0, 0, 255));
driver->setRenderTarget(0, 0, false, false, false);
driver->setRenderTarget((video::IRenderTarget*)0, 0, 0);
driver->endScene();
scene::ISceneManager* smgr = device->getSceneManager();
@ -259,7 +259,7 @@ bool rttAndText(video::E_DRIVER_TYPE driverType)
// create a long text to produce much difference in failing result pictures
gui::IGUIStaticText* text = guienv->addStaticText(L"asdddddddoamgmoasmgom\nfoaomsodommogdd\nddddddddd", core::rect<s32>(10, 20, 100, 160));
driver->beginScene(true, true, video::SColor(255,255, 255, 255));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255, 255, 255));
cube->setVisible(false);
smgr->drawAll();
guienv->drawAll();
@ -286,7 +286,7 @@ static void Render(IrrlichtDevice* device, video::IRenderTarget* rt, core::vecto
core::vector3df& pos2, scene::IAnimatedMesh* sphereMesh, core::vector3df& pos3, core::vector3df& pos4)
{
video::IVideoDriver* driver = device->getVideoDriver();
driver->setRenderTarget(rt, 0, true, true, false);
driver->setRenderTarget(rt, 0, video::ECBF_COLOR | video::ECBF_DEPTH);
device->getSceneManager()->drawAll();
video::SMaterial mat;
@ -390,7 +390,7 @@ bool rttAndAntiAliasing(video::E_DRIVER_TYPE driverType)
renderTarget4->setTexture(renderTargetTex4, renderTargetDepth);
device->getSceneManager()->setActiveCamera(cam);
device->getVideoDriver()->beginScene();
device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0));
#if 1
st->setText(L"Texture Rendering");
Render(device, renderTarget1, pos1, pos2, sphereMesh, pos3, pos4);
@ -398,7 +398,7 @@ bool rttAndAntiAliasing(video::E_DRIVER_TYPE driverType)
Render(device, renderTarget3, pos1, pos2, sphereMesh, pos3, pos4);
Render(device, renderTarget4, pos1, pos2, sphereMesh, pos3, pos4);
device->getVideoDriver()->setRenderTarget(0, 0, false, false, false);
device->getVideoDriver()->setRenderTarget((video::IRenderTarget*)0, 0, 0);
device->getVideoDriver()->draw2DImage(renderTargetTex1, core::position2di(0, 0));
device->getVideoDriver()->draw2DImage(renderTargetTex2, core::position2di(80, 0));
device->getVideoDriver()->draw2DImage(renderTargetTex3, core::position2di(0, 60));

View File

@ -300,7 +300,7 @@ static bool checkBBoxIntersection(IrrlichtDevice * device,
bool result=true;
for (u32 round=0; round<2; ++round)
{
driver->beginScene(true, true, video::SColor(100, 50, 50, 100));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(100, 50, 50, 100));
smgr->drawAll();
driver->endScene();
@ -364,7 +364,7 @@ static bool checkBBoxIntersection(IrrlichtDevice * device,
u32 count=0;
for (u32 i=0; i<30; ++i)
{
driver->beginScene(true, true, video::SColor(100, 50, 50, 100));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(100, 50, 50, 100));
smgr->drawAll();
driver->endScene();
@ -402,7 +402,7 @@ static bool compareGetSceneNodeFromRayBBWithBBIntersectsWithLine(IrrlichtDevice
// add a cube to pick
scene::ISceneNode* cube = smgr->addCubeSceneNode(15);
driver->beginScene(true, true, video::SColor(100, 50, 50, 100));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(100, 50, 50, 100));
smgr->drawAll();
driver->endScene();

View File

@ -42,7 +42,7 @@ bool testShots(video::E_DRIVER_TYPE type)
node->setAnimationSpeed(0);
device->run();
driver->beginScene(true, true, video::SColor(255, 255, 255, 0));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 255, 255, 0));
smgr->drawAll();
driver->endScene();

View File

@ -37,7 +37,7 @@ bool softwareDevice(void)
(void)smgr->addCameraSceneNode(0, core::vector3df(0,0,-40), core::vector3df(0,0,0));
driver->beginScene(true, true, video::SColor(255,255,255,0));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,255,0));
smgr->drawAll();
driver->setMaterial(material);

View File

@ -31,7 +31,7 @@ static bool shadows(video::E_DRIVER_TYPE driverType)
light->setRadius(500.f);
light->getLightData().DiffuseColor.set(0,1,1);
device->getVideoDriver()->beginScene (true, true, 0);
device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0));
device->getSceneManager()->drawAll();
device->getVideoDriver()->endScene();
@ -48,7 +48,7 @@ static bool shadows(video::E_DRIVER_TYPE driverType)
cam->setPosition(core::vector3df(0,55,-30));
cam->setTarget(core::vector3df(60,45,150));
device->getVideoDriver()->beginScene (true, true, 0);
device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0));
device->getSceneManager()->drawAll();
device->getVideoDriver()->endScene();

View File

@ -45,7 +45,7 @@ bool terrainRecalc(void)
// This shouldn't cause a recalc
camera->setUpVector(vector3df(1.f, 0.f, .01f).normalize());
device->run();
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
smgr->drawAll();
driver->endScene();
@ -59,7 +59,7 @@ bool terrainRecalc(void)
// This is big enough to cause a recalc
camera->setUpVector(vector3df(1.f, 0.f, .1f).normalize());
device->run();
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
smgr->drawAll();
driver->endScene();
@ -105,7 +105,7 @@ bool terrainGaps()
terrain->setMaterialFlag(video::EMF_WIREFRAME, !terrain->getMaterial(0).Wireframe);
}
irrVideo->beginScene(true, true, video::SColor(0,150,150,150));
irrVideo->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,150,150,150));
irrScene->drawAll();
irrVideo->endScene();

View File

@ -73,7 +73,7 @@ bool testGeometryCreator(void)
bool result = false;
device->run();
if (driver->beginScene(true, true, video::SColor(0, 80, 80, 80)))
if (driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0, 80, 80, 80)))
{
smgr->drawAll();
driver->endScene();
@ -110,7 +110,7 @@ bool testGeometryCreator(void)
anode->setPosition(core::vector3df(-5000,0,-5000));
}
driver->beginScene();
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0));
smgr->drawAll();
driver->endScene();

View File

@ -338,7 +338,7 @@ void stabilizeScreenBackground(irr::video::IVideoDriver * driver,
{
for(int i = 0; i < 10000; ++i)
{
driver->beginScene(true, true, color);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, color);
driver->endScene();
irr::video::IImage * screenshot = driver->createScreenShot();

View File

@ -69,7 +69,7 @@ bool renderMipLevels(video::E_DRIVER_TYPE driverType)
(void)smgr->addCameraSceneNode(0, core::vector3df(10,0,-30));
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
smgr->drawAll();
driver->endScene();
@ -142,7 +142,7 @@ bool lockAllMipLevels(video::E_DRIVER_TYPE driverType)
(void)smgr->addCameraSceneNode();
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
smgr->drawAll();
driver->endScene();
@ -247,7 +247,7 @@ bool lockWithAutoMipmap(video::E_DRIVER_TYPE driverType)
}
(void)smgr->addCameraSceneNode();
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
smgr->drawAll();
driver->endScene();

View File

@ -47,7 +47,7 @@ static bool manyTextures(video::E_DRIVER_TYPE driverType)
mesh->setDirty();
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
// set camera
smgr->drawAll();
// draw meshbuffer
@ -86,13 +86,13 @@ static bool renderAndLoad(video::E_DRIVER_TYPE driverType)
(void)smgr->addCameraSceneNode();
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
driver->draw2DImage(tex1, position2di(0,0));
driver->endScene();
driver->getTexture("../media/tools.png");
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
driver->draw2DImage(tex1, position2di(0,0));
driver->endScene();
@ -121,7 +121,7 @@ static bool renderAndRemove(video::E_DRIVER_TYPE driverType)
logTestString("Testing driver %ls\n", driver->getName());
driver->beginScene (true, true, video::SColor(255, 0, 255, 0));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 0, 255, 0));
smgr->drawAll();
driver->endScene();
@ -130,14 +130,14 @@ static bool renderAndRemove(video::E_DRIVER_TYPE driverType)
scene::ISceneNode * img = smgr->addCubeSceneNode();
img->setMaterialTexture(0, texture);
driver->beginScene (true, true, video::SColor (255, 0, 255, 0));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor (255, 0, 255, 0));
smgr->drawAll();
driver->endScene();
smgr->clear(); // Remove anything that used the texture
driver->removeTexture(texture);
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
smgr->drawAll();
driver->endScene();
@ -146,7 +146,7 @@ static bool renderAndRemove(video::E_DRIVER_TYPE driverType)
img = smgr->addCubeSceneNode();
img->setMaterialTexture(0, texture);
driver->beginScene (true, true, irr::video::SColor (255, 0, 255, 0));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, irr::video::SColor (255, 0, 255, 0));
smgr->drawAll();
driver->endScene();
@ -201,7 +201,7 @@ static bool testTextureMatrixInMixedScenes(video::E_DRIVER_TYPE driverType)
scene::IAnimatedMesh* pmesh = sceneManager->addHillPlaneMesh("testMesh",dimension2d<f32>(50,50),dimension2d<u32>(6,6),&mat);
sceneManager->addAnimatedMeshSceneNode(pmesh);
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
sceneManager->drawAll();
gui->drawAll();
driver->endScene();
@ -261,7 +261,7 @@ static bool textureMatrix(video::E_DRIVER_TYPE driverType)
trans.X += 0.0005f;
textureMatrix.buildTextureTransform(0.f, rcenter, trans, scale);
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
sceneManager->drawAll();
driver->endScene();
@ -270,7 +270,7 @@ static bool textureMatrix(video::E_DRIVER_TYPE driverType)
trans.X += 0.45f;
textureMatrix.buildTextureTransform(0.f, rcenter, trans, scale);
driver->beginScene(true, true, video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140));
sceneManager->drawAll();
driver->endScene();
@ -325,7 +325,7 @@ bool danglingTexturePointer()
device->run();
{
driver->beginScene(true, true, irr::video::SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, irr::video::SColor(255,100,101,140));
// This is required to trigger the white appearance (this unbinds the
// texture, forcing draw2DImage to rebind the logo3 texture (#2)).

View File

@ -47,7 +47,7 @@ bool testTransparentAlphaChannelRef(video::E_DRIVER_TYPE driverType)
(void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15));
driver->beginScene(true, true, video::SColor(255,113,113,133));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133));
smgr->drawAll();
driver->endScene();
@ -99,7 +99,7 @@ bool testTransparentAlphaChannel(video::E_DRIVER_TYPE driverType)
(void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15));
driver->beginScene(true, true, video::SColor(255,113,113,133));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133));
smgr->drawAll();
driver->endScene();
@ -158,7 +158,7 @@ bool testTransparentVertexAlpha(video::E_DRIVER_TYPE driverType)
(void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15));
driver->beginScene(true, true, video::SColor(255,113,113,133));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133));
smgr->drawAll();
driver->endScene();
@ -220,7 +220,7 @@ bool testTransparentReflection2Layer(video::E_DRIVER_TYPE driverType)
(void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15));
driver->beginScene(true, true, video::SColor(255,113,113,133));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133));
smgr->drawAll();
driver->endScene();
@ -272,7 +272,7 @@ bool testTransparentAddColor(video::E_DRIVER_TYPE driverType)
(void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15));
driver->beginScene(true, true, video::SColor(255,113,113,133));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133));
smgr->drawAll();
driver->endScene();
@ -335,7 +335,7 @@ bool testTransparentVertexAlphaMore(E_DRIVER_TYPE driverType)
smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
driver->beginScene(true, true, SColor(0,200,200,200));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200));
smgr->drawAll();
driver->endScene();

View File

@ -90,7 +90,7 @@ bool octree()
bool result = true;
{
camera->setPosition(core::vector3df(-620,-20,550));
driver->beginScene(true, true, 0);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0));
smgr->drawAll();
core::aabbox3df box(boxPosition.X - BOX_SIZE1, boxPosition.Y - BOX_SIZE1, boxPosition.Z - BOX_SIZE1,
@ -114,7 +114,7 @@ bool octree()
}
{
camera->setPosition(core::vector3df(120,40,50));
driver->beginScene(true, true, 0);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0));
smgr->drawAll();
core::aabbox3df box(boxPosition.X - BOX_SIZE2, boxPosition.Y - BOX_SIZE2, boxPosition.Z - BOX_SIZE2,
@ -203,7 +203,7 @@ bool triangle()
bool result = true;
{
driver->beginScene(true, true, 0xff00ffff);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0xff00ffff));
smgr->drawAll();
core::aabbox3df box(boxPosition.X - BOX_SIZE, boxPosition.Y - BOX_SIZE, boxPosition.Z - BOX_SIZE,
@ -227,7 +227,7 @@ bool triangle()
}
{
boxPosition.Z -= 10.f;
driver->beginScene(true, true, 0xff00ffff);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0xff00ffff));
smgr->drawAll();
core::aabbox3df box(boxPosition.X - BOX_SIZE, boxPosition.Y - BOX_SIZE, boxPosition.Z - BOX_SIZE,
@ -251,7 +251,7 @@ bool triangle()
}
{
boxPosition.Z -= 20.f;
driver->beginScene(true, true, 0xff00ffff);
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0xff00ffff));
smgr->drawAll();
core::aabbox3df box(boxPosition.X - BOX_SIZE, boxPosition.Y - BOX_SIZE, boxPosition.Z - BOX_SIZE,

View File

@ -36,7 +36,7 @@ static bool withSphere(video::E_DRIVER_TYPE type)
device->run();
// while(device->run())
{
driver->beginScene(true, true, video::SColor(255,113,113,133));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133));
driver->setClipPlane(3, core::plane3df(core::vector3df(-8,0,0), core::vector3df(1,0,0)), true);
driver->setClipPlane(4, core::plane3df(core::vector3df(0,0,8), core::vector3df(0,0,-1)));
driver->setClipPlane(5, core::plane3df(core::vector3df(0,0,-8), core::vector3df(0,0,1)));

View File

@ -43,7 +43,7 @@ static bool viewPortText(E_DRIVER_TYPE driverType)
smgr->addCubeSceneNode();
smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
driver->beginScene(true, true, SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140));
smgr->drawAll();
env->drawAll();
driver->setViewPort(rect<s32>(0,0,160/2,120/2));

View File

@ -30,7 +30,7 @@ bool writeImageToFile(void)
cube->setMaterialFlag(video::EMF_LIGHTING, false);
(void)smgr->addCameraSceneNode();
driver->beginScene(true, true, SColor(255,100,101,140));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140));
smgr->drawAll();
// Test for benign handling of offscreen pixel values as well as onscreen ones.

View File

@ -65,7 +65,7 @@ int main()
wchar_t caption[512];
swprintf_irr(caption, 512, L"screen (%4u/%4u)", screenSize.Width, screenSize.Height);
device->setWindowCaption(caption);
driver->beginScene(true, true, video::SColor(0,200,200,200));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,200,200,200));
smgr->drawAll();
env->drawAll();
driver->endScene();

View File

@ -347,7 +347,7 @@ public:
//while(Device->getTimer()->getTime() < endt )
//{
Device->run();
Device->getVideoDriver()->beginScene(true,true,video::SColor(0,0,0,0));
Device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0));
for (u32 v=0;v<ll.size(); ++v)
for (u32 h=0;h<ll[v].lines.size(); ++h)
{
@ -696,7 +696,7 @@ public:
const f32 phase = f32((device->getTimer()->getTime()-stt) % 500) / 500.0f;
device->run();
device->getVideoDriver()->beginScene(true,true,video::SColor(0,0,0,0));
device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0));
for (u32 g=0;g<groups.size(); ++g)
for (u32 v=0;v<groups[g].edges.size(); ++v)
for (u32 p=1;p<groups[g].edges[v].positions.size(); ++p)
@ -722,7 +722,7 @@ public:
const f32 phase = f32((device->getTimer()->getTime()-stt) % 500) / 500.0f;
device->run();
device->getVideoDriver()->beginScene(true,true,video::SColor(0,0,0,0));
device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0));
for (u32 g=0;g<groups.size(); ++g)
for (u32 v=0;v<groups[g].triangles.indexes.size()*phase; v+=3)
{
@ -748,7 +748,7 @@ public:
while(device->getTimer()->getTime() < endt )
{
device->run();
device->getVideoDriver()->beginScene(true,true,video::SColor(0,0,0,0));
device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0));
for (u32 g=0;g<groups.size(); ++g)
for (u32 v=0;v<groups[g].ll.size()-1; ++v)
for (u32 h=0;h<groups[g].ll[v].lines.size(); ++h)

View File

@ -476,7 +476,7 @@ int main()
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(0,200,200,200));
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,200,200,200));
smgr->drawAll();
env->drawAll();
driver->endScene();