Code: Select all
//created by craig.fox[at]hotmail.co.uk
// http://virtualworld.synthasite.com all rights reserved
#include <irrlicht.h>
#include <windows.h>
using namespace irr;
#pragma comment(lib, "Irrlicht.lib")
//use winmain to stop console screen poping-up
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
// start up the irr engine in fullscreen
IrrlichtDevice *device =createDevice(video::EDT_DIRECT3D9, core::dimension2d<s32>(512, 384), 32,true, false, false, 0);
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* scenemgr = device->getSceneManager();
//get font for text rendering
gui::IGUIFont* font = device->getGUIEnvironment()->getBuiltInFont();
//only applicable for windowed mode
//device->setWindowCaption(L"Deep Sleep by http://virtualworld.synthasite.com ");
// add a FPS style user controlled camera
scenemgr->addCameraSceneNodeFPS();
while(device->run() && driver)
{
driver->beginScene(true, true, video::SColor(255,255,255,255));
scenemgr->drawAll();
driver->endScene();
}
// delete device
device->drop();
return 0;
}