Article View: comp.sys.sgi.misc
Article #122SGI graphics Frequently Asked Questions (FAQ)
From: Allan Schaffer
Date: Wed, 02 Jun 1993 06:37
Date: Wed, 02 Jun 1993 06:37
1468 lines
58738 bytes
58738 bytes
Archive-name: sgi/faq/graphics
SGI graphics Frequently Asked Questions (FAQ)
This information is freely distributable and wide circulation is encouraged.
The contents are accurate as far as we know, but the usual disclaimers apply.
This FAQ contains errors! Finding them is an exercise for alert readers.
Please send additions and changes to sgi-faq@archone.tamu.edu.
This FAQ is one of the SGI FAQ series, which consists of:
SGI Admin FAQ - IRIX System Administration
SGI Apps FAQ - Applications & Compilers
SGI Graphics FAQ - Graphics & Windowing
SGI Hardware FAQ - Hardware issues
SGI Misc FAQ - Introduction & Miscellaneous Information
Each FAQ is posted to each comp.sys.sgi.* group as well as the news.answers
and comp.answers newsgroups (whose purpose is to store FAQs) every two weeks.
If you can't find one of the FAQs with your news program, you can get it by
anonymous FTP from one of these sites:
rtfm.mit.edu:pub/usenet/news.answers/sgi/faq/graphics
rtfm.mit.edu:pub/usenet/comp.sys.sgi.misc/SGI_graphics_Frequently_Asked_Questions
archone.tamu.edu:ftp/pub/sgi/faq/graphics
rtfm.mit.edu:pub/usenet/comp.answers/sgi/faq/graphics
Note that 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.
Topics covered in this FAQ:
--------------------------
-1- How can I quickly find the question I want in this FAQ?
-2- What books about the X Window System and OSF/Motif
do you recommend?
-3- Sun XView applications like "mailtool" are hanging
my X server in 4.0.5. They come up fine, but as soon
as I click on them the server freezes.
-4- Why do I get DGL errors when trying to run Jot,
Workspace, or other IRIS GL applications on an
X terminal or other non-SGI workstation?
-5- After running a few programs, the colors change as
the cursor moves. The colors are usually all wrong
in other windows.
-6- How can I change my X Server to use a 12-bit PseudoColor,
12-bit TrueColor, or 24-bit TrueColor visual by default?
-7- The library /usr/lib/libgl_s.a isn't on my R4000 Indigo.
Where is it?
-8- How do I run a program on one machine and display
it on another?
-9- Does the DISPLAY environment variable work for
GL applications?
-10- The DISPLAY variable doesn't seem to work. Why?
-11- I'm getting DGL errors when I display an Iris GL
application to another SGI machine.
-12- Can I save my screen layout?
-13- Sometimes an extra 4Dwm is running, using a lot of
the CPU. Is this necessary?
-14- I'm running IRIX 4.0.1, and can't log in correctly.
After logging in the screen turns blue then goes back
to Pandora.
-15- How do I run 'xinit' manually, (not automatically
from 'xdm')?
-16- How do I start X on a remote host with no users logged in?
-17- What do the errors in my 'xdm-errors' file mean?
-18- How do I log into pandora without bringing up graphics?
-19- How do I start and stop the graphics system?
-20- Pandora won't come up, and /usr/adm/SYSLOG says
"helvetica font missing"
-21- How do I restart the console?
-22- What are resources?
-23- How do I set resources?
-24- How do I know what resources I can set for an application?
-25- How do I run the same program twice with different attributes?
-26- Does the GL recognize resources?
-27- How do I find out what fonts are available?
-28- Does SGI provide any tools to help with the
customization process?
-29- What is a good approach to take in looking for resources?
-30- What is the precedence for resource files?
-31- What files affect the window manager and what is
their relationship to each other?
-32- Do I need my own .4Dwmrc file?
-33- Can I run different window managers?
-34- How do I choose a different window manager as the default?
-35- Where can I learn more about the Window Manager behavior?
-36- How do I recover from a failed customization attempt?
-37- What is the difference between .xsession and .sgisession?
-38- After copying /usr/lib/X11/xdm/Xsession to .xsession,
I can't login.
-39- What are the important login and resource files
for IRIX 4D1-4.0?
-40- What is the sequence of events that occur at login time?
-41- How can I convert RGB Bitmaps to & from other formats?
-42- Can I compress RGB bitmaps?
-43- How can I look at a Postscript file?
-44- How do I make a screen dump?
-45- Can I use 4Dgifts code in my application?
-46- What does ERR_WMANIPC mean?
-47- How can I translate screen (x,y) coords into world
(x,y,z) coords?
-48- How can I translate world (x,y,z) coords into
screen (x,y) coords?
-49- I call mapcolor(index, R, G, B) but nothing happens. Why?
-50- What's wrong with blink()?
-51- 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".
-52- What is a GL widget?
-53- 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 is the problem?
-54- I get a "Broken Pipe" error when I close the window
of an X client, such as xman or xterm. What does
this error mean? Is there something wrong with my system?
-55- Is there a way to switch on the fly between single
and double buffering within a GL widget?
-56- Why doesn't SGI's xlock lock my screen?
-57- Why do I get compilation errors when compiling the
Inventor C++ examples, using C++ 3.0?
-58- Credits
----------------------------------------------------------------------
Subject: -1- How can I quickly find the question I want in this FAQ?
Date: 27 May 93 00:00:01 EST
- This FAQ follows the RFC1153 recommendations for message digests and thus
can be viewed easily with newsreaders that understand message digests.
- Each question has a Subject: line, so you can easily step through the answers
with rn's ^G command.
- Each question is marked with a "dash number dash" so that you can find any
answer with a simple search pattern.
- Questions marked with a '+' are new this posting; those marked with a '!'
have significant new content since the last edition.
------------------------------
Subject: -2- What books about the X Window System and OSF/Motif
do you recommend?
Date: 07 May 93 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: -3- Sun XView applications like "mailtool" are hanging
my X server in 4.0.5. They come up fine, but as soon
as I click on them the server freezes.
Date: 07 May 93 00:00:01 EST
Any XView application run under the Xsgi X11-server shipped in
IRIX versions 4.0.5A through 4.0.5G will lock the X Server on
the first mouse click and will not release it until killed from
somewhere else. Fortunately there is a workaround:
a) Run the application with '-Wfsdb' on the command line.
Alternatively you could use '-fullscreendebug'. For example:
% mailtool -Wfsdb
b) If you have the sources, add
extern int fullscreendebug;
before main() and
fullscreendebug = 1;
after the xv_init() call. This forces the program to set this
flag in any case - even when run with non-SGI X servers. It
releases you of the danger of omitting -Wfsdb and locking
your screen.
c) if the program uses the 'fullscreen' package, you might add
Fullscreen.Debug: True
in $HOME/.Xresources or specify this resource on the command
line. This flag currently disables grabs in both the 'window'
and the 'fullscreen' package, but is only set from resources
in the 'fullscreen' package.
------------------------------
Subject: -4- Why do I get DGL errors when trying to run Jot,
Workspace, or other IRIS GL applications on an
X terminal or other non-SGI workstation?
Date: 07 May 93 00:00:01 EST
This occurs because X Terminals and other vendors X servers
only understand X protocols. The above applications use Iris GL,
which is not an X server extension.
It is not currently possible to display IRIS GL-based applications
on X terminals or other non-SGI workstations.
Typically the error message resembles the following:
dgl error (TCP connect): Connection refused
dgl error (default init): default dglopen(host:0,4) returned -127
When OpenGL is available from other vendors, then you will be able
to do OpenGL rendering to those servers that export the GLX extension.
OpenGL is a normal X extension and the transport happens automatically
via the X transport stream.
------------------------------
Subject: -5- After running a few programs, the colors change as
the cursor moves. The colors are usually all wrong
in other windows.
Date: 07 May 93 00:00:01 EST
This is known as colormap flashing. It is caused by the server
maintaining 2 seperate 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 flasing by configuring your
X Server to use a 12-bit or 24-bit visual by default.
------------------------------
Subject: -6- How can I change my X Server to use a 12-bit PseudoColor,
12-bit TrueColor, or 24-bit TrueColor visual by default?
Date: 07 May 93 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. You can do this by invoking either
of the following commands:
% killall -TERM Xsgi
% /usr/gfx/stopgfx; /usr/gfx/startgfx
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: -7- The library /usr/lib/libgl_s.a isn't on my R4000 Indigo.
Where is it?
Date: 07 May 93 00:00:01 EST
It's in the "maint" software, in the maint_gl_x_dev package.
------------------------------
Subject: -8- How do I run a program on one machine and display
it on another?
Date: 07 May 93 00:00:01 EST
Use the DISPLAY environment variable to specify the remote host
on which you want the X client to be displayed; then invoke the
appplication.
To specify the 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: -9- Does the DISPLAY environment variable work for
GL applications?
Date: 07 May 93 00:00:01 EST
Yes. Iris GL programs display on the machine specified by the
DISPLAY environment variable. This occurs because the GL now uses
the Distributed Graphics Library (DGL) capabilities by default. It
is important to remember that only Silicon Graphics' machines can
display GL. For networks running NIS (formerly yellow pages),
it is sometimes necessary to add the flag "-lsun" when compiling.
------------------------------
Subject: -10- The DISPLAY variable doesn't seem to work. Why?
Date: 07 May 93 00:00:01 EST
There are several possibilities. First, check your DISPLAY
variable to make sure it is syntactically correct. For example,
to display applications on a machine named "enterprise" whose
IP address is 123.45.678.90, it should be set to "enterprise:0"
or "123.45.678.90:0".
Also, 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.
Sometimes, when trying to display to a remote server, you see
messages like "permission denied" or "can't connect to server".
To solve permission problems, you need to disable access control
on the remote server using the xhost command. By default, access
control is disabled on Silicon Graphics' machines.
For more information see Chapter 3 of the X Window System
User's Guide, (Vol. 3 of the O'Reilly series)
If NIS is used, make sure the client is linked with "-lsun".
------------------------------
Subject: -11- I'm getting DGL errors when I display an Iris GL
application to another SGI machine.
Date: 07 May 93 00:00:01 EST
Commonly the errors will look like:
dgl error (TCP connect): Connection refused
dgl error (default init): default dglopen(enterprise:0) returned -127
If this is the case, check the files /etc/services and
/usr/etc/inetd.conf on both machines. Make sure neither
of the lines below have been commented out. The services
file should contain a line which reads:
sgi-dgl 5232/tcp
inetd.conf should contain a line which reads:
sgi-dgl stream tcp nowait root /usr/etc/dgld dgld -IM -tDGLTSOCKET
------------------------------
Subject: -12- Can I save my screen layout?
Date: 07 May 93 00:00:01 EST
Not very easily. You must run "xwininfo" to find the X and Y
position of each window, then use that information to customize
your .sgisession or .xsession files.
There is also a tool called "xtoolplaces" that was posted to
comp.sources.x in volume14.
For more information see Chapter 3 of the X Window System
User's Guide, (Vol. 3 of the O'Reilly series)
------------------------------
Subject: -13- Sometimes an extra 4Dwm is running, using a lot of
the CPU. Is this necessary?
Date: 07 May 93 00:00:01 EST
No, there should only be one. This multiple window manager
problem usually is triggered by the "kill" feedback of the
window manager when a user logs out. The workaround for the
problem is to remove the "kill" feedback.
The "kill" feedback is controlled by the resource "showFeedback." For
4Dwm, this resource is defined in /usr/lib/X11/app-defaults/4DWm as:
*showFeedback: behavior restart quit kill
Modify the resource to read:
*showFeedback: behavior restart quit
For mwm, set a "showFeedback" resource that does not include the
"kill" feedback in /usr/lib/X11/app-defaults/Mwm. A sample setting is:
Mwm*showFeedback: move placement resize behavior restart quit
------------------------------
Subject: -14- I'm running IRIX 4.0.1, and can't log in correctly.
After logging in the screen turns blue then goes back
to Pandora.
Date: 07 May 93 00:00:01 EST
The problem is caused by an incorrect shutdown. When you log
out, xdm runs /usr/sbin/gamma and writes the current value to
/etc/config/system.glGammaVal. IRIX buffers this data in main
memory in the buffer cache. If the system is powered off right
after logout, the data is not written to the file.
a) Login to your system as root, either via the network or
by taking the machine down to single-user mode.
b) enter these commands at the # prompt:
# cd /etc/config
# cat system.glGammaVal
If the cat command returns a value of 1.7000, contact your technical
support provider for additional troubleshooting. If the command
returns nothing (empty file) or "0", it means the problem can be
fixed by entering the following command:
# /bin/rm system.glGammaVal
# /bin/echo "1.7" > system.glGammaVal
Check your work:
# cat system.glGammaVal
The command above should now return 1.7.
Your login should now be successful. If you edited the file while
Pandora was running, you'll find the first login attempt will fail,
but any later attempts will be successful. After the first login
attempt, Pandora will read in the correct gamma value.
------------------------------
Subject: -15- How do I run 'xinit' manually, (not automatically
from 'xdm')?
Date: 07 May 93 00:00:01 EST
Note that this change would 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: -16- How do I start X on a remote host with no users logged in?
Date: 07 May 93 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: -17- What do the errors in my 'xdm-errors' file mean?
Date: 07 May 93 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: -18- How do I log into pandora without bringing up graphics?
Date: 07 May 93 00:00:01 EST
In IRIX 3.3 you could specify the "NOGRAPHICS" option on the
login screen. The "NOGRAPHICS" option has been replaced with
the keyword "failsafe" that is typed after the users name on
the login screen. However, this command no longer brings up
a "textport" window without graphics. Instead, it now starts
a single xwsh on the center of the screen with no window manager.
Example login:
login: root failsafe
------------------------------
Subject: -19- How do I start and stop the graphics system?
Date: 07 May 93 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. Under
IRIX 3.* use /etc/gl/restartgl.
------------------------------
Subject: -20- Pandora won't come up, and /usr/adm/SYSLOG says
"helvetica font missing"
Date: 07 May 93 00:00:01 EST
It appears that the subsystem, "eoe2.sw.fonts" did not get loaded.
Re-install the subsystem using the following sequence from 'inst':
1) type "inst" or boot the mini-root, as documented in Section 4.5
of the "IRIS Software Installation Guide"
2) keep *
3) set neweroverride on
4) install eoe2.sw.fonts
5) exit
------------------------------
Subject: -21- How do I restart the console?
Date: 07 May 93 00:00:01 EST
Use /usr/sbin/startconsole. In IRIX 3.*, use /etc/gl/startconsole.
------------------------------
Subject: -22- What are resources?
Date: 07 May 93 00:00:01 EST
Basically, 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 for question #25.
------------------------------
Subject: -23- How do I set resources?
Date: 07 May 93 00:00:01 EST
There are many ways to set resources. Resources may be listed
in files or contained in a data base. It is recommended that
you consult a Book on X as well as the man page for "xrdb"
for detailed descriptions. Generally speaking, if xrdb is not
used, resource files are specified through environment
variables. Question #14 addresses the precedence of these
files and variables.
For some examples, see the file /usr/tutor/Customize/example.Xdefaults.
------------------------------
Subject: -24- How do I know what resources I can set for an application?
Date: 07 May 93 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: -25- How do I run the same program twice with different attributes?
Date: 07 May 93 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 93 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 do I find out what fonts are available?
Date: 07 May 93 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: -28- Does SGI provide any tools to help with the
customization process?
Date: 07 May 93 00:00:01 EST
Yes. The Customization rollover menu in the Toolchest contains three
entries: Window Info, Color Names, and Font Names. Please refer
to the man pages on these commands for details: xfontsel, xlsfonts,
xwininfo, xdpyinfo, xprop, appres, listres, and xrdb.
Also, see the "WorkSpace User's Guide" and the example files in
/usr/tutor/Customize.
------------------------------
Subject: -29- What is a good approach to take in looking for resources?
Date: 07 May 93 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: -30- What is the precedence for resource files?
Date: 07 May 93 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: -31- What files affect the window manager and what is
their relationship to each other?
Date: 07 May 93 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: -32- Do I need my own .4Dwmrc file?
Date: 07 May 93 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: -33- Can I run different window managers?
Date: 07 May 93 00:00:01 EST
In Irix 4D1-4.0, you may choose 4Dwm, mwm, twm, or uwm. Note that GL
programs are guaranteed to work only under 4Dwm.
------------------------------
Subject: -34- How do I choose a different window manager as the default?
Date: 07 May 93 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 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: -35- Where can I learn more about the Window Manager behavior?
Date: 07 May 93 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 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: -36- How do I recover from a failed customization attempt?
Date: 07 May 93 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: -37- What is the difference between .xsession and .sgisession?
Date: 07 May 93 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.
2) You can override some of the defaults the system default has
given you.
DISADVANTAGES OF $HOME/.sgisession :
1) You cannot override ALL of the defaults set for you.
2) 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.
3) 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 will exec your .xsession
file. This means that if you are REALLY sure you know what you are
doing, you can login 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.
This next part might be redundant
From the login event sequence mentioned earlier, you will note
that /usr/lib/X11/xdm/Xsession tries to exec $HOME/.xsession
if it exists. This is how you would go about changing
programs started by default. An example is the start of the
window manager. There is a discussion on xsession files in volume
3 of the O'Reilly series. For examples of alternate xsession files
look at /usr/people/4Dgifts/.xsession or /usr/demos/.xsession.
If you don't have a $HOME/.xsession file, /usr/lib/X11/xdm/Xsession
starts things for you and eventually looks for $HOME/.sgisession.
This is a good way to start additional programs without
changing what is started by default.
------------------------------
Subject: -38- After copying /usr/lib/X11/xdm/Xsession to .xsession,
I can't login.
Date: 07 May 93 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: -39- What are the important login and resource files
for IRIX 4D1-4.0?
Date: 07 May 93 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: -40- What is the sequence of events that occur at login time?
Date: 07 May 93 00:00:01 EST
This is a bare bones synopsis of the events that occur when
you log in to the console via xdm (xdm is the default method
of logging in).
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) Start 4Dwm.
8) Wait for 4Dwm to come up.
9) Disable display access control (xhost +). (man xhost)
10) Execute $HOME/.sgisession if it exists.
11) Start WorkSpace if the user wants it.
12) Put a Toolchest on each screen.
13) Start the console.
14) Exec the "reaper". (man reaper / endsession)
------------------------------
Subject: -41- How can I convert RGB Bitmaps to & from other formats?
Date: 07 May 93 00:00:01 EST
Several bitmap conversion tools are shipped with IRIX. 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 shipped in the 4Dgifts
dev.dev_sw.giftsfull package and placed in the directory
/usr/people/4Dgifts/iristools/imgtools. Each also has a man page.
------------------------------
Subject: -42- Can I compress RGB bitmaps?
Date: 07 May 93 00:00:01 EST
Yes. Use /usr/sbin/rle, which is part of eoe2.sw.imagetools
------------------------------
Subject: -43- How can I look at a Postscript file?
Date: 07 May 93 00:00:01 EST
Use xpsview or Ghostscript. xpsview is in dps_eoe. If you have
upgraded from 3.3, you will need to purchase this product.
Ghostscript, combined with Ghostview, allows you to preview PostScript
documents in an X window, without the need for Display PostScript (DPS).
This allows you to preview PostScript from your SGI machine on any device
that supports the X protocol (like X terminals, Suns, etc..)
There are ghostscript/ghostview inst'able images for IRIX 4.0.1+
available via anonymous ftp to ftp.sgi.com in ~ftp/sgi/ghost.
------------------------------
Subject: -44- How do I make a screen dump?
Date: 07 May 93 00:00:01 EST
Use the utilities /usr/sbin/snapshot or /usr/sbin/scrsave. Both
have a man page. You need to make sure that you have eoe2.sw.gltools
loaded to get the program and eoe2.man.gltools for the man page.
From within a GL program, you should call readdisplay().
For an example look at ~4Dgifts/iristools/imgtools/scrsave.c
------------------------------
Subject: -45- Can I use 4Dgifts code in my application?
Date: 07 May 93 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: -46- What does ERR_WMANIPC mean?
Date: 07 May 93 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: -47- How can I translate screen (x,y) coords into world
(x,y,z) coords?
Date: 07 May 93 00:00:01 EST
Check the manual page for mapw(3G) or mapw2(3G). mapw() returns
a line into (x,y,z) space.
------------------------------
Subject: -48- How can I translate world (x,y,z) coords into
screen (x,y) coords?
Date: 07 May 93 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: -49- I call mapcolor(index, R, G, B) but nothing happens. Why?
Date: 07 May 93 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: -50- What's wrong with blink()?
Date: 07 May 93 00:00:01 EST
- blink() is broken all the way up through 4.0.5F, where blink()
only blinks to black.
- you can work-around this blink() problem by doing the following:
blink(rate, index, red<<8, green<<8, blue<<8)
- ~4Dgifts/examples/glpg/ch04/blinker.c has three main problems:
- it doesn't do the above work-around.
- it doesn't do a gflush after mapping colors.
- it doesn't turn blinking off initially.
- what happens is that if a program starts anything blinking and
exits without ever turning blinking off with blink(-1, 0, 0, 0, 0)
then the next program to attempt blinking will not be able to blink.
this happens if for instance you close the blinker window before its
10 second sleep() has completed.
- a simple idea for a work-around for this problem: programs which do
blinking should turn their blinking on when they have focus; they
should turn all blinking off when they lose focus. This is not perfect
but is a plausible attempt at sharing the 20 blinking system-wide
colormap entries.
------------------------------
Subject: -51- 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 93 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: -52- What is a GL widget?
Date: 07 May 93 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: -53- 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 is the problem?
Date: 07 May 93 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: -54- I get a "Broken Pipe" error when I close the window
of an X client, such as xman or xterm. What does
this error mean? Is there something wrong with my system?
Date: 07 May 93 00:00:01 EST
Typically the error message resembles the following:
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: -55- Is there a way to switch on the fly between single
and double buffering within a GL widget?
Date: 07 May 93 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: -56- Why doesn't SGI's xlock lock my screen?
Date: 07 May 93 00:00:01 EST
If you or the super-user do not have a password, xlock will
not lock. Also, in IRIX 4.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: -57- Why do I get compilation errors when compiling the
Inventor C++ examples, using C++ 3.0?
Date: 07 May 93 00:00:01 EST
Inventor 1.0 and 1.0.1 were built using the 2.1.1 version
of the C++ compiler. If you are using C++ 3.0, you must
add the "-v2" switch to the Makefile's LC++DEFS line. It
would then look like the following:
# Options to C++; see the CC manual page for what they do
LC++OPTS = -v2 +p -Wf,-XNp10000
------------------------------
Subject: -58- Credits
Date: 6 May 93 00:00:01 EST
The comp.sys.sgi FAQs are the collective effort of
Dale Chayes dale@ldeo.columbia.edu
Steve Rikli steve@archone.tamu.edu
Allan Schaffer aschaffe@sgi.com
Dave Schweisguth dcs@neutron.chem.yale.edu
Special thanks are due to
Tom Davis Author of 'zip'
Harry Mangalam Maintainer of the comp.sys.sgi.* WAIS database
Finally, much thanks to all of the SGI employees on Usenet, all of whom have
provided gigabytes of help and information.
Credits for individual contributions are given in the answers.
------------------------------
--
Allan Schaffer
aschaffe@sgi.com
--
Allan Schaffer
aschaffe@sgi.com
Technical Details
Message-ID:
<graphics_739003067@fido.asd.sgi.com>Path:
arc1-ca.pugleaf.net!senator-bedfellow.mit.edu!enterpoop.mit.edu!gatech!howland.reston.ans.net!spool.mu.edu!olivea!sgigate!odin!fido.asd.sgi.com!holodeck.csd.sgi.com!aschaffeReferences:
<misc_739003067@fido.asd.sgi.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!senator-bedfellow.mit.edu!enterpoop.mit.edu!gatech!howland.reston.ans.net!spool.mu.edu!olivea!sgigate!odin!fido.asd.sgi.com!holodeck.csd.sgi.com!aschaffe From: aschaffe@holodeck.csd.sgi.com (Allan Schaffer) Newsgroups: comp.sys.sgi.misc,comp.sys.sgi.admin,comp.sys.sgi.apps,comp.sys.sgi.bugs,comp.sys.sgi.graphics,comp.sys.sgi.hardware,comp.answers,news.answers Subject: SGI graphics Frequently Asked Questions (FAQ) Supersedes: <graphics_738918418@fido.asd.sgi.com> Followup-To: comp.sys.sgi.misc Date: 2 Jun 1993 06:37:52 GMT Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 1468 Approved: news-answers-request@MIT.Edu Message-ID: <graphics_739003067@fido.asd.sgi.com> References: <misc_739003067@fido.asd.sgi.com> Reply-To: sgi-faq@archone.tamu.edu NNTP-Posting-Host: holodeck.csd.sgi.com Originator: aschaffe@holodeck.csd.sgi.com