multiple winopen()'s with different gconfig()'s?

Dan Wallach dwallach at soda.berkeley.edu
Sun Apr 28 21:56:05 AEST 1991


While I was working on the sperm program (posted a couple hours ago) I ran
into one nasty bug that I just threw my hands up at.

There are times when I have two windows open, and I'd like them to have
different drawmode()'s and different color modes (RGBmode vs. cmode).

I tried effectively saying....

    win1 = winopen("Win 1");
    drawmode(OVERDRAW);
    gconfig();
    win2 = winopen("Win 2");
    winset(win2);  /* probably not necessary */
    drawmode(NORMALDRAW);
    RGBmode();
    gconfig();

And that just didn't work.  The NORMALDRAW business stuck.  I also tried
keeping track of this myself and getting the state, doing stuff, and writing
the state back out again.  I ended up screwing the window manager such
that background mode simply didn't work any more, and I'd have RGBmode
where windows weren't, and cmode where windows were (leading to some
cool effects, but not what I wanted).  The only fix for this was rebooting
the windows (ctrl-shift-f12-/), i.e. perfectly good programs started breaking.

The question:

How can I get different graphics states in different windows automatically,
so winset() is all I ever have to do?  Is it possible to get hold of my
graphics context directly and screw with it at a lower level?

Another side question:

How can I open a window title bar without any drawing area?  All I want is
a title bar, nothing else.  Need I dig down into NeWS?  Barring that, how
can I open a window that hangs below the screen?  I tried prefposition()
but it insisted on keeping the window completely on-screen.

For your info:
    I'm on a Personal Iris running Irix 3.3.1
    gversion() returns "GL4DPI2-3.3"
			   [^^^ hey, what's the 2 mean in PI2?]
hinv says:
    1 12 MHZ IP6 Processor
    FPU: MIPS R2010A/R3010 VLSI Floating Point Chip Revision: 1.5
    CPU: MIPS R2000A/R3000 Processor Chip Revision: 1.6
    Data cache size: 8 Kbytes
    Instruction cache size: 16 Kbytes
    Main memory size: 12 Mbytes
    Integral Ethernet controller: Version 0
    Graphics board: GR1.2 Bit-plane, Z-buffer options installed
    Integral SCSI controller 0: Version WD33C93
    Disk drive: unit 1 on SCSI controller 0

Thanks,

Dan Wallach
dwallach at soda.berkeley.edu



More information about the Comp.sys.sgi mailing list