@@ -284,14 +284,6 @@ static bool getWindowHandle(irr::video::IVideoDriver *driver, HWND &hWnd)
284
284
const video::SExposedVideoData exposedData = driver->getExposedVideoData ();
285
285
286
286
switch (driver->getDriverType ()) {
287
- #if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 9
288
- case video::EDT_DIRECT3D8:
289
- hWnd = reinterpret_cast <HWND>(exposedData.D3D8 .HWnd );
290
- break ;
291
- #endif
292
- case video::EDT_DIRECT3D9:
293
- hWnd = reinterpret_cast <HWND>(exposedData.D3D9 .HWnd );
294
- break ;
295
287
#if ENABLE_GLES
296
288
case video::EDT_OGLES1:
297
289
case video::EDT_OGLES2:
@@ -527,11 +519,19 @@ void RenderingEngine::draw_menu_scene(gui::IGUIEnvironment *guienv,
527
519
528
520
std::vector<irr::video::E_DRIVER_TYPE> RenderingEngine::getSupportedVideoDrivers ()
529
521
{
522
+ // Only check these drivers.
523
+ // We do not support software and D3D in any capacity.
524
+ static const irr::video::E_DRIVER_TYPE glDrivers[4 ] = {
525
+ irr::video::EDT_NULL,
526
+ irr::video::EDT_OPENGL,
527
+ irr::video::EDT_OGLES1,
528
+ irr::video::EDT_OGLES2,
529
+ };
530
530
std::vector<irr::video::E_DRIVER_TYPE> drivers;
531
531
532
- for (int i = 0 ; i != irr::video::EDT_COUNT ; i++) {
533
- if (irr::IrrlichtDevice::isDriverSupported ((irr::video::E_DRIVER_TYPE)i ))
534
- drivers.push_back ((irr::video::E_DRIVER_TYPE)i );
532
+ for (int i = 0 ; i < 4 ; i++) {
533
+ if (irr::IrrlichtDevice::isDriverSupported (glDrivers[i] ))
534
+ drivers.push_back (glDrivers[i] );
535
535
}
536
536
537
537
return drivers;
@@ -557,34 +557,26 @@ void RenderingEngine::draw_scene(video::SColor skycolor, bool show_hud,
557
557
558
558
const char *RenderingEngine::getVideoDriverName (irr::video::E_DRIVER_TYPE type)
559
559
{
560
- static const char *driver_ids[] = {
561
- " null" ,
562
- " software" ,
563
- " burningsvideo" ,
564
- " direct3d8" ,
565
- " direct3d9" ,
566
- " opengl" ,
567
- " ogles1" ,
568
- " ogles2" ,
560
+ static const std::unordered_map<irr::video::E_DRIVER_TYPE,const std::string> driver_ids = {
561
+ {irr::video::EDT_NULL, " null" },
562
+ {irr::video::EDT_OPENGL, " opengl" },
563
+ {irr::video::EDT_OGLES1, " ogles1" },
564
+ {irr::video::EDT_OGLES2, " ogles2" },
569
565
};
570
566
571
- return driver_ids[ type] ;
567
+ return driver_ids. at ( type). c_str () ;
572
568
}
573
569
574
570
const char *RenderingEngine::getVideoDriverFriendlyName (irr::video::E_DRIVER_TYPE type)
575
571
{
576
- static const char *driver_names[] = {
577
- " NULL Driver" ,
578
- " Software Renderer" ,
579
- " Burning's Video" ,
580
- " Direct3D 8" ,
581
- " Direct3D 9" ,
582
- " OpenGL" ,
583
- " OpenGL ES1" ,
584
- " OpenGL ES2" ,
572
+ static const std::unordered_map<irr::video::E_DRIVER_TYPE,const std::string> driver_names = {
573
+ {irr::video::EDT_NULL, " NULL Driver" },
574
+ {irr::video::EDT_OPENGL, " OpenGL" },
575
+ {irr::video::EDT_OGLES1, " OpenGL ES1" },
576
+ {irr::video::EDT_OGLES2, " OpenGL ES2" },
585
577
};
586
578
587
- return driver_names[ type] ;
579
+ return driver_names. at ( type). c_str () ;
588
580
}
589
581
590
582
#ifndef __ANDROID__
0 commit comments