Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions RenderSystems/NULL/include/OgreNULLTextureGpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,22 @@ namespace Ogre
PixelFormatGpu getDesiredDepthBufferFormat() const override;
};

/// A RenderWindow-specific texture. Its only job over the base class is to
/// answer the "Window" custom attribute, which RenderSystem::getDepthBufferFor
/// relies on for every render-window-specific colour target.
class _OgreNULLExport NULLTextureGpuWindow final : public NULLTextureGpuRenderTarget
{
Window *mWindow;

public:
NULLTextureGpuWindow( GpuPageOutStrategy::GpuPageOutStrategy pageOutStrategy,
VaoManager *vaoManager, IdString name, uint32 textureFlags,
TextureTypes::TextureTypes initialType, TextureGpuManager *textureManager,
Window *window );

void getCustomAttribute( IdString name, void *pData ) override;
};

/** @} */
/** @} */
} // namespace Ogre
Expand Down
2 changes: 1 addition & 1 deletion RenderSystems/NULL/include/OgreNULLTextureGpuManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace Ogre
NULLTextureGpuManager( VaoManager *vaoManager, RenderSystem *renderSystem );
~NULLTextureGpuManager() override;

TextureGpu *createTextureGpuWindow();
TextureGpu *createTextureGpuWindow( Window *window );
};

/** @} */
Expand Down
19 changes: 19 additions & 0 deletions RenderSystems/NULL/src/OgreNULLTextureGpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,23 @@ namespace Ogre
{
return mDesiredDepthBufferFormat;
}
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
NULLTextureGpuWindow::NULLTextureGpuWindow( GpuPageOutStrategy::GpuPageOutStrategy pageOutStrategy,
VaoManager *vaoManager, IdString name,
uint32 textureFlags,
TextureTypes::TextureTypes initialType,
TextureGpuManager *textureManager, Window *window ) :
NULLTextureGpuRenderTarget( pageOutStrategy, vaoManager, name, textureFlags, initialType,
textureManager ),
mWindow( window )
{
}
//-----------------------------------------------------------------------------------
void NULLTextureGpuWindow::getCustomAttribute( IdString name, void *pData )
{
if( name == "Window" )
*static_cast<Window **>( pData ) = mWindow;
}
} // namespace Ogre
12 changes: 6 additions & 6 deletions RenderSystems/NULL/src/OgreNULLTextureGpuManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ namespace Ogre
//-----------------------------------------------------------------------------------
NULLTextureGpuManager::~NULLTextureGpuManager() { destroyAll(); }
//-----------------------------------------------------------------------------------
TextureGpu *NULLTextureGpuManager::createTextureGpuWindow()
TextureGpu *NULLTextureGpuManager::createTextureGpuWindow( Window *window )
{
return OGRE_NEW NULLTextureGpuRenderTarget(
GpuPageOutStrategy::Discard, mVaoManager, "RenderWindow",
TextureFlags::NotTexture | TextureFlags::RenderToTexture |
TextureFlags::RenderWindowSpecific | TextureFlags::DiscardableContent,
TextureTypes::Type2D, this );
return OGRE_NEW NULLTextureGpuWindow( GpuPageOutStrategy::Discard, mVaoManager, "RenderWindow",
TextureFlags::NotTexture | TextureFlags::RenderToTexture |
TextureFlags::RenderWindowSpecific |
TextureFlags::DiscardableContent,
TextureTypes::Type2D, this, window );
}
//-----------------------------------------------------------------------------------
TextureGpu *NULLTextureGpuManager::createTextureImpl(
Expand Down
4 changes: 2 additions & 2 deletions RenderSystems/NULL/src/OgreNULLWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ namespace Ogre
NULLTextureGpuManager *textureManager =
static_cast<NULLTextureGpuManager *>( textureGpuManager );

mTexture = textureManager->createTextureGpuWindow();
mDepthBuffer = textureManager->createTextureGpuWindow();
mTexture = textureManager->createTextureGpuWindow( this );
mDepthBuffer = textureManager->createTextureGpuWindow( this );
mStencilBuffer = mDepthBuffer;

setFinalResolution( mRequestedWidth, mRequestedHeight );
Expand Down
Loading