Desktop Resolution

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
BenFlowers
Posts: 18
Joined: Fri Nov 03, 2006 10:42 pm

Desktop Resolution

Post by BenFlowers »

OK im a n00b only started not long ago, but i find this bit of code useful and im sure some other people will as i've seen some other people asking about getting the desktop resolution

Code: Select all

IrrlichtDevice *device0 = 0;
dimension2d<int> DesktopResolution;
dimension2d<int> getDesktopRes()
{
	device0 = createDevice(EDT_NULL,dimension2d<s32>(100,100),false,false);
	IVideoModeList *list = device0->getVideoModeList();
	DesktopResolution = (list->getDesktopResolution());
        device0->drop();
	return DesktopResolution;

}
just stick this in your header or wherever then call it and when you create your device set the size parameter to "DesktopResolution"

hope this helps :D
-BEN
Veylon
Posts: 7
Joined: Wed Nov 15, 2006 7:21 pm

Post by Veylon »

Very nice and convenient!
noreg
Posts: 158
Joined: Fri Jun 23, 2006 6:01 pm
Location: continental europe

Post by noreg »

Thanks Ben, i'am gonna try this. You're not related to a Noreen Flowers from LA?
Post Reply