Commit 538751d8 authored by nadro's avatar nadro

- Added new IRenderTarget interface.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5068 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 36ffff0b
-------------------------- --------------------------
Changes in 1.9 (not yet released) Changes in 1.9 (not yet released)
- Added new IRenderTarget interface.
- Replace the swprintf and snprintf defines by swprintf_irr and snprintf_irr to avoid conflicts with the standard libraries (and other libraries). - Replace the swprintf and snprintf defines by swprintf_irr and snprintf_irr to avoid conflicts with the standard libraries (and other libraries).
- XBox support removed as it would need DX8 (this was about the original XBox). - XBox support removed as it would need DX8 (this was about the original XBox).
- Support for Direct3D 8 removed after svn revision 5052 due to lack of maintenance. - Support for Direct3D 8 removed after svn revision 5052 due to lack of maintenance.
...@@ -15,7 +16,6 @@ Changes in 1.9 (not yet released) ...@@ -15,7 +16,6 @@ Changes in 1.9 (not yet released)
- Add a new core::rect constructor which takes a dimension parameter and set's left-top to 0. - Add a new core::rect constructor which takes a dimension parameter and set's left-top to 0.
- mtl (obj) format reader and write now regards texture scaling and translation. (thx @thanhle for noticing and patch proposal). - mtl (obj) format reader and write now regards texture scaling and translation. (thx @thanhle for noticing and patch proposal).
- Added Visual Studio 2013 project files. - Added Visual Studio 2013 project files.
- Added ability to set custom depth/stencil texture for render targets.
- Added new color formats: ECF_R8, ECF_R8G8, ECF_D16, ECF_D32, ECF_D24S8. - Added new color formats: ECF_R8, ECF_R8G8, ECF_D16, ECF_D32, ECF_D24S8.
- Can now enable/disable backround drawing for IGUITable. - Can now enable/disable backround drawing for IGUITable.
- Bugfix: Cloning CBillboardSceneNode now copies colors and sizes. - Bugfix: Cloning CBillboardSceneNode now copies colors and sizes.
......
...@@ -109,14 +109,20 @@ int main() ...@@ -109,14 +109,20 @@ int main()
*/ */
// create render target // create render target
video::ITexture* rt = 0; video::IRenderTarget* renderTarget = 0;
video::ITexture* renderTargetTex = 0;
scene::ICameraSceneNode* fixedCam = 0; scene::ICameraSceneNode* fixedCam = 0;
if (driver->queryFeature(video::EVDF_RENDER_TO_TARGET)) if (driver->queryFeature(video::EVDF_RENDER_TO_TARGET))
{ {
rt = driver->addRenderTargetTexture(core::dimension2d<u32>(256,256), "RTT1"); renderTargetTex = driver->addRenderTargetTexture(core::dimension2d<u32>(256, 256), "RTT1", video::ECF_A8R8G8B8);
test->setMaterialTexture(0, rt); // set material of cube to render target video::ITexture* renderTargetDepth = driver->addRenderTargetTexture(core::dimension2d<u32>(256, 256), "DepthStencil", video::ECF_D16);
renderTarget = driver->addRenderTarget();
renderTarget->setTexture(renderTargetTex, renderTargetDepth);
test->setMaterialTexture(0, renderTargetTex); // set material of cube to render target
// add fixed camera // add fixed camera
fixedCam = smgr->addCameraSceneNode(0, core::vector3df(10,10,-80), fixedCam = smgr->addCameraSceneNode(0, core::vector3df(10,10,-80),
...@@ -161,12 +167,12 @@ int main() ...@@ -161,12 +167,12 @@ int main()
{ {
driver->beginScene(true, true, 0); driver->beginScene(true, true, 0);
if (rt) if (renderTarget)
{ {
// draw scene into render target // draw scene into render target
// set render target texture // set render target texture
driver->setRenderTarget(rt, true, true, video::SColor(0,0,0,255)); driver->setRenderTarget(renderTarget, 0, true, true, false, video::SColor(0, 0, 0, 255));
// make cube invisible and set fixed camera as active camera // make cube invisible and set fixed camera as active camera
test->setVisible(false); test->setVisible(false);
...@@ -177,7 +183,7 @@ int main() ...@@ -177,7 +183,7 @@ int main()
// set back old render target // set back old render target
// The buffer might have been distorted, so clear it // The buffer might have been distorted, so clear it
driver->setRenderTarget(0, true, true, 0); driver->setRenderTarget(0, 0, false, false, false, 0);
// make the cube visible and set the user controlled camera as active one // make the cube visible and set the user controlled camera as active one
test->setVisible(true); test->setVisible(true);
......
// Copyright (C) 2015 Patryk Nadrowski
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_RENDER_TARGET_H_INCLUDED__
#define __I_RENDER_TARGET_H_INCLUDED__
#include "IReferenceCounted.h"
#include "EDriverTypes.h"
#include "irrArray.h"
namespace irr
{
namespace video
{
class ITexture;
//! Interface of a Render Target.
class IRenderTarget : public virtual IReferenceCounted
{
public:
//! constructor
IRenderTarget() : DepthStencil(0), DriverType(EDT_NULL)
{
}
//! Set multiple textures.
/** Set multiple textures for the render target.
\param texture Array of texture objects. These textures are used for a color outputs.
\param depthStencil Depth or packed depth-stencil texture. This texture is used as depth
or depth-stencil buffer. */
virtual void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil) = 0;
//! Set one texture.
void setTexture(ITexture* texture, ITexture* depthStencil)
{
core::array<ITexture*> textureArray(1);
textureArray.push_back(texture);
setTexture(textureArray, depthStencil);
}
//! Get driver type of render target.
E_DRIVER_TYPE getDriverType() const
{
return DriverType;
}
protected:
//! Textures assigned to render target.
core::array<ITexture*> Texture;
//! Depth or packed depth-stencil texture assigned to render target.
ITexture* DepthStencil;
//! Driver type of render target.
E_DRIVER_TYPE DriverType;
};
}
}
#endif
...@@ -47,6 +47,7 @@ namespace video ...@@ -47,6 +47,7 @@ namespace video
class IImageWriter; class IImageWriter;
class IMaterialRenderer; class IMaterialRenderer;
class IGPUProgrammingServices; class IGPUProgrammingServices;
class IRenderTarget;
//! enumeration for geometry transformation states //! enumeration for geometry transformation states
enum E_TRANSFORMATION_STATE enum E_TRANSFORMATION_STATE
...@@ -209,43 +210,6 @@ namespace video ...@@ -209,43 +210,6 @@ namespace video
}; };
struct IRenderTarget
{
IRenderTarget(ITexture* texture,
E_COLOR_PLANE colorMask=ECP_ALL,
E_BLEND_FACTOR blendFuncSrc=EBF_ONE,
E_BLEND_FACTOR blendFuncDst=EBF_ONE_MINUS_SRC_ALPHA,
E_BLEND_OPERATION blendOp=EBO_NONE) :
RenderTexture(texture),
TargetType(ERT_RENDER_TEXTURE), ColorMask(colorMask),
BlendFuncSrc(blendFuncSrc), BlendFuncDst(blendFuncDst),
BlendOp(blendOp) {}
IRenderTarget(E_RENDER_TARGET target,
E_COLOR_PLANE colorMask=ECP_ALL,
E_BLEND_FACTOR blendFuncSrc=EBF_ONE,
E_BLEND_FACTOR blendFuncDst=EBF_ONE_MINUS_SRC_ALPHA,
E_BLEND_OPERATION blendOp=EBO_NONE) :
RenderTexture(0),
TargetType(target), ColorMask(colorMask),
BlendFuncSrc(blendFuncSrc), BlendFuncDst(blendFuncDst),
BlendOp(blendOp) {}
bool operator!=(const IRenderTarget& other) const
{
return ((RenderTexture != other.RenderTexture) ||
(TargetType != other.TargetType) ||
(ColorMask != other.ColorMask) ||
(BlendFuncSrc != other.BlendFuncSrc) ||
(BlendFuncDst != other.BlendFuncDst) ||
(BlendOp != other.BlendOp));
}
ITexture* RenderTexture;
E_RENDER_TARGET TargetType:8;
E_COLOR_PLANE ColorMask:8;
E_BLEND_FACTOR BlendFuncSrc:4;
E_BLEND_FACTOR BlendFuncDst:4;
E_BLEND_OPERATION BlendOp:4;
};
//! Interface to driver which is able to perform 2d and 3d graphics functions. //! Interface to driver which is able to perform 2d and 3d graphics functions.
/** This interface is one of the most important interfaces of /** This interface is one of the most important interfaces of
the Irrlicht Engine: All rendering and texture manipulation is done with the Irrlicht Engine: All rendering and texture manipulation is done with
...@@ -503,6 +467,15 @@ namespace video ...@@ -503,6 +467,15 @@ namespace video
The value is a safe approximation, i.e. can be larger than the The value is a safe approximation, i.e. can be larger than the
actual value of pixels. */ actual value of pixels. */
virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const =0; virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const =0;
//! Create render target.
virtual IRenderTarget* addRenderTarget() = 0;
//! Remove render target.
virtual void removeRenderTarget(IRenderTarget* renderTarget) = 0;
//! Remove all render targets.
virtual void removeAllRenderTargets() = 0;
//! Sets a boolean alpha channel on the texture based on a color key. //! Sets a boolean alpha channel on the texture based on a color key.
/** This makes the texture fully transparent at the texels where /** This makes the texture fully transparent at the texels where
...@@ -552,7 +525,7 @@ namespace video ...@@ -552,7 +525,7 @@ namespace video
information is multiplied.*/ information is multiplied.*/
virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) const =0; virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) const =0;
//! Sets a new render target. (this prototype will be removed in future) //! Set a new render target.
/** This will only work if the driver supports the /** This will only work if the driver supports the
EVDF_RENDER_TO_TARGET feature, which can be queried with EVDF_RENDER_TO_TARGET feature, which can be queried with
queryFeature(). Usually, rendering to textures is done in this queryFeature(). Usually, rendering to textures is done in this
...@@ -586,48 +559,38 @@ namespace video ...@@ -586,48 +559,38 @@ namespace video
\return True if sucessful and false if not. */ \return True if sucessful and false if not. */
virtual bool setRenderTarget(video::ITexture* texture, virtual bool setRenderTarget(video::ITexture* texture,
bool clearBackBuffer=true, bool clearZBuffer=true, bool clearBackBuffer=true, bool clearZBuffer=true,
SColor color=video::SColor(0,0,0,0), SColor color=video::SColor(0,0,0,0)) =0;
video::ITexture* depthStencil = 0) =0;
//! Sets a new render target. //! Set a render target.
virtual bool setRenderTarget(video::ITexture* texture, /** This will only work if the driver supports the
video::ITexture* depthStencil, EVDF_RENDER_TO_TARGET feature, which can be queried with
bool clearBackBuffer=true, bool clearZBuffer=true, queryFeature(). Please note that you cannot render 3D or 2D
SColor color=video::SColor(0,0,0,0)) geometry with a render target as texture on it when you are rendering
{ the scene into this render target at the same time. It is usually only
return setRenderTarget(texture, clearBackBuffer, clearZBuffer, color, depthStencil); possible to render into a texture between the
} IVideoDriver::beginScene() and endScene() method calls.
\param target Render target object.
//! Sets new multiple render targets. (this prototype will be removed in future) \param activeTextureID Array of texture indices which should be active during
virtual bool setRenderTarget(const core::array<video::IRenderTarget>& texture, RTT process. If more than one ID will be apply, this render target will work
bool clearBackBuffer=true, bool clearZBuffer=true, as a Multiple Render Target.
SColor color=video::SColor(0,0,0,0), \param clearBackBuffer Clears the back buffer of the render
video::ITexture* depthStencil = 0) =0; 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.
\return True if sucessful and false if not. */
virtual bool setRenderTarget(IRenderTarget* target, core::array<u32> activeTextureID, bool clearBackBuffer,
bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor) = 0;
//! Sets new multiple render targets. //! Set a render target.
virtual bool setRenderTarget(const core::array<video::IRenderTarget>& texture, bool setRenderTarget(IRenderTarget* target, u32 activeTextureID, bool clearBackBuffer, bool clearDepthBuffer,
video::ITexture* depthStencil, bool clearStencilBuffer, SColor clearColor)
bool clearBackBuffer=true, bool clearZBuffer=true,
SColor color=video::SColor(0,0,0,0))
{ {
return setRenderTarget(texture, clearBackBuffer, clearZBuffer, color, depthStencil); core::array<u32> idArray(1);
} idArray.push_back(activeTextureID);
//! set or reset special render targets return setRenderTarget(target, idArray, clearBackBuffer, clearDepthBuffer, clearStencilBuffer, clearColor);
/** This method enables access to special color buffers such as }
stereoscopic buffers or auxiliary buffers.
\param target Enum value for the render target
\param clearTarget Clears the target buffer with the color
parameter
\param clearZBuffer Clears the zBuffer of the rendertarget.
Note that because the main 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.
\return True if sucessful and false if not. */
virtual bool setRenderTarget(E_RENDER_TARGET target, bool clearTarget=true,
bool clearZBuffer=true,
SColor color=video::SColor(0,0,0,0)) =0;
//! Sets a new viewport. //! Sets a new viewport.
/** Every rendering operation is done into this new area. /** Every rendering operation is done into this new area.
...@@ -1381,6 +1344,9 @@ namespace video ...@@ -1381,6 +1344,9 @@ namespace video
//! Returns a pointer to the mesh manipulator. //! Returns a pointer to the mesh manipulator.
virtual scene::IMeshManipulator* getMeshManipulator() =0; 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;
//! Clears the ZBuffer. //! Clears the ZBuffer.
/** Note that you usually need not to call this method, as it /** Note that you usually need not to call this method, as it
is automatically done in IVideoDriver::beginScene() or is automatically done in IVideoDriver::beginScene() or
...@@ -1388,7 +1354,7 @@ namespace video ...@@ -1388,7 +1354,7 @@ namespace video
you have to render some special things, you can clear the you have to render some special things, you can clear the
zbuffer during the rendering process with this method any time. zbuffer during the rendering process with this method any time.
*/ */
virtual void clearZBuffer() =0; _IRR_DEPRECATED_ virtual void clearZBuffer() = 0;
//! Make a screenshot of the last rendered frame. //! Make a screenshot of the last rendered frame.
/** \return An image created from the last rendered frame. */ /** \return An image created from the last rendered frame. */
......
...@@ -124,6 +124,7 @@ ...@@ -124,6 +124,7 @@
#include "IReferenceCounted.h" #include "IReferenceCounted.h"
#include "irrArray.h" #include "irrArray.h"
#include "IRandomizer.h" #include "IRandomizer.h"
#include "IRenderTarget.h"
#include "IrrlichtDevice.h" #include "IrrlichtDevice.h"
#include "irrList.h" #include "irrList.h"
#include "irrMap.h" #include "irrMap.h"
......
This diff is collapsed.
...@@ -27,30 +27,15 @@ namespace irr ...@@ -27,30 +27,15 @@ namespace irr
namespace video namespace video
{ {
class CD3D9CallBridge; class CD3D9CallBridge;
class CD3D9RenderTarget;
struct SDepthSurface : public IReferenceCounted class CD3D9Texture;
{
SDepthSurface() : Surface(0)
{
#ifdef _DEBUG
setDebugName("SDepthSurface");
#endif
}
virtual ~SDepthSurface()
{
if (Surface)
Surface->Release();
}
IDirect3DSurface9* Surface;
core::dimension2du Size;
};
class CD3D9Driver : public CNullDriver, IMaterialRendererServices class CD3D9Driver : public CNullDriver, IMaterialRendererServices
{ {
public: public:
friend class CD3D9CallBridge; friend class CD3D9CallBridge;
friend class CD3D9RenderTarget;
friend class CD3D9Texture; friend class CD3D9Texture;
//! constructor //! constructor
...@@ -77,13 +62,9 @@ namespace video ...@@ -77,13 +62,9 @@ namespace video
//! sets a material //! sets a material
virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_; virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_;
//! sets a render target //! set a render target
virtual bool setRenderTarget(video::ITexture* texture, bool clearBackBuffer, virtual bool setRenderTarget(IRenderTarget* target, core::array<u32> activeTextureID, bool clearBackBuffer,
bool clearZBuffer, SColor color, video::ITexture* depthStencil) _IRR_OVERRIDE_; bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor) _IRR_OVERRIDE_;
//! Sets multiple render targets
virtual bool setRenderTarget(const core::array<video::IRenderTarget>& targets,
bool clearBackBuffer, bool clearZBuffer, SColor color, video::ITexture* depthStencil) _IRR_OVERRIDE_;
//! sets a viewport //! sets a viewport
virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_; virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_;
...@@ -144,6 +125,9 @@ namespace video ...@@ -144,6 +125,9 @@ namespace video
actual value of pixels. */ actual value of pixels. */
virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const _IRR_OVERRIDE_; virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const _IRR_OVERRIDE_;
//! Create render target.
virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_;
//! draws a vertex primitive list //! draws a vertex primitive list
virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
const void* indexList, u32 primitiveCount, const void* indexList, u32 primitiveCount,
...@@ -287,6 +271,9 @@ namespace video ...@@ -287,6 +271,9 @@ namespace video
virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size, virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_; 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. //! Clears the ZBuffer.
virtual void clearZBuffer() _IRR_OVERRIDE_; virtual void clearZBuffer() _IRR_OVERRIDE_;
...@@ -308,9 +295,6 @@ namespace video ...@@ -308,9 +295,6 @@ namespace video
//! Check if the driver was recently reset. //! Check if the driver was recently reset.
virtual bool checkDriverReset() _IRR_OVERRIDE_ {return DriverWasReset;} virtual bool checkDriverReset() _IRR_OVERRIDE_ {return DriverWasReset;}
// removes the depth struct from the DepthSurface array
void removeDepthSurface(SDepthSurface* depth);
//! Get the current color format of the color buffer //! Get the current color format of the color buffer
/** \return Color format of the color buffer. */ /** \return Color format of the color buffer. */
virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_; virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_;
...@@ -378,9 +362,6 @@ namespace video ...@@ -378,9 +362,6 @@ namespace video
//! returns the current size of the screen or rendertarget //! returns the current size of the screen or rendertarget
virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const _IRR_OVERRIDE_; virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const _IRR_OVERRIDE_;
//! Check if a proper depth buffer for the RTT is available, otherwise create it.
void checkDepthBuffer(ITexture* tex);
//! Adds a new material renderer to the VideoDriver, using pixel and/or //! Adds a new material renderer to the VideoDriver, using pixel and/or
//! vertex shaders to render geometry. //! vertex shaders to render geometry.
s32 addShaderMaterial(const c8* vertexShaderProgram, const c8* pixelShaderProgram, s32 addShaderMaterial(const c8* vertexShaderProgram, const c8* pixelShaderProgram,
...@@ -443,8 +424,12 @@ namespace video ...@@ -443,8 +424,12 @@ namespace video
IDirect3D9* pID3D; IDirect3D9* pID3D;
IDirect3DDevice9* pID3DDevice; IDirect3DDevice9* pID3DDevice;
IDirect3DSurface9* PrevRenderTarget; IDirect3DSurface9* BackBufferSurface;
IDirect3DSurface9* DepthStencilSurface;
core::dimension2d<u32> CurrentRendertargetSize; core::dimension2d<u32> CurrentRendertargetSize;
core::array<s32> RenderTargetChannel;
core::array<u32> RenderTargetActiveID;
HWND WindowId; HWND WindowId;
core::rect<s32>* SceneSourceRect; core::rect<s32>* SceneSourceRect;
...@@ -460,12 +445,8 @@ namespace video ...@@ -460,12 +445,8 @@ namespace video
core::stringc VendorName; core::stringc VendorName;
u16 VendorID; u16 VendorID;
core::array<SDepthSurface*> DepthBuffers;
u32 MaxTextureUnits; u32 MaxTextureUnits;
u32 MaxUserClipPlanes; u32 MaxUserClipPlanes;
u32 MaxMRTs;
u32 NumSetMRTs;
f32 MaxLightDistance; f32 MaxLightDistance;
s32 LastSetLight; s32 LastSetLight;
......
// Copyright (C) 2015 Patryk Nadrowski
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CD3D9RenderTarget.h"
#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
#include "IImage.h"
#include "irrMath.h"
#include "CD3D9Driver.h"
#include "CD3D9Texture.h"
namespace irr
{
namespace video
{
CD3D9RenderTarget::CD3D9RenderTarget(CD3D9Driver* driver) : DepthStencilSurface(0), Driver(driver)
{
#ifdef _DEBUG
setDebugName("CD3D9RenderTarget");
#endif
DriverType = EDT_DIRECT3D9;
Size = Driver->getScreenSize();
}
CD3D9RenderTarget::~CD3D9RenderTarget()
{
for (u32 i = 0; i < Surface.size(); ++i)
{
if (Surface[i])
Surface[i]->Release();
}
if (DepthStencilSurface)
DepthStencilSurface->Release();
for (u32 i = 0; i < Texture.size(); ++i)
{
if (Texture[i])
Texture[i]->drop();
}
if (DepthStencil)
DepthStencil->drop();
}
void CD3D9RenderTarget::setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil)
{
bool depthStencilUpdate = (DepthStencil != depthStencil) ? true : false;
bool textureUpdate = (Texture != texture) ? true : false;
if (depthStencilUpdate || textureUpdate)
{
// Set color attachments.
if (textureUpdate)
{
const u32 size = core::min_(texture.size(), static_cast<u32>(Driver->RenderTargetChannel.size()));
for (u32 i = 0; i < Surface.size(); ++i)
{
if (Surface[i])
Surface[i]->Release();
}
Surface.set_used(size);
for (u32 i = 0; i < Texture.size(); ++i)
{
if (Texture[i])
Texture[i]->drop();
}
Texture.set_used(size);
for (u32 i = 0; i < size; ++i)
{
IDirect3DTexture9* currentTexture = (texture[i] && texture[i]->getDriverType() == EDT_DIRECT3D9) ?
static_cast<CD3D9Texture*>(texture[i])->getDX9Texture() : 0;
if (currentTexture)
{
Texture[i] = texture[i];
Texture[i]->grab();
IDirect3DSurface9* currentSurface = 0;
currentTexture->GetSurfaceLevel(0, &currentSurface);
Surface[i] = currentSurface;
}
else
{
Surface[i] = 0;
Texture[i] = 0;
}
}
}
// Set depth and stencil attachments.
if (depthStencilUpdate)
{
if (DepthStencilSurface)
{
DepthStencilSurface->Release();
DepthStencilSurface = 0;
}
if (DepthStencil)
{
DepthStencil->drop();
DepthStencil = 0;
DepthStencilSurface = 0;
}
IDirect3DTexture9* currentTexture = (depthStencil && depthStencil->getDriverType() == EDT_DIRECT3D9) ?
static_cast<CD3D9Texture*>(depthStencil)->getDX9Texture() : 0;
const ECOLOR_FORMAT textureFormat = (depthStencil) ? depthStencil->getColorFormat() : ECF_UNKNOWN;
if (IImage::isDepthFormat(textureFormat))
{
DepthStencil = depthStencil;
DepthStencil->grab();
IDirect3DSurface9* currentSurface = 0;
currentTexture->GetSurfaceLevel(0, &currentSurface);
DepthStencilSurface = currentSurface;
}
}
// Set size required for a viewport.
bool sizeDetected = false;
for (u32 i = 0; i < Texture.size(); ++i)
{
if (Texture[i])
{
Size = Texture[i]->getSize();
sizeDetected = true;
break;
}
}
if (!sizeDetected)
{
if (DepthStencil)
Size = DepthStencil->getSize();
else
Size = Driver->getScreenSize();
}
}
}
const core::dimension2d<u32>& CD3D9RenderTarget::getSize() const
{
return Size;
}
IDirect3DSurface9* CD3D9RenderTarget::getSurface(u32 id) const
{
return (id < Surface.size()) ? Surface[id] : 0;
}
u32 CD3D9RenderTarget::getSurfaceCount() const
{
return Surface.size();
}
IDirect3DSurface9* CD3D9RenderTarget::getDepthStencilSurface() const
{
return DepthStencilSurface;
}
}
}
#endif
// Copyright (C) 2015 Patryk Nadrowski
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_OPEN_GL_RENDER_TARGET_H_INCLUDED__
#define __C_OPEN_GL_RENDER_TARGET_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
#include "IRenderTarget.h"
#include "dimension2d.h"
#include "COpenGLExtensionHandler.h"
#include <d3d9.h>
namespace irr
{
namespace video
{
class CD3D9Driver;
class CD3D9RenderTarget : public IRenderTarget
{
public:
CD3D9RenderTarget(CD3D9Driver* driver);
virtual ~CD3D9RenderTarget();
virtual void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil) _IRR_OVERRIDE_;
const core::dimension2d<u32>& getSize() const;
IDirect3DSurface9* getSurface(u32 id) const;
u32 getSurfaceCount() const;
IDirect3DSurface9* getDepthStencilSurface() const;
protected:
core::dimension2d<u32> Size;
core::array<IDirect3DSurface9*> Surface;
IDirect3DSurface9* DepthStencilSurface;
CD3D9Driver* Driver;
};
}
}
#endif
#endif
...@@ -18,14 +18,12 @@ namespace video ...@@ -18,14 +18,12 @@ namespace video
{ {
//! rendertarget constructor //! rendertarget constructor
CD3D9Texture::CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<u32>& size, CD3D9Texture::CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<u32>& size, const io::path& name, const ECOLOR_FORMAT format)
const io::path& name, const ECOLOR_FORMAT format) : ITexture(name), Texture(0), RTTSurface(0), Driver(driver), HardwareMipMaps(false), IsCompressed(false)
: ITexture(name), Texture(0), RTTSurface(0), Driver(driver), DepthSurface(0),
HardwareMipMaps(false), IsCompressed(false)
{ {
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("CD3D9Texture"); setDebugName("CD3D9Texture");
#endif #endif
Device=driver->getExposedVideoData().D3D9.D3DDev9; Device=driver->getExposedVideoData().D3D9.D3DDev9;
if (Device) if (Device)
...@@ -41,14 +39,12 @@ CD3D9Texture::CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<u32>& si ...@@ -41,14 +39,12 @@ CD3D9Texture::CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<u32>& si
//! constructor //! constructor
CD3D9Texture::CD3D9Texture(IImage* image, CD3D9Driver* driver, CD3D9Texture::CD3D9Texture(IImage* image, CD3D9Driver* driver, u32 flags, const io::path& name, void* mipmapData)
u32 flags, const io::path& name, void* mipmapData) : ITexture(name), Texture(0), RTTSurface(0), Driver(driver), HardwareMipMaps(false), IsCompressed(false)
: ITexture(name), Texture(0), RTTSurface(0), Driver(driver), DepthSurface(0),
HardwareMipMaps(false), IsCompressed(false)
{ {
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("CD3D9Texture"); setDebugName("CD3D9Texture");
#endif #endif
DriverType = EDT_DIRECT3D9; DriverType = EDT_DIRECT3D9;
HasMipMaps = Driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); HasMipMaps = Driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS);
...@@ -105,15 +101,6 @@ CD3D9Texture::~CD3D9Texture() ...@@ -105,15 +101,6 @@ CD3D9Texture::~CD3D9Texture()
if (RTTSurface) if (RTTSurface)
RTTSurface->Release(); RTTSurface->Release();
// if this texture was the last one using the depth buffer
// we can release the surface. We only use the value of the pointer
// hence it is safe to use the dropped pointer...
if (DepthSurface)
{
if (DepthSurface->drop())
Driver->removeDepthSurface(DepthSurface);
}
if (Device) if (Device)
Device->Release(); Device->Release();
} }
...@@ -165,17 +152,9 @@ void CD3D9Texture::createRenderTarget(const ECOLOR_FORMAT format) ...@@ -165,17 +152,9 @@ void CD3D9Texture::createRenderTarget(const ECOLOR_FORMAT format)
} }
// create texture // create texture
HRESULT hr; DWORD usage = (IImage::isDepthFormat(ColorFormat)) ? D3DUSAGE_DEPTHSTENCIL : D3DUSAGE_RENDERTARGET;
hr = Device->CreateTexture( HRESULT hr = Device->CreateTexture(Size.Width, Size.Height, 1, usage, d3dformat, D3DPOOL_DEFAULT, &Texture, NULL);
Size.Width,
Size.Height,
1, // mip map level count, we don't want mipmaps here
D3DUSAGE_RENDERTARGET,
d3dformat,
D3DPOOL_DEFAULT,
&Texture,
NULL);
if (FAILED(hr)) if (FAILED(hr))
{ {
...@@ -556,7 +535,7 @@ void CD3D9Texture::unlock() ...@@ -556,7 +535,7 @@ void CD3D9Texture::unlock()
//! returns the DIRECT3D9 Texture //! returns the DIRECT3D9 Texture
IDirect3DBaseTexture9* CD3D9Texture::getDX9Texture() const IDirect3DTexture9* CD3D9Texture::getDX9Texture() const
{ {
return Texture; return Texture;
} }
...@@ -725,23 +704,6 @@ void CD3D9Texture::regenerateMipMapLevels(void* mipmapData) ...@@ -725,23 +704,6 @@ void CD3D9Texture::regenerateMipMapLevels(void* mipmapData)
} }
//! Returns pointer to the render target surface
IDirect3DSurface9* CD3D9Texture::getRenderTargetSurface()
{
if (!IsRenderTarget)
return 0;
IDirect3DSurface9 *pRTTSurface = 0;
if (Texture)
Texture->GetSurfaceLevel(0, &pRTTSurface);
if (pRTTSurface)
pRTTSurface->Release();
return pRTTSurface;
}
void CD3D9Texture::setPitch(D3DFORMAT d3dformat) void CD3D9Texture::setPitch(D3DFORMAT d3dformat)
{ {
switch(d3dformat) switch(d3dformat)
......
...@@ -52,10 +52,7 @@ public: ...@@ -52,10 +52,7 @@ public:
virtual void regenerateMipMapLevels(void* mipmapData = 0) _IRR_OVERRIDE_; virtual void regenerateMipMapLevels(void* mipmapData = 0) _IRR_OVERRIDE_;
//! returns the DIRECT3D9 Texture //! returns the DIRECT3D9 Texture
IDirect3DBaseTexture9* getDX9Texture() const; IDirect3DTexture9* getDX9Texture() const;
//! Returns pointer to the render target surface
IDirect3DSurface9* getRenderTargetSurface();
private: private:
friend class CD3D9Driver; friend class CD3D9Driver;
...@@ -90,7 +87,6 @@ private: ...@@ -90,7 +87,6 @@ private:
IDirect3DTexture9* Texture; IDirect3DTexture9* Texture;
IDirect3DSurface9* RTTSurface; IDirect3DSurface9* RTTSurface;
CD3D9Driver* Driver; CD3D9Driver* Driver;
SDepthSurface* DepthSurface;
u32 MipLevelLocked; u32 MipLevelLocked;
bool HardwareMipMaps; bool HardwareMipMaps;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "CMeshManipulator.h" #include "CMeshManipulator.h"
#include "CColorConverter.h" #include "CColorConverter.h"
#include "IAttributeExchangingObject.h" #include "IAttributeExchangingObject.h"
#include "IRenderTarget.h"
namespace irr namespace irr
...@@ -82,9 +83,9 @@ IImageWriter* createImageWriterPPM(); ...@@ -82,9 +83,9 @@ IImageWriter* createImageWriterPPM();
//! constructor //! constructor
CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& screenSize) CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& screenSize)
: FileSystem(io), MeshManipulator(0), ViewPort(0,0,0,0), ScreenSize(screenSize), : CurrentRenderTarget(0), CurrentRenderTargetSize(0, 0), FileSystem(io), MeshManipulator(0),
PrimitivesDrawn(0), MinVertexCountForVBO(500), TextureCreationFlags(0), ViewPort(0, 0, 0, 0), ScreenSize(screenSize), PrimitivesDrawn(0), MinVertexCountForVBO(500),
OverrideMaterial2DEnabled(false), AllowZWriteOnTransparent(false) TextureCreationFlags(0), OverrideMaterial2DEnabled(false), AllowZWriteOnTransparent(false)
{ {
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("CNullDriver"); setDebugName("CNullDriver");
...@@ -211,6 +212,9 @@ CNullDriver::~CNullDriver() ...@@ -211,6 +212,9 @@ CNullDriver::~CNullDriver()
if (MeshManipulator) if (MeshManipulator)
MeshManipulator->drop(); MeshManipulator->drop();
removeAllRenderTargets();
deleteAllTextures(); deleteAllTextures();
u32 i; u32 i;
...@@ -613,33 +617,21 @@ ITexture* CNullDriver::createDeviceDependentTexture(IImage* surface, const io::p ...@@ -613,33 +617,21 @@ ITexture* CNullDriver::createDeviceDependentTexture(IImage* surface, const io::p
} }
//! sets a render target //! set a render target
bool CNullDriver::setRenderTarget(video::ITexture* texture, bool clearBackBuffer, bool CNullDriver::setRenderTarget(video::ITexture* texture, bool clearBackBuffer, bool clearZBuffer, SColor color)
bool clearZBuffer, SColor color, video::ITexture* depthStencil)
{ {
return false; return false;
} }
//! Sets multiple render targets //! set a render target
bool CNullDriver::setRenderTarget(const core::array<video::IRenderTarget>& texture, bool CNullDriver::setRenderTarget(IRenderTarget* target, core::array<u32> activeTextureID, bool clearBackBuffer,
bool clearBackBuffer, bool clearZBuffer, SColor color, video::ITexture* depthStencil) bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor)
{ {
return false; return false;
} }
//! set or reset special render targets
bool CNullDriver::setRenderTarget(video::E_RENDER_TARGET target, bool clearTarget,
bool clearZBuffer, SColor color)
{
if (ERT_FRAME_BUFFER==target)
return setRenderTarget(0,clearTarget, clearZBuffer, color, 0);
else
return false;
}
//! sets a viewport //! sets a viewport
void CNullDriver::setViewPort(const core::rect<s32>& area) void CNullDriver::setViewPort(const core::rect<s32>& area)
{ {
...@@ -879,6 +871,13 @@ const core::dimension2d<u32>& CNullDriver::getScreenSize() const ...@@ -879,6 +871,13 @@ const core::dimension2d<u32>& CNullDriver::getScreenSize() const
} }
//! get current render target
IRenderTarget* CNullDriver::getCurrentRenderTarget() const
{
return CurrentRenderTarget;
}
//! returns the current render target size, //! returns the current render target size,
//! or the screen size if render targets are not implemented //! or the screen size if render targets are not implemented
const core::dimension2d<u32>& CNullDriver::getCurrentRenderTargetSize() const const core::dimension2d<u32>& CNullDriver::getCurrentRenderTargetSize() const
...@@ -1760,6 +1759,42 @@ u32 CNullDriver::getOcclusionQueryResult(scene::ISceneNode* node) const ...@@ -1760,6 +1759,42 @@ u32 CNullDriver::getOcclusionQueryResult(scene::ISceneNode* node) const
} }
//! Create render target.
IRenderTarget* CNullDriver::addRenderTarget()
{
return 0;
}
//! Remove render target.
void CNullDriver::removeRenderTarget(IRenderTarget* renderTarget)
{
if (!renderTarget)
return;
for (u32 i = 0; i < RenderTargets.size(); ++i)
{
if (RenderTargets[i] == renderTarget)
{
RenderTargets[i]->drop();
RenderTargets.erase(i);
return;
}
}
}
//! Remove all render targets.
void CNullDriver::removeAllRenderTargets()
{
for (u32 i = 0; i < RenderTargets.size(); ++i)
RenderTargets[i]->drop();
RenderTargets.clear();
}
//! Only used by the internal engine. Used to notify the driver that //! Only used by the internal engine. Used to notify the driver that
//! the window was resized. //! the window was resized.
void CNullDriver::OnResize(const core::dimension2d<u32>& size) void CNullDriver::OnResize(const core::dimension2d<u32>& size)
...@@ -2331,6 +2366,12 @@ ITexture* CNullDriver::addRenderTargetTexture(const core::dimension2d<u32>& size ...@@ -2331,6 +2366,12 @@ ITexture* CNullDriver::addRenderTargetTexture(const core::dimension2d<u32>& size
} }
//! Clear the color, depth and/or stencil buffers.
void CNullDriver::clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
{
}
//! Clears the ZBuffer. //! Clears the ZBuffer.
void CNullDriver::clearZBuffer() void CNullDriver::clearZBuffer()
{ {
......
...@@ -100,17 +100,12 @@ namespace video ...@@ -100,17 +100,12 @@ namespace video
//! creates a Texture //! creates a Texture
virtual ITexture* addTexture(const core::dimension2d<u32>& size, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) _IRR_OVERRIDE_; virtual ITexture* addTexture(const core::dimension2d<u32>& size, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) _IRR_OVERRIDE_;
//! sets a render target //! set a render target
virtual bool setRenderTarget(video::ITexture* texture, bool clearBackBuffer, virtual bool setRenderTarget(ITexture* texture, bool clearBackBuffer, bool clearZBuffer, SColor color) _IRR_OVERRIDE_;
bool clearZBuffer, SColor color, video::ITexture* depthStencil) _IRR_OVERRIDE_;
//! Sets multiple render targets //! set a render target
virtual bool setRenderTarget(const core::array<video::IRenderTarget>& texture, virtual bool setRenderTarget(IRenderTarget* target, core::array<u32> activeTextureID, bool clearBackBuffer,
bool clearBackBuffer, bool clearZBuffer, SColor color, video::ITexture* depthStencil) _IRR_OVERRIDE_; bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor) _IRR_OVERRIDE_;
//! set or reset special render targets
virtual bool setRenderTarget(video::E_RENDER_TARGET target, bool clearTarget,
bool clearZBuffer, SColor color) _IRR_OVERRIDE_;
//! sets a viewport //! sets a viewport
virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_; virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_;
...@@ -242,6 +237,9 @@ namespace video ...@@ -242,6 +237,9 @@ namespace video
//! get screen size //! get screen size
virtual const core::dimension2d<u32>& getScreenSize() const _IRR_OVERRIDE_; virtual const core::dimension2d<u32>& getScreenSize() const _IRR_OVERRIDE_;
//! get current render target
IRenderTarget* getCurrentRenderTarget() const;
//! get render target size //! get render target size
virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const _IRR_OVERRIDE_; virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const _IRR_OVERRIDE_;
...@@ -471,6 +469,15 @@ namespace video ...@@ -471,6 +469,15 @@ namespace video
actual value of pixels. */ actual value of pixels. */
virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const _IRR_OVERRIDE_; virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const _IRR_OVERRIDE_;
//! Create render target.
virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_;
//! Remove render target.
virtual void removeRenderTarget(IRenderTarget* renderTarget) _IRR_OVERRIDE_;
//! Remove all render targets.
virtual void removeAllRenderTargets() _IRR_OVERRIDE_;
//! Only used by the engine internally. //! Only used by the engine internally.
/** Used to notify the driver that the window was resized. */ /** Used to notify the driver that the window was resized. */
virtual void OnResize(const core::dimension2d<u32>& size) _IRR_OVERRIDE_; virtual void OnResize(const core::dimension2d<u32>& size) _IRR_OVERRIDE_;
...@@ -584,6 +591,9 @@ namespace video ...@@ -584,6 +591,9 @@ namespace video
//! Returns a pointer to the mesh manipulator. //! Returns a pointer to the mesh manipulator.
virtual scene::IMeshManipulator* getMeshManipulator() _IRR_OVERRIDE_; 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. //! Clears the ZBuffer.
virtual void clearZBuffer() _IRR_OVERRIDE_; virtual void clearZBuffer() _IRR_OVERRIDE_;
...@@ -796,6 +806,11 @@ namespace video ...@@ -796,6 +806,11 @@ namespace video
}; };
core::array<SOccQuery> OcclusionQueries; core::array<SOccQuery> OcclusionQueries;
core::array<IRenderTarget*> RenderTargets;
IRenderTarget* CurrentRenderTarget;
core::dimension2d<u32> CurrentRenderTargetSize;
core::array<video::IImageLoader*> SurfaceLoader; core::array<video::IImageLoader*> SurfaceLoader;
core::array<video::IImageWriter*> SurfaceWriter; core::array<video::IImageWriter*> SurfaceWriter;
core::array<SLight> Lights; core::array<SLight> Lights;
......
This diff is collapsed.
...@@ -134,6 +134,9 @@ namespace video ...@@ -134,6 +134,9 @@ namespace video
actual value of pixels. */ actual value of pixels. */
virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const _IRR_OVERRIDE_; virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const _IRR_OVERRIDE_;
//! Create render target.
virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_;
//! draws a vertex primitive list //! draws a vertex primitive list
virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
const void* indexList, u32 primitiveCount, const void* indexList, u32 primitiveCount,
...@@ -356,17 +359,12 @@ namespace video ...@@ -356,17 +359,12 @@ namespace video
virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size, virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_; const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_;
//! sets a render target //! set a render target
virtual bool setRenderTarget(video::ITexture* texture, bool clearBackBuffer, virtual bool setRenderTarget(IRenderTarget* target, core::array<u32> activeTextureID, bool clearBackBuffer,
bool clearZBuffer, SColor color, video::ITexture* depthStencil) _IRR_OVERRIDE_; bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor) _IRR_OVERRIDE_;
//! Sets multiple render targets
virtual bool setRenderTarget(const core::array<video::IRenderTarget>& texture,
bool clearBackBuffer, bool clearZBuffer, SColor color, video::ITexture* depthStencil) _IRR_OVERRIDE_;
//! set or reset special render targets //! Clear the color, depth and/or stencil buffers.
virtual bool setRenderTarget(video::E_RENDER_TARGET target, bool clearTarget, virtual void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color) _IRR_OVERRIDE_;
bool clearZBuffer, SColor color) _IRR_OVERRIDE_;
//! Clears the ZBuffer. //! Clears the ZBuffer.
virtual void clearZBuffer() _IRR_OVERRIDE_; virtual void clearZBuffer() _IRR_OVERRIDE_;
...@@ -429,9 +427,6 @@ namespace video ...@@ -429,9 +427,6 @@ namespace video
private: private:
//! clears the zbuffer and color buffer
void clearBuffers(bool backBuffer, bool zBuffer, bool stencilBuffer, SColor color);
bool updateVertexHardwareBuffer(SHWBufferLink_opengl *HWBuffer); bool updateVertexHardwareBuffer(SHWBufferLink_opengl *HWBuffer);
bool updateIndexHardwareBuffer(SHWBufferLink_opengl *HWBuffer); bool updateIndexHardwareBuffer(SHWBufferLink_opengl *HWBuffer);
...@@ -494,8 +489,6 @@ namespace video ...@@ -494,8 +489,6 @@ namespace video
u8 AntiAlias; u8 AntiAlias;
SMaterial Material, LastMaterial; SMaterial Material, LastMaterial;
COpenGLTexture* RenderTargetTexture;
core::array<video::IRenderTarget> MRTargets;
class STextureStageCache class STextureStageCache
{ {
...@@ -562,7 +555,6 @@ namespace video ...@@ -562,7 +555,6 @@ namespace video
}; };
STextureStageCache CurrentTexture; STextureStageCache CurrentTexture;
core::array<ITexture*> DepthTextures;
struct SUserClipPlane struct SUserClipPlane
{ {
SUserClipPlane() : Enabled(false) {} SUserClipPlane() : Enabled(false) {}
...@@ -571,8 +563,6 @@ namespace video ...@@ -571,8 +563,6 @@ namespace video
}; };
core::array<SUserClipPlane> UserClipPlanes; core::array<SUserClipPlane> UserClipPlanes;
core::dimension2d<u32> CurrentRendertargetSize;
core::stringc VendorName; core::stringc VendorName;
core::matrix4 TextureFlipMatrix; core::matrix4 TextureFlipMatrix;
...@@ -582,9 +572,6 @@ namespace video ...@@ -582,9 +572,6 @@ namespace video
E_OPENGL_FIXED_PIPELINE_STATE FixedPipelineState; E_OPENGL_FIXED_PIPELINE_STATE FixedPipelineState;
//! Render target type for render operations
E_RENDER_TARGET CurrentTarget;
SIrrlichtCreationParameters Params; SIrrlichtCreationParameters Params;
//! All the lights that have been requested; a hardware limited //! All the lights that have been requested; a hardware limited
...@@ -683,6 +670,12 @@ namespace video ...@@ -683,6 +670,12 @@ namespace video
void setDepthTest(bool enable); void setDepthTest(bool enable);
// FBO calls.
void getFBO(GLuint& id) const;
void setFBO(GLuint id);
// Matrix calls. // Matrix calls.
void setMatrixMode(GLenum mode); void setMatrixMode(GLenum mode);
...@@ -731,6 +724,8 @@ namespace video ...@@ -731,6 +724,8 @@ namespace video
bool DepthMask; bool DepthMask;
bool DepthTest; bool DepthTest;
GLuint FrameBufferID;
GLenum MatrixMode; GLenum MatrixMode;
GLenum ActiveTexture; GLenum ActiveTexture;
......
...@@ -21,7 +21,7 @@ COpenGLExtensionHandler::COpenGLExtensionHandler() : ...@@ -21,7 +21,7 @@ COpenGLExtensionHandler::COpenGLExtensionHandler() :
TextureCompressionExtension(false), TextureCompressionExtension(false),
MaxSupportedTextures(1), MaxTextureUnits(1), MaxLights(1), MaxSupportedTextures(1), MaxTextureUnits(1), MaxLights(1),
MaxAnisotropy(1), MaxUserClipPlanes(0), MaxAuxBuffers(0), MaxAnisotropy(1), MaxUserClipPlanes(0), MaxAuxBuffers(0),
MaxMultipleRenderTargets(1), MaxIndices(65535), MaxMultipleRenderTargets(1), MaxColorAttachments(1), MaxIndices(65535),
MaxTextureSize(1), MaxGeometryVerticesOut(0), MaxTextureSize(1), MaxGeometryVerticesOut(0),
MaxTextureLODBias(0.f), Version(0), ShaderLanguageVersion(0), MaxTextureLODBias(0.f), Version(0), ShaderLanguageVersion(0),
OcclusionQuerySupport(false) OcclusionQuerySupport(false)
...@@ -654,6 +654,13 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) ...@@ -654,6 +654,13 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
glGetIntegerv(GL_MAX_DRAW_BUFFERS_ATI, &num); glGetIntegerv(GL_MAX_DRAW_BUFFERS_ATI, &num);
MaxMultipleRenderTargets = static_cast<u8>(num); MaxMultipleRenderTargets = static_cast<u8>(num);
} }
#endif
#if defined(GL_EXT_framebuffer_object)
if (FeatureAvailable[IRR_EXT_framebuffer_object])
{
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &num);
MaxColorAttachments = static_cast<u8>(num);
}
#endif #endif
glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, DimAliasedLine); glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, DimAliasedLine);
glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, DimAliasedPoint); glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, DimAliasedPoint);
......
...@@ -1092,6 +1092,8 @@ class COpenGLExtensionHandler ...@@ -1092,6 +1092,8 @@ class COpenGLExtensionHandler
u8 MaxAuxBuffers; u8 MaxAuxBuffers;
//! Number of rendertargets available as MRTs //! Number of rendertargets available as MRTs
u8 MaxMultipleRenderTargets; u8 MaxMultipleRenderTargets;
//! Number of color attachments available in FBO
u8 MaxColorAttachments;
//! Optimal number of indices per meshbuffer //! Optimal number of indices per meshbuffer
u32 MaxIndices; u32 MaxIndices;
//! Maximal texture dimension //! Maximal texture dimension
......
// Copyright (C) 2015 Patryk Nadrowski
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "COpenGLRenderTarget.h"
#ifdef _IRR_COMPILE_WITH_OPENGL_
#include "IImage.h"
#include "irrMath.h"
#include "COpenGLDriver.h"
#include "COpenGLTexture.h"
#if !defined(GL_VERSION_3_0) && !defined(GL_ARB_framebuffer_object)
#ifdef GL_EXT_framebuffer_object
#define GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT
#define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
#define GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_EXT
#define GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT_EXT
#define GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT
#define GL_FRAMEBUFFER_UNSUPPORTED GL_FRAMEBUFFER_UNSUPPORTED_EXT
#else
#define GL_FRAMEBUFFER 0
#define GL_COLOR_ATTACHMENT0 0
#define GL_DEPTH_ATTACHMENT 0
#define GL_STENCIL_ATTACHMENT 0
#define GL_FRAMEBUFFER_COMPLETE 0
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 1
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 2
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 3
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 4
#define GL_FRAMEBUFFER_UNSUPPORTED 5
#endif
#endif
#ifdef GL_EXT_framebuffer_object
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT
#else
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS 6
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 7
#endif
namespace irr
{
namespace video
{
bool checkFBOStatus(COpenGLDriver* Driver)
{
GLenum status = Driver->extGlCheckFramebufferStatus(GL_FRAMEBUFFER);
switch (status)
{
case GL_FRAMEBUFFER_COMPLETE:
return true;
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
os::Printer::log("FBO has invalid read buffer", ELL_ERROR);
break;
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
os::Printer::log("FBO has invalid draw buffer", ELL_ERROR);
break;
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
os::Printer::log("FBO has one or several incomplete image attachments", ELL_ERROR);
break;
case GL_FRAMEBUFFER_INCOMPLETE_FORMATS:
os::Printer::log("FBO has one or several image attachments with different internal formats", ELL_ERROR);
break;
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
os::Printer::log("FBO has one or several image attachments with different dimensions", ELL_ERROR);
break;
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
os::Printer::log("FBO missing an image attachment", ELL_ERROR);
break;
case GL_FRAMEBUFFER_UNSUPPORTED:
os::Printer::log("FBO format unsupported", ELL_ERROR);
break;
default:
os::Printer::log("FBO error", ELL_ERROR);
break;
}
return false;
}
COpenGLRenderTarget::COpenGLRenderTarget(COpenGLDriver* driver) : AssignedTextureCount(0), AssignedDepth(false), AssignedStencil(false),
TextureUpdate(false), DepthStencilUpdate(false), BufferID(0), SupportForFBO(false), SupportForMRT(false), BridgeCalls(0), Driver(driver)
{
#ifdef _DEBUG
setDebugName("COpenGLRenderTarget");
#endif
DriverType = EDT_OPENGL;
AssignedActiveTextureID.set_used(1);
AssignedActiveTextureID[0] = 0;
Size = Driver->getScreenSize();
BridgeCalls = Driver->getBridgeCalls();
#if defined(GL_VERSION_3_0) || defined(GL_ARB_framebuffer_object) || defined(GL_EXT_framebuffer_object)
SupportForFBO = Driver->FeatureAvailable[COpenGLDriver::IRR_EXT_framebuffer_object] || Driver->FeatureAvailable[COpenGLDriver::IRR_ARB_framebuffer_object];
#endif
SupportForMRT = SupportForFBO && Driver->MaxMultipleRenderTargets > 1 && (Driver->Version >= 200 || Driver->FeatureAvailable[COpenGLDriver::IRR_ARB_draw_buffers] ||
Driver->FeatureAvailable[COpenGLDriver::IRR_ATI_draw_buffers]);
if (SupportForFBO)
Driver->extGlGenFramebuffers(1, &BufferID);
}
COpenGLRenderTarget::~COpenGLRenderTarget()
{
if (SupportForFBO && BufferID != 0)
Driver->extGlDeleteFramebuffers(1, &BufferID);
for (u32 i = 0; i < Texture.size(); ++i)
{
if (Texture[i])
Texture[i]->drop();
}
if (DepthStencil)
DepthStencil->drop();
}
void COpenGLRenderTarget::setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil)
{
TextureUpdate = TextureUpdate || Texture != texture;
if (Texture != texture)
{
for (u32 i = 0; i < Texture.size(); ++i)
{
if (Texture[i])
Texture[i]->drop();
}
Texture.set_used(core::min_(texture.size(), static_cast<u32>(Driver->MaxColorAttachments)));
for (u32 i = 0; i < Texture.size(); ++i)
{
GLuint textureID = (texture[i] && texture[i]->getDriverType() == EDT_OPENGL) ? static_cast<COpenGLTexture*>(depthStencil)->getOpenGLTextureName() : 0;
if (textureID != 0)
{
Texture[i] = texture[i];
Texture[i]->grab();
}
else
{
Texture[i] = 0;
}
}
}
DepthStencilUpdate = DepthStencilUpdate || DepthStencil != depthStencil;
if (DepthStencil != depthStencil)
{
GLuint textureID = (depthStencil && depthStencil->getDriverType() == EDT_OPENGL) ? static_cast<COpenGLTexture*>(depthStencil)->getOpenGLTextureName() : 0;
const ECOLOR_FORMAT textureFormat = (textureID != 0) ? depthStencil->getColorFormat() : ECF_UNKNOWN;
if (IImage::isDepthFormat(textureFormat))
{
DepthStencil = depthStencil;
DepthStencil->grab();
}
else
{
if (DepthStencil)
DepthStencil->drop();
DepthStencil = 0;
}
}
}
void COpenGLRenderTarget::update(const core::array<u32>& id)
{
if (TextureUpdate || DepthStencilUpdate)
{
// Set color attachments.
if (TextureUpdate)
{
const u32 textureSize = Texture.size();
const u32 stepCount = core::max_(textureSize, AssignedTextureCount);
for (u32 i = 0; i < stepCount; ++i)
{
GLuint textureID = 0;
if (i < textureSize && Texture[i])
textureID = static_cast<COpenGLTexture*>(Texture[i])->getOpenGLTextureName();
if (textureID != 0)
{
Driver->extGlFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, GL_TEXTURE_2D, textureID, 0);
}
else if (i < AssignedTextureCount)
{
Driver->extGlFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, GL_TEXTURE_2D, 0, 0);
}
}
AssignedTextureCount = textureSize;
TextureUpdate = false;
}
// Set depth and stencil attachments.
if (DepthStencilUpdate)
{
const ECOLOR_FORMAT textureFormat = (DepthStencil) ? DepthStencil->getColorFormat() : ECF_UNKNOWN;
if (IImage::isDepthFormat(textureFormat))
{
GLuint textureID = static_cast<COpenGLTexture*>(DepthStencil)->getOpenGLTextureName();
Driver->extGlFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, textureID, 0);
if (textureFormat == ECF_D24S8)
{
Driver->extGlFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, textureID, 0);
AssignedStencil = true;
}
else
{
if (AssignedStencil)
Driver->extGlFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
AssignedStencil = false;
}
AssignedDepth = true;
}
else
{
if (AssignedDepth)
Driver->extGlFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
if (AssignedStencil)
Driver->extGlFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
AssignedDepth = false;
AssignedStencil = false;
}
DepthStencilUpdate = false;
}
// Set size required for a viewport.
ITexture* firstTexture = getTexture();
if (firstTexture)
Size = firstTexture->getSize();
else
{
if (DepthStencil)
Size = DepthStencil->getSize();
else
Size = Driver->getScreenSize();
}
#ifdef _DEBUG
checkFBOStatus(Driver);
#endif
}
if ((AssignedActiveTextureID != id) && SupportForFBO && BufferID != 0)
{
const u32 size = id.size();
if (size == 0)
glDrawBuffer(GL_NONE);
else if (size == 1 || !SupportForMRT)
glDrawBuffer(GL_COLOR_ATTACHMENT0 + id[0]);
else
{
GLenum* target = new GLenum[Driver->MaxMultipleRenderTargets];
for (u32 i = 0; i < Driver->MaxMultipleRenderTargets; ++i)
target[i] = GL_NONE;
const u32 mrtSize = core::min_(size, static_cast<u32>(Driver->MaxMultipleRenderTargets));
for (u32 i = 0; i < mrtSize; ++i)
target[i + id[i]] = GL_COLOR_ATTACHMENT0 + id[i];
Driver->extGlDrawBuffers(mrtSize, target);
delete[] target;
}
AssignedActiveTextureID = id;
}
}
GLuint COpenGLRenderTarget::getBufferID() const
{
return BufferID;
}
const core::dimension2d<u32>& COpenGLRenderTarget::getSize() const
{
return Size;
}
ITexture* COpenGLRenderTarget::getTexture() const
{
for (u32 i = 0; i < Texture.size(); ++i)
{
if (Texture[i])
return Texture[i];
}
return 0;
}
}
}
#endif
// Copyright (C) 2015 Patryk Nadrowski
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_OPEN_GL_RENDER_TARGET_H_INCLUDED__
#define __C_OPEN_GL_RENDER_TARGET_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_OPENGL_
#include "IRenderTarget.h"
#include "dimension2d.h"
#include "COpenGLExtensionHandler.h"
namespace irr
{
namespace video
{
class COpenGLDriver;
class COpenGLCallBridge;
class COpenGLRenderTarget : public IRenderTarget
{
public:
COpenGLRenderTarget(COpenGLDriver* driver);
virtual ~COpenGLRenderTarget();
virtual void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil) _IRR_OVERRIDE_;
void update(const core::array<u32>& id);
GLuint getBufferID() const;
const core::dimension2d<u32>& getSize() const;
ITexture* getTexture() const;
protected:
core::array<u32> AssignedActiveTextureID;
u32 AssignedTextureCount;
bool AssignedDepth;
bool AssignedStencil;
bool TextureUpdate;
bool DepthStencilUpdate;
GLuint BufferID;
core::dimension2d<u32> Size;
bool SupportForFBO;
bool SupportForMRT;
COpenGLCallBridge* BridgeCalls;
COpenGLDriver* Driver;
};
}
}
#endif
#endif
This diff is collapsed.
...@@ -72,8 +72,11 @@ public: ...@@ -72,8 +72,11 @@ public:
bool IsCached; bool IsCached;
}; };
//! constructor //! constructor for a standard textures
COpenGLTexture(IImage* surface, const io::path& name, void* mipmapData=0, COpenGLDriver* driver=0); COpenGLTexture(IImage* surface, const io::path& name, void* mipmapData, COpenGLDriver* driver);
//! constructor for a render target textures
COpenGLTexture(const io::path& name, const core::dimension2d<u32>& size, ECOLOR_FORMAT format, COpenGLDriver* driver);
//! destructor //! destructor
virtual ~COpenGLTexture(); virtual ~COpenGLTexture();
...@@ -92,24 +95,6 @@ public: ...@@ -92,24 +95,6 @@ public:
//! return open gl texture name //! return open gl texture name
GLuint getOpenGLTextureName() const; GLuint getOpenGLTextureName() const;
//! Is it a FrameBufferObject?
virtual bool isFrameBufferObject() const;
//! Is it a depth texture?
bool isDepthTexture() const;
//! Is it a renderbuffer?
bool isRenderBuffer() const;
//! Bind RenderTargetTexture
virtual void bindRTT();
//! Unbind RenderTargetTexture
virtual void unbindRTT();
//! sets whether this texture is intended to be used as a render target.
void setIsRenderTarget(bool isTarget);
//! Get an access to texture states cache. //! Get an access to texture states cache.
SStatesCache& getStatesCache() const; SStatesCache& getStatesCache() const;
...@@ -150,68 +135,9 @@ protected: ...@@ -150,68 +135,9 @@ protected:
bool ReadOnlyLock; bool ReadOnlyLock;
bool KeepImage; bool KeepImage;
bool IsDepthTexture;
bool IsRenderBuffer;
mutable SStatesCache StatesCache; mutable SStatesCache StatesCache;
}; };
//! OpenGL FBO texture.
class COpenGLFBOTexture : public COpenGLTexture
{
public:
//! FrameBufferObject constructor
COpenGLFBOTexture(const core::dimension2d<u32>& size, const io::path& name,
COpenGLDriver* driver = 0, ECOLOR_FORMAT format = ECF_UNKNOWN);
//! destructor
virtual ~COpenGLFBOTexture();
//! Is it a FrameBufferObject?
virtual bool isFrameBufferObject() const _IRR_OVERRIDE_;
//! Bind RenderTargetTexture
virtual void bindRTT() _IRR_OVERRIDE_;
//! Unbind RenderTargetTexture
virtual void unbindRTT() _IRR_OVERRIDE_;
//! Return depth texture.
ITexture* getDepthTexture() const;
//! Set depth texture.
bool setDepthTexture(ITexture* depthTexture);
protected:
GLuint BufferID;
COpenGLTexture* DepthTexture;
};
//! OpenGL Render Buffer.
class COpenGLRenderBuffer : public COpenGLTexture
{
public:
//! FrameBufferObject depth constructor
COpenGLRenderBuffer(const core::dimension2d<u32>& size, const io::path& name, COpenGLDriver* driver=0, bool useStencil=false);
//! destructor
virtual ~COpenGLRenderBuffer();
//! Bind RenderTargetTexture
virtual void bindRTT() _IRR_OVERRIDE_;
//! Unbind RenderTargetTexture
virtual void unbindRTT() _IRR_OVERRIDE_;
GLuint getBufferID() const;
protected:
GLuint BufferID;
};
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
......
...@@ -174,6 +174,16 @@ bool CSoftwareDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const ...@@ -174,6 +174,16 @@ bool CSoftwareDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
} }
//! Create render target.
IRenderTarget* CSoftwareDriver::addRenderTarget()
{
CSoftwareRenderTarget* renderTarget = new CSoftwareRenderTarget(this);
RenderTargets.push_back(renderTarget);
return renderTarget;
}
//! sets transformation //! sets transformation
void CSoftwareDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) void CSoftwareDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat)
{ {
...@@ -226,11 +236,7 @@ bool CSoftwareDriver::beginScene(bool backBuffer, bool zBuffer, SColor color, ...@@ -226,11 +236,7 @@ bool CSoftwareDriver::beginScene(bool backBuffer, bool zBuffer, SColor color,
WindowId=videoData.D3D9.HWnd; WindowId=videoData.D3D9.HWnd;
SceneSourceRect = sourceRect; SceneSourceRect = sourceRect;
if (backBuffer && BackBuffer) clearBuffers(backBuffer, zBuffer, false, color);
BackBuffer->fill(color);
if (ZBuffer && zBuffer)
ZBuffer->clear();
return true; return true;
} }
...@@ -253,20 +259,21 @@ ITexture* CSoftwareDriver::createDeviceDependentTexture(IImage* surface, const i ...@@ -253,20 +259,21 @@ ITexture* CSoftwareDriver::createDeviceDependentTexture(IImage* surface, const i
} }
//! sets a render target //! set a render target
bool CSoftwareDriver::setRenderTarget(video::ITexture* texture, bool clearBackBuffer, bool CSoftwareDriver::setRenderTarget(IRenderTarget* target, core::array<u32> activeTextureID, bool clearBackBuffer,
bool clearZBuffer, SColor color, video::ITexture* depthStencil) bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor)
{ {
if (texture && texture->getDriverType() != EDT_SOFTWARE) if (target && target->getDriverType() != EDT_SOFTWARE)
{ {
os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); os::Printer::log("Fatal Error: Tried to set a render target not owned by this driver.", ELL_ERROR);
return false; return false;
} }
if (RenderTargetTexture) if (RenderTargetTexture)
RenderTargetTexture->drop(); RenderTargetTexture->drop();
RenderTargetTexture = texture; CSoftwareRenderTarget* renderTarget = static_cast<CSoftwareRenderTarget*>(target);
RenderTargetTexture = (renderTarget) ? renderTarget->getTexture() : 0;
if (RenderTargetTexture) if (RenderTargetTexture)
{ {
...@@ -278,14 +285,7 @@ bool CSoftwareDriver::setRenderTarget(video::ITexture* texture, bool clearBackBu ...@@ -278,14 +285,7 @@ bool CSoftwareDriver::setRenderTarget(video::ITexture* texture, bool clearBackBu
setRenderTarget(BackBuffer); setRenderTarget(BackBuffer);
} }
if (RenderTargetSurface && (clearBackBuffer || clearZBuffer)) clearBuffers(clearBackBuffer, clearDepthBuffer, clearStencilBuffer, clearColor);
{
if (clearZBuffer)
ZBuffer->clear();
if (clearBackBuffer)
RenderTargetSurface->fill(color);
}
return true; return true;
} }
...@@ -913,6 +913,17 @@ ITexture* CSoftwareDriver::addRenderTargetTexture(const core::dimension2d<u32>& ...@@ -913,6 +913,17 @@ ITexture* CSoftwareDriver::addRenderTargetTexture(const core::dimension2d<u32>&
} }
//! Clear the color, depth and/or stencil buffers.
void CSoftwareDriver::clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
{
if (backBuffer && RenderTargetSurface)
RenderTargetSurface->fill(color);
if (depthBuffer && ZBuffer)
ZBuffer->clear();
}
//! Clears the ZBuffer. //! Clears the ZBuffer.
void CSoftwareDriver::clearZBuffer() void CSoftwareDriver::clearZBuffer()
{ {
......
...@@ -27,14 +27,18 @@ namespace video ...@@ -27,14 +27,18 @@ namespace video
//! queries the features of the driver, returns true if feature is available //! queries the features of the driver, returns true if feature is available
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const _IRR_OVERRIDE_; virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const _IRR_OVERRIDE_;
//! Create render target.
virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_;
//! sets transformation //! sets transformation
virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) _IRR_OVERRIDE_; virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) _IRR_OVERRIDE_;
//! sets a material //! sets a material
virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_; virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_;
virtual bool setRenderTarget(video::ITexture* texture, bool clearBackBuffer, //! set a render target
bool clearZBuffer, SColor color, video::ITexture* depthStencil) _IRR_OVERRIDE_; virtual bool setRenderTarget(IRenderTarget* target, core::array<u32> activeTextureID, bool clearBackBuffer,
bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor) _IRR_OVERRIDE_;
//! sets a viewport //! sets a viewport
virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_; virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_;
...@@ -107,6 +111,9 @@ namespace video ...@@ -107,6 +111,9 @@ namespace video
virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size, virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_; 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. //! Clears the ZBuffer.
virtual void clearZBuffer() _IRR_OVERRIDE_; virtual void clearZBuffer() _IRR_OVERRIDE_;
......
...@@ -335,6 +335,17 @@ bool CBurningVideoDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const ...@@ -335,6 +335,17 @@ bool CBurningVideoDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
//! Create render target.
IRenderTarget* CBurningVideoDriver::addRenderTarget()
{
CSoftwareRenderTarget2* renderTarget = new CSoftwareRenderTarget2(this);
RenderTargets.push_back(renderTarget);
return renderTarget;
}
//! sets transformation //! sets transformation
void CBurningVideoDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) void CBurningVideoDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat)
{ {
...@@ -390,11 +401,7 @@ bool CBurningVideoDriver::beginScene(bool backBuffer, bool zBuffer, ...@@ -390,11 +401,7 @@ bool CBurningVideoDriver::beginScene(bool backBuffer, bool zBuffer,
WindowId = videoData.D3D9.HWnd; WindowId = videoData.D3D9.HWnd;
SceneSourceRect = sourceRect; SceneSourceRect = sourceRect;
if (backBuffer && BackBuffer) clearBuffers(backBuffer, zBuffer, false, color);
BackBuffer->fill(color);
if (zBuffer && DepthBuffer)
DepthBuffer->clear();
memset ( TransformationFlag, 0, sizeof ( TransformationFlag ) ); memset ( TransformationFlag, 0, sizeof ( TransformationFlag ) );
return true; return true;
...@@ -410,20 +417,21 @@ bool CBurningVideoDriver::endScene() ...@@ -410,20 +417,21 @@ bool CBurningVideoDriver::endScene()
} }
//! sets a render target //! set a render target
bool CBurningVideoDriver::setRenderTarget(video::ITexture* texture, bool clearBackBuffer, bool CBurningVideoDriver::setRenderTarget(IRenderTarget* target, core::array<u32> activeTextureID, bool clearBackBuffer,
bool clearZBuffer, SColor color, video::ITexture* depthStencil) bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor)
{ {
if (texture && texture->getDriverType() != EDT_BURNINGSVIDEO) if (target && target->getDriverType() != EDT_BURNINGSVIDEO)
{ {
os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); os::Printer::log("Fatal Error: Tried to set a render target not owned by this driver.", ELL_ERROR);
return false; return false;
} }
if (RenderTargetTexture) if (RenderTargetTexture)
RenderTargetTexture->drop(); RenderTargetTexture->drop();
RenderTargetTexture = texture; CSoftwareRenderTarget2* renderTarget = static_cast<CSoftwareRenderTarget2*>(target);
RenderTargetTexture = (renderTarget) ? renderTarget->getTexture() : 0;
if (RenderTargetTexture) if (RenderTargetTexture)
{ {
...@@ -435,14 +443,7 @@ bool CBurningVideoDriver::setRenderTarget(video::ITexture* texture, bool clearBa ...@@ -435,14 +443,7 @@ bool CBurningVideoDriver::setRenderTarget(video::ITexture* texture, bool clearBa
setRenderTarget(BackBuffer); setRenderTarget(BackBuffer);
} }
if (RenderTargetSurface && (clearBackBuffer || clearZBuffer)) clearBuffers(clearBackBuffer, clearDepthBuffer, clearStencilBuffer, clearColor);
{
if (clearZBuffer)
DepthBuffer->clear();
if (clearBackBuffer)
RenderTargetSurface->fill( color );
}
return true; return true;
} }
...@@ -2237,6 +2238,20 @@ ITexture* CBurningVideoDriver::addRenderTargetTexture(const core::dimension2d<u3 ...@@ -2237,6 +2238,20 @@ ITexture* CBurningVideoDriver::addRenderTargetTexture(const core::dimension2d<u3
} }
//! Clear the color, depth and/or stencil buffers.
void CBurningVideoDriver::clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
{
if (backBuffer && RenderTargetSurface)
RenderTargetSurface->fill(color);
if (depthBuffer && DepthBuffer)
DepthBuffer->clear();
if (stencilBuffer && StencilBuffer)
StencilBuffer->clear();
}
//! Clears the DepthBuffer. //! Clears the DepthBuffer.
void CBurningVideoDriver::clearZBuffer() void CBurningVideoDriver::clearZBuffer()
{ {
......
...@@ -30,14 +30,18 @@ namespace video ...@@ -30,14 +30,18 @@ namespace video
//! queries the features of the driver, returns true if feature is available //! queries the features of the driver, returns true if feature is available
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const _IRR_OVERRIDE_; virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const _IRR_OVERRIDE_;
//! Create render target.
virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_;
//! sets transformation //! sets transformation
virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) _IRR_OVERRIDE_; virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) _IRR_OVERRIDE_;
//! sets a material //! sets a material
virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_; virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_;
virtual bool setRenderTarget(video::ITexture* texture, bool clearBackBuffer, //! set a render target
bool clearZBuffer, SColor color, video::ITexture* depthStencil) _IRR_OVERRIDE_; virtual bool setRenderTarget(IRenderTarget* target, core::array<u32> activeTextureID, bool clearBackBuffer,
bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor) _IRR_OVERRIDE_;
//! sets a viewport //! sets a viewport
virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_; virtual void setViewPort(const core::rect<s32>& area) _IRR_OVERRIDE_;
...@@ -132,6 +136,9 @@ namespace video ...@@ -132,6 +136,9 @@ namespace video
virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size, virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_; 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. //! Clears the DepthBuffer.
virtual void clearZBuffer() _IRR_OVERRIDE_; virtual void clearZBuffer() _IRR_OVERRIDE_;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#ifdef _IRR_COMPILE_WITH_SOFTWARE_ #ifdef _IRR_COMPILE_WITH_SOFTWARE_
#include "CSoftwareTexture.h" #include "CSoftwareTexture.h"
#include "CSoftwareDriver.h"
#include "os.h" #include "os.h"
namespace irr namespace irr
...@@ -119,6 +120,54 @@ void CSoftwareTexture::regenerateMipMapLevels(void* mipmapData) ...@@ -119,6 +120,54 @@ void CSoftwareTexture::regenerateMipMapLevels(void* mipmapData)
} }
/* Software Render Target */
CSoftwareRenderTarget::CSoftwareRenderTarget(CSoftwareDriver* driver) : Driver(driver)
{
DriverType = EDT_SOFTWARE;
Texture.set_used(1);
Texture[0] = 0;
}
CSoftwareRenderTarget::~CSoftwareRenderTarget()
{
if (Texture[0])
Texture[0]->drop();
}
void CSoftwareRenderTarget::setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil)
{
if (Texture != texture)
{
if (Texture[0])
Texture[0]->drop();
bool textureDetected = false;
for (u32 i = 0; i < texture.size(); ++i)
{
if (texture[i] && texture[i]->getDriverType() == EDT_SOFTWARE)
{
Texture[0] = texture[i];
Texture[0]->grab();
textureDetected = true;
break;
}
}
if (!textureDetected)
Texture[0] = 0;
}
}
ITexture* CSoftwareRenderTarget::getTexture() const
{
return Texture[0];
}
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define __C_SOFTWARE_TEXTURE_H_INCLUDED__ #define __C_SOFTWARE_TEXTURE_H_INCLUDED__
#include "ITexture.h" #include "ITexture.h"
#include "IRenderTarget.h"
#include "CImage.h" #include "CImage.h"
namespace irr namespace irr
...@@ -13,6 +14,8 @@ namespace irr ...@@ -13,6 +14,8 @@ namespace irr
namespace video namespace video
{ {
class CSoftwareDriver;
/*! /*!
interface for a Video Driver dependent Texture. interface for a Video Driver dependent Texture.
*/ */
...@@ -48,6 +51,23 @@ private: ...@@ -48,6 +51,23 @@ private:
CImage* Texture; CImage* Texture;
}; };
/*!
interface for a Video Driver dependent render target.
*/
class CSoftwareRenderTarget : public IRenderTarget
{
public:
CSoftwareRenderTarget(CSoftwareDriver* driver);
virtual ~CSoftwareRenderTarget();
virtual void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil) _IRR_OVERRIDE_;
ITexture* getTexture() const;
protected:
CSoftwareDriver* Driver;
};
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "SoftwareDriver2_compile_config.h" #include "SoftwareDriver2_compile_config.h"
#include "SoftwareDriver2_helper.h" #include "SoftwareDriver2_helper.h"
#include "CSoftwareTexture2.h" #include "CSoftwareTexture2.h"
#include "CSoftwareDriver2.h"
#include "os.h" #include "os.h"
namespace irr namespace irr
...@@ -172,6 +173,54 @@ void CSoftwareTexture2::regenerateMipMapLevels(void* mipmapData) ...@@ -172,6 +173,54 @@ void CSoftwareTexture2::regenerateMipMapLevels(void* mipmapData)
} }
/* Software Render Target 2 */
CSoftwareRenderTarget2::CSoftwareRenderTarget2(CBurningVideoDriver* driver) : Driver(driver)
{
DriverType = EDT_BURNINGSVIDEO;
Texture.set_used(1);
Texture[0] = 0;
}
CSoftwareRenderTarget2::~CSoftwareRenderTarget2()
{
if (Texture[0])
Texture[0]->drop();
}
void CSoftwareRenderTarget2::setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil)
{
if (Texture != texture)
{
if (Texture[0])
Texture[0]->drop();
bool textureDetected = false;
for (u32 i = 0; i < texture.size(); ++i)
{
if (texture[i] && texture[i]->getDriverType() == EDT_BURNINGSVIDEO)
{
Texture[0] = texture[i];
Texture[0]->grab();
textureDetected = true;
break;
}
}
if (!textureDetected)
Texture[0] = 0;
}
}
ITexture* CSoftwareRenderTarget2::getTexture() const
{
return Texture[0];
}
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "SoftwareDriver2_compile_config.h" #include "SoftwareDriver2_compile_config.h"
#include "ITexture.h" #include "ITexture.h"
#include "IRenderTarget.h"
#include "CImage.h" #include "CImage.h"
namespace irr namespace irr
...@@ -15,6 +16,8 @@ namespace irr ...@@ -15,6 +16,8 @@ namespace irr
namespace video namespace video
{ {
class CBurningVideoDriver;
/*! /*!
interface for a Video Driver dependent Texture. interface for a Video Driver dependent Texture.
*/ */
...@@ -87,6 +90,23 @@ private: ...@@ -87,6 +90,23 @@ private:
ECOLOR_FORMAT OriginalFormat; ECOLOR_FORMAT OriginalFormat;
}; };
/*!
interface for a Video Driver dependent render target.
*/
class CSoftwareRenderTarget2 : public IRenderTarget
{
public:
CSoftwareRenderTarget2(CBurningVideoDriver* driver);
virtual ~CSoftwareRenderTarget2();
virtual void setTexture(const core::array<ITexture*>& texture, ITexture* depthStencil) _IRR_OVERRIDE_;
ITexture* getTexture() const;
protected:
CBurningVideoDriver* Driver;
};
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
......
...@@ -519,6 +519,7 @@ ...@@ -519,6 +519,7 @@
<Unit filename="..\..\include\IQ3Shader.h" /> <Unit filename="..\..\include\IQ3Shader.h" />
<Unit filename="..\..\include\IReadFile.h" /> <Unit filename="..\..\include\IReadFile.h" />
<Unit filename="..\..\include\IReferenceCounted.h" /> <Unit filename="..\..\include\IReferenceCounted.h" />
<Unit filename="..\..\include\IRenderTarget.h" />
<Unit filename="..\..\include\ISceneCollisionManager.h" /> <Unit filename="..\..\include\ISceneCollisionManager.h" />
<Unit filename="..\..\include\ISceneLoader.h" /> <Unit filename="..\..\include\ISceneLoader.h" />
<Unit filename="..\..\include\ISceneManager.h" /> <Unit filename="..\..\include\ISceneManager.h" />
...@@ -642,6 +643,8 @@ ...@@ -642,6 +643,8 @@
<Unit filename="CD3D9NormalMapRenderer.h" /> <Unit filename="CD3D9NormalMapRenderer.h" />
<Unit filename="CD3D9ParallaxMapRenderer.cpp" /> <Unit filename="CD3D9ParallaxMapRenderer.cpp" />
<Unit filename="CD3D9ParallaxMapRenderer.h" /> <Unit filename="CD3D9ParallaxMapRenderer.h" />
<Unit filename="CD3D9RenderTarget.cpp" />
<Unit filename="CD3D9RenderTarget.h" />
<Unit filename="CD3D9ShaderMaterialRenderer.cpp" /> <Unit filename="CD3D9ShaderMaterialRenderer.cpp" />
<Unit filename="CD3D9ShaderMaterialRenderer.h" /> <Unit filename="CD3D9ShaderMaterialRenderer.h" />
<Unit filename="CD3D9Texture.cpp" /> <Unit filename="CD3D9Texture.cpp" />
...@@ -834,6 +837,8 @@ ...@@ -834,6 +837,8 @@
<Unit filename="COpenGLNormalMapRenderer.h" /> <Unit filename="COpenGLNormalMapRenderer.h" />
<Unit filename="COpenGLParallaxMapRenderer.cpp" /> <Unit filename="COpenGLParallaxMapRenderer.cpp" />
<Unit filename="COpenGLParallaxMapRenderer.h" /> <Unit filename="COpenGLParallaxMapRenderer.h" />
<Unit filename="COpenGLRenderTarget.cpp" />
<Unit filename="COpenGLRenderTarget.h" />
<Unit filename="COpenGLSLMaterialRenderer.cpp" /> <Unit filename="COpenGLSLMaterialRenderer.cpp" />
<Unit filename="COpenGLSLMaterialRenderer.h" /> <Unit filename="COpenGLSLMaterialRenderer.h" />
<Unit filename="COpenGLShaderMaterialRenderer.cpp" /> <Unit filename="COpenGLShaderMaterialRenderer.cpp" />
......
...@@ -840,6 +840,7 @@ ...@@ -840,6 +840,7 @@
<ClInclude Include="..\..\include\IProfiler.h" /> <ClInclude Include="..\..\include\IProfiler.h" />
<ClInclude Include="..\..\include\IRandomizer.h" /> <ClInclude Include="..\..\include\IRandomizer.h" />
<ClInclude Include="..\..\include\IReferenceCounted.h" /> <ClInclude Include="..\..\include\IReferenceCounted.h" />
<ClInclude Include="..\..\include\IRenderTarget.h" />
<ClInclude Include="..\..\include\IrrCompileConfig.h" /> <ClInclude Include="..\..\include\IrrCompileConfig.h" />
<ClInclude Include="..\..\include\irrlicht.h" /> <ClInclude Include="..\..\include\irrlicht.h" />
<ClInclude Include="..\..\include\IrrlichtDevice.h" /> <ClInclude Include="..\..\include\IrrlichtDevice.h" />
...@@ -993,11 +994,13 @@ ...@@ -993,11 +994,13 @@
<ClInclude Include="..\..\include\IGUIToolbar.h" /> <ClInclude Include="..\..\include\IGUIToolbar.h" />
<ClInclude Include="..\..\include\IGUITreeView.h" /> <ClInclude Include="..\..\include\IGUITreeView.h" />
<ClInclude Include="..\..\include\IGUIWindow.h" /> <ClInclude Include="..\..\include\IGUIWindow.h" />
<ClInclude Include="CD3D9RenderTarget.h" />
<ClInclude Include="CDefaultSceneNodeAnimatorFactory.h" /> <ClInclude Include="CDefaultSceneNodeAnimatorFactory.h" />
<ClInclude Include="CDefaultSceneNodeFactory.h" /> <ClInclude Include="CDefaultSceneNodeFactory.h" />
<ClInclude Include="CGeometryCreator.h" /> <ClInclude Include="CGeometryCreator.h" />
<ClInclude Include="CMeshCache.h" /> <ClInclude Include="CMeshCache.h" />
<ClInclude Include="CMeshManipulator.h" /> <ClInclude Include="CMeshManipulator.h" />
<ClInclude Include="COpenGLRenderTarget.h" />
<ClInclude Include="CProfiler.h" /> <ClInclude Include="CProfiler.h" />
<ClInclude Include="CSceneManager.h" /> <ClInclude Include="CSceneManager.h" />
<ClInclude Include="Octree.h" /> <ClInclude Include="Octree.h" />
...@@ -1237,11 +1240,13 @@ ...@@ -1237,11 +1240,13 @@
<None Include="..\..\readme.txt" /> <None Include="..\..\readme.txt" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="CD3D9RenderTarget.cpp" />
<ClCompile Include="CDefaultSceneNodeAnimatorFactory.cpp" /> <ClCompile Include="CDefaultSceneNodeAnimatorFactory.cpp" />
<ClCompile Include="CDefaultSceneNodeFactory.cpp" /> <ClCompile Include="CDefaultSceneNodeFactory.cpp" />
<ClCompile Include="CGeometryCreator.cpp" /> <ClCompile Include="CGeometryCreator.cpp" />
<ClCompile Include="CMeshCache.cpp" /> <ClCompile Include="CMeshCache.cpp" />
<ClCompile Include="CMeshManipulator.cpp" /> <ClCompile Include="CMeshManipulator.cpp" />
<ClCompile Include="COpenGLRenderTarget.cpp" />
<ClCompile Include="CSceneManager.cpp" /> <ClCompile Include="CSceneManager.cpp" />
<ClCompile Include="C3DSMeshFileLoader.cpp" /> <ClCompile Include="C3DSMeshFileLoader.cpp" />
<ClCompile Include="CSMFMeshFileLoader.cpp" /> <ClCompile Include="CSMFMeshFileLoader.cpp" />
...@@ -1400,7 +1405,7 @@ ...@@ -1400,7 +1405,7 @@
<ClCompile Include="Irrlicht.cpp" /> <ClCompile Include="Irrlicht.cpp" />
<ClCompile Include="leakHunter.cpp" /> <ClCompile Include="leakHunter.cpp" />
<ClCompile Include="os.cpp" /> <ClCompile Include="os.cpp" />
<ClCompile Include="utf8.cpp" /> <ClCompile Include="utf8.cpp" />
<ClCompile Include="CProfiler.cpp" /> <ClCompile Include="CProfiler.cpp" />
<ClCompile Include="lzma\LzmaDec.c" /> <ClCompile Include="lzma\LzmaDec.c" />
<ClCompile Include="zlib\adler32.c" /> <ClCompile Include="zlib\adler32.c" />
......
...@@ -1300,6 +1300,15 @@ ...@@ -1300,6 +1300,15 @@
<ClInclude Include="CProfiler.h"> <ClInclude Include="CProfiler.h">
<Filter>Irrlicht\irr</Filter> <Filter>Irrlicht\irr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IRenderTarget.h">
<Filter>include\video</Filter>
</ClInclude>
<ClInclude Include="CD3D9RenderTarget.h">
<Filter>Irrlicht\video\Direct3D9</Filter>
</ClInclude>
<ClInclude Include="COpenGLRenderTarget.h">
<Filter>Irrlicht\video\OpenGL</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\..\changes.txt"> <None Include="..\..\changes.txt">
...@@ -2222,6 +2231,12 @@ ...@@ -2222,6 +2231,12 @@
<ClCompile Include="leakHunter.cpp"> <ClCompile Include="leakHunter.cpp">
<Filter>Irrlicht\irr</Filter> <Filter>Irrlicht\irr</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CD3D9RenderTarget.cpp">
<Filter>Irrlicht\video\Direct3D9</Filter>
</ClCompile>
<ClCompile Include="COpenGLRenderTarget.cpp">
<Filter>Irrlicht\video\OpenGL</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="Irrlicht.rc" /> <ResourceCompile Include="Irrlicht.rc" />
......
...@@ -842,14 +842,15 @@ ...@@ -842,14 +842,15 @@
<ClInclude Include="..\..\include\EMaterialFlags.h" /> <ClInclude Include="..\..\include\EMaterialFlags.h" />
<ClInclude Include="..\..\include\IAnimatedMeshMD3.h" /> <ClInclude Include="..\..\include\IAnimatedMeshMD3.h" />
<ClInclude Include="..\..\include\IEventReceiver.h" /> <ClInclude Include="..\..\include\IEventReceiver.h" />
<ClInclude Include="..\..\include\IProfiler.h" /> <ClInclude Include="..\..\include\IProfiler.h" />
<ClInclude Include="..\..\include\ILogger.h" /> <ClInclude Include="..\..\include\ILogger.h" />
<ClInclude Include="..\..\include\IOSOperator.h" /> <ClInclude Include="..\..\include\IOSOperator.h" />
<ClInclude Include="..\..\include\IRandomizer.h" /> <ClInclude Include="..\..\include\IRandomizer.h" />
<ClInclude Include="..\..\include\IReferenceCounted.h" /> <ClInclude Include="..\..\include\IReferenceCounted.h" />
<ClInclude Include="..\..\include\IRenderTarget.h" />
<ClInclude Include="..\..\include\IrrCompileConfig.h" /> <ClInclude Include="..\..\include\IrrCompileConfig.h" />
<ClInclude Include="..\..\include\irrlicht.h" /> <ClInclude Include="..\..\include\irrlicht.h" />
<ClInclude Include="..\..\include\leakHunter.h" /> <ClInclude Include="..\..\include\leakHunter.h" />
<ClInclude Include="..\..\include\IrrlichtDevice.h" /> <ClInclude Include="..\..\include\IrrlichtDevice.h" />
<ClInclude Include="..\..\include\irrTypes.h" /> <ClInclude Include="..\..\include\irrTypes.h" />
<ClInclude Include="..\..\include\ITimer.h" /> <ClInclude Include="..\..\include\ITimer.h" />
...@@ -927,7 +928,7 @@ ...@@ -927,7 +928,7 @@
<ClInclude Include="..\..\include\IMeshLoader.h" /> <ClInclude Include="..\..\include\IMeshLoader.h" />
<ClInclude Include="..\..\include\IMeshManipulator.h" /> <ClInclude Include="..\..\include\IMeshManipulator.h" />
<ClInclude Include="..\..\include\IMeshSceneNode.h" /> <ClInclude Include="..\..\include\IMeshSceneNode.h" />
<ClInclude Include="..\..\include\IMeshTextureLoader.h" /> <ClInclude Include="..\..\include\IMeshTextureLoader.h" />
<ClInclude Include="..\..\include\IMeshWriter.h" /> <ClInclude Include="..\..\include\IMeshWriter.h" />
<ClInclude Include="..\..\include\IMetaTriangleSelector.h" /> <ClInclude Include="..\..\include\IMetaTriangleSelector.h" />
<ClInclude Include="..\..\include\IParticleAffector.h" /> <ClInclude Include="..\..\include\IParticleAffector.h" />
...@@ -973,7 +974,7 @@ ...@@ -973,7 +974,7 @@
<ClInclude Include="..\..\include\EGUIAlignment.h" /> <ClInclude Include="..\..\include\EGUIAlignment.h" />
<ClInclude Include="..\..\include\EGUIElementTypes.h" /> <ClInclude Include="..\..\include\EGUIElementTypes.h" />
<ClInclude Include="..\..\include\EMessageBoxFlags.h" /> <ClInclude Include="..\..\include\EMessageBoxFlags.h" />
<ClInclude Include="..\..\include\EFocusFlags.h" /> <ClInclude Include="..\..\include\EFocusFlags.h" />
<ClInclude Include="..\..\include\ICursorControl.h" /> <ClInclude Include="..\..\include\ICursorControl.h" />
<ClInclude Include="..\..\include\IGUIButton.h" /> <ClInclude Include="..\..\include\IGUIButton.h" />
<ClInclude Include="..\..\include\IGUICheckbox.h" /> <ClInclude Include="..\..\include\IGUICheckbox.h" />
...@@ -990,7 +991,7 @@ ...@@ -990,7 +991,7 @@
<ClInclude Include="..\..\include\IGUIInOutFader.h" /> <ClInclude Include="..\..\include\IGUIInOutFader.h" />
<ClInclude Include="..\..\include\IGUIListBox.h" /> <ClInclude Include="..\..\include\IGUIListBox.h" />
<ClInclude Include="..\..\include\IGUIMeshViewer.h" /> <ClInclude Include="..\..\include\IGUIMeshViewer.h" />
<ClInclude Include="..\..\include\IGUIProfiler.h" /> <ClInclude Include="..\..\include\IGUIProfiler.h" />
<ClInclude Include="..\..\include\IGUIScrollBar.h" /> <ClInclude Include="..\..\include\IGUIScrollBar.h" />
<ClInclude Include="..\..\include\IGUISkin.h" /> <ClInclude Include="..\..\include\IGUISkin.h" />
<ClInclude Include="..\..\include\IGUISpinBox.h" /> <ClInclude Include="..\..\include\IGUISpinBox.h" />
...@@ -1000,11 +1001,13 @@ ...@@ -1000,11 +1001,13 @@
<ClInclude Include="..\..\include\IGUIToolbar.h" /> <ClInclude Include="..\..\include\IGUIToolbar.h" />
<ClInclude Include="..\..\include\IGUITreeView.h" /> <ClInclude Include="..\..\include\IGUITreeView.h" />
<ClInclude Include="..\..\include\IGUIWindow.h" /> <ClInclude Include="..\..\include\IGUIWindow.h" />
<ClInclude Include="CD3D9RenderTarget.h" />
<ClInclude Include="CDefaultSceneNodeAnimatorFactory.h" /> <ClInclude Include="CDefaultSceneNodeAnimatorFactory.h" />
<ClInclude Include="CDefaultSceneNodeFactory.h" /> <ClInclude Include="CDefaultSceneNodeFactory.h" />
<ClInclude Include="CGeometryCreator.h" /> <ClInclude Include="CGeometryCreator.h" />
<ClInclude Include="CMeshCache.h" /> <ClInclude Include="CMeshCache.h" />
<ClInclude Include="CMeshManipulator.h" /> <ClInclude Include="CMeshManipulator.h" />
<ClInclude Include="COpenGLRenderTarget.h" />
<ClInclude Include="CSceneManager.h" /> <ClInclude Include="CSceneManager.h" />
<ClInclude Include="Octree.h" /> <ClInclude Include="Octree.h" />
<ClInclude Include="CSMFMeshFileLoader.h" /> <ClInclude Include="CSMFMeshFileLoader.h" />
...@@ -1022,7 +1025,7 @@ ...@@ -1022,7 +1025,7 @@
<ClInclude Include="CLWOMeshFileLoader.h" /> <ClInclude Include="CLWOMeshFileLoader.h" />
<ClInclude Include="CMD2MeshFileLoader.h" /> <ClInclude Include="CMD2MeshFileLoader.h" />
<ClInclude Include="CMD3MeshFileLoader.h" /> <ClInclude Include="CMD3MeshFileLoader.h" />
<ClInclude Include="CMeshTextureLoader.h" /> <ClInclude Include="CMeshTextureLoader.h" />
<ClInclude Include="CMS3DMeshFileLoader.h" /> <ClInclude Include="CMS3DMeshFileLoader.h" />
<ClInclude Include="CMY3DHelper.h" /> <ClInclude Include="CMY3DHelper.h" />
<ClInclude Include="CMY3DMeshFileLoader.h" /> <ClInclude Include="CMY3DMeshFileLoader.h" />
...@@ -1149,8 +1152,8 @@ ...@@ -1149,8 +1152,8 @@
<ClInclude Include="COSOperator.h" /> <ClInclude Include="COSOperator.h" />
<ClInclude Include="CTimer.h" /> <ClInclude Include="CTimer.h" />
<ClInclude Include="os.h" /> <ClInclude Include="os.h" />
<ClInclude Include="CProfiler.h" /> <ClInclude Include="CProfiler.h" />
<ClInclude Include="EProfileIDs.h" /> <ClInclude Include="EProfileIDs.h" />
<ClInclude Include="lzma\LzmaDec.h" /> <ClInclude Include="lzma\LzmaDec.h" />
<ClInclude Include="lzma\Types.h" /> <ClInclude Include="lzma\Types.h" />
<ClInclude Include="zlib\crc32.h" /> <ClInclude Include="zlib\crc32.h" />
...@@ -1228,7 +1231,7 @@ ...@@ -1228,7 +1231,7 @@
<ClInclude Include="CGUIMessageBox.h" /> <ClInclude Include="CGUIMessageBox.h" />
<ClInclude Include="CGUIModalScreen.h" /> <ClInclude Include="CGUIModalScreen.h" />
<ClInclude Include="CGUIProfiler.h" /> <ClInclude Include="CGUIProfiler.h" />
<ClInclude Include="CGUIScrollBar.h" /> <ClInclude Include="CGUIScrollBar.h" />
<ClInclude Include="CGUISkin.h" /> <ClInclude Include="CGUISkin.h" />
<ClInclude Include="CGUISpinBox.h" /> <ClInclude Include="CGUISpinBox.h" />
<ClInclude Include="CGUISpriteBank.h" /> <ClInclude Include="CGUISpriteBank.h" />
...@@ -1244,11 +1247,13 @@ ...@@ -1244,11 +1247,13 @@
<None Include="..\..\readme.txt" /> <None Include="..\..\readme.txt" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="CD3D9RenderTarget.cpp" />
<ClCompile Include="CDefaultSceneNodeAnimatorFactory.cpp" /> <ClCompile Include="CDefaultSceneNodeAnimatorFactory.cpp" />
<ClCompile Include="CDefaultSceneNodeFactory.cpp" /> <ClCompile Include="CDefaultSceneNodeFactory.cpp" />
<ClCompile Include="CGeometryCreator.cpp" /> <ClCompile Include="CGeometryCreator.cpp" />
<ClCompile Include="CMeshCache.cpp" /> <ClCompile Include="CMeshCache.cpp" />
<ClCompile Include="CMeshManipulator.cpp" /> <ClCompile Include="CMeshManipulator.cpp" />
<ClCompile Include="COpenGLRenderTarget.cpp" />
<ClCompile Include="CSceneManager.cpp" /> <ClCompile Include="CSceneManager.cpp" />
<ClCompile Include="C3DSMeshFileLoader.cpp" /> <ClCompile Include="C3DSMeshFileLoader.cpp" />
<ClCompile Include="CSMFMeshFileLoader.cpp" /> <ClCompile Include="CSMFMeshFileLoader.cpp" />
...@@ -1265,7 +1270,7 @@ ...@@ -1265,7 +1270,7 @@
<ClCompile Include="CLWOMeshFileLoader.cpp" /> <ClCompile Include="CLWOMeshFileLoader.cpp" />
<ClCompile Include="CMD2MeshFileLoader.cpp" /> <ClCompile Include="CMD2MeshFileLoader.cpp" />
<ClCompile Include="CMD3MeshFileLoader.cpp" /> <ClCompile Include="CMD3MeshFileLoader.cpp" />
<ClCompile Include="CMeshTextureLoader.cpp" /> <ClCompile Include="CMeshTextureLoader.cpp" />
<ClCompile Include="CMS3DMeshFileLoader.cpp" /> <ClCompile Include="CMS3DMeshFileLoader.cpp" />
<ClCompile Include="CMY3DMeshFileLoader.cpp" /> <ClCompile Include="CMY3DMeshFileLoader.cpp" />
<ClCompile Include="COBJMeshFileLoader.cpp" /> <ClCompile Include="COBJMeshFileLoader.cpp" />
...@@ -1407,8 +1412,8 @@ ...@@ -1407,8 +1412,8 @@
<ClCompile Include="Irrlicht.cpp" /> <ClCompile Include="Irrlicht.cpp" />
<ClCompile Include="os.cpp" /> <ClCompile Include="os.cpp" />
<ClCompile Include="utf8.cpp" /> <ClCompile Include="utf8.cpp" />
<ClCompile Include="CProfiler.cpp" /> <ClCompile Include="CProfiler.cpp" />
<ClCompile Include="leakHunter.cpp" /> <ClCompile Include="leakHunter.cpp" />
<ClCompile Include="lzma\LzmaDec.c" /> <ClCompile Include="lzma\LzmaDec.c" />
<ClCompile Include="zlib\adler32.c" /> <ClCompile Include="zlib\adler32.c" />
<ClCompile Include="zlib\compress.c" /> <ClCompile Include="zlib\compress.c" />
...@@ -1538,7 +1543,7 @@ ...@@ -1538,7 +1543,7 @@
<ClCompile Include="CGUIMessageBox.cpp" /> <ClCompile Include="CGUIMessageBox.cpp" />
<ClCompile Include="CGUIModalScreen.cpp" /> <ClCompile Include="CGUIModalScreen.cpp" />
<ClCompile Include="CGUIProfiler.cpp" /> <ClCompile Include="CGUIProfiler.cpp" />
<ClCompile Include="CGUIScrollBar.cpp" /> <ClCompile Include="CGUIScrollBar.cpp" />
<ClCompile Include="CGUISkin.cpp" /> <ClCompile Include="CGUISkin.cpp" />
<ClCompile Include="CGUISpinBox.cpp" /> <ClCompile Include="CGUISpinBox.cpp" />
<ClCompile Include="CGUISpriteBank.cpp" /> <ClCompile Include="CGUISpriteBank.cpp" />
...@@ -1555,4 +1560,4 @@ ...@@ -1555,4 +1560,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>
\ No newline at end of file
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
<ClInclude Include="..\..\include\IEventReceiver.h"> <ClInclude Include="..\..\include\IEventReceiver.h">
<Filter>include</Filter> <Filter>include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IProfiler.h"> <ClInclude Include="..\..\include\IProfiler.h">
<Filter>include</Filter> <Filter>include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\ILogger.h"> <ClInclude Include="..\..\include\ILogger.h">
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
<ClInclude Include="..\..\include\irrlicht.h"> <ClInclude Include="..\..\include\irrlicht.h">
<Filter>include</Filter> <Filter>include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\leakHunter.h"> <ClInclude Include="..\..\include\leakHunter.h">
<Filter>include</Filter> <Filter>include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IrrlichtDevice.h"> <ClInclude Include="..\..\include\IrrlichtDevice.h">
...@@ -357,7 +357,7 @@ ...@@ -357,7 +357,7 @@
<ClInclude Include="..\..\include\IMeshSceneNode.h"> <ClInclude Include="..\..\include\IMeshSceneNode.h">
<Filter>include\scene</Filter> <Filter>include\scene</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IMeshTextureLoader.h"> <ClInclude Include="..\..\include\IMeshTextureLoader.h">
<Filter>include\scene</Filter> <Filter>include\scene</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IMeshWriter.h"> <ClInclude Include="..\..\include\IMeshWriter.h">
...@@ -492,7 +492,7 @@ ...@@ -492,7 +492,7 @@
<ClInclude Include="..\..\include\EMessageBoxFlags.h"> <ClInclude Include="..\..\include\EMessageBoxFlags.h">
<Filter>include\gui</Filter> <Filter>include\gui</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\EFocusFlags.h"> <ClInclude Include="..\..\include\EFocusFlags.h">
<Filter>include\gui</Filter> <Filter>include\gui</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\ICursorControl.h"> <ClInclude Include="..\..\include\ICursorControl.h">
...@@ -543,7 +543,7 @@ ...@@ -543,7 +543,7 @@
<ClInclude Include="..\..\include\IGUIMeshViewer.h"> <ClInclude Include="..\..\include\IGUIMeshViewer.h">
<Filter>include\gui</Filter> <Filter>include\gui</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IGUIProfiler.h"> <ClInclude Include="..\..\include\IGUIProfiler.h">
<Filter>include\gui</Filter> <Filter>include\gui</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IGUIScrollBar.h"> <ClInclude Include="..\..\include\IGUIScrollBar.h">
...@@ -636,7 +636,7 @@ ...@@ -636,7 +636,7 @@
<ClInclude Include="CMD3MeshFileLoader.h"> <ClInclude Include="CMD3MeshFileLoader.h">
<Filter>Irrlicht\scene\loaders</Filter> <Filter>Irrlicht\scene\loaders</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="CMeshTextureLoader.h"> <ClInclude Include="CMeshTextureLoader.h">
<Filter>Irrlicht\scene\loaders</Filter> <Filter>Irrlicht\scene\loaders</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="CMS3DMeshFileLoader.h"> <ClInclude Include="CMS3DMeshFileLoader.h">
...@@ -1011,10 +1011,10 @@ ...@@ -1011,10 +1011,10 @@
<ClInclude Include="os.h"> <ClInclude Include="os.h">
<Filter>Irrlicht\irr</Filter> <Filter>Irrlicht\irr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="CProfiler.h"> <ClInclude Include="CProfiler.h">
<Filter>Irrlicht\irr</Filter> <Filter>Irrlicht\irr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="EProfileIDs.h"> <ClInclude Include="EProfileIDs.h">
<Filter>Irrlicht\irr</Filter> <Filter>Irrlicht\irr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="lzma\LzmaDec.h"> <ClInclude Include="lzma\LzmaDec.h">
...@@ -1248,7 +1248,7 @@ ...@@ -1248,7 +1248,7 @@
<ClInclude Include="CGUIProfiler.h"> <ClInclude Include="CGUIProfiler.h">
<Filter>Irrlicht\gui</Filter> <Filter>Irrlicht\gui</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="CGUIScrollBar.h"> <ClInclude Include="CGUIScrollBar.h">
<Filter>Irrlicht\gui</Filter> <Filter>Irrlicht\gui</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="CGUISkin.h"> <ClInclude Include="CGUISkin.h">
...@@ -1300,6 +1300,15 @@ ...@@ -1300,6 +1300,15 @@
<ClInclude Include="..\..\include\EMaterialFlags.h"> <ClInclude Include="..\..\include\EMaterialFlags.h">
<Filter>include\video</Filter> <Filter>include\video</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IRenderTarget.h">
<Filter>include\video</Filter>
</ClInclude>
<ClInclude Include="CD3D9RenderTarget.h">
<Filter>Irrlicht\video\Direct3D9</Filter>
</ClInclude>
<ClInclude Include="COpenGLRenderTarget.h">
<Filter>Irrlicht\video\OpenGL</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\..\changes.txt"> <None Include="..\..\changes.txt">
...@@ -1370,7 +1379,7 @@ ...@@ -1370,7 +1379,7 @@
<ClCompile Include="CMD3MeshFileLoader.cpp"> <ClCompile Include="CMD3MeshFileLoader.cpp">
<Filter>Irrlicht\scene\loaders</Filter> <Filter>Irrlicht\scene\loaders</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CMeshTextureLoader.cpp"> <ClCompile Include="CMeshTextureLoader.cpp">
<Filter>Irrlicht\scene\loaders</Filter> <Filter>Irrlicht\scene\loaders</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CMS3DMeshFileLoader.cpp"> <ClCompile Include="CMS3DMeshFileLoader.cpp">
...@@ -1793,10 +1802,10 @@ ...@@ -1793,10 +1802,10 @@
<ClCompile Include="utf8.cpp"> <ClCompile Include="utf8.cpp">
<Filter>Irrlicht\irr</Filter> <Filter>Irrlicht\irr</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CProfiler.cpp"> <ClCompile Include="CProfiler.cpp">
<Filter>Irrlicht\irr</Filter> <Filter>Irrlicht\irr</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="leakHunter.cpp"> <ClCompile Include="leakHunter.cpp">
<Filter>Irrlicht\irr</Filter> <Filter>Irrlicht\irr</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="lzma\LzmaDec.c"> <ClCompile Include="lzma\LzmaDec.c">
...@@ -2186,7 +2195,7 @@ ...@@ -2186,7 +2195,7 @@
<ClCompile Include="CGUIProfiler.cpp"> <ClCompile Include="CGUIProfiler.cpp">
<Filter>Irrlicht\gui</Filter> <Filter>Irrlicht\gui</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CGUIScrollBar.cpp"> <ClCompile Include="CGUIScrollBar.cpp">
<Filter>Irrlicht\gui</Filter> <Filter>Irrlicht\gui</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CGUISkin.cpp"> <ClCompile Include="CGUISkin.cpp">
...@@ -2222,6 +2231,12 @@ ...@@ -2222,6 +2231,12 @@
<ClCompile Include="CSMFMeshFileLoader.cpp"> <ClCompile Include="CSMFMeshFileLoader.cpp">
<Filter>Irrlicht\scene\loaders</Filter> <Filter>Irrlicht\scene\loaders</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CD3D9RenderTarget.cpp">
<Filter>Irrlicht\video\Direct3D9</Filter>
</ClCompile>
<ClCompile Include="COpenGLRenderTarget.cpp">
<Filter>Irrlicht\video\OpenGL</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="Irrlicht.rc" /> <ResourceCompile Include="Irrlicht.rc" />
......
...@@ -847,6 +847,7 @@ ...@@ -847,6 +847,7 @@
<ClInclude Include="..\..\include\IOSOperator.h" /> <ClInclude Include="..\..\include\IOSOperator.h" />
<ClInclude Include="..\..\include\IRandomizer.h" /> <ClInclude Include="..\..\include\IRandomizer.h" />
<ClInclude Include="..\..\include\IReferenceCounted.h" /> <ClInclude Include="..\..\include\IReferenceCounted.h" />
<ClInclude Include="..\..\include\IRenderTarget.h" />
<ClInclude Include="..\..\include\IrrCompileConfig.h" /> <ClInclude Include="..\..\include\IrrCompileConfig.h" />
<ClInclude Include="..\..\include\irrlicht.h" /> <ClInclude Include="..\..\include\irrlicht.h" />
<ClInclude Include="..\..\include\leakHunter.h" /> <ClInclude Include="..\..\include\leakHunter.h" />
...@@ -1000,11 +1001,13 @@ ...@@ -1000,11 +1001,13 @@
<ClInclude Include="..\..\include\IGUIToolbar.h" /> <ClInclude Include="..\..\include\IGUIToolbar.h" />
<ClInclude Include="..\..\include\IGUITreeView.h" /> <ClInclude Include="..\..\include\IGUITreeView.h" />
<ClInclude Include="..\..\include\IGUIWindow.h" /> <ClInclude Include="..\..\include\IGUIWindow.h" />
<ClInclude Include="CD3D9RenderTarget.h" />
<ClInclude Include="CDefaultSceneNodeAnimatorFactory.h" /> <ClInclude Include="CDefaultSceneNodeAnimatorFactory.h" />
<ClInclude Include="CDefaultSceneNodeFactory.h" /> <ClInclude Include="CDefaultSceneNodeFactory.h" />
<ClInclude Include="CGeometryCreator.h" /> <ClInclude Include="CGeometryCreator.h" />
<ClInclude Include="CMeshCache.h" /> <ClInclude Include="CMeshCache.h" />
<ClInclude Include="CMeshManipulator.h" /> <ClInclude Include="CMeshManipulator.h" />
<ClInclude Include="COpenGLRenderTarget.h" />
<ClInclude Include="CSceneManager.h" /> <ClInclude Include="CSceneManager.h" />
<ClInclude Include="Octree.h" /> <ClInclude Include="Octree.h" />
<ClInclude Include="CSMFMeshFileLoader.h" /> <ClInclude Include="CSMFMeshFileLoader.h" />
...@@ -1244,11 +1247,13 @@ ...@@ -1244,11 +1247,13 @@
<None Include="..\..\readme.txt" /> <None Include="..\..\readme.txt" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="CD3D9RenderTarget.cpp" />
<ClCompile Include="CDefaultSceneNodeAnimatorFactory.cpp" /> <ClCompile Include="CDefaultSceneNodeAnimatorFactory.cpp" />
<ClCompile Include="CDefaultSceneNodeFactory.cpp" /> <ClCompile Include="CDefaultSceneNodeFactory.cpp" />
<ClCompile Include="CGeometryCreator.cpp" /> <ClCompile Include="CGeometryCreator.cpp" />
<ClCompile Include="CMeshCache.cpp" /> <ClCompile Include="CMeshCache.cpp" />
<ClCompile Include="CMeshManipulator.cpp" /> <ClCompile Include="CMeshManipulator.cpp" />
<ClCompile Include="COpenGLRenderTarget.cpp" />
<ClCompile Include="CSceneManager.cpp" /> <ClCompile Include="CSceneManager.cpp" />
<ClCompile Include="C3DSMeshFileLoader.cpp" /> <ClCompile Include="C3DSMeshFileLoader.cpp" />
<ClCompile Include="CSMFMeshFileLoader.cpp" /> <ClCompile Include="CSMFMeshFileLoader.cpp" />
......
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
<ClInclude Include="..\..\include\IEventReceiver.h"> <ClInclude Include="..\..\include\IEventReceiver.h">
<Filter>include</Filter> <Filter>include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IProfiler.h"> <ClInclude Include="..\..\include\IProfiler.h">
<Filter>include</Filter> <Filter>include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\ILogger.h"> <ClInclude Include="..\..\include\ILogger.h">
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
<ClInclude Include="..\..\include\irrlicht.h"> <ClInclude Include="..\..\include\irrlicht.h">
<Filter>include</Filter> <Filter>include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\leakHunter.h"> <ClInclude Include="..\..\include\leakHunter.h">
<Filter>include</Filter> <Filter>include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IrrlichtDevice.h"> <ClInclude Include="..\..\include\IrrlichtDevice.h">
...@@ -357,7 +357,7 @@ ...@@ -357,7 +357,7 @@
<ClInclude Include="..\..\include\IMeshSceneNode.h"> <ClInclude Include="..\..\include\IMeshSceneNode.h">
<Filter>include\scene</Filter> <Filter>include\scene</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IMeshTextureLoader.h"> <ClInclude Include="..\..\include\IMeshTextureLoader.h">
<Filter>include\scene</Filter> <Filter>include\scene</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IMeshWriter.h"> <ClInclude Include="..\..\include\IMeshWriter.h">
...@@ -492,7 +492,7 @@ ...@@ -492,7 +492,7 @@
<ClInclude Include="..\..\include\EMessageBoxFlags.h"> <ClInclude Include="..\..\include\EMessageBoxFlags.h">
<Filter>include\gui</Filter> <Filter>include\gui</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\EFocusFlags.h"> <ClInclude Include="..\..\include\EFocusFlags.h">
<Filter>include\gui</Filter> <Filter>include\gui</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\ICursorControl.h"> <ClInclude Include="..\..\include\ICursorControl.h">
...@@ -543,7 +543,7 @@ ...@@ -543,7 +543,7 @@
<ClInclude Include="..\..\include\IGUIMeshViewer.h"> <ClInclude Include="..\..\include\IGUIMeshViewer.h">
<Filter>include\gui</Filter> <Filter>include\gui</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IGUIProfiler.h"> <ClInclude Include="..\..\include\IGUIProfiler.h">
<Filter>include\gui</Filter> <Filter>include\gui</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IGUIScrollBar.h"> <ClInclude Include="..\..\include\IGUIScrollBar.h">
...@@ -636,7 +636,7 @@ ...@@ -636,7 +636,7 @@
<ClInclude Include="CMD3MeshFileLoader.h"> <ClInclude Include="CMD3MeshFileLoader.h">
<Filter>Irrlicht\scene\loaders</Filter> <Filter>Irrlicht\scene\loaders</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="CMeshTextureLoader.h"> <ClInclude Include="CMeshTextureLoader.h">
<Filter>Irrlicht\scene\loaders</Filter> <Filter>Irrlicht\scene\loaders</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="CMS3DMeshFileLoader.h"> <ClInclude Include="CMS3DMeshFileLoader.h">
...@@ -1011,10 +1011,10 @@ ...@@ -1011,10 +1011,10 @@
<ClInclude Include="os.h"> <ClInclude Include="os.h">
<Filter>Irrlicht\irr</Filter> <Filter>Irrlicht\irr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="CProfiler.h"> <ClInclude Include="CProfiler.h">
<Filter>Irrlicht\irr</Filter> <Filter>Irrlicht\irr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="EProfileIDs.h"> <ClInclude Include="EProfileIDs.h">
<Filter>Irrlicht\irr</Filter> <Filter>Irrlicht\irr</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="lzma\LzmaDec.h"> <ClInclude Include="lzma\LzmaDec.h">
...@@ -1248,7 +1248,7 @@ ...@@ -1248,7 +1248,7 @@
<ClInclude Include="CGUIProfiler.h"> <ClInclude Include="CGUIProfiler.h">
<Filter>Irrlicht\gui</Filter> <Filter>Irrlicht\gui</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="CGUIScrollBar.h"> <ClInclude Include="CGUIScrollBar.h">
<Filter>Irrlicht\gui</Filter> <Filter>Irrlicht\gui</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="CGUISkin.h"> <ClInclude Include="CGUISkin.h">
...@@ -1300,6 +1300,15 @@ ...@@ -1300,6 +1300,15 @@
<ClInclude Include="..\..\include\EMaterialFlags.h"> <ClInclude Include="..\..\include\EMaterialFlags.h">
<Filter>include\video</Filter> <Filter>include\video</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\include\IRenderTarget.h">
<Filter>include\video</Filter>
</ClInclude>
<ClInclude Include="CD3D9RenderTarget.h">
<Filter>Irrlicht\video\Direct3D9</Filter>
</ClInclude>
<ClInclude Include="COpenGLRenderTarget.h">
<Filter>Irrlicht\video\OpenGL</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\..\changes.txt"> <None Include="..\..\changes.txt">
...@@ -1370,7 +1379,7 @@ ...@@ -1370,7 +1379,7 @@
<ClCompile Include="CMD3MeshFileLoader.cpp"> <ClCompile Include="CMD3MeshFileLoader.cpp">
<Filter>Irrlicht\scene\loaders</Filter> <Filter>Irrlicht\scene\loaders</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CMeshTextureLoader.cpp"> <ClCompile Include="CMeshTextureLoader.cpp">
<Filter>Irrlicht\scene\loaders</Filter> <Filter>Irrlicht\scene\loaders</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CMS3DMeshFileLoader.cpp"> <ClCompile Include="CMS3DMeshFileLoader.cpp">
...@@ -1793,10 +1802,10 @@ ...@@ -1793,10 +1802,10 @@
<ClCompile Include="utf8.cpp"> <ClCompile Include="utf8.cpp">
<Filter>Irrlicht\irr</Filter> <Filter>Irrlicht\irr</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CProfiler.cpp"> <ClCompile Include="CProfiler.cpp">
<Filter>Irrlicht\irr</Filter> <Filter>Irrlicht\irr</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="leakHunter.cpp"> <ClCompile Include="leakHunter.cpp">
<Filter>Irrlicht\irr</Filter> <Filter>Irrlicht\irr</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="lzma\LzmaDec.c"> <ClCompile Include="lzma\LzmaDec.c">
...@@ -2186,7 +2195,7 @@ ...@@ -2186,7 +2195,7 @@
<ClCompile Include="CGUIProfiler.cpp"> <ClCompile Include="CGUIProfiler.cpp">
<Filter>Irrlicht\gui</Filter> <Filter>Irrlicht\gui</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CGUIScrollBar.cpp"> <ClCompile Include="CGUIScrollBar.cpp">
<Filter>Irrlicht\gui</Filter> <Filter>Irrlicht\gui</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CGUISkin.cpp"> <ClCompile Include="CGUISkin.cpp">
...@@ -2222,6 +2231,12 @@ ...@@ -2222,6 +2231,12 @@
<ClCompile Include="CSMFMeshFileLoader.cpp"> <ClCompile Include="CSMFMeshFileLoader.cpp">
<Filter>Irrlicht\scene\loaders</Filter> <Filter>Irrlicht\scene\loaders</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CD3D9RenderTarget.cpp">
<Filter>Irrlicht\video\Direct3D9</Filter>
</ClCompile>
<ClCompile Include="COpenGLRenderTarget.cpp">
<Filter>Irrlicht\video\OpenGL</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="Irrlicht.rc" /> <ResourceCompile Include="Irrlicht.rc" />
......
...@@ -772,6 +772,10 @@ ...@@ -772,6 +772,10 @@
RelativePath="..\..\include\IMaterialRendererServices.h" RelativePath="..\..\include\IMaterialRendererServices.h"
> >
</File> </File>
<File
RelativePath="..\..\include\IRenderTarget.h"
>
</File>
<File <File
RelativePath="..\..\include\IShaderConstantSetCallBack.h" RelativePath="..\..\include\IShaderConstantSetCallBack.h"
> >
...@@ -2211,6 +2215,14 @@ ...@@ -2211,6 +2215,14 @@
RelativePath="COpenGLParallaxMapRenderer.h" RelativePath="COpenGLParallaxMapRenderer.h"
> >
</File> </File>
<File
RelativePath="COpenGLRenderTarget.cpp"
>
</File>
<File
RelativePath="COpenGLRenderTarget.h"
>
</File>
<File <File
RelativePath="COpenGLShaderMaterialRenderer.cpp" RelativePath="COpenGLShaderMaterialRenderer.cpp"
> >
...@@ -2471,6 +2483,14 @@ ...@@ -2471,6 +2483,14 @@
RelativePath="CD3D9ParallaxMapRenderer.h" RelativePath="CD3D9ParallaxMapRenderer.h"
> >
</File> </File>
<File
RelativePath="CD3D9RenderTarget.cpp"
>
</File>
<File
RelativePath="CD3D9RenderTarget.h"
>
</File>
<File <File
RelativePath="CD3D9ShaderMaterialRenderer.cpp" RelativePath="CD3D9ShaderMaterialRenderer.cpp"
> >
......
...@@ -38,7 +38,7 @@ IRRMESHOBJ = $(IRRMESHLOADER) $(IRRMESHWRITER) \ ...@@ -38,7 +38,7 @@ IRRMESHOBJ = $(IRRMESHLOADER) $(IRRMESHWRITER) \
IRROBJ = CBillboardSceneNode.o CCameraSceneNode.o CDummyTransformationSceneNode.o CEmptySceneNode.o CGeometryCreator.o CLightSceneNode.o CMeshManipulator.o CMetaTriangleSelector.o COctreeSceneNode.o COctreeTriangleSelector.o CSceneCollisionManager.o CSceneManager.o CShadowVolumeSceneNode.o CSkyBoxSceneNode.o CSkyDomeSceneNode.o CTerrainSceneNode.o CTerrainTriangleSelector.o CVolumeLightSceneNode.o CCubeSceneNode.o CSphereSceneNode.o CTextSceneNode.o CTriangleBBSelector.o CTriangleSelector.o CWaterSurfaceSceneNode.o CMeshCache.o CDefaultSceneNodeAnimatorFactory.o CDefaultSceneNodeFactory.o CSceneLoaderIrr.o IRROBJ = CBillboardSceneNode.o CCameraSceneNode.o CDummyTransformationSceneNode.o CEmptySceneNode.o CGeometryCreator.o CLightSceneNode.o CMeshManipulator.o CMetaTriangleSelector.o COctreeSceneNode.o COctreeTriangleSelector.o CSceneCollisionManager.o CSceneManager.o CShadowVolumeSceneNode.o CSkyBoxSceneNode.o CSkyDomeSceneNode.o CTerrainSceneNode.o CTerrainTriangleSelector.o CVolumeLightSceneNode.o CCubeSceneNode.o CSphereSceneNode.o CTextSceneNode.o CTriangleBBSelector.o CTriangleSelector.o CWaterSurfaceSceneNode.o CMeshCache.o CDefaultSceneNodeAnimatorFactory.o CDefaultSceneNodeFactory.o CSceneLoaderIrr.o
IRRPARTICLEOBJ = CParticleAnimatedMeshSceneNodeEmitter.o CParticleBoxEmitter.o CParticleCylinderEmitter.o CParticleMeshEmitter.o CParticlePointEmitter.o CParticleRingEmitter.o CParticleSphereEmitter.o CParticleAttractionAffector.o CParticleFadeOutAffector.o CParticleGravityAffector.o CParticleRotationAffector.o CParticleSystemSceneNode.o CParticleScaleAffector.o IRRPARTICLEOBJ = CParticleAnimatedMeshSceneNodeEmitter.o CParticleBoxEmitter.o CParticleCylinderEmitter.o CParticleMeshEmitter.o CParticlePointEmitter.o CParticleRingEmitter.o CParticleSphereEmitter.o CParticleAttractionAffector.o CParticleFadeOutAffector.o CParticleGravityAffector.o CParticleRotationAffector.o CParticleSystemSceneNode.o CParticleScaleAffector.o
IRRANIMOBJ = CSceneNodeAnimatorCameraFPS.o CSceneNodeAnimatorCameraMaya.o CSceneNodeAnimatorCollisionResponse.o CSceneNodeAnimatorDelete.o CSceneNodeAnimatorFlyCircle.o CSceneNodeAnimatorFlyStraight.o CSceneNodeAnimatorFollowSpline.o CSceneNodeAnimatorRotation.o CSceneNodeAnimatorTexture.o IRRANIMOBJ = CSceneNodeAnimatorCameraFPS.o CSceneNodeAnimatorCameraMaya.o CSceneNodeAnimatorCollisionResponse.o CSceneNodeAnimatorDelete.o CSceneNodeAnimatorFlyCircle.o CSceneNodeAnimatorFlyStraight.o CSceneNodeAnimatorFollowSpline.o CSceneNodeAnimatorRotation.o CSceneNodeAnimatorTexture.o
IRRDRVROBJ = CNullDriver.o COpenGLDriver.o COpenGLNormalMapRenderer.o COpenGLParallaxMapRenderer.o COpenGLShaderMaterialRenderer.o COpenGLTexture.o COpenGLSLMaterialRenderer.o COpenGLExtensionHandler.o CD3D9Driver.o CD3D9HLSLMaterialRenderer.o CD3D9NormalMapRenderer.o CD3D9ParallaxMapRenderer.o CD3D9ShaderMaterialRenderer.o CD3D9Texture.o IRRDRVROBJ = CNullDriver.o COpenGLDriver.o COpenGLNormalMapRenderer.o COpenGLParallaxMapRenderer.o COpenGLRenderTarget.o COpenGLShaderMaterialRenderer.o COpenGLTexture.o COpenGLSLMaterialRenderer.o COpenGLExtensionHandler.o CD3D9Driver.o CD3D9HLSLMaterialRenderer.o CD3D9NormalMapRenderer.o CD3D9ParallaxMapRenderer.o CD3D9ShaderMaterialRenderer.o CD3D9Texture.o
IRRIMAGEOBJ = CColorConverter.o CImage.o CImageLoaderBMP.o CImageLoaderDDS.o CImageLoaderJPG.o CImageLoaderPCX.o CImageLoaderPNG.o CImageLoaderPSD.o CImageLoaderTGA.o CImageLoaderPPM.o CImageLoaderWAL.o CImageLoaderRGB.o \ IRRIMAGEOBJ = CColorConverter.o CImage.o CImageLoaderBMP.o CImageLoaderDDS.o CImageLoaderJPG.o CImageLoaderPCX.o CImageLoaderPNG.o CImageLoaderPSD.o CImageLoaderTGA.o CImageLoaderPPM.o CImageLoaderWAL.o CImageLoaderRGB.o \
CImageWriterBMP.o CImageWriterJPG.o CImageWriterPCX.o CImageWriterPNG.o CImageWriterPPM.o CImageWriterPSD.o CImageWriterTGA.o CImageWriterBMP.o CImageWriterJPG.o CImageWriterPCX.o CImageWriterPNG.o CImageWriterPPM.o CImageWriterPSD.o CImageWriterTGA.o
IRRVIDEOOBJ = CVideoModeList.o CFPSCounter.o $(IRRDRVROBJ) $(IRRIMAGEOBJ) IRRVIDEOOBJ = CVideoModeList.o CFPSCounter.o $(IRRDRVROBJ) $(IRRIMAGEOBJ)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment