kopia lustrzana https://github.com/FreeSpacenav/libspnav
Fixed a typo in the magellan compatibility wrapper which obviously broke compatibility :)
Thanks to Jon Scholz for pointing it out. (also some whitespace fixes) git-svn-id: svn+ssh://svn.code.sf.net/p/spacenav/code/trunk/libspnav@101 ef983eb1-d774-4af8-acfd-baaf7b16a646pull/2/head v0.2.2
rodzic
9219db9556
commit
8e138bc2b0
|
@ -7,7 +7,7 @@ lib_so = $(soname).1
|
|||
|
||||
CC = gcc
|
||||
AR = ar
|
||||
CFLAGS = $(opt) $(dbg) -std=c89 -fpic -pedantic -Wall -fno-strict-aliasing -g -I.
|
||||
CFLAGS = $(opt) $(dbg) -std=c89 -fpic -pedantic -Wall -fno-strict-aliasing -I.
|
||||
|
||||
.PHONY: all
|
||||
all: $(lib_a) $(lib_so)
|
||||
|
|
2
README
2
README
|
@ -1,4 +1,4 @@
|
|||
libspnav - 0.2.1
|
||||
libspnav - 0.2.2
|
||||
----------------
|
||||
|
||||
1. About
|
||||
|
|
|
@ -33,7 +33,7 @@ GLXContext ctx;
|
|||
Window win;
|
||||
|
||||
vec3_t pos = {0, 0, -6};
|
||||
quat_t rot = {0, 0, 0, 1};
|
||||
quat_t rot = {0, 0, 0, 1}; /* that's 1 + 0i + 0j + 0k */
|
||||
|
||||
int redisplay;
|
||||
|
||||
|
@ -130,7 +130,7 @@ int create_gfx(int xsz, int ysz)
|
|||
XSetWMProtocols(dpy, win, &wm_del_win, 1);
|
||||
|
||||
set_window_title("libspnav cube");
|
||||
|
||||
|
||||
class_hint.res_name = "cube";
|
||||
class_hint.res_class = "cube";
|
||||
XSetClassHint(dpy, win, &class_hint);
|
||||
|
@ -168,7 +168,7 @@ void set_window_title(const char *title)
|
|||
void redraw(void)
|
||||
{
|
||||
mat4_t xform;
|
||||
|
||||
|
||||
quat_to_mat(xform, rot);
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
@ -292,6 +292,7 @@ int handle_event(XEvent *xev)
|
|||
if((sym & 0xff) == 27) {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case ConfigureNotify:
|
||||
{
|
||||
|
|
6
spnav.c
6
spnav.c
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
This file is part of libspnav, part of the spacenav project (spacenav.sf.net)
|
||||
Copyright (C) 2007-2009 John Tsiombikas <nuclear@siggraph.org>
|
||||
Copyright (C) 2007-2010 John Tsiombikas <nuclear@member.fsf.org>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
@ -205,7 +205,7 @@ static int x11_sensitivity(double sens)
|
|||
Window daemon_win;
|
||||
float fsens;
|
||||
unsigned int isens;
|
||||
|
||||
|
||||
if(!(daemon_win = get_daemon_window(dpy))) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -428,7 +428,7 @@ static int enqueue_event(spnav_event *event, struct event_node **tailptr)
|
|||
if(!tailptr) {
|
||||
tailptr = &ev_queue_tail;
|
||||
}
|
||||
|
||||
|
||||
(*tailptr)->next = node;
|
||||
*tailptr = node;
|
||||
return 0;
|
||||
|
|
2
spnav.h
2
spnav.h
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
This file is part of libspnav, part of the spacenav project (spacenav.sf.net)
|
||||
Copyright (C) 2007-2009 John Tsiombikas <nuclear@siggraph.org>
|
||||
Copyright (C) 2007-2010 John Tsiombikas <nuclear@member.fsf.org>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
This file is part of libspnav, part of the spacenav project (spacenav.sf.net)
|
||||
Copyright (C) 2007-2009 John Tsiombikas <nuclear@siggraph.org>
|
||||
Copyright (C) 2007-2010 John Tsiombikas <nuclear@member.fsf.org>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
@ -71,7 +71,7 @@ int MagellanInputEvent(Display *dpy, XEvent *xev, MagellanIntEvent *mev)
|
|||
}
|
||||
mev->u.data[6] = event.motion.period * 1000 / 60;
|
||||
} else {
|
||||
mev->type = event.button.press ? MagellanInputButtonEvent : MagellanInputButtonReleaseEvent;
|
||||
mev->type = event.button.press ? MagellanInputButtonPressEvent : MagellanInputButtonReleaseEvent;
|
||||
mev->u.button = event.button.bnum;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ int MagellanTranslateEvent(Display *dpy, XEvent *xev, MagellanFloatEvent *mev, d
|
|||
}
|
||||
mev->MagellanPeriod = event.motion.period;
|
||||
} else {
|
||||
mev->MagellanType = event.button.press ? MagellanInputButtonEvent : MagellanInputButtonReleaseEvent;
|
||||
mev->MagellanType = event.button.press ? MagellanInputButtonPressEvent : MagellanInputButtonReleaseEvent;
|
||||
mev->MagellanButton = event.button.bnum;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
This file is part of libspnav, part of the spacenav project (spacenav.sf.net)
|
||||
Copyright (C) 2007-2009 John Tsiombikas <nuclear@siggraph.org>
|
||||
Copyright (C) 2007-2010 John Tsiombikas <nuclear@member.fsf.org>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
|
Ładowanie…
Reference in New Issue