mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-29 03:36:40 +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{};
|
GLExtensionsObserver GLExtensionsObserver::sInstance{};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool glExtensionsReady()
|
||||||
|
{
|
||||||
|
return !sGLExtensions.empty();
|
||||||
|
}
|
||||||
|
|
||||||
osg::GLExtensions& getGLExtensions()
|
osg::GLExtensions& getGLExtensions()
|
||||||
{
|
{
|
||||||
if (sGLExtensions.empty())
|
if (sGLExtensions.empty())
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
namespace SceneUtil
|
namespace SceneUtil
|
||||||
{
|
{
|
||||||
|
bool glExtensionsReady();
|
||||||
osg::GLExtensions& getGLExtensions();
|
osg::GLExtensions& getGLExtensions();
|
||||||
|
|
||||||
class GetGLExtensionsOperation : public osg::GraphicsOperation
|
class GetGLExtensionsOperation : public osg::GraphicsOperation
|
||||||
|
|
|
@ -825,9 +825,9 @@ namespace SceneUtil
|
||||||
, mPointLightFadeEnd(0.f)
|
, mPointLightFadeEnd(0.f)
|
||||||
, mPointLightFadeStart(0.f)
|
, mPointLightFadeStart(0.f)
|
||||||
{
|
{
|
||||||
osg::GLExtensions& exts = SceneUtil::getGLExtensions();
|
osg::GLExtensions* exts = SceneUtil::glExtensionsReady() ? &SceneUtil::getGLExtensions() : nullptr;
|
||||||
bool supportsUBO = exts.isUniformBufferObjectSupported;
|
bool supportsUBO = exts && exts->isUniformBufferObjectSupported;
|
||||||
bool supportsGPU4 = exts.isGpuShader4Supported;
|
bool supportsGPU4 = exts && exts->isGpuShader4Supported;
|
||||||
|
|
||||||
mSupported[static_cast<int>(LightingMethod::FFP)] = true;
|
mSupported[static_cast<int>(LightingMethod::FFP)] = true;
|
||||||
mSupported[static_cast<int>(LightingMethod::PerObjectUniform)] = true;
|
mSupported[static_cast<int>(LightingMethod::PerObjectUniform)] = true;
|
||||||
|
|
Loading…
Reference in a new issue