Commit 38d83734 authored by cutealien's avatar cutealien

Add an array with driver name strings for the driver enums.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4950 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 5238954d
......@@ -21,17 +21,6 @@ using namespace irr;
*/
namespace
{
const wchar_t* const DriverTypeNames[] =
{
L"NULL",
L"SOFTWARE",
L"BURNINGSVIDEO",
L"DIRECT3D8",
L"DIRECT3D9",
L"OPENGL",
0,
};
// For the gui id's
enum EGUI_IDS
{
......@@ -805,7 +794,7 @@ protected:
Device = createDevice(Config.DriverType, Config.ScreenSize);
if (!Device)
return false;
Device->setWindowCaption( DriverTypeNames[Config.DriverType] );
Device->setWindowCaption( core::stringw(video::DRIVER_TYPE_NAMES[Config.DriverType]).c_str() );
Device->setEventReceiver(this);
scene::ISceneManager* smgr = Device->getSceneManager();
......
......@@ -5,6 +5,8 @@
#ifndef __E_DRIVER_TYPES_H_INCLUDED__
#define __E_DRIVER_TYPES_H_INCLUDED__
#include "irrTypes.h"
namespace irr
{
namespace video
......@@ -55,10 +57,21 @@ namespace video
//! No driver, just for counting the elements
EDT_COUNT
};
const c8* const DRIVER_TYPE_NAMES[] =
{
"NullDriver",
"Software Renderer",
"Burning's Video",
"Direct3D 8.1",
"Direct3D 9.0c",
"OpenGL 1.x/2.x/3.x",
0
};
} // end namespace video
} // end namespace irr
#endif
......@@ -8,7 +8,6 @@
#include <iostream>
#include <cstdio>
#include "EDriverTypes.h"
#include "irrTypes.h"
#include "IrrlichtDevice.h"
namespace irr
......@@ -17,13 +16,12 @@ namespace irr
//! ask user for driver
static irr::video::E_DRIVER_TYPE driverChoiceConsole(bool allDrivers=true)
{
const char* const names[] = {"NullDriver","Software Renderer","Burning's Video","Direct3D 8.1","Direct3D 9.0c","OpenGL 1.x/2.x/3.x"};
printf("Please select the driver you want:\n");
irr::u32 i=0;
for (i=irr::video::EDT_COUNT; i>0; --i)
{
if (allDrivers || (irr::IrrlichtDevice::isDriverSupported(irr::video::E_DRIVER_TYPE(i-1))))
printf(" (%c) %s\n", 'a'+irr::video::EDT_COUNT-i, names[i-1]);
printf(" (%c) %s\n", 'a'+irr::video::EDT_COUNT-i, irr::video::DRIVER_TYPE_NAMES[i-1]);
}
char c;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment