Irrlicht 3D Engine
 
Loading...
Searching...
No Matches
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
14namespace irr
15{
16
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 {
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 {
36 --c;
37 if ((char)i==c)
38 return irr::video::E_DRIVER_TYPE(i-1);
39 }
41}
42
43} // end namespace irr
44
45#endif
static bool isDriverSupported(video::E_DRIVER_TYPE driver)
Check if a driver type is supported by the engine.
E_DRIVER_TYPE
An enum for all types of drivers the Irrlicht Engine supports.
@ EDT_COUNT
No driver, just for counting the elements.
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58