Page 1 of 1

iDisplayModes question

Posted: Tue Jul 20, 2004 12:00 pm
by swamped
I've just started checking out madCollection, working thru some of the examples, and am pretty impressed. :)

A question on iDisplayModes: the example works fine on the primary "monitor", but the interface doesn't seem to permit enumeration of other "monitors" (in a multimonitor array) - did I miss something?

And this may be a stupid question, so apologies in advance. :)
Is it possible to "inject" a resolution into the list that Windows returns with EnumDisplaySettings() - one that isn't normally returned by the display driver?

I realize that that might seem like a pointless thing to do, but I have my reasons... I'm just wondering if its possible?

Thanks in advance...

Re: iDisplayModes question

Posted: Tue Jul 20, 2004 1:25 pm
by madshi
swamped wrote:A question on iDisplayModes: the example works fine on the primary "monitor", but the interface doesn't seem to permit enumeration of other "monitors" (in a multimonitor array) - did I miss something?
I've not yet done anything for multi monitor support. Probably I should, but then I need 2 monitors first...
swamped wrote:Is it possible to "inject" a resolution into the list that Windows returns with EnumDisplaySettings() - one that isn't normally returned by the display driver?
Well, you can not really inject a new display mode into the list of display modes, but you can nevertheless work with a new display mode by using the function "DisplayMode". Does that help?

Code: Select all

function DisplayMode (width        : integer;
                      height       : integer;
                      bitsPerPixel : integer;
                      refreshRate  : integer = 0) : IDisplayMode;

Posted: Tue Jul 20, 2004 1:55 pm
by swamped
Thanks for the quick reply. That doesn't help, but I'm not surprised. I'm programming the graphics card to a "non-standard" resolution, and I was looking for a way to get Windows to use the resolution. Right now, e.g., if I program the hardware to 1032x776, I just end up with 1024x768 and 8 lines and rows of pixel garbage on screen.

Posted: Tue Jul 20, 2004 2:11 pm
by madshi
I've just checked. With the NVidia driver you can add custom resolutions. I've tried 1032x768 and it works just fine. I've no idea how to do this programatically, though. I think the NVidia control panel directly talks to the NVidia driver. I'm not aware of any API which would offer this kind of functionality.

Posted: Tue Jul 20, 2004 3:20 pm
by swamped
Thanks - I wanted to add this to drivers that do not support custom resolutions. Perhaps a filter driver...

Posted: Wed Jul 21, 2004 6:17 am
by madshi
I'm sorry to say but I've no idea how that would work.

Well, maybe adding the resolutions to the registry is already good enough? You know there are some registry keys where all the resolution information is listed. If you add a custom resolution there, the driver might accept that. I'm not sure, though.

Posted: Wed Jul 21, 2004 9:54 am
by swamped
Thanks for the idea, but I've been down that road already. So I wonder if it is would be possible and suffice to hook the EnumDisplaySettings() API call and modify the result, adding more devmodes?

Probably this is already too late. EnumDisplayModes() is how applications get a list of display modes from Windows. How does Windows get its list? Just musing... :)

Posted: Wed Jul 21, 2004 10:18 am
by madshi
Well, it's no problem to hook EnumDisplayModes and to simulate a new mode there. The real problem is to make the driver display that new mode.

I'd suggest using RegMon and FileMon to see what NVidia's control panel does when you add a custom resolution. If it's only adding some registry keys/values (what I suspect) you should be able to see whether those are NVidia specific or whether they might work with other IHVs, too.