Archive-name: sgi/faq/graphics Last-modified: Wed Oct 20 1:00:04 CDT 1999 Posting-Frequency: Twice monthly URL: http://www-viz.tamu.edu/~sgi-faq/ SGI graphics Frequently Asked Questions (FAQ) This is one of the Silicon Graphics FAQ series, which consists of: SGI admin FAQ - IRIX system administration SGI apps FAQ - Applications and miscellaneous programming SGI audio FAQ - Audio applications and programming SGI diffs FAQ - Changes to the other FAQs since the last posting SGI graphics FAQ - Graphics and user environment customization SGI hardware FAQ - Hardware SGI impressario FAQ - IRIS Impressario SGI inventor FAQ - IRIS Inventor SGI misc FAQ - Introduction & miscellaneous information SGI movie FAQ - Movies SGI performer FAQ - IRIS Performer SGI pointer FAQ - Pointer to the other FAQs SGI security FAQ - IRIX security Read the misc FAQ for information about the FAQs themselves. Each FAQ is posted to comp.sys.sgi.misc and to the news.answers and comp.answers newsgroups (whose purpose is to store FAQs) twice per month. If you can't find one of the FAQs with your news program, you can get it from ftp://viz.tamu.edu/pub/sgi/faq/ ftp://rtfm.mit.edu/pub/usenet/news.answers/sgi/faq/ (rtfm.mit.edu is home to many other FAQs and informational documents, and is a good place to look if you can't find an answer here.) The FAQs are on the World Wide Web at http://www-viz.tamu.edu/~sgi-faq/ If you can't use FTP or WWW, send mail to [email protected] with the word 'help' on a line by itself in the text, and it will send you a document describing how to get files from rtfm.mit.edu by mail. Send the command 'send usenet/news.answers/sgi/faq/misc' to get the SGI misc FAQ, and similarly for the other FAQs. Send the command 'send usenet/news.answers/internet-services/access-via-email' to get the "Accessing the Internet by E-Mail FAQ". You may distribute the SGI FAQs freely and we encourage you to do so. However, you must keep them intact, including headers and this notice, and you must not charge for or profit from them. Contact us for other arrangements. We can't be responsible for copies of the SGI FAQs at sites which we do not control, and copies published on paper or CD-ROM are certain to be out of date. The contents are accurate as far as we know, but the usual disclaimers apply. Send additions and changes to [email protected]. Topics covered in this FAQ: --------------------------- -1- DISPLAYS AND DGL -2- How can I run a program on one machine and display it on another? -3- Does the DISPLAY environment variable work for GL applications? -4- Why doesn't the DISPLAY environment variable seem to work? -5- Why do I get DGL errors when I try to run a GL program? -6- CUSTOMIZING -7- What tools does SGI provide to help with the customization process? -8- What are the important login and resource files for IRIX 4.0.x? -9- What is the sequence of events that occur at login time in IRIX 4.0.x? -10- What is the difference between .xsession and .sgisession in IRIX 4.0.x? -11- Why do 4Dwm, toolchest, Workspace, etc. not recognize an environment variable I set in my shell's startup files in IRIX 4.0.x? -12- How can I change desktops without using the mouse and Desks Overview? -13- How can I turn off the IRIX 5.2 Magic user environment? -14- How can I display my own background image under Indigo Magic? -15- Where is the default value of PATH set? -16- Why can't I log in after copying /usr/lib/X11/xdm/Xsession to .xsession? -17- How can I find out what fonts are available? -18- How can I use the Alt key as a Meta key in an xwsh window? -19- How can I configure my keyboard like a VT100? -20- Can I put a single large picture in the 'clogin' display? -21- How can I change clogin's background to an image? -22- RESOURCES -23- What are resources? -24- How can I set resources? -25- How can I use resources to run the same program twice with different attributes? -26- Does the GL recognize resources? -27- How can I know what resources I can set for an application? -28- What is a good approach to take in looking for resources? -29- What is the precedence for resource files? -30- Why do long resources cause X to crash mysteriously in IRIX 5.2? -31- 4DWM -32- Where can I learn more about the Window Manager? -33- What files affect the window manager and what is their relationship to each other? -34- Do I need my own .4Dwmrc file? -35- Can I run a different window manager? -36- How can I choose a different window manager as the default? -37- How can I recover from a failed window manager customization attempt? -38- ADMINISTRATION -39- How can I log into pandora/clogin without bringing up graphics? -40- How can I restart the console? -41- How can I start and stop the graphics system? -42- How can I restart the X server? -43- How can I run 'xinit' manually, rather than automatically from 'xdm'? -44- How can I start X on a remote host with no users logged in? -45- IMAGE FILES -46- How can I convert images to and from other formats? -47- How can I convert models to and from other formats? -48- What is the format of SGI's RGB files? -49- How can I compress RGB bitmaps? -50- How can I make a screen dump? -51- Why does the IRIX 5.3 desktop recognize but not deal with JPEG files? -52- PROGRAMMING -53- Can I use 4Dgifts code in my application? -54- What does ERR_WMANIPC mean? -55- How can I translate screen (x,y) coords into world (x,y,z) coords? -56- How can I translate world (x,y,z) coords into screen (x,y) coords? -57- Why does nothing happen when I call mapcolor(index, R, G, B)? -58- Why can't 'cc' find some standard Xwindows functions? -59- What is a GL widget? -60- I'm using the GlxMDraw widget and it doesn't seem that colors are being installed correctly. Overlays in the GlxMDraw widget are displayed in red and gray instead of the colors I specify. What's wrong? -61- Is there a way to switch between single and double buffering within a GL widget on the fly? -62- Why doesn't my X server use backing store? How can I turn it on? -63- What is "/dev/tport" used for? -64- Why is OpenGL's glDrawPixels slower than IrisGL's lrectwrite? -65- BUGS AND PROBLEMS -66- Why do I get a "Broken Pipe" error when I close an X client window? -67- What do the errors in my 'xdm-errors' file mean? -68- Why doesn't SGI's xlock lock my screen? -69- Why can't my XView application find its fonts? -70- After running a few programs, the colors change as the cursor moves. The colors are usually all wrong in other windows. -71- How can I make my X Server use a 12-bit PseudoColor, 12-bit TrueColor or 24-bit TrueColor visual by default? -72- When I try to run UIM/X uxserverd, I get an error message saying, "license file has been modified, cannot start the UIM/X license server". -73- I just upgraded from IRIX 5.2 to 5.3. Why does my PI or VGX say "extension GLX missing on display :0.0"? -74- Why does my X server (Xsgi) grow inexorably? -75- Why does my GL application run slower on newer SGI hardware than it did on older SGI hardware? -76- MISCELLANEOUS -77- What books about the X Window System and OSF/Motif do you recommend? -78- Does the IRIX 5.2 Magic user environment display on an X terminal? -79- What about OpenGL? -80- Which SGI machines can run OpenGL now? Which will in the future? -81- What's this about a copyright dispute over virtual desks in Indigo Magic? ---------------------------------------------------------------------- Subject: -1- DISPLAYS AND DGL Date: 15 May 1994 00:00:01 EST This section discusses how to use remote displays. ------------------------------ Subject: -2- How can I run a program on one machine and display it on another? Date: 07 May 1993 00:00:01 EST Specify the host on which you want the X client to be displayed, then run the application. To specify a remote host, setenv DISPLAY <destination>:0 where <destination> is the name or IP address of the remote host. To specify the local host (console), setenv DISPLAY :0 ------------------------------ Subject: -3- Does the DISPLAY environment variable work for GL applications? Date: 4 Jun 1997 00:00:01 EST Yes: IRIX 4.0.x and later uses the Distributed Graphics Library (DGL) to allow GL programs to run remotely. Applications running over DGL use the DISPLAY environment variable just as do ordinary X applications. OpenGL applications also will pay attention to the DISPLAY variable. OpenGL data, however, does not use DGL; it uses the standard X communications mechanism. ------------------------------ Subject: -4- Why doesn't the DISPLAY environment variable seem to work? Date: 4 Jun 1997 00:00:01 EST First, make sure your DISPLAY variable is syntactically correct. For example, to display applications on a machine named "enterprise", whose IP address is 123.45.678.90, DISPLAY should be set to "enterprise:0" or "123.45.678.90:0". Next, try to "ping" the machine to which your DISPLAY variable is set. If this does not work, you have either specified an invalid hostname, the host is down, or you are having network problems. If you are running an older binary that expects to see /etc/resolv.conf in /usr/etc, you will either have to make a symbolic link from /usr/etc/resolv.conf to /etc/resolv.conf, or set the DISPLAY variable with a numeric address. If you see messages like "permission denied" or "can't connect to server", you have a permission problem. Do 'xhost +yourmachine' on the remote machine to give 'yourmachine' access to the remote machine's display. (Note that 'xhost' is inactive by default on SGIs.) If you're using NIS (YP), make sure the client is linked with "-lsun". For more information see Chapter 3 of the X Window System User's Guide. ------------------------------ Subject: -5- Why do I get DGL errors when I try to run a GL program? Date: 4 Jun 1997 00:00:01 EST - There may be a problem with the DISPLAY variable or Xwindows permissions. See the previous question. - You may be trying to display on a non-SGI machine which doesn't support GL/DGL. Note that DGL is for running GL programs remotely, not OpenGL programs. OpenGL programs run remotely via the GLX X server extension. - DGL may be disabled in /etc/services and/or /etc/inetd.conf. The former file should have a line reading sgi-dgl 5232/tcp and the latter should have a line reading sgi-dgl stream tcp nowait root /usr/etc/dgld dgld -IM -tDGLTSOCKET If either is commented out, remove the comment. - You may be trying to display on a machine with a much older version of IRIX. Try another machine with a newer IRIX. An article in the Jan/Feb 1993 Pipeline describes the above in great detail. ------------------------------ Subject: -6- CUSTOMIZING Date: 15 May 1994 00:00:01 EST This section discusses ways to customize your environment, both with and without graphics. The next two sections go into depth on customizing Xwindows resources and the 4Dwm. ------------------------------ Subject: -7- What tools does SGI provide to help with the customization process? Date: 05 Jul 1994 00:00:01 EST Here are some good places to look in IRIX 4.0.x: - The Customization rollover menu in the Toolchest. - The manpages for xfontsel, xlsfonts, xwininfo, xdpyinfo, xprop, appres, listres, and xrdb. - The "WorkSpace User's Guide". - The example files in /usr/tutor/Customize. In IRIX 5.x, take the systemtour and keep your eyes open. ------------------------------ Subject: -8- What are the important login and resource files for IRIX 4.0.x? Date: 07 May 1993 00:00:01 EST The following three file groupings indicate where files that affect your login session reside. 1) /usr/lib/X11/* - This is THE starting place. Here you find the system default bindings for Motif, 4Dwm, and the Toolchest. The xdm directory lives here as well as the app-defaults directory. xdm controls the session management. Many application defaults are set in the app-defaults directory. 2) $HOME/[.Xdefaults, .4Dwmrc, .chestrc, .xsession, .sgisession] Here you find the files that control your system set-up. You create these files; they don't exist when you first log in. 3) /usr/bin/X11 - This is where the binaries live. It makes life nice to include this directory in your path. ------------------------------ Subject: -9- What is the sequence of events that occur at login time in IRIX 4.0.x? Date: 10 Dec 1993 00:00:01 EST This is a bare bones synopsis of the events that occur when you log in to the console via xdm (the default method of logging in) under IRIX 4.0.x and, with the desktop *disabled*, IRIX 5.x. 1) Provide a "failsafe" (nographics) login if required/requested. 2) Exec $HOME/.xsession if it exists. If it exists, the remaining steps should normally be included in the users .xsession file as well. 3) Load $HOME/.Xresources if it exists. 4) Set XUSERFILESEARCHPATH. 5) Incorporate a "shell" environment into the "session". (man userenv) 6) Set the root background and cursor. 7) Disable display access control (xhost +). (man xhost) 8) Start 4Dwm. 9) Wait for 4Dwm to come up. 10) Start the console. 11) Execute $HOME/.sgisession if it exists. 12) Start WorkSpace if the user wants it. 13) Put a Toolchest on each screen. 14) Exec the "reaper". (man reaper / endsession) ------------------------------ Subject: -10- What is the difference between .xsession and .sgisession in IRIX 4.0.x? Date: 07 May 1993 00:00:01 EST The system Xsession file (/usr/lib/X11/xdm/Xsession or Xsession-remote) starts up a number of important things when you log in, eg. 4Dwm, toolchest, loads resources, sets your XUSERFILESEARCHPATH, sets your root background, etc. One of the last things it does is look in your home directory for a .sgisession file. This allows you to start additional programs at login time. This is the file that you would use to start a mailbox, additional window, a calendar, etc. ADVANTAGES OF $HOME/.sgisession : 1) You don't need to read through yet another system file to see what you need or don't need. DISADVANTAGES OF $HOME/.sgisession : 1) You cannot override ALL of the defaults set for you. Some things you can't change from a .sgisession file: A) You can't start a different window manager. B) You can't change the way the console starts. C) You can't change toolchest output redirection to the console. 2) Users of other vendors' equipment are used to seeing a .xsession file. After checking for a "failsafe" (ie. no graphics) login, one of the first things that /usr/lib/X11/xdm/Xsession does is check for $HOME/.xsession. If it exists, Xsession execs your .xsession file. This means that if you are REALLY sure you know what you are doing, you can log in with a different window manager, xterm as a console, or xwsh not already iconified, etc. You can also turn off the toolchest output redirection, and start anything else you might have done in $HOME/.sgisession. There is a discussion on xsession files in volume 3 of the O'Reilly series. ------------------------------ Subject: -11- Why do 4Dwm, toolchest, Workspace, etc. not recognize an environment variable I set in my shell's startup files in IRIX 4.0.x? Date: 03 Sep 1995 00:00:01 EST The script /usr/lib/X11/xdm/Xsession (or, if you have one, your own ~/.xsession) runs when you log in and starts your window manager (4Dwm), Workspace, etc. To give these programs a copy of the environment you define in your shell's startup files, Xsession first runs 'userenv', which runs your shell just to see what environment variables your shell's startup files set and puts them into Xsession's environment. Later on Xsession runs 4Dwm, Workspace, etc. and they inherit Xsession's environment including the environment variables which 'userenv' got from your shell's startup files. However, 'userenv' objects to 1) errors in your shell startup files, 2) commands which print output to the terminal and 3) commands like 'stty' and 'tset', which expect to be connected to a terminal. Any of these may cause 'userenv' to give up completely, so that Xsession, 4Dwm, Workspace, etc. do not get any of your shell's enviroment. To get 'userenv' to work, you must 1) make sure that your shell startup files are error-free and 2) protect 'userenv' from commands which print output or expect to be connected to a terminal by testing for the ENVONLY environment variable before running them. (See the userenv(1) manpage.) You might try disabling your shell startup files (or parts thereof) one by one to narrow down which is causing the problem. Be sure to check both personal and system-wide shell startup files! See your shell's manpage for a complete list. Note that each terminal window (aka 'winterm', 'xwsh' or 'xterm') runs a fresh copy of your shell, so it has a second chance to set your environment variables. Your shell is now connected to a terminal and 'userenv' isn't involved, so none of the above problems apply. The environment in a terminal window will appear correct, and programs started from a window (e.g. by typing 'workspace' to start Workspace) will inherit the environment properly. Furthermore, 'userenv' often appears to work when run inside a terminal window, even when it does not work when run from Xsession. This is all fine, but it doesn't help when you log in. One right way to see if 'userenv' is working when it should is to add the line 'env > $HOME/test-userenv' to Xsession after the line that runs 'userenv', log in and examine the file it creates. 'bash' users take note: 'bash' has particular problems with 'userenv', and there is a special version of 'userenv' which works with 'bash' at ftp://viz.tamu.edu/pub/sgi/software/desktop/userenv.tar.gz. ------------------------------ Subject: -12- How can I change desktops without using the mouse and Desks Overview? Date: 8 Mar 1997 00:00:01 CST Ping Huang <[email protected]> contributes the following method: Unlike some other window managers, you can't navigate between desktops geographically, using some Control, Alt, and/or Shift'ed version of the arrow keys. However, you can tell 4Dwm to let you jump to a given desktop with a keystroke. If you want to customize one account only, copy /usr/lib/X11/system.4Dwmrc (or possibly /usr/lib/X11/$LANG/system.4Dwmrc, if you set the LANG environment variable for localization) to the user's home directory as .4Dwmrc. Look for the "Keys 4DwmKeyBindings" section, and add lines of the following form: # IndigoMagic desktops <Key>F1 root|icon|window f.switch_desk "Desk 1" <Key>F2 root|icon|window f.switch_desk "Desk 2" <Key>F3 root|icon|window f.switch_desk "Desk 3" <Key>F10 root|icon|window f.switch_desk "Global" The names of the desks are whatever arbitrary names you used to name your desks in Desk Overview. (The "Global" desk is, however, a special desk; see Desk Overview help for details. You still reference its name here as you would any other desk.) ------------------------------ Subject: -13- How can I turn off the IRIX 5.2 Magic user environment? Date: 18 Aug 1994 00:00:01 EST Mark Andrews <[email protected]> says: You can disable the Indigo Magic environment in two ways: 1) If you wish to disable it for all users on the machine: chkconfig desktop off 2) If you wish to disable it for a specific user, do touch ~<username>/.disableDesktop You may also have to remove the ~/.desktop-<hostname> directory as well as 4Dwm looks in there for a 4Dwmsession file which it uses for a guide to redisplay windows left open from the last session. Method 2 works ONLY if you have the original IRIX 5.2 xdm Xsession file, which contains the following code chunk: if /etc/chkconfig desktop ; then if [ -x $0.dt -a \! -f $HOME/.disableDesktop ] then exec $0.dt $* fi fi If you only want to turn off the file manager, create the file ~/.desktop-<hostname>/nodesktop. Whether you disable the entire desktop or just the file manager, you may also want to set one or more of these resources 4DWm*SG_autoSave: false 4Dwm*SG_manageSession: false 4Dwm*SG_useBackgrounds: false which are explained in the 4Dwm(1) manpage. See also the desktop_eoe release notes. ------------------------------ Subject: -14- How can I display my own background image under Indigo Magic? Date: 30 Apr 1995 00:00:01 EST Two SGI employees described two different ways to do this, one for folks who don't care about desktop icons and one for folks who do. Joel Tesler of SGI <[email protected]> says: 1) Disable Indigo Magic desktop icons in any of the three ways (~/.desktop-<host>/nodesktop, ~/.disableDesktop, or 'chkconfig desktop off') described in the previous entry. 2) Set the resource 4Dwm*SG_useBackgrounds: false 3) Run whatever command you like to display the image on the background. Jon Madison of SGI <[email protected]> says: 1) cp /usr/lib/X11/system.backgrounds ~/.backgrounds 2) Read your new ~/.backgrounds file (and 'man background') to see how it works, and edit it. Here's an example entry which uses 'xli' (a free image viewer) to display a GIF image: background "Legos" command "-execute /usr/local/bin/xli -onroot -fork /usr/people/jm/graphics/pix/lego.gif" default "-execute /usr/local/bin/xli -onroot -fork /usr/people/jm/graphics/pix/lego.gif" exeok "/usr/local/bin/xli" readok "/usr/people/jm/graphics/pix/lego.gif" 3) Run the 'background' customization panel. (It's in the default toolchest. Hey, there's your custom background in the list! Backgrounds set up in this way coexist fine with desktop icons. ------------------------------ Subject: -15- Where is the default value of PATH set? Date: 10 Dec 1993 00:00:01 EST Every program which allows a user to log in (telnet, rlogin, pandora, etc.) can specify PATH. Shells may as well if it isn't already set. There are many slightly different default values, and relying on them is a good way to get confused. The only reliable method is to set PATH in your shell's startup files. These are different for each shell, and are described in each shell's manpage. Beware of 'ksh', which has an internal, invisible default path ('/bin:/usr/bin') which it uses when PATH is not set. ------------------------------ Subject: -16- Why can't I log in after copying /usr/lib/X11/xdm/Xsession to .xsession? Date: 07 May 1993 00:00:01 EST After copying this file to your home directory, you need to remove all references to "xsession". References to xsession cause the system to try to execute $HOME/.xsession, which will create an infinite loop. Remove the lines in ~/.xsession that say: if [ -r $xsession -a "$0" != $xsession ]; then if [ -x $xsession ]; then exec $xsession else exec /bin/sh $xsession fi fi ------------------------------ Subject: -17- How can I find out what fonts are available? Date: 07 May 1993 00:00:01 EST The xfontsel and xlsfonts utilities help you find appropriate fonts. xlsfonts lists the fonts; xfontsel provides an interface for selecting a desired font. To use xfontsel, choose "Font Names" from the Customization rollover menu in the Toolchest. Please see the man pages and the IRIS Utilities Guide for further information. ------------------------------ Subject: -18- How can I use the Alt key as a Meta key in an xwsh window? Date: 23 Jun 1994 00:00:01 EST First, put the following X resources wherever you put X resources: --- beginning of resources --- ! This turns Alt-key into Meta-key. XWsh*metaKeyMask: 8 ! This allows multiple key modifiers in keybindings (so we can do ! meta-shift, meta-control, etc. and incidentally a) turns vt100 ! cursor key mode off and b) changes the cursor key bindings. XWsh*keyboardType: xlib ! This turns vt100 cursor key mode back on. Running 'tset' at login ! resets the terminal and turns the cursor keys back off, so don't ! run it. XWsh*initSequence: \233?1h ! The iris-ansi terminfo entry has arrow key sequences for the ibmrt ! keyboard, not the xlib keyboard; for curses applications to work, ! the arrow keys must be bound to the sequences in the terminfo ! entry. Rebinding the arrow keys to match the terminfo entry is more ! convenient than changing the terminfo entry. XWsh*ckmeKeyMap: \ Left(any): send("\033[D"); \ Right(any): send("\033[C"); \ Up(any): send("\033[A"); \ Down(any): send("\033[B"); --- end of resources --- 'tset' resets your terminal, so running it will undo the initSequence resource setting. There is a 'tset' command in the default csh/tcsh ~/.login file; replace the line eval `tset -s -Q` with if (! $?TERM) then eval `tset -s -Q` endif so 'tset' will run only if the TERM environment variable isn't already set. (You can't say 'if (! $?TERM) eval `tset -sQ`', because csh/tcsh evaluates the backquotes *before* the if.) Finally, if you use GNU Emacs, put the following in your .emacs: (set-input-mode nil nil t) This tells Emacs to allow Meta key usage even though the iris-ansi (xwsh) terminal description doesn't specify a Meta key. ------------------------------ Subject: -19- How can I configure my keyboard like a VT100? Date: 4 Jun 1997 00:00:01 EST 'xwsh -vt100' may be close enough; try it and see. (The PF keys are mapped to F9-F12.) If not, use 'xterm -name VT200' and put the following wherever you put the rest of your X resources: === snip === XTerm*VT200.Translations: #override \ <Key>BackSpace: string(0x7f) \n\ <Key>Num_Lock: string(0x1b) string("OP") \n\ <Key>KP_Divide: string(0x1b) string("OQ") \n\ <Key>KP_Multiply: string(0x1b) string("OR") \n\ <Key>KP_Subtract: string(0x1b) string("OS") \n\ <Key>KP_Add: string(0x1b) string("Om") \n\ <Key>Pause: string(0x1b) string("[34~") \n\ <Key>Print: string(0x1b) string("[32~") \n\ <Key>Scroll_Lock: string(0x1b) string("[33~") \n\ <Key>KP_0: string(0x1b) string("Op") \n\ <Key>KP_1: string(0x1b) string("Oq") \n\ <Key>KP_2: string(0x1b) string("Or") \n\ <Key>KP_3: string(0x1b) string("Os") \n\ <Key>KP_4: string(0x1b) string("Ot") \n\ <Key>KP_5: string(0x1b) string("Ou") \n\ <Key>KP_6: string(0x1b) string("Ov") \n\ <Key>KP_7: string(0x1b) string("Ow") \n\ <Key>KP_8: string(0x1b) string("Ox") \n\ <Key>KP_9: string(0x1b) string("Oy") \n\ <Key>KP_Decimal: string(0x1b) string("On") \n\ <Key>Insert: string(0x1b) string("[1~") \n\ <Key>Home: string(0x1b) string("[2~") \n\ <Key>Prior: string(0x1b) string("[3~") \n\ <Key>Delete: string(0x1b) string("[4~") \n\ <Key>End: string(0x1b) string("[5~") \n\ <Key>Next: string(0x1b) string("[6~") \n\ <Key>F1: string(0x1b) string("[17~") \n\ <Key>F2: string(0x1b) string("[18~") \n\ <Key>F3: string(0x1b) string("[19~") \n\ <Key>F4: string(0x1b) string("[20~") \n\ <Key>F5: string(0x1b) string("[21~") \n\ <Key>F6: string(0x1b) string("[23~") \n\ <Key>F7: string(0x1b) string("[24~") \n\ <Key>F8: string(0x1b) string("[25~") \n\ <Key>F9: string(0x1b) string("[26~") \n\ <Key>F10: string(0x1b) string("[28~") \n\ <Key>F11: string(0x1b) string("[29~") \n\ <Key>F12: string(0x1b) string("[31~") \n\ === snip === This remaps the keys as follows: --------------------------------------------- SGI Key | Emulated VT100 key --------------------------------------------- Num Lock | PF1 / | PF2 * | PF3 - | PF4 7 | 7 8 | 8 9 | 9 + | - 4 | 4 5 | 5 6 | 6 1 | 1 2 | 2 3 | 3 Enter | Enter 0 | 0 . | . Insert | Find Home | Insert Here Page Up | Remove Delete | Select End | Prev Screen Page Down | Next Screen F1 | F6 F2 | F7 F3 | F8 F4 | F9 F5 | F10 F6 | F11 F7 | F12 F8 | F13 F9 | F14 F10 | Help F11 | Do F12 | F17 Print Screen | F18 Scroll Lock | F19 Pause | F20 These translations encompass both VT100 and VT200 (LK201-style) keyboards. Thanks to Hemant Shah <[email protected]> and Isaac A. Stoddard <[email protected]> for their contributions here. Any volunteers to work out similar bindings for xwsh? ------------------------------ Subject: -20- Can I put a single large picture in the 'clogin' display? Date: 05 Nov 1995 00:00:01 EST Not in IRIX 5.0-5.2 or 6.0-6.0.1. You could in IRIX 4.0.x and earlier, and you can in IRIX 5.3 and 6.1 and later. Read the clogin(1) manpage. ------------------------------ Subject: -21- How can I change clogin's background to an image? Date: 05 Nov 1995 00:00:01 EST Convert the image to xbm ("X BitMap") format. (See under "IMAGE FILES" below for conversion programs.) Uncomment the 'xsetroot' line in /usr/lib/X11/xdm/Xlogin and change the filename after '-bitmap' to your .xbm file. If your image is smaller than your screen, it will be tiled to fill the screen. ------------------------------ Subject: -22- RESOURCES Date: 15 May 1994 00:00:01 EST This section discusses Xwindows resources. ------------------------------ Subject: -23- What are resources? Date: 07 May 1993 00:00:01 EST Resources are "attributes" that control the look and feel of an application. Resources include color, fonts, size, location, and more. Resources can have a complex format for binding strengths. For a complete description of resources, including a description of "loose" and "tight" bindings, consult a book listed in the bibliography question above. ------------------------------ Subject: -24- How can I set resources? Date: 07 May 1993 00:00:01 EST There are many ways to set resources. Resources may be listed in files or contained in a data base. Consult a book on X as well as the xrdb(1) manpage for detailed descriptions. Generally speaking, if xrdb is not used, resource files are specified through environment variables. "What is a good approach to take in looking for resources?" addresses the precedence of these files and variables. For some examples in IRIX 4.0.x, see the file /usr/tutor/Customize/example.Xdefaults. ------------------------------ Subject: -25- How can I use resources to run the same program twice with different attributes? Date: 07 May 1993 00:00:01 EST To accomplish this task, you need to take advantage of the "instance vs class" concept. This concept is explained further in most books on Xt. Many applications have a resource that lets you to give it a unique name. For example, from the xwsh man page : -name instance-name Provide a unique name for an xwsh window. This name becomes the instance name of the specific xwsh, with the class name always being "XWsh". Using the -name option allows you to give "names" to different instances of xwsh and assign different resources to each one. So if you want two different xwsh's with different resource sets, give them two different names, say howdymom and howdydoody, for example. Add the following to your ~/.Xdefaults file (if you use .Xdefaults) : howdymom*foreground: SeaGreen howdydoody*foreground: SGIBeet Now all you have to do is start them up : xwsh -name howdymom& xwsh -name howdydoody& ------------------------------ Subject: -26- Does the GL recognize resources? Date: 07 May 1993 00:00:01 EST Yes. In IRIX 4.0 and later, the GL responds to several X resources, allowing run-time control over some aspects of GL programs. The man page assumes you are somewhat familiar with X resources, if you are not, you should read some X documentation such as Volume 3 of the O'Reily X books. The GL uses resources names with the prefixes appname.gl. (instance prefix) Appname.GL. (class prefix) where appname and Appname are derived from the argument to the GL program's first call to winopen(3G) upper case. For complete information see the man page for GLRESOURCES. ------------------------------ Subject: -27- How can I know what resources I can set for an application? Date: 07 May 1993 00:00:01 EST The most common place to find resource variables for a particular application is in the man page for that application. For example, take a look at the man page for `xwsh'. Look for the section heading called `RESOURCES'. This section lists each resource for `xwsh', and in some cases, the valid values for that resource. Also, many major applications are built on top of the Xt toolkit. There are standard resources that these applications recognize. For a more complete description, see one of the books on Xt listed in the bibliography. ------------------------------ Subject: -28- What is a good approach to take in looking for resources? Date: 07 May 1993 00:00:01 EST The following is a recommended list of steps to take when searching for a resource, binding, behavior, etc. 1) Look in the 4.0 Transition Guide. 2) Look in /usr/tutor/Customize. 3) Look in /usr/demos. 4) Look in ~4Dgifts. (Available with the development option.) 5) If the client you are interested in is a GL client, see the man page for GLRESOURCES. 6) Look in /usr/lib/X11/app-defaults/ClientName. 7) Look in /usr/lib/X11/system.* . 8) Look through the man page for the client you are interested in. 9) Look in O'Reilly & Associates Vol. III. It has many gems pertaining to standard X clients. 10) Look in the documentation that came with your application. 11) Look in the OSF Motif manuals. 12) Post to comp.windows.x if you can not find an answer using steps 1 through 11. ------------------------------ Subject: -29- What is the precedence for resource files? Date: 07 May 1993 00:00:01 EST The following list indicates the weight of set resources. Items at the top have the greatest weight. 1) Hard coded values for resources. 2) Command line arguments. 3) Resources pointed to by $XENVIRONMENT. 4) Resource values loaded into the Resource Data Base via xrdb. 5) Resources pointed to by other environment variables : IF $XUSERFILESEARCHPATH is set then it contains a list of directories to search. ELSE IF $XAPPLRESDIR is set it contains a single directory, and a short list of related directories (e.g. adjusted for language) is where resource files must be found. ELSE Look in a short list of places related to $HOME (e.g. language adjusted). This includes files in $HOME that have the name of the class of the application. 6) Resource values set in $HOME/.Xdefaults, provided that the RESOURCE_MANAGER property hasn't been set via the xrdb command. (see the third paragraph in the xrdb man page) 7) Values set in /usr/lib/X11/app-defaults/*. 8) Values set through through the application's fall back mechanism. ------------------------------ Subject: -30- Why do long resources cause X to crash mysteriously in IRIX 5.2? Date: 13 Nov 1994 00:00:01 EST Get patch 36. ------------------------------ Subject: -31- 4DWM Date: 15 May 1994 00:00:01 EST This section discusses the 4D Window Manager. ------------------------------ Subject: -32- Where can I learn more about the Window Manager? Date: 07 May 1993 00:00:01 EST The man pages for 4Dwm and mwm contain a wealth of information on the window manager. There are also online files. You may want to read /usr/tutor/Customize/example.4Dwmrc (IRIX 4.0.x only) as well as /usr/people/4Dgifts/.4Dwmrc (if you have the IDO option). The OSF/Motif manuals listed in the bibliography are also good places to find information. (4Dwm is based on mwm). ------------------------------ Subject: -33- What files affect the window manager and what is their relationship to each other? Date: 07 May 1993 00:00:01 EST 1) ~/.4Dwmrc, if you have one 2) /usr/lib/X11/system.4Dwmrc 3) /usr/bin/X11/4Dwm 4) /usr/lib/X11/app-defaults/4Dwm 5) ~/.Xdefaults (or wherever you set resources) When 4Dwm is started, it looks for ~/.4Dwmrc. If it does not exist, it looks at /usr/lib/X11/system.4Dwmrc. The definitions for button bindings, menus, etc are contained in these files. For a better description of bindings, look in /usr/tutor/Customize/example.4Dwmrc and /usr/people/ 4Dgifts/.4Dwmrc. Also see the man pages for 4Dwm. The resource set for the bindings will actually "choose" which binding definition is set. ------------------------------ Subject: -34- Do I need my own .4Dwmrc file? Date: 07 May 1993 00:00:01 EST Not necessarily. As mentioned in the previous question, actual bindings are determined by resource names. If there is a binding definition in /usr/lib/X11/system.4Dwmrc that you like, you may choose it by setting the appropriate resource. ------------------------------ Subject: -35- Can I run a different window manager? Date: 07 May 1993 00:00:01 EST IRIX has 4Dwm, mwm, twm, and uwm. However, GL programs are guaranteed to work only under 4Dwm. ------------------------------ Subject: -36- How can I choose a different window manager as the default? Date: 07 May 1993 00:00:01 EST You must use a .xsession file and explicitly invoke the window manager and any other applications you want to use, such as 'toolchest' and 'xwsh'. After making this change, you may only be able to log out by using the "Log Out" selection in the toolchest, or by executing /usr/bin/X11/endsession. Here are the contents of a sample .xsession file: xhost + & toolchest -name ToolChest > /dev/console 2&>1 & winterm -bg red & winterm -bg blue & mwm > /dev/console 2&>1 & /usr/bin/X11/reaper Note that 'reaper' is not put into the background. When 'reaper' exits you will be logged out. Alternatively, you can do the following steps: 1. cp /usr/lib/X11/xdm/Xsession ~/.xsession 2. Remove the lines in ~/.xsession that say: if [ -r $xsession -a "$0" != $xsession ]; then if [ -x $xsession ]; then exec $xsession else exec /bin/sh $xsession fi fi 3. Change the line that says /usr/bin/X11/4Dwm >/dev/console 2>&1 & to /usr/bin/X11/mwm > /dev/console 2>&1 & ------------------------------ Subject: -37- How can I recover from a failed window manager customization attempt? Date: 07 May 1993 00:00:01 EST If your attempt at customization leaves you in a state where buttons and menus are no longer recognized, you can recover by pressing the <Alt><CTRL><Shift><!>keys simultaneously. A menu appears that will let you choose Motif, Iris, or user defaults. Choose either Motif or Iris defaults and then push OK. This restarts the window manager to a usable state. ------------------------------ Subject: -38- ADMINISTRATION Date: 15 May 1994 00:00:01 EST This section describes how to start and stop parts of the graphics system in various funky ways. ------------------------------ Subject: -39- How can I log into pandora/clogin without bringing up graphics? Date: 07 May 1993 00:00:01 EST Add the magic word 'failsafe' after your username. E.g. to log in as root without graphics, you'd type 'root failsafe', whack Enter, and type your password. ------------------------------ Subject: -40- How can I restart the console? Date: 07 May 1993 00:00:01 EST Use /usr/sbin/startconsole. 'startconsole' and 'winterm' (which 'startconsole' calls) are scripts, so you can see how they do it. ------------------------------ Subject: -41- How can I start and stop the graphics system? Date: 07 May 1993 00:00:01 EST Use /usr/gfx/startgfx and /usr/gfx/stopgfx. Be aware that stopgfx will kill any active windows and log you out. ------------------------------ Subject: -42- How can I restart the X server? Date: 10 Sep 1995 00:00:01 EST To restart the X server (Xsgi) once, do any one of the following (in increasing order of brutality): - killall -TERM Xsgi - hold down the left-Control, left-Shift, F12 and keypad slash keys (this is fondly known as the "Vulcan Death Grip") - /usr/gfx/stopgfx; /usr/gfx/startgfx - reboot To restart the X server every time someone logs out of the console, edit /var/X11/xdm/xdm-config, change the setting of "DisplayManager._0.terminateServer" from "False" to "True" and do 'killall -HUP xdm'. ------------------------------ Subject: -43- How can I run 'xinit' manually, rather than automatically from 'xdm'? Date: 07 May 1993 00:00:01 EST By doing the following, which will affect all users: 1) log in as root 2) Type: /usr/gfx/stopgfx chkconfig xdm off. 3) all users need to copy /usr/bin/X11/X to their home directory (renaming the file to .xserverrc), removing the if test for windowsystem, OR be familiar enough with xinit to have an alternate command line. 4) transfer all startup programs from .xsession/.sgisession to .xinitrc. 5) the last program to start from .xinitrc must not exit. When this one exits, the session terminates. ------------------------------ Subject: -44- How can I start X on a remote host with no users logged in? Date: 07 May 1993 00:00:01 EST This example starts up an xclock on the remote system. The easy way to test this for now is to rlogin to the system and type the commands. Once something works you can write some shell scripts and use rsh to run them: hydra is being used to login to oscar and start graphics on oscar. oscar is displaying the pandora login when this is done: hydra 2% rlogin oscar -l root oscar 1# /usr/gfx/stopgfx (screen blanks) oscar 2# chkconfig windowsystem on oscar 3# setenv DISPLAY :0.0 (display on local screen) oscar 4# /usr/bin/X11/X & (start Xsgi) oscar 5# xclock & (clock is displayed) To clean up: oscar 6# /usr/gfx/stopgfx (screen blanks) oscar 7# /usr/gfx/startgfx (re-start pandora) ------------------------------ Subject: -45- IMAGE FILES Date: 15 May 1994 00:00:01 EST This section discusses image files and formats. ------------------------------ Subject: -46- How can I convert images to and from other formats? Date: 10 Mar 1996 00:00:01 EST IRIX comes with several tools which convert images to or from SGI's RGB format. The executables are part of the eoe2.sw.imagetools subsystem, and include: fromalias - convert an Alias image to an IRIS image frombin - create an RGB IRIS image file from a binary dump of image data fromcmap - convert a color map into an image with one scanline fromcube - convert a Cubicomp/Vertigo image file to IRIS format fromdi - convert an old .di dithered image into an IRIS image fromface - convert a UNIX faceserver image into an IRIS image fromgif - convert a GIF image into an IRIS image frommac - convert a MacPaint image into an IRIS image frompic - convert a MOVIE BYU .PIC image to an IRIS image fromppm - convert an image in Jef Poskanzer's format into an IRIS image fromrla - convert a Wavefront image to an IRIS image fromsun - convert a sun image into an IRIS image fromtarga - convert a targa image into an IRIS image fromxbm - convert an X Bitmap image into an IRIS image fromxud - convert an xwd file into an IRIS image fromxwd - convert an xwd file into an IRIS image fromyuv - convert an Abekas yuv image into an IRIS image toalias - convert an IRIS image to an Alias image toascii - convert an IRIS image to text characters tobin - convert an IRIS image to binary dump of pixel data tobw - convert an IRIS image to black and white togif - convert an IRIS image to a Compuserve GIF image tomac - convert an IRIS image to MacPaint format tonews - convert an IRIS image into NeWS format topict - convert an IRIS image to Macintosh PICT format toppm - convert an IRIS image file into Jef Poskanzer's ppm image format tops - convert an IRIS image to PostScript toscitex - Convert IRIS images into Scitex CT2T images tosun - convert an IRIS image to a sun raster file totarga - convert an IRIS image to a type 2 targa image toyuv - convert an IRIS image to yuv format The source for each of these tools is in the 4Dgifts dev.dev_sw.giftsfull subsystem and installed in the directory /usr/people/4Dgifts/iristools/imgtools. Each also has a manpage. Similar tools for more formats ('fromeps', 'frompict', 'frompixar', 'fromps', 'fromtiff', 'fromutah', 'totiff', 'toutah', 'toxbm' and 'toxpm' at last count), as well as some which come with IRIX and a few miscellaneous cool image editing tools, are in ftp://ftp.sgi.com/graphics/bin/. 'fromjpeg' and 'tojpeg' can be found in ftp://ftp.clr.toronto.edu/pub/sgi/sgijpeg/. ftp://swedishchef.lerc.nasa.gov/ has 'fromvicar' in /image/conversion/from/, 'tocolps' and 'topcl' in /image/conversion/to/ and many other image-related tools in nearby directories. The Independent JPEG Group's free JPEG software (in ftp://ftp.uu.net/graphics/jpeg/) and ghostscript (in ftp://ftp.cs.wisc.edu/ghost/) don't speak RGB, but do convert many common formats to and from JPEG and PostScript respectively. Note that older versions ghostscript understand GIF images but newer ones do not due to copyright restrictions. Finally, 'imgworks' (in the imgtools.sw.tools subsystem) understands RGB, TIFF and FIT formats, and there are several freeware programs which work on SGIs and understand SGI's RGB format as well as many other formats: imtools ftp://ftp.sdsc.edu/pub/sdsc/graphics/imtools/sgi_4d/ xv ftp://ftp.cis.upenn.edu/pub/xv/ ImageMagick ftp://ftp.x.org/contrib/applications/ImageMagick/ netpbm ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/ The Graphics File Formats FAQ (in ftp://rtfm.mit.edu/pub/usenet/news.answers/graphics/fileformats-faq/) lists many other graphics file viewing and conversion programs. ------------------------------ Subject: -47- How can I convert models to and from other formats? Date: Wed Sep 22 14:32:29 CDT 1999 Converters to and from SGI's Inventor format are at ftp://ftp.sgi.com/sgi/inventor/ and ftp://viz.tamu.edu/pub/sgi/software/graphics/. ------------------------------ Subject: -48- What is the format of SGI's RGB files? Date: Wed Sep 22 16:52:40 CDT 1999 Read http://reality.sgi.com/grafica/sgiimage.html ------------------------------ Subject: -49- How can I compress RGB bitmaps? Date: 07 May 1993 00:00:01 EST Use /usr/sbin/rle, which is part of eoe2.sw.imagetools. ------------------------------ Subject: -50- How can I make a screen dump? Date: 13 Nov 1994 00:00:01 EST Use the utilities 'imgsnap' (IRIX 4.0.x only), 'scrsave', 'snapshot' or 'xwd'. All have manpages. 'imgsnap' is in the imgtools.sw.tools subsystem, 'scrsave' and 'snapshot' are in the eoe2.sw.gltools subsystem, 'xwd' is in x_eoe.sw.Xapps and their manpages are in the respective *.man.* subsystems. From within a GL program, you should call readdisplay(). For an example look at ~4Dgifts/iristools/imgtools/scrsave.c. ------------------------------ Subject: -51- Why does the IRIX 5.3 desktop recognize but not deal with JPEG files? Date: 18 Jun 1995 00:00:01 EST It's a bug in the IRIX 5.3 filetype rules. It is fixed in WebForce and will be fixed in future IRIXes. If you don't have WebForce, get the file ftp://viz.tamu.edu/pub/sgi/software/desktop/jpeg.ftr, put it in /usr/lib/filetype/local, cd to /usr/lib/filetype and type 'make'. ------------------------------ Subject: -52- PROGRAMMING Date: 15 May 1994 00:00:01 EST This section discusses graphics programming. See the apps, audio and movie FAQs for general, audio and movie programming issues and the impressario, inventor and performer FAQs for discussions of those packages. ------------------------------ Subject: -53- Can I use 4Dgifts code in my application? Date: 07 May 1993 00:00:01 EST Yes. The 4Dgifts are a "gift" and developers are welcome to use the code. However, SGI does not support the code in 4Dgifts. Note that certain restrictions apply. Please read the copyright statement in ~4Dgifts/README.Copyright. ------------------------------ Subject: -54- What does ERR_WMANIPC mean? Date: 07 May 1993 00:00:01 EST The "WMAN" in that message means "window manager." However, this no longer means "window manager" such as 4Dwm, but rather the entire X Window system. The error means that the GL program triggered a fatal X error. A GL program can get an X error, because all GL programs are actually X clients. When a GL program does a winopen(), libgl actually calls XCreateWindow, etc.) When a GL program gets an X error, libgl prints out these X errors using this error message: GL: X request = maj.min, error code = ercode where maj = major request code that caused the error min = minor request code ercode = X error code This turns out to be easy to interpret, so long as the request was a core X protocol request (e.g., a CreateWindow request). In that case: 1. You can look up the major code in /usr/include/X11/Xproto.h. 2. The minor code is not used. 3. The X error code can be found in /usr/include/X11/X.h. As you can see in Xproto.h, the core X protocol requests have request codes <= 127. However, if maj > 127, then the request is an X extension request. Unfortunately, it can be difficult to interpret this unless you built your program with a debugging libgl.a (compiled with -g). The reason is that for an X extension, the major request code and the starting error code are copied from the X server during client startup, and these codes are saved in variables inside libgl. With a debugging libgl, these variables can be printed out from within a debugger, such as dbx. If the major code indicates an X Input extension request, then the minor numbers then tell the X input request type, and these are found in /usr/include/X11/extensions/XIproto.h. Finally, the X Input Extension uses 132 as its "starting error code." The possible errors are found in /usr/include/X11/extensions/XI.h, where they're defined like this: #define XI_BadDevice 0 #define XI_BadEvent 1 #define XI_BadMode 2 #define XI_DeviceBusy 3 #define XI_BadClass 4 If you add 132 to these numbers, you get the error that's reported by the libgl error message. ------------------------------ Subject: -55- How can I translate screen (x,y) coords into world (x,y,z) coords? Date: 07 May 1993 00:00:01 EST Check the manual page for mapw(3G) or mapw2(3G). mapw() returns a line into (x,y,z) space. ------------------------------ Subject: -56- How can I translate world (x,y,z) coords into screen (x,y) coords? Date: 07 May 1993 00:00:01 EST There are two methods. The first method is detailed in ~4Dgifts/examples/grafix/world2scrn.c, which is part of the dev.dev_sw.giftsfull package. It multiplies the (x,y,z) vector into the current modeling and projection matrixes, and uses the result to interpolate based on the window size and position. The second method uses the current cursor position as a trick and is much simpler. Use cmov() to set the cursor position to the point of interest in world space, then call getcpos() to return the cursor position in screen coordinates. Note that if your entire viewport is off-screen, the results are undefined and you'll have to use the first method. float x,y,z; short x1, y1; cmov (x,y,z); getcpos (&x1, &y1); ------------------------------ Subject: -57- Why does nothing happen when I call mapcolor(index, R, G, B)? Date: 07 May 1993 00:00:01 EST You either need to call glcompat(GLC_SLOWMAPCOLORS, TRUE) at the beginning of your program, or call gflush() after calling mapcolor. See the NOTES section in "man mapcolors" and also "man glcompat" for further info. (This may also be in the GL release notes) ------------------------------ Subject: -58- Why can't 'cc' find some standard Xwindows functions? Date: 14 May 1994 00:00:01 EST You may be linking X libraries, which have complex interdependencies, in the wrong order. Mark Kilgard <[email protected]> provided this handy chart: libXm--libXirisw \ libXt--libXmu--libgl--libXi--libXext--libX11 / libXaw Libraries should be listed in the same order on the cc or ld command line, left to right, as they appear above. If you don't use routines from a library, of course, you don't need it. ------------------------------ Subject: -59- What is a GL widget? Date: 10 Jun 1993 00:00:01 EST GL widget refers to the GlxDraw (generic) and GlxMDraw (Motif) widgets that allow you to embed GL windows in Xt-based programs. To embed a GL windows in X-based programs is frequently called "Mixed-model" or "GLX" programming. There are several examples of mixed-model programming in the directory /usr/people/4Dgifts/examples/GLX. ------------------------------ Subject: -60- I'm using the GlxMDraw widget and it doesn't seem that colors are being installed correctly. Overlays in the GlxMDraw widget are displayed in red and gray instead of the colors I specify. What's wrong? Date: 10 Jun 1993 00:00:01 EST The window manager must be directed to install all appropriate colormaps. Use the XSetWMColormapWindows() call to do this -- list one window for each colormap to be installed plus the top level window. If using overlays, include the overlay window as well as the normal GL window. If your window is TrueColor, you should still install the appropriate colormap, as Indigo TrueColor is simulated using a colormap. ------------------------------ Subject: -61- Is there a way to switch between single and double buffering within a GL widget on the fly? Date: 10 Jun 1993 00:00:01 EST There is no way to switch between single and double buffered mode within the same window. (In X, this would mean changing the depth, which is not allowed.) To simulate this, you can create two GL widgets: a double buffered GL widget and a single buffered GL widget. When it is time to change the buffering mode, restack the windows so that the appropriate one is on top. If the two windows are created with a common parent, they move together when the parent is moved. For non-mixed mode applications, the GL performs this switching when you call gconfig(). ------------------------------ Subject: -62- Why doesn't my X server use backing store? How can I turn it on? Date: 12 Feb 1994 00:00:01 EST Mark Kilgard of SGI <[email protected]> writes, SGI ships its X server with backing store disabled. If you edit /usr/lib/X11/xdm/Xservers and remove the -bs option, then restart the X server, backing store will be available. The reason for not turning on backing store by default is two-fold. 1) In IRIX 4.0.X the code for managing overlay planes didn't properly take overlays into account so backing store doesn't work if you have overlay windows on the screen. This is fixed in IRIX 5.x. 2) In most cases, backing store hurts your performance. It cases ALL X rendering operations to make an extra (small) traversal through backing store code even if backing store isn't in use. Also when backing store is in use, it tends to grow the X server since a large amount of memory can easily be used to maintain backing store. One alternative to backing store is to render your image to a pixmap and then blit from the pixmap to the screen in response to expose events. This will stress the X server a great deal less than using backing store. Additionally, make sure you are compressing expose events when you redraw. ------------------------------ Subject: -63- What is "/dev/tport" used for? Date: 26 May 1993 00:00:01 CST Mark Stadler ([email protected]) says: /dev/tport is a streams-based tty device driver which can be in one of 2 modes: - when X is not running, /dev/tport gets its input from the graphics keyboard and images in the frame buffer (textport mode). This mode is only intended to be used in single-user mode or during transitional periods when the X server is not running. - when X is running, /dev/tport doesn't get any input and generates no output. Any programs or shells using /dev/tport hang on reads and toss writes. Kind of a strange device. But it makes more sense with a clear understanding of how /dev/console works. /dev/console is kind of like a terminal switch box. Rather than switching physical rs232 cables, we direct console output onto the output stream of other streams-based devices who request such behavior with TIOCCONS ioctl. By default, /dev/console directs its output to /dev/tport. In the absence of a windowing system this causes console output (including kernel prints) to show up on the textport in front of you. Once the window system is started, the /dev/tport is no longer visible. Thus the console is no longer visible. At this point, a terminal emulation window (using streams based ttys) can issue the TIOCCONS ioctl to cause console output (including kernel printfs) to show up in the emulation in the window in front of you. Note that when you bring the window system down, /dev/tport is still there with the same session it started with and the console output redirected back to it again. ------------------------------ Subject: -64- Why is OpenGL's glDrawPixels slower than IrisGL's lrectwrite? Date: 28 Jul 1995 00:00:01 EST Allen Akin of SGI <[email protected]> says: It's not, for the most common cases. After all, similar microcode and the same hardware are used for both commands. However, there are three issues to keep in mind. First, some midrange and low-end SGI graphics adaptors (particularly XS, XZ, Elan, and Extreme) transfer ABGR-ordered images much faster than they transfer RGBA-ordered images. The normal image format in IrisGL was ABGR, while in OpenGL it's RGBA. So to achieve the same performance in OpenGL that you did in IrisGL on those machines, you need to use ABGR-format images in OpenGL. The ABGR extension available in Irix 5.3 and later releases allows you to do this. See ``man glintro'' for background information on using OpenGL extensions, and ``man gldrawpixels'' for details on ABGR. Note that RealityEngine, IMPACT, and all future machines will process RGBA data at least as fast as ABGR, so RGBA is the way to go for new code. Second, some OpenGL pixel data types are faster than others. For most machines, unsigned byte RGBA (or ABGR) is the fastest full-color type. Unsigned byte and unsigned short are usually the fastest gray-scale types. Signed integer types are slower. Third, OpenGL pixel operations have a much richer set of features than IrisGL, and if any of those features are enabled, then image transfer can be significantly slower. Always disable the features that you don't need. The following code fragment disables features that are likely to make glDrawPixels slow: /* * Disable stuff that's likely to slow down glDrawPixels. * (Omit as much of this as possible, when you know in advance * that the OpenGL state will already be set correctly.) */ glDisable(GL_ALPHA_TEST); glDisable(GL_BLEND); glDisable(GL_DEPTH_TEST); glDisable(GL_DITHER); glDisable(GL_FOG); glDisable(GL_LIGHTING); glDisable(GL_LOGIC_OP); glDisable(GL_STENCIL_TEST); glDisable(GL_TEXTURE_1D); glDisable(GL_TEXTURE_2D); glPixelTransferi(GL_MAP_COLOR, GL_FALSE); glPixelTransferi(GL_RED_SCALE, 1); glPixelTransferi(GL_RED_BIAS, 0); glPixelTransferi(GL_GREEN_SCALE, 1); glPixelTransferi(GL_GREEN_BIAS, 0); glPixelTransferi(GL_BLUE_SCALE, 1); glPixelTransferi(GL_BLUE_BIAS, 0); glPixelTransferi(GL_ALPHA_SCALE, 1); glPixelTransferi(GL_ALPHA_BIAS, 0); /* * Disable extensions that could slow down glDrawPixels. * (Actually, you should check for the presence of the proper * extension before making these calls. I've omitted that * code for simplicity.) */ #ifdef GL_EXT_convolution glDisable(GL_CONVOLUTION_1D_EXT); glDisable(GL_CONVOLUTION_2D_EXT); glDisable(GL_SEPARABLE_2D_EXT); #endif #ifdef GL_EXT_histogram glDisable(GL_HISTOGRAM_EXT); glDisable(GL_MINMAX_EXT); #endif #ifdef GL_EXT_texture3D glDisable(GL_TEXTURE_3D_EXT); #endif ------------------------------ Subject: -65- BUGS AND PROBLEMS Date: 15 May 1994 00:00:01 EST This section discusses real and apparent bugs and problems we haven't covered already. ------------------------------ Subject: -66- Why do I get a "Broken Pipe" error when I close an X client window? Date: 10 Jun 1993 00:00:01 EST Typically the error message looks like: XIO: fatal IO error 32 (Broken pipe) on X server ":0.0" after 214 requests (214 known processed) with 0 events remaining. The connection was probably broken by a server shutdown or KillClient. The Window Manager is reporting that the pipe for your X client has been broken. This is normal when an X client exits. There is nothing wrong with your system. This message will also occur when the system is shut down. This is not an error condition and no core files are produced. ------------------------------ Subject: -67- What do the errors in my 'xdm-errors' file mean? Date: 07 May 1993 00:00:01 EST It depends on the error message, obviously. Some are: unable to load display mode, rnid = 196614, errno = 22 Failed to unbind rn from clip, rnid = 3,errno = 22 bogus window id in rrm request type(2) These are messages related to the communication between the rrm layer in the kernel and the X server. The messages usually occur when a GL window is being destroyed in a sequence that the X server did not expect. They are quite benign. ------------------------------ Subject: -68- Why doesn't SGI's xlock lock my screen? Date: 10 Jun 1993 00:00:01 EST If you or the super-user don't have a password, xlock will not lock. Under IRIX 4.0.x, xlock is set up by default to act as if invoked with the "-nolock" option, which tells it not to lock the screen. If you want force xlock to lock, do either of the following: a) Use the "+nolock" option when invoking xlock. This means "not nolock" (the opposite of "-nolock"). For example: % xlock +nolock b) Add the following line to your ~/.Xdefaults file: XLock.nolock: False In IRIX 5.x, the default behavior of xlock has been reversed, so xlock does indeed lock by default. If you wish to keep the IRIX 4.x behavior, invoke xlock with the -nolock option. ------------------------------ Subject: -69- Why can't my XView application find its fonts? Date: 11 Feb 1996 00:00:01 EST You haven't installed the x_eoe.sw.Xoptfonts subsystem. ------------------------------ Subject: -70- After running a few programs, the colors change as the cursor moves. The colors are usually all wrong in other windows. Date: 07 May 1993 00:00:01 EST This is known as colormap flashing. It is caused by the server maintaining 2 separate colormaps, one for GL windows and one for X windows. As the cursor moves around, the window manager will install the correct colormap for each window. This will cause colors to be wrong in other windows. For more information on colormaps and installation please see the Xlib Programming manual, chapter 7 (Vol I of the O'Reilly series). You can sometimes avoid colormap flashing by configuring your X Server to use a 12-bit or 24-bit visual by default. ------------------------------ Subject: -71- How can I make my X Server use a 12-bit PseudoColor, 12- bit TrueColor or 24-bit TrueColor visual by default? Date: 07 May 1993 00:00:01 EST By default, the SGI X Server is configured to use an 8-bit PseudoColor visual. X-based applications can request other visuals directly if they are available. Alternatively, you can change the default visual by performing the following steps: a) Run "/usr/bin/X11/xdpyinfo" and check that your server is capable of using a 12-bit or 24-bit visual. If it is, you will see lines similar to the following: visual id, max buffers, depth: 0x28, 0, 12 visual id, max buffers, depth: 0x29, 0, 12 visual id, max buffers, depth: 0x2a, 0, 24 The last number on each line represents the number of bits available for that visual. b) Log in as root c) Edit the file /usr/lib/X11/xdm/Xservers. By default it will contain the string: :0 secure /usr/bin/X11/X -bs -c -pseudomap 4sight for a 24-bit TrueColor visual change it to: :0 secure /usr/bin/X11/X -bs -c -class TrueColor -depth 24 for a 12-bit PseudoColor visual change it to: :0 secure /usr/bin/X11/X -bs -c -class PseudoColor -depth 12 d) Restart your X server as above. Note: X Server visuals are an advanced topic; before making the above changes you should be aware that some 3rd-party and freeware applications might not gracefully adapt to an X Server which supplies anything but an 8-bit PseudoColor visual by default. ------------------------------ Subject: -72- When I try to run UIM/X uxserverd, I get an error message saying, "license file has been modified, cannot start the UIM/X license server". Date: 07 May 1993 00:00:01 EST You probably have been given a bad key. The most frequent causes of incorrect keys have been incorrect capitalization and incorrect IP addresses. The program that generates the UIM/X key requires that the "host ID" (or IP address) be in hexadecimal format. If you feed it the standard form of IP address (i.e., 123.45.678.90) it will generate the wrong key and will not complain. To ensure that you are is giving the correct information when requesting a UIM/X key, please do the following: Hostname: Type in 'hostname' at the prompt, and be sure to say exactly what it says (including capitalization, if any). Host ID: Type in 'hostid' at the prompt, and be sure to say exactly what it says. You will be reading back a series of numbers of the form 0xc030c844. The leading 0x indicates that the following number is hexadecimal. The key generating script is highly sensitive to capital letters. Make sure you confirm the case of the letters, both when getting the hostname/hostid and when having your key read back to you. If this still doesn't fix the problem, you may have mixed files between UIM/X 1.0 and 2.0. Completely remove UIM/X, re-install it, and reproduce a Uimx2_0.license file with the correct information. ------------------------------ Subject: -73- I just upgraded from IRIX 5.2 to 5.3. Why does my PI or VGX say "extension GLX missing on display :0.0"? Date: 14 May 1995 00:00:01 EST Mark Kilgard of SGI <[email protected]> explains: /usr/lib/X11/dyDDX/glx.so, without which OpenGL doesn't work, is missing due to peculiar installation circumstances. (See the INSTALLING section of the SGI admin FAQ for general comments on that sort of thing.) Either remove the 5.2 gl_dev.sw.glprof subsystem *before* upgrading, or reinstall the 5.3 x_eoe.sw.Server subsystem *after* upgrading, and reboot. If you do the latter, be sure to "set neweroverride on" in 'inst'. ------------------------------ Subject: -74- Why does my X server (Xsgi) grow inexorably? Date: 04 May 1996 00:00:01 EST It's a combination of bugs in the kernel and X server (Xsgi) which result in leaked memory being allocated to Xsgi. Its total size (but not its resident size) increases until swap space is completely filled. It is fixed by the combination of patches 1187 (for non-Impact graphics) or 1098 (for Impact graphics) and 1255 for IRIX 5.3. You might also add the following to /usr/bin/X11/X before the lines where it starts Xsgi MALLOC_CONFIG=2:mm_minunmapsrch=0:mm_xf[0].mm_flindx=7:mm_xf[0].mm_szshft=5:mm_xf[1].mm_flindx=2055:mm_xf[1].mm_szshft=8:mm_xf[2].mm_flindx=2065:mm_xf[2].mm_szshft=20:mm_flsearh=30:mm_missthrash=4:mm_nszmult=32 export MALLOC_CONFIG (two lines, one beginning with "MALLOC_CONFIG=" and one with "export") or restart Xsgi periodically by hand or at each logout as described above. ------------------------------ Subject: -75- Why does my GL application run slower on newer SGI hardware than it did on older SGI hardware? Date: 8 Mar 1997 00:00:01 CST One probable explanation is that your program is using IrisGL (sometimes referred to as just "GL") rather than OpenGL. Starting with Impact graphics, SGI graphics hardware is optimized for native OpenGL. IrisGL calls are executed through an emulation layer known as IGLOO, or "IrisGL On OpenGL." This layer of emulation reduces performance. The best solution is to port your program to OpenGL. ------------------------------ Subject: -76- MISCELLANEOUS Date: 15 May 1994 00:00:01 EST Everything else. ------------------------------ Subject: -77- What books about the X Window System and OSF/Motif do you recommend? Date: 07 May 1993 00:00:01 EST Introductory Texts on the X Window System - O'Reilly and Associates Inc., "The Definitive Guides to the X Window System", by Valerie Quercia and Tim O'Reilly. Vol. 3, "X Window System User's Guide", Sebastopol, CA., 1988, 1989. Discusses being an end user of the X window system. Covers topics like window manages, font specifications, standard X clients and resources. Texts on X Window System Programming - O'Reilly and Associates, Inc. "The Definitive Guides to the X Window System", by Adrian Nye. Vol. 1, "Xlib Programming Manual", Sebastopol, CA, 1990. Contains the introductory elements for programming with the Xlib, the lowest level of the X window system. Discusses concepts such as X color capacities, windows, events, drawing primitives. - Young, Douglas A., "X Window Systems Programming and Applications with Xt" (OSF/Motif Edition). Prentice Hall. Englewood Cliffs, NJ. 1990. A thorough book starting with the basics of programming with a toolkit though advanced topics. Contains source code for several small complete applications. (Source code for this book is also available on line in the /usr/src directory of the Motif Development option.) - O'Reilly and Associates Inc., "The Definitive Guides to the X Window System", by Adrian Nye and Tim O'Reilly. Vol. 4, "X Toolkit Intrinsics Programming Manual", Sebastopol, CA., 1990. Another reference for programming with the OSF/Motif toolkit. Covers topics including basic programming, widgets, resources, and more advanced topics. Reference Texts for the X Window System : - O'Reilly and Associates Inc., "The Definitive Guides to the X Window System", by Adrian Nye. Vol. 2, "Xlib Reference Manual", Sebastopol, CA., 1988. Complete reference for Xlib library routines. - Scheifler, Robert and James Gettys, X Window System, Second Edition, Digital Press, 1990. ISBN 1-55558-050-5. Referred to as "the Bible" of Xlib and X Protocol reference. Reference Texts for the OSF/Motif Toolkit : - Open Software Foundation, "OSF/Motif Programmer's Guide". Release 1.1, Prentice Hall. Englewood Cliffs, NJ. 1990. Exhaustive reference of every widget in the OSF/Motif library. - Asente, Paul J. and Ralph R. Swick. "X Window System Toolkit". X Version 11, Release 4. Digital Press. 1990. Very in-depth reference to the structure and operation of an X window system toolkit. ------------------------------ Subject: -78- Does the IRIX 5.2 Magic user environment display on an X terminal? Date: 30 Apr 1994 00:00:01 EST Joel Tesler <[email protected]> says: Although it is not officially supported, it should work in IRIX 5.2 MR (but not in the beta release). There are some glitches. You probably don't have to set the environment variable _NO_DESKTOP_IMAGES, but try it if you have problems. There should be no reason to set _SGI_NO_REMOTE_GL. ------------------------------ Subject: -79- What about OpenGL? Date: 11 Aug 1995 00:00:01 EST It has its own newsgroup, comp.graphics.api.opengl, which has an FAQ, which is listed in the misc FAQ. ------------------------------ Subject: -80- Which SGI machines can run OpenGL now? Which will in the future? Date: 04 Oct 1995 00:00:01 EST The version of OpenGL which comes with IRIX 5.3 supports Entry, XS, XS24, XZ, XL, Elan, Extreme, VTX, Reality Engine, Reality Engine 2, G (on 4D20, 25, 30 and 35s only) TG (as G), VGX, and VGXT graphics. There are no plans for ports to any more older systems. See also 'relnotes gl_dev 6' under IRIX 5.3. ------------------------------ Subject: -81- What's this about a copyright dispute over virtual desks in Indigo Magic? Date: 27 Nov 1995 00:00:01 EST Xerox has a software patent which they claimed covered the virtual desks which are part of Indigo Magic. IRIX 5.3 and 6.x include licensing code which turned off virtual desks on 15 May 1995. See chapter 1 of the desktop_eoe release notes for details. The dispute has been resolved (we don't know how) and SGI has provided a new licensing code which will allow one to use virtual desks until 2038. The code and installation instructions are, among other places, at ftp://viz.tamu.edu/pub/sgi/software/desktop/overview-license and in the May/Jun 1995 Pipeline. Here's the punchline: Edit /var/netls/nodelock and replace the line containing the word "Desks" (this is the only non-blank line on a clean IRIX 5.3 system) with the following two lines: #:# "Silicon Graphics" Desks A "2038/01/01" 546fb4684914.02.c0.1a.3d.52.00.00.00 y49ga6qrewn69tqaq4r6m44g22 (Although the two lines are preceded by spaces here, they should be flush left in /var/netls/nodelock.) OR, if you like, you can get patch 455 from the TAC, which includes an 'ov' which doesn't check the license manager at all. Note, however, that patch 455 makes 'showfiles -F' fail. We don't yet know why. ------------------------------ End of sgi/faq/graphics Digest ****************************** -- The SGI FAQ group <[email protected]> http://www-viz.tamu.edu/~sgi-faq/ Finger us for info on the SGI FAQs, or look in ftp://viz.tamu.edu/pub/sgi/.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |