Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials

driverChoice.h

Go to the documentation of this file.
00001 // Copyright (C) 2009-2010 Christian Stehno
00002 // This file is part of the "Irrlicht Engine".
00003 // For conditions of distribution and use, see copyright notice in irrlicht.h
00004 
00005 #ifndef __E_DRIVER_CHOICE_H_INCLUDED__
00006 #define __E_DRIVER_CHOICE_H_INCLUDED__
00007 
00008 #include <iostream>
00009 #include "EDriverTypes.h"
00010 
00011 namespace irr
00012 {
00013 
00015 static irr::video::E_DRIVER_TYPE driverChoiceConsole(bool allDrivers=true)
00016 {
00017         const char* const names[] = {"NullDriver","Software Renderer","Burning's Video","Direct3D 8.1","Direct3D 9.0c","OpenGL 1.x/2.x/3.x"};
00018         printf("Please select the driver you want:\n");
00019         irr::u32 i=0;
00020         for (i=irr::video::EDT_COUNT; i>0; --i)
00021         {
00022                 if (allDrivers || (irr::IrrlichtDevice::isDriverSupported(irr::video::E_DRIVER_TYPE(i-1))))
00023                         printf(" (%c) %s\n", 'a'+irr::video::EDT_COUNT-i, names[i-1]);
00024         }
00025 
00026         char c;
00027         std::cin >> c;
00028         c = irr::video::EDT_COUNT+'a'-c;
00029 
00030         for (i=irr::video::EDT_COUNT; i>0; --i)
00031         {
00032                 if (!(allDrivers || (irr::IrrlichtDevice::isDriverSupported(irr::video::E_DRIVER_TYPE(i-1)))))
00033                         --c;
00034                 if ((char)i==c)
00035                         return irr::video::E_DRIVER_TYPE(i-1);
00036         }
00037         return irr::video::EDT_COUNT;
00038 }
00039 
00040 } // end namespace irr
00041 
00042 #endif

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Sun Oct 24 12:41:56 2010 by Doxygen (1.6.2)