mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 03:59:56 +00:00
Accept that it's too much work to defer light manager creation in the CS and instead use something akin to the old approach
This commit is contained in:
parent
dec8d32b3a
commit
a761e417f1
3 changed files with 9 additions and 3 deletions
|
@ -33,6 +33,11 @@ namespace SceneUtil
|
|||
GLExtensionsObserver GLExtensionsObserver::sInstance{};
|
||||
}
|
||||
|
||||
bool glExtensionsReady()
|
||||
{
|
||||
return !sGLExtensions.empty();
|
||||
}
|
||||
|
||||
osg::GLExtensions& getGLExtensions()
|
||||
{
|
||||
if (sGLExtensions.empty())
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
namespace SceneUtil
|
||||
{
|
||||
bool glExtensionsReady();
|
||||
osg::GLExtensions& getGLExtensions();
|
||||
|
||||
class GetGLExtensionsOperation : public osg::GraphicsOperation
|
||||
|
|
|
@ -825,9 +825,9 @@ namespace SceneUtil
|
|||
, mPointLightFadeEnd(0.f)
|
||||
, mPointLightFadeStart(0.f)
|
||||
{
|
||||
osg::GLExtensions& exts = SceneUtil::getGLExtensions();
|
||||
bool supportsUBO = exts.isUniformBufferObjectSupported;
|
||||
bool supportsGPU4 = exts.isGpuShader4Supported;
|
||||
osg::GLExtensions* exts = SceneUtil::glExtensionsReady() ? &SceneUtil::getGLExtensions() : nullptr;
|
||||
bool supportsUBO = exts && exts->isUniformBufferObjectSupported;
|
||||
bool supportsGPU4 = exts && exts->isGpuShader4Supported;
|
||||
|
||||
mSupported[static_cast<int>(LightingMethod::FFP)] = true;
|
||||
mSupported[static_cast<int>(LightingMethod::PerObjectUniform)] = true;
|
||||
|
|
Loading…
Reference in a new issue