Getting resolution

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
delfy
Posts: 5
Joined: Sun Aug 24, 2003 7:42 pm

Getting resolution

Post by delfy »

1. How can I get resolution of desktop???

2. I have problem with DIRECTX.
When I run application with parameter DT_DIRECTX8, it start and immediately close - nothing shown!! Why??? When I start with DT_SOFTWARE it works OK.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

1) Not yet. Coming in next release.
2) Are you using DevC++? There is no support for DirectX yet in DevC++.
delfy
Posts: 5
Joined: Sun Aug 24, 2003 7:42 pm

Post by delfy »

1. OK, Thanks!!
2. Yes, I am using DevC++
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

How did you change resolutions in the tech demo. I'm looking to do that in a game. Thanks

~~The Robomaniac
delfy
Posts: 5
Joined: Sun Aug 24, 2003 7:42 pm

Post by delfy »

Not yet. Coming in next release.
is this possible now???
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

Yes, there is a windows function. Include windows.h and use this

// width
int cx = GetSystemMetrics(SM_CXSCREEN);
// height
int cy = GetSystemMetrics(SM_CYSCREEN);

That returns the resolution to the two aforementioned variables

~~ The Robomaniac
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

This feature is now implemented in version 0.4. But its not good to use windows functions, because your application won't compile with Linux. Use the VideoModeList instead:

Code: Select all

yourIrrlichtDevice()->getVideoModeList()->getDesktopResolution();
There is a detailed description at
http://irrlicht.sourceforge.net/docu/cl ... eList.html
Post Reply