Irrlicht 3D Engine
driverChoice.h
Go to the documentation of this file.
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
14
namespace
irr
15
{
16
18
static
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
IrrlichtDevice.h
irr::video::EDT_COUNT
@ EDT_COUNT
No driver, just for counting the elements.
Definition:
EDriverTypes.h:56
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition:
aabbox3d.h:12
irrTypes.h
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition:
irrTypes.h:58
irr::video::E_DRIVER_TYPE
E_DRIVER_TYPE
An enum for all types of drivers the Irrlicht Engine supports.
Definition:
EDriverTypes.h:14
irr::IrrlichtDevice::isDriverSupported
static bool isDriverSupported(video::E_DRIVER_TYPE driver)
Check if a driver type is supported by the engine.
Definition:
IrrlichtDevice.h:277
EDriverTypes.h
Irrlicht Engine
Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on Mon Apr 25 2022 14:03:04 for Irrlicht 3D Engine by
Doxygen
1.8.17