[comp.sys.sgi] Setmonitor

jra@BRL.MIL ("John R. Anderson", VLD/ASB) (03/20/90)

	I am trying to use the "setmonitor" routine to switch our 4D to
30 Hz, sync on green mode while I grab the video with another device.
I wrote a very simple program to attempt this:

	#include <gl/gl.h>
	#include <gl/get.h>


	main()
	{
		short mtype;
		int ch;

		mtype = HZ30_SG;
		setmonitor( mtype );	/* switch to 30 Hz */

		while( (ch=getchar()) != '\n' ); /* wait for a CR */

		mtype = HZ60;
		setmonitor( mtype );	/* switch back to normal */
	}



It compiles nicely, but upon execution I get an "invalid argument" error
message from both "setmonitor" calls.  Anyone run into this before?? Any
ideas on why this desn't work??



				Thanks,
				-John

root@sgzh.uucp (Bruno Pape) (03/20/90)

	#include <gl/gl.h>
	#include <gl/get.h>


	main()
	{
		short mtype;
		int ch;

		ginit();

		mtype = HZ30_SG;
		setmonitor( mtype );	/* switch to 30 Hz */

		sleep(5);

		mtype = HZ60;
		setmonitor( mtype );	/* switch back to normal */
	}



It compiles nicely, but upon execution I get an "invalid argument" error
message from both "setmonitor" calls.  Anyone run into this before?? Any
ideas on why this desn't work??



				Thanks,
				-John


The ginit() should help it work better. 

 Bruno

" ratcliffe) (03/20/90)

In article <1990Mar20.090310.4802@sgzh.uucp> root@sgzh.UUCP (Bruno Pape) writes:
>> In article <....> John ______________ writes:
>>	#include <gl/gl.h>
>>	#include <gl/get.h>
>>
>>	main() {
>>		short mtype;
>>		int ch;
>>
>>		ginit();
>>		mtype = HZ30_SG;
>>		setmonitor( mtype );	/* switch to 30 Hz */
>>		sleep(5);
>>		mtype = HZ60;
>>		setmonitor( mtype );	/* switch back to normal */
>>	}
>>
>>It compiles nicely, but upon execution I get an "invalid argument" error
>>message from both "setmonitor" calls.  Anyone run into this before?? Any
>>ideas on why this desn't work??
>>				Thanks, -John
>
>The ginit() should help it work better. 
>
> Bruno

however, since all you are indicating you wish to do here is set 
yer monitor to a different mode than 60Hz, ginit(), is NOT an 
optimal/"state of the art" choice.  ginit() was the original 
"o.k. it's time to initialize grafix, ms. grafix pipe" signal to
prepare the geometry pipe for incoming grafix commands and data 
back in GL1 days on the 1000 terminals and workstations BEFORE 
the primitive "mex" window manager was implemented.  GINIT(3G) 
was implemented to take over the whole grafix console screen and
NOT be a moveable/resizeable GL window.  Then when "mex" came 
along, first GETPORT(3G), and then WINOPEN(3G) (we'll skip 
GBEGIN(3G) in this discussion.) became the standard way of 
opening multiple GL windows that were capable of "co-existing"
with each other. (getport() was the first such attempt at this,
as it is indeed a movable/resizeable window, but you can only 
open one per GL program.  contrasted to this was the fully 
evolved winopen which lets you open more than one window per GL
prog and switch back and forth as you need to drawing first into
window A, then into window E, and then window ___..., etc.).  
so much for the history lesson.
all of that is a preamble to what i wud recommend you *really* want
to do in the above prog. which is replace "ginit();" w/the sequence:

		 noport();
		 winopen("set monitor to 30Hz");

this use of noport *prior* to winopen is a rather swank trick 
which enables one to initialize grafix (the necessary pre-requisite
to successful invocation of 98.5% of all GL calls) *without* having
to open a window if one does not explicitly need to do so.  the 
above sequence is the standard approach when needing to modify 
[a piece of] the colormap, changing monitor mode(s), etc..
--
                                             daveus rattus   

                                   yer friendly neighborhood ratman

                              KOYAANISQATSI

   ko.yan.nis.qatsi (from the Hopi Language)  n.  1. crazy life.  2. life
     in turmoil.  3. life out of balance.  4. life disintegrating.  
     5. a state of life that calls for another way of living.