Commit 1d2a2cd8 authored by hybrid's avatar hybrid

Add driver choice.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2984 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 504a2474
...@@ -14,6 +14,7 @@ windows book for details. ...@@ -14,6 +14,7 @@ windows book for details.
#error Windows only example #error Windows only example
#else #else
#include <windows.h> // this example only runs with windows #include <windows.h> // this example only runs with windows
#include <iostream>
using namespace irr; using namespace irr;
...@@ -50,9 +51,35 @@ static LRESULT CALLBACK CustomWndProc(HWND hWnd, UINT message, ...@@ -50,9 +51,35 @@ static LRESULT CALLBACK CustomWndProc(HWND hWnd, UINT message,
} }
/*
Now ask for the driver and create the Windows specific window.
*/
int main() int main()
//int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hpre, LPSTR cmd, int cc) //int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hpre, LPSTR cmd, int cc)
{ {
// ask user for driver
video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D8;
printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Burning's Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");
char key;
std::cin >> key;
switch(key)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 1;
}
HINSTANCE hInstance = 0; HINSTANCE hInstance = 0;
// create dialog // create dialog
...@@ -116,7 +143,7 @@ int main() ...@@ -116,7 +143,7 @@ int main()
irr::SIrrlichtCreationParameters param; irr::SIrrlichtCreationParameters param;
param.WindowId = reinterpret_cast<void*>(hIrrlichtWindow); // hColorButton param.WindowId = reinterpret_cast<void*>(hIrrlichtWindow); // hColorButton
param.DriverType = video::EDT_OPENGL; param.DriverType = driverType;
irr::IrrlichtDevice* device = irr::createDeviceEx(param); irr::IrrlichtDevice* device = irr::createDeviceEx(param);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment