aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/include/driverChoice.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/include/driverChoice.h')
-rw-r--r--src/others/irrlicht-1.8.1/include/driverChoice.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/include/driverChoice.h b/src/others/irrlicht-1.8.1/include/driverChoice.h
new file mode 100644
index 0000000..d418ba8
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/include/driverChoice.h
@@ -0,0 +1,45 @@
1// Copyright (C) 2009-2012 Christian Stehno
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __E_DRIVER_CHOICE_H_INCLUDED__
6#define __E_DRIVER_CHOICE_H_INCLUDED__
7
8#include <iostream>
9#include <cstdio>
10#include "EDriverTypes.h"
11#include "irrTypes.h"
12#include "IrrlichtDevice.h"
13
14namespace irr
15{
16
17//! ask user for driver
18static irr::video::E_DRIVER_TYPE driverChoiceConsole(bool allDrivers=true)
19{
20 const char* const names[] = {"NullDriver","Software Renderer","Burning's Video","Direct3D 8.1","Direct3D 9.0c","OpenGL 1.x/2.x/3.x"};
21 printf("Please select the driver you want:\n");
22 irr::u32 i=0;
23 for (i=irr::video::EDT_COUNT; i>0; --i)
24 {
25 if (allDrivers || (irr::IrrlichtDevice::isDriverSupported(irr::video::E_DRIVER_TYPE(i-1))))
26 printf(" (%c) %s\n", 'a'+irr::video::EDT_COUNT-i, names[i-1]);
27 }
28
29 char c;
30 std::cin >> c;
31 c = irr::video::EDT_COUNT+'a'-c;
32
33 for (i=irr::video::EDT_COUNT; i>0; --i)
34 {
35 if (!(allDrivers || (irr::IrrlichtDevice::isDriverSupported(irr::video::E_DRIVER_TYPE(i-1)))))
36 --c;
37 if ((char)i==c)
38 return irr::video::E_DRIVER_TYPE(i-1);
39 }
40 return irr::video::EDT_COUNT;
41}
42
43} // end namespace irr
44
45#endif