PDA

View Full Version : how to change color and depth bits using OpenGL for SGI stations?



eugene
03-25-2002, 04:17 PM
Hi,

I wrote an OpenGL program for Windows 98 that uses the color buffer and the depth buffer. The number of bits for pixel are 8/8/8 for RGB and 16 for depth.

However, when I migrate the program to SGI station, I found out the number of bits are 5/5/5 for RGB and 0 for depth.

How can I change it, either using UNIX command or openGL?

Thanks.

john
03-25-2002, 06:01 PM
Howdy

you can change the video format with /usr/gfx/setmon. No, it isn't a crazy idea to call system commands from within a program (and, no, there isn't any other X way to do it under sgis, AFAIK); stereo programs call setmon all the time.

Hopefully you can setmon to something that supports a better pixel format. What you're saying is quite weird, tho'... are you sure you're choosing the ~best~ visual from the list?

cheers,
John

dorbie
03-25-2002, 06:26 PM
To be clear, this setmon thing only applies to lower end systems, systsms like the O2 where you are trading system memory on the UMA architecture for framebuffer memory. Other SGI systems have visuals based on display resolution and available hardware resources but typically always have deep visuals available.

john
03-25-2002, 06:51 PM
setmon is for EVERYTHING. Even the Onyx needs to use setmon to get into stereo mode.

marcus256
03-25-2002, 10:16 PM
How about the XSGIvc extension?? I think it should be able to do what setmon does.

Do you know any examples of how to use these things? (I do not have an IRIX station around to test them on)

newt
03-26-2002, 04:32 AM
On IRIX, there is a list of visuals supported
for the display when in a certain mode.

The visuals are determined when the X server (Xsgi) is started, so they only apply for the power-on default timing table. If you can switch formats on the fly (with setmon, xsetmon, ircombine, sgcombine, or programatically with XSGIvc), then it doesn't follow that the visuals will be different for the new video format. You need to restart X for that to happen.

The IRIX X server supports many visuals (color depths, buffer sizes etc.) simultaneously. That is, you don't have to change display modes to use a particular one. On smaller systems (O2 and such) there is a trade off between the visual capabilities and the display resolution and default depth.

A visual is analogous to a Win32 PixelFormat and there are glX calls which are analogous to ChoosePixelFormat to allow you to pick one for your application. To list the currently available visuals use the "glxinfo" command. Here's a snippet from one :-

-----------------------------------------------------------------
id dep cl xp bs lv rg d st rb gb bb ab ax dp st ar ag ab aa ms,b
-----------------------------------------------------------------
0x3f 15 tc . 16 . r y y 5 5 5 1 . 24 8 24 24 24 24 . .
0x40 24 tc . 32 . r . . 8 8 8 8 . 24 . 24 24 24 24 . .
0x41 24 tc . 32 . r . . 8 8 8 8 . 24 8 24 24 24 24 . .
0x42 24 tc . 32 . r y . 8 8 8 8 . 24 . 24 24 24 24 . .
0x43 24 tc . 32 . r y . 8 8 8 8 . 24 8 24 24 24 24 . .
0x45 30 tc . 32 . r . . 10 10 10 2 . 24 . 24 24 24 24 . .
0x46 30 tc . 32 . r . . 10 10 10 2 . 24 8 24 24 24 24 . .
0x47 30 tc . 32 . r y . 10 10 10 2 . 24 . 24 24 24 24 . .
0x48 30 tc . 32 . r y . 10 10 10 2 . 24 8 24 24 24 24 . .
0x49 30 tc . 48 . r . . 12 12 12 12 . . . 24 24 24 24 . .
0x4a 30 tc . 48 . r . . 12 12 12 12 . 16 . 24 24 24 24 . .
0x4b 30 tc . 48 . r y . 12 12 12 12 . 16 . 24 24 24 24 . .

The manual page glXIntro is a good place to
start with this.
http://techpubs.sgi.com:80/library/tpl/c...enGL/glxintro.z (http://techpubs.sgi.com:80/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=man&fname=/usr/share/catman/g_man/cat3/OpenGL/glxintro.z)

Moshe Nissim
03-26-2002, 12:24 PM
Originally posted by dorbie:
Other SGI systems have visuals based on display resolution and available hardware resources but typically always have deep visuals available.
Doesn't the Onyx also configure pixel depth on X startup? (small, medium, large, extra-large..)
So it actually needs a 'deeper' thing then setmon to go into deeper pixel format (where a different set of visuals is available