aboutsummaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
authorJoshua Allen <axlecrusher@gmail.com>2017-03-18 20:23:40 -0400
committerJoshua Allen <axlecrusher@gmail.com>2017-03-18 20:23:40 -0400
commit079ef4516edee08da8a129a0d84249ccb79bbf23 (patch)
tree9e7b109a98957526ceca63b0ddd07fc96f8697a6 /test.c
parent4e3ac12016cc489c818709412acd293cac54cb78 (diff)
parent0f94e39d96fbc2744e61b85d2884250d0783eb11 (diff)
downloadlibsurvive-079ef4516edee08da8a129a0d84249ccb79bbf23.tar.gz
libsurvive-079ef4516edee08da8a129a0d84249ccb79bbf23.tar.bz2
Merge branch 'master' of github.com:cnlohr/libsurvive
Diffstat (limited to 'test.c')
-rwxr-xr-xtest.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/test.c b/test.c
index 7679ad4..4909d50 100755
--- a/test.c
+++ b/test.c
@@ -1,4 +1,6 @@
+#ifdef __linux__
#include <unistd.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
@@ -9,6 +11,31 @@
struct SurviveContext * ctx;
+void HandleKey( int keycode, int bDown )
+{
+ if( !bDown ) return;
+
+ if( keycode == 'O' || keycode == 'o' )
+ {
+ survive_send_magic(ctx,1,0,0);
+ }
+ if( keycode == 'F' || keycode == 'f' )
+ {
+ survive_send_magic(ctx,0,0,0);
+ }
+}
+
+void HandleButton( int x, int y, int button, int bDown )
+{
+}
+
+void HandleMotion( int x, int y, int mask )
+{
+}
+
+void HandleDestroy()
+{
+}
static void dump_iface( struct SurviveObject * so, const char * prefix )
@@ -56,6 +83,7 @@ int main()
dump_iface( survive_get_so_by_name( ctx, "WM0" ), "WM0" );
dump_iface( survive_get_so_by_name( ctx, "WM1" ), "WM1" );
dump_iface( survive_get_so_by_name( ctx, "TR0" ), "TR0" );
+ dump_iface( survive_get_so_by_name( ctx, "WW0" ), "WW0" );
while(survive_poll(ctx) == 0)
{