Amiga.org

Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Karlos on March 04, 2003, 02:23:32 PM

Title: Display info
Post by: Karlos on March 04, 2003, 02:23:32 PM
Hi all,

I got another RTFM question :-P

Does anybody know how to determine the horizontal / vertical refresh rates of a given display from C? I've been rumaging through the RKMS's, Includes & Autodocs and can't seem to find what I need.

I especially need the vertical refresh rate to determine the maximum safe locking time for direct video access / rendering under cybergraphx.

I know the info must be stored away in an intuition or graphics library structure somewhere. After all, you can see the refresh rates in the screenmode preferences window...

Thanks,

K
Title: Re: Display info
Post by: Karlos on March 05, 2003, 10:20:17 AM
*bump*

:-)
Title: Re: Display info
Post by: Piru on March 05, 2003, 11:14:06 AM
Quote
Does anybody know how to determine the horizontal / vertical refresh rates of a given display from C?

See getmodeidrate.c (http://www.iki.fi/sintonen/src/misc/getmodeidrate.c).
Title: Re: Display info
Post by: Karlos on March 05, 2003, 11:48:41 AM
Thanks! :-)

-edit-

BTW, whats the significance of the constants 280 and 5 in the

moninfo.TotalColorClocks * 280 * moninfo.TotalRows / 1000) + 5;

expression? Is there any likelyhood that theyre hardware dependent? Sorry if that turns out to be a really stupid question, don't have RKM to hand at the mo :-)

Title: Re: Display info
Post by: Piru on March 05, 2003, 12:52:11 PM
from graphics/displayinfo.h:

/* scanline width in 280 ns units    */

That +5 is just for proper rounding.
These are not hw dependant constants.
Title: Re: Display info
Post by: Karlos on March 05, 2003, 01:25:47 PM
Thanks again ;-)#

-edit-

Worked a treat...