arsa  2.7
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 "IrrlichtDevice.h"
12 
13 namespace irr
14 {
15 
17  static irr::video::E_DRIVER_TYPE driverChoiceConsole(bool allDrivers=false)
18  {
19 #if defined (_IRR_IPHONE_PLATFORM_) || defined (_IRR_ANDROID_PLATFORM_)
21 #else
22  printf("Please select the driver you want:\n");
23  irr::u32 i=0;
24  char c = 'a';
25 
26  for (i=irr::video::EDT_COUNT; i>0; --i)
27  {
29  {
30  printf(" (%c) %s\n", c, irr::video::DRIVER_TYPE_NAMES[i-1]);
31  ++c;
32  }
33  }
34 
35  char userSelection;
36  std::cin >> userSelection;
37  c = 'a';
38 
39  for (i=irr::video::EDT_COUNT; i>0; --i)
40  {
42  {
43  if (userSelection == c)
44  return irr::video::E_DRIVER_TYPE(i-1);
45  ++c;
46  }
47  }
48 
49  return irr::video::EDT_COUNT;
50 #endif
51  }
52 
53 } // end namespace irr
54 
55 #endif
static bool isDriverSupported(video::E_DRIVER_TYPE driver)
Check if a driver type is supported by the engine.
Everything in the Irrlicht Engine can be found in this namespace.
Definition: CARSADPad.h:6
E_DRIVER_TYPE
An enum for all types of drivers the Irrlicht Engine supports.
Definition: EDriverTypes.h:16
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
const c8 *const DRIVER_TYPE_NAMES[]
Definition: EDriverTypes.h:69
OpenGL-ES 2.x driver, for embedded and mobile systems.
Definition: EDriverTypes.h:60
const GLubyte * c
No driver, just for counting the elements.
Definition: EDriverTypes.h:66