Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials
driverChoice.h
Go to the documentation of this file.
1 // Copyright (C) 2009-2010 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 "EDriverTypes.h"
10 
11 namespace irr
12 {
13 
15 static irr::video::E_DRIVER_TYPE driverChoiceConsole(bool allDrivers=true)
16 {
17  const char* const names[] = {"NullDriver","Software Renderer","Burning's Video","Direct3D 8.1","Direct3D 9.0c","OpenGL 1.x/2.x/3.x"};
18  printf("Please select the driver you want:\n");
19  irr::u32 i=0;
20  for (i=irr::video::EDT_COUNT; i>0; --i)
21  {
23  printf(" (%c) %s\n", 'a'+irr::video::EDT_COUNT-i, names[i-1]);
24  }
25 
26  char c;
27  std::cin >> c;
28  c = irr::video::EDT_COUNT+'a'-c;
29 
30  for (i=irr::video::EDT_COUNT; i>0; --i)
31  {
33  --c;
34  if ((char)i==c)
35  return irr::video::E_DRIVER_TYPE(i-1);
36  }
37  return irr::video::EDT_COUNT;
38 }
39 
40 } // end namespace irr
41 
42 #endif

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Tue Jun 5 2012 17:57:10 by Doxygen (1.8.1)