Skip to content
Draft
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
6 changes: 6 additions & 0 deletions OgreMain/include/OgreRenderSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,12 @@ namespace Ogre
/** Initialize the render system from the capabilities*/
virtual void initialiseFromRenderSystemCapabilities(RenderSystemCapabilities* caps, RenderTarget* primary) = 0;

/** Helper method to initialise capabilities and fire the RenderSystemCapabilitiesCreated event.
* This method creates render system capabilities, sets current capabilities if custom capabilities
* are not used, fires the RenderSystemCapabilitiesCreated event, and initialises from capabilities.
* @param primary The primary render target
*/
void initialiseRenderSystemCapabilities(RenderTarget* primary);

DriverVersion mDriverVersion;
uint16 mNativeShadingLanguageVersion;
Expand Down
13 changes: 13 additions & 0 deletions OgreMain/src/OgreRenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,19 @@ namespace Ogre {
msSharedEventListener->eventOccurred(name, params);
}
//-----------------------------------------------------------------------
void RenderSystem::initialiseRenderSystemCapabilities(RenderTarget* primary)
{
mRealCapabilities = createRenderSystemCapabilities();

// use real capabilities if custom capabilities are not available
if (!mUseCustomCapabilities)
mCurrentCapabilities = mRealCapabilities;

fireEvent("RenderSystemCapabilitiesCreated");

initialiseFromRenderSystemCapabilities(mCurrentCapabilities, primary);
}
//-----------------------------------------------------------------------
void RenderSystem::destroyHardwareOcclusionQuery( HardwareOcclusionQuery *hq)
{
auto end = mHwOcclusionQueries.end();
Expand Down
11 changes: 1 addition & 10 deletions RenderSystems/GL/src/OgreGLRenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,18 +1007,9 @@ namespace Ogre {
}

// Initialise GL after the first window has been created
// TODO: fire this from emulation options, and don't duplicate Real and Current capabilities
mRealCapabilities = createRenderSystemCapabilities();
initialiseRenderSystemCapabilities(win);
initFixedFunctionParams(); // create params

// use real capabilities if custom capabilities are not available
if(!mUseCustomCapabilities)
mCurrentCapabilities = mRealCapabilities;

fireEvent("RenderSystemCapabilitiesCreated");

initialiseFromRenderSystemCapabilities(mCurrentCapabilities, win);

// Initialise the main context
_oneTimeContextInitialization();
if(mCurrentContext)
Expand Down
11 changes: 1 addition & 10 deletions RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,16 +578,7 @@ namespace Ogre {
}

// Initialise GL after the first window has been created
// TODO: fire this from emulation options, and don't duplicate Real and Current capabilities
mRealCapabilities = createRenderSystemCapabilities();

// use real capabilities if custom capabilities are not available
if (!mUseCustomCapabilities)
mCurrentCapabilities = mRealCapabilities;

fireEvent("RenderSystemCapabilitiesCreated");

initialiseFromRenderSystemCapabilities(mCurrentCapabilities, (RenderTarget *) win);
initialiseRenderSystemCapabilities((RenderTarget *) win);

// Initialise the main context
_oneTimeContextInitialization();
Expand Down
11 changes: 1 addition & 10 deletions RenderSystems/GLES2/src/OgreGLES2RenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,16 +596,7 @@ namespace Ogre {
mNativeShadingLanguageVersion = 100;

// Initialise GL after the first window has been created
// TODO: fire this from emulation options, and don't duplicate Real and Current capabilities
mRealCapabilities = createRenderSystemCapabilities();

// use real capabilities if custom capabilities are not available
if (!mUseCustomCapabilities)
mCurrentCapabilities = mRealCapabilities;

fireEvent("RenderSystemCapabilitiesCreated");

initialiseFromRenderSystemCapabilities(mCurrentCapabilities, (RenderTarget *) win);
initialiseRenderSystemCapabilities((RenderTarget *) win);

// Initialise the main context
_oneTimeContextInitialization();
Expand Down
11 changes: 1 addition & 10 deletions RenderSystems/Tiny/src/OgreTinyRenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,7 @@ namespace Ogre {
LogManager::getSingleton().logMessage("**************************************");

// Initialise GL after the first window has been created
// TODO: fire this from emulation options, and don't duplicate Real and Current capabilities
mRealCapabilities = createRenderSystemCapabilities();

// use real capabilities if custom capabilities are not available
if (!mUseCustomCapabilities)
mCurrentCapabilities = mRealCapabilities;

fireEvent("RenderSystemCapabilitiesCreated");

initialiseFromRenderSystemCapabilities(mCurrentCapabilities, (RenderTarget *) win);
initialiseRenderSystemCapabilities((RenderTarget *) win);
}

if ( win->getDepthBufferPool() != RBP_NONE )
Expand Down
Loading