Index: Horde3D/Bindings/C++/Horde3D.h =================================================================== --- Horde3D/Bindings/C++/Horde3D.h (revision 330) +++ Horde3D/Bindings/C++/Horde3D.h (working copy) @@ -1368,6 +1368,9 @@ */ DLL void h3dResizePipelineBuffers( H3DRes pipeRes, int width, int height ); + +DLL void h3dResizePipelineBuffer( H3DRes pipeRes, int index, int width, int height ); + /* Function: h3dGetRenderTargetData Reads back the pixel data of a render target buffer. Index: Horde3D/Source/Horde3DEngine/egMain.cpp =================================================================== --- Horde3D/Source/Horde3DEngine/egMain.cpp (revision 331) +++ Horde3D/Source/Horde3DEngine/egMain.cpp (working copy) @@ -414,7 +414,16 @@ pipeResObj->resize( width, height ); } +DLLEXP void h3dResizePipelineBuffer( ResHandle pipeRes, int index, int width, int height ) +{ + Resource *resObj = Modules::resMan().resolveResHandle( pipeRes ); + APIFUNC_VALIDATE_RES_TYPE( resObj, ResourceTypes::Pipeline, "h3dResizePipelineBuffers", APIFUNC_RET_VOID ); + PipelineResource *pipeResObj = (PipelineResource *)resObj; + pipeResObj->resizeRenderTarget( index, width, height ); +} + + DLLEXP bool h3dGetRenderTargetData( ResHandle pipelineRes, const char *targetName, int bufIndex, int *width, int *height, int *compCount, void *dataBuffer, int bufferSize ) { Index: Horde3D/Source/Horde3DEngine/egPipeline.cpp =================================================================== --- Horde3D/Source/Horde3DEngine/egPipeline.cpp (revision 330) +++ Horde3D/Source/Horde3DEngine/egPipeline.cpp (working copy) @@ -310,7 +310,31 @@ return true; } +bool PipelineResource::resizeRenderTarget( uint32 targetIndex, int width, int height ) +{ + if( targetIndex < _renderTargets.size() ) + { + RenderTarget &rt = _renderTargets[targetIndex]; + if( rt.rendBuf ) + gRDI->destroyRenderBuffer( rt.rendBuf ); + rt.width = ftoi_r( width / rt.scale ); + rt.height = ftoi_r( rt.height / rt.scale ); + + uint32 width = ftoi_r( rt.width * rt.scale ), height = ftoi_r( rt.height * rt.scale ); + if( width == 0 ) width = ftoi_r( _baseWidth * rt.scale ); + if( height == 0 ) height = ftoi_r( _baseHeight * rt.scale ); + + rt.rendBuf = gRDI->createRenderBuffer( + width, height, rt.format, rt.hasDepthBuf, rt.numColBufs, rt.samples ); + if( rt.rendBuf == 0 ) return false; + + + return true; + } + return false; +} + void PipelineResource::releaseRenderTargets() { for( uint32 i = 0; i < _renderTargets.size(); ++i ) Index: Horde3D/Source/Horde3DEngine/egPipeline.h =================================================================== --- Horde3D/Source/Horde3DEngine/egPipeline.h (revision 330) +++ Horde3D/Source/Horde3DEngine/egPipeline.h (working copy) @@ -164,6 +164,7 @@ void release(); bool load( const char *data, int size ); void resize( uint32 width, uint32 height ); + bool resizeRenderTarget( uint32 targetIndex, int width, int height ); int getElemCount( int elem ); int getElemParamI( int elem, int elemIdx, int param );