# HG changeset patch # User John Tsiombikas # Date 1405651477 -10800 # Node ID 2b559dc24c7bdde140c233ca38d586a367dfb92f # Parent 819c7ebb1bec329f97e84a803d9e1e169bc55484 done diff -r 819c7ebb1bec -r 2b559dc24c7b README --- a/README Fri Jul 18 05:07:40 2014 +0300 +++ b/README Fri Jul 18 05:44:37 2014 +0300 @@ -1,5 +1,19 @@ -1. Create 2 pseudoterminals: socat -d -d PTY PTY -2. start ./eqemu /dev/pts/one -3. set the php script to use /dev/pts/theother (make sure apache has permission - to rw it). - Try minicom -D /dev/pts/theother with disabled flow control to test it. +equeue emulator usage +--------------------- +- execute the included RUN script to start a pseudoterminal pair and connect the + emulator to one end. +- then make sure your program connects to the pseudoterminal /tmp/ttyeqemu. + +For testing you can run minicom thus: minicom -D /tmp/ttyeqemu + + +build instructions +------------------ +dependencies: +- OpenGL +- GLEW +- libpng +- libjpeg +- zlib + +After installing all necessary depdencies, just type make. diff -r 819c7ebb1bec -r 2b559dc24c7b RUN --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RUN Fri Jul 18 05:44:37 2014 +0300 @@ -0,0 +1,13 @@ +#!/bin/sh + +socat PTY,link=emuport PTY,link=/tmp/ttyeqemu & +if [ $? != 0 ]; then + echo "failed to create PTY pair" >&2 + exit 1 +fi + +echo 'starting equeue system emulator. connect to the /tmp/ttyeqemu fake serial port' + +./eqemu emuport + +kill %1 # kill socat diff -r 819c7ebb1bec -r 2b559dc24c7b src/dev.cc --- a/src/dev.cc Fri Jul 18 05:07:40 2014 +0300 +++ b/src/dev.cc Fri Jul 18 05:44:37 2014 +0300 @@ -12,6 +12,8 @@ #include "dev.h" #include "timer.h" +void post_redisplay(); // defined in main.cc + int customer, ticket; static int report_inputs, cmd_echo; static long last_ticket_msec = LONG_MIN; @@ -106,6 +108,8 @@ if(report_inputs) { fprintf(fp, "ticket: %d\n", ticket); } + + post_redisplay(); } void next_customer() @@ -116,6 +120,8 @@ if(report_inputs) { fprintf(fp, "customer: %d\n", customer); } + + post_redisplay(); } } @@ -162,6 +168,7 @@ customer = 0; ticket = 0; last_ticket_msec = LONG_MIN; + post_redisplay(); break; case 't': diff -r 819c7ebb1bec -r 2b559dc24c7b src/main.cc --- a/src/main.cc Fri Jul 18 05:07:40 2014 +0300 +++ b/src/main.cc Fri Jul 18 05:44:37 2014 +0300 @@ -19,6 +19,7 @@ GLOW_PASS }; +void post_redisplay(); static bool init(); static void cleanup(); static void display(); @@ -109,6 +110,11 @@ return 0; } +void post_redisplay() +{ + draw_pending = true; +} + static bool init() { if(fake_devpath) { @@ -509,7 +515,7 @@ unsigned int evmask = StructureNotifyMask | VisibilityChangeMask | ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | - PointerMotionMask; + PointerMotionMask | LeaveWindowMask; XSelectInput(dpy, win, evmask); xa_wm_prot = XInternAtom(dpy, "WM_PROTOCOLS", False); @@ -600,6 +606,13 @@ } break; + case LeaveNotify: + if(ev.xcrossing.mode == NotifyNormal) { + cam_theta = cam_phi = 0; + draw_pending = true; + } + break; + default: break; }