Allow starting STK with non-gl drivers
This commit is contained in:
parent
23ec5ba379
commit
f95d73c041
@ -37,6 +37,7 @@ void CentralVideoSettings::init()
|
|||||||
m_gl_major_version = 2;
|
m_gl_major_version = 2;
|
||||||
m_gl_minor_version = 1;
|
m_gl_minor_version = 1;
|
||||||
m_gl_mem = 0;
|
m_gl_mem = 0;
|
||||||
|
m_glsl = false;
|
||||||
|
|
||||||
// Parse extensions
|
// Parse extensions
|
||||||
hasBufferStorage = false;
|
hasBufferStorage = false;
|
||||||
@ -66,6 +67,16 @@ void CentralVideoSettings::init()
|
|||||||
// Call to glGetIntegerv should not be made if --no-graphics is used
|
// Call to glGetIntegerv should not be made if --no-graphics is used
|
||||||
if (!GUIEngine::isNoGraphics())
|
if (!GUIEngine::isNoGraphics())
|
||||||
{
|
{
|
||||||
|
if (GE::getDriver()->getDriverType() != video::EDT_OPENGL &&
|
||||||
|
GE::getDriver()->getDriverType() != video::EDT_OGLES2)
|
||||||
|
{
|
||||||
|
GraphicsRestrictions::init("", "", GE::getDriver()->getVendorInfo().c_str());
|
||||||
|
GE::getGEConfig()->m_disable_npot_texture =
|
||||||
|
GraphicsRestrictions::isDisabled(
|
||||||
|
GraphicsRestrictions::GR_NPOT_TEXTURES);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
glGetIntegerv(GL_MAJOR_VERSION, &m_gl_major_version);
|
glGetIntegerv(GL_MAJOR_VERSION, &m_gl_major_version);
|
||||||
glGetIntegerv(GL_MINOR_VERSION, &m_gl_minor_version);
|
glGetIntegerv(GL_MINOR_VERSION, &m_gl_minor_version);
|
||||||
const char *vendor = (const char *)glGetString(GL_VENDOR);
|
const char *vendor = (const char *)glGetString(GL_VENDOR);
|
||||||
|
@ -475,11 +475,7 @@ void IrrDriver::initDevice()
|
|||||||
UserConfigParams::m_gamepad_visualisation);
|
UserConfigParams::m_gamepad_visualisation);
|
||||||
|
|
||||||
// Try 32 and, upon failure, 24 then 16 bit per pixels
|
// Try 32 and, upon failure, 24 then 16 bit per pixels
|
||||||
#ifdef __SWITCH__
|
|
||||||
int bits=24;
|
|
||||||
#else
|
|
||||||
for (int bits=32; bits>15; bits -=8)
|
for (int bits=32; bits>15; bits -=8)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if(UserConfigParams::logMisc())
|
if(UserConfigParams::logMisc())
|
||||||
Log::verbose("irr_driver", "Trying to create device with "
|
Log::verbose("irr_driver", "Trying to create device with "
|
||||||
@ -536,12 +532,8 @@ void IrrDriver::initDevice()
|
|||||||
*/
|
*/
|
||||||
m_device = createDeviceEx(params);
|
m_device = createDeviceEx(params);
|
||||||
|
|
||||||
#ifdef __SWITCH__
|
|
||||||
assert(m_device != NULL);
|
|
||||||
#else
|
|
||||||
if(m_device)
|
if(m_device)
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
} // for bits=32, 24, 16
|
} // for bits=32, 24, 16
|
||||||
|
|
||||||
|
|
||||||
@ -580,6 +572,7 @@ void IrrDriver::initDevice()
|
|||||||
}
|
}
|
||||||
#ifndef SERVER_ONLY
|
#ifndef SERVER_ONLY
|
||||||
|
|
||||||
|
GE::init(m_device->getVideoDriver());
|
||||||
// Assume sp is supported
|
// Assume sp is supported
|
||||||
CentralVideoSettings::m_supports_sp = true;
|
CentralVideoSettings::m_supports_sp = true;
|
||||||
CVS->init();
|
CVS->init();
|
||||||
@ -625,9 +618,6 @@ void IrrDriver::initDevice()
|
|||||||
m_scene_manager = m_device->getSceneManager();
|
m_scene_manager = m_device->getSceneManager();
|
||||||
m_gui_env = m_device->getGUIEnvironment();
|
m_gui_env = m_device->getGUIEnvironment();
|
||||||
m_video_driver = m_device->getVideoDriver();
|
m_video_driver = m_device->getVideoDriver();
|
||||||
#ifndef SERVER_ONLY
|
|
||||||
GE::init(m_video_driver);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
B3DMeshLoader* b3dl = new B3DMeshLoader(m_scene_manager);
|
B3DMeshLoader* b3dl = new B3DMeshLoader(m_scene_manager);
|
||||||
m_scene_manager->addExternalMeshLoader(b3dl);
|
m_scene_manager->addExternalMeshLoader(b3dl);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user