OpenGL graphics are displayed in windows provided by the Microsoft Windows operating system or by X Windows.
To display graphics in a Microsoft Windows window, an OpenGL client will have to call Microsoft Windows functions such as CreateWindow.
Install the beta version of
Bloodshed
Dev-C++.
File →
New →
Project … →
MultiMedia →
OpenGL
To display graphics in an X Window window, an OpenGL client will have to call glX functions such as glXQueryExtension.
Compile and run this client
main.C
makefile
on i5.nyu.edu.
Mac: press control keys when clicking.
When displaying the output in X11.app on Mac OS X,
there were 27 extensions when a.out was run on
Solaris,
95 when a.out was run on on
Mac OS X.
Output
of
comm.
g++ main.C -lGL -lX11 ls -l a.out
/usr/openwin/bin/Xvfb
on i5.nyu.eduglReadPixels
.
/dev/winlock
:
/usr/kernel/drv/sparcv9/winlock
/system/object/winlock
#!/bin/sh # Copyright 2002, 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # Split off Server Number ServerNumber=`echo $1 |grep ":"` if [ "$ServerNumber" ] then shift fi exec /usr/openwin/bin/Xsun $ServerNumber +nkeyboard +nmouse -dev vfb $*
The temporary files are in
/tmp/.X11-pipe
,
/tmp/.X11-unix
,
/tmp/.X11-vfb
.
/usr/openwin/bin/Xvfb :0 screen 800x600x8 &
export DISPLAY=:0 env | grep DISPLAY
g++ little.C -lGL -lX11
./a.out fstat: Bad file number caused by glXCreateContext (failed to stat vfb) stat: No such file or directory (failed to stat vfb) Segmentation Fault(coredump)
echo $? 139
/usr/X11/bin/Xvfb :0 -screen scrn 800x600x8 _XSERVTransmkdir: Mode of /tmp/.X11-unix should be set to 1777 _XSERVTransmkdir: this may cause subsequent errors _XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed _XSERVTransMakeAllCOTSServerListeners: server already running Fatal server error: Cannot establish any listening sockets - Make sure an X server isn't already running
ls -l /tmp/.X11-unix total 0 srwxrwxrwx 1 root root 0 Apr 12 09:34 X0 srwxrwxrwx 1 root root 0 Apr 11 09:23 X10
Launch the application X11.app. In the xterm window it gives you, log into i5.nyu.edu.
ssh -Y abc1234@i5.nyu.edu
Then echo your DISPLAY environment variable and run your X Window client:
echo $DISPLAY ./a.out
Download Xming from
Sourceforge.
Launch it.
To verify that Xming is running,
right-click on the tool bar at the bottom of the screen,
Task Manager →
Processes
and look for
Xming.exe.
Launch
putty.exe.
PuTTY Configuration →
Category →
Connection →
SSH →
Tunnels
and check Enable X11 forwarding.
Then
Category →
Session
and connect to i5.nyu.edu.
You can open an xterm by saying
/usr/openwin/bin/xterm &
In the xterm window, or in the original putty window, you can now echo your DISPLAY environment variable and run your X Window client:
echo $DISPLAY ./a.out