Skip to content

Commit

Permalink
Main: unify and deprecate RenderSystem::_createRenderWindows
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Jul 26, 2020
1 parent 5a269e4 commit e984c17
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 109 deletions.
18 changes: 2 additions & 16 deletions OgreMain/include/OgreRenderSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -411,22 +411,8 @@ namespace Ogre
virtual RenderWindow* _createRenderWindow(const String &name, unsigned int width, unsigned int height,
bool fullScreen, const NameValuePairList *miscParams = 0);

/** Creates multiple rendering windows.
@param
renderWindowDescriptions Array of structures containing the descriptions of each render window.
The structure's members are the same as the parameters of _createRenderWindow:
* name
* width
* height
* fullScreen
* miscParams
See _createRenderWindow for details about each member.
@param
createdWindows This array will hold the created render windows.
@return
true on success.
*/
virtual bool _createRenderWindows(const RenderWindowDescriptionList& renderWindowDescriptions,
/// @deprecated call _createRenderWindow multiple times
OGRE_DEPRECATED bool _createRenderWindows(const RenderWindowDescriptionList& renderWindowDescriptions,
RenderWindowList& createdWindows);


Expand Down
5 changes: 2 additions & 3 deletions OgreMain/include/OgreRoot.h
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,8 @@ namespace Ogre
desc.useFullScreen, &desc.miscParams);
}

/** @copydoc RenderSystem::_createRenderWindows
*/
bool createRenderWindows(const RenderWindowDescriptionList& renderWindowDescriptions,
/// @deprecated call createRenderWindow multiple times
OGRE_DEPRECATED bool createRenderWindows(const RenderWindowDescriptionList& renderWindowDescriptions,
RenderWindowList& createdWindows);

/** Detaches a RenderTarget from the active render system
Expand Down
13 changes: 13 additions & 0 deletions OgreMain/src/OgreRenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,19 @@ namespace Ogre {
}
}

// Simply call _createRenderWindow in a loop.
for (const auto& curRenderWindowDescription : renderWindowDescriptions)
{
RenderWindow* curWindow = NULL;
curWindow = _createRenderWindow(curRenderWindowDescription.name,
curRenderWindowDescription.width,
curRenderWindowDescription.height,
curRenderWindowDescription.useFullScreen,
&curRenderWindowDescription.miscParams);

createdWindows.push_back(curWindow);
}

return true;
}

Expand Down
3 changes: 2 additions & 1 deletion OgreMain/src/OgreRoot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1133,8 +1133,9 @@ namespace Ogre {
}

bool success;

OGRE_IGNORE_DEPRECATED_BEGIN
success = mActiveRenderer->_createRenderWindows(renderWindowDescriptions, createdWindows);
OGRE_IGNORE_DEPRECATED_END
if(success && !mFirstTimePostWindowInit)
{
oneTimePostWindowInit();
Expand Down
4 changes: 0 additions & 4 deletions RenderSystems/Direct3D9/include/OgreD3D9RenderSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,6 @@ namespace Ogre
RenderWindow* _createRenderWindow(const String &name, unsigned int width, unsigned int height,
bool fullScreen, const NameValuePairList *miscParams = 0);

/// @copydoc RenderSystem::_createRenderWindows
bool _createRenderWindows(const RenderWindowDescriptionList& renderWindowDescriptions,
RenderWindowList& createdWindows);

/// @copydoc RenderSystem::_createDepthBufferFor
DepthBuffer* _createDepthBufferFor( RenderTarget *renderTarget );

Expand Down
26 changes: 0 additions & 26 deletions RenderSystems/Direct3D9/src/OgreD3D9RenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,33 +876,7 @@ namespace Ogre
#endif

return renderWindow;
}
//---------------------------------------------------------------------
bool D3D9RenderSystem::_createRenderWindows(const RenderWindowDescriptionList& renderWindowDescriptions,
RenderWindowList& createdWindows)
{
// Call base render system method.
if (false == RenderSystem::_createRenderWindows(renderWindowDescriptions, createdWindows))
return false;

// Simply call _createRenderWindow in a loop.
for (size_t i = 0; i < renderWindowDescriptions.size(); ++i)
{
const RenderWindowDescription& curRenderWindowDescription = renderWindowDescriptions[i];
RenderWindow* curWindow = NULL;

curWindow = _createRenderWindow(curRenderWindowDescription.name,
curRenderWindowDescription.width,
curRenderWindowDescription.height,
curRenderWindowDescription.useFullScreen,
&curRenderWindowDescription.miscParams);

createdWindows.push_back(curWindow);
}

return true;
}

//---------------------------------------------------------------------
RenderSystemCapabilities* D3D9RenderSystem::updateRenderSystemCapabilities(D3D9RenderWindow* renderWindow)
{
Expand Down
4 changes: 0 additions & 4 deletions RenderSystems/GL/include/OgreGLRenderSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@ namespace Ogre {
RenderWindow* _createRenderWindow(const String &name, unsigned int width, unsigned int height,
bool fullScreen, const NameValuePairList *miscParams = 0);

/// @copydoc RenderSystem::_createRenderWindows
bool _createRenderWindows(const RenderWindowDescriptionList& renderWindowDescriptions,
RenderWindowList& createdWindows);

/// @copydoc RenderSystem::_createDepthBufferFor
DepthBuffer* _createDepthBufferFor( RenderTarget *renderTarget );

Expand Down
26 changes: 0 additions & 26 deletions RenderSystems/GL/src/OgreGLRenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,32 +1033,6 @@ namespace Ogre {
break;
}
}

//---------------------------------------------------------------------
bool GLRenderSystem::_createRenderWindows(const RenderWindowDescriptionList& renderWindowDescriptions,
RenderWindowList& createdWindows)
{
// Call base render system method.
if (false == RenderSystem::_createRenderWindows(renderWindowDescriptions, createdWindows))
return false;

// Simply call _createRenderWindow in a loop.
for (size_t i = 0; i < renderWindowDescriptions.size(); ++i)
{
const RenderWindowDescription& curRenderWindowDescription = renderWindowDescriptions[i];
RenderWindow* curWindow = NULL;

curWindow = _createRenderWindow(curRenderWindowDescription.name,
curRenderWindowDescription.width,
curRenderWindowDescription.height,
curRenderWindowDescription.useFullScreen,
&curRenderWindowDescription.miscParams);

createdWindows.push_back(curWindow);
}

return true;
}
//---------------------------------------------------------------------
RenderWindow* GLRenderSystem::_createRenderWindow(const String &name,
unsigned int width, unsigned int height, bool fullScreen,
Expand Down
4 changes: 0 additions & 4 deletions RenderSystems/GL3Plus/include/OgreGL3PlusRenderSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ namespace Ogre {
RenderWindow* _createRenderWindow(const String &name, unsigned int width, unsigned int height,
bool fullScreen, const NameValuePairList *miscParams = 0);

/// @copydoc RenderSystem::_createRenderWindows
bool _createRenderWindows(const RenderWindowDescriptionList& renderWindowDescriptions,
RenderWindowList& createdWindows);

/// @copydoc RenderSystem::_createDepthBufferFor
DepthBuffer* _createDepthBufferFor( RenderTarget *renderTarget );

Expand Down
25 changes: 0 additions & 25 deletions RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,31 +586,6 @@ namespace Ogre {
// RenderSystem::shutdown();
}

bool GL3PlusRenderSystem::_createRenderWindows(const RenderWindowDescriptionList& renderWindowDescriptions,
RenderWindowList& createdWindows)
{
// Call base render system method.
if (false == RenderSystem::_createRenderWindows(renderWindowDescriptions, createdWindows))
return false;

// Simply call _createRenderWindow in a loop.
for (size_t i = 0; i < renderWindowDescriptions.size(); ++i)
{
const RenderWindowDescription& curRenderWindowDescription = renderWindowDescriptions[i];
RenderWindow* curWindow = NULL;

curWindow = _createRenderWindow(curRenderWindowDescription.name,
curRenderWindowDescription.width,
curRenderWindowDescription.height,
curRenderWindowDescription.useFullScreen,
&curRenderWindowDescription.miscParams);

createdWindows.push_back(curWindow);
}

return true;
}

RenderWindow* GL3PlusRenderSystem::_createRenderWindow(const String &name, unsigned int width, unsigned int height,
bool fullScreen, const NameValuePairList *miscParams)
{
Expand Down

0 comments on commit e984c17

Please sign in to comment.