(Run an FPS fullscreen mode and no cmd window!) shell I did
Posted: Mon Oct 06, 2008 1:45 pm
Ok, I'm also fairly new to Irrlicht, but am reading through the API's, *.docs 'n' tut's ect at a vast rate, and am at a reasonable level with game dev in general, but I often see people on here asking things like "How do I go in full screen mode and change the color", "How do I get rid of the command window" etc etc, well, I am working on a 3D game at the moment and when I first started it, I created a FPS fullscreen mode shell setting the RGB values to white , also using the WinAPI for the main method to stop the console winow, runs directly on DX3D9 (which can easily be changed if need be) and is an easy starting point which I will use in the future but I thought some of you may find this helpful.
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;
}