Page 1 of 1

(Run an FPS fullscreen mode and no cmd window!) shell I did

Posted: Mon Oct 06, 2008 1:45 pm
by Systemerror
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;
 }

Posted: Mon Oct 06, 2008 2:33 pm
by rogerborg
Thanks for sharing. Just FYI, the examples on the SVN trunk now remove the console for Windows apps like so:

Code: Select all

#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
Personally I'd only remove the log window in release builds, but I guess it will cut down on the number of "How do I..." questions (at the cost of adding "What log window?" question). ;)

Posted: Mon Oct 06, 2008 3:07 pm
by Seven
there is a log window now?

Posted: Mon Oct 06, 2008 4:23 pm
by sudi
haha...just great^^