xterm
window for input
robowindow.o
contains code for window management
Display *init_window(argc, argv, wscale)
: opens and
initializes the display window, with (float) wscale
scaling factor and returns a pointer to the X
display in use.
process_event()
: handles X events related to the
display window.
update_player(id, name)
: adds a new player id to
name mapping for the display labeling function.
update_window(nobj, status)
: redraws the display
window according to the new status (received from the Robowar
server).
init_window
init_window
-display
Display
type:
#include <X11/Xlib.h> Display *dpy; dpy = init_window(argc, argv, wscale);
process_event
XPending
is true
while (XPending(dpy)) process_event();
XPending
is in X library
update_player
update_player
manages list of players; your client
just passes in changes
update_window
robowindow.o
, math and X libraries
gcc ${CFLAGS} -o player player.o \ /home/brian/cse342/bin/robowindow-solaris10-x86.o -lX11 -lm -L/usr/openwin/lib(Other versions of robowindow.o are available for different platforms.)