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

A forum to store posts deemed exceptionally wise and useful
Post Reply
Systemerror
Posts: 98
Joined: Fri Oct 03, 2008 1:25 pm
Location: UK
Contact:

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

Post 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;
 }
-System error
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post 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). ;)
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Post by Seven »

there is a log window now?
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

haha...just great^^
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Post Reply