-/* gltrackball, Copyright (c) 2002-2008 Jamie Zawinski <jwz@jwz.org>
+/* gltrackball, Copyright (c) 2002-2012 Jamie Zawinski <jwz@jwz.org>
* GL-flavored wrapper for trackball.c
*
* Permission to use, copy, modify, distribute, and sell this software and its
#include <math.h>
#include <stdlib.h>
+#include <string.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#ifdef HAVE_COCOA
-# include <OpenGL/gl.h>
-#else
+#ifndef HAVE_COCOA
# include <GL/gl.h>
#endif
+#ifdef HAVE_JWZGLES
+# include "jwzgles.h"
+#endif /* HAVE_JWZGLES */
+
#include "trackball.h"
#include "gltrackball.h"
return ts;
}
+/* Reset the trackball to the default unrotated state.
+ */
+void
+gltrackball_reset (trackball_state *ts)
+{
+ memset (ts, 0, sizeof(*ts));
+ trackball (ts->q, 0, 0, 0, 0);
+}
+
/* Begin tracking the mouse: Call this when the mouse button goes down.
x and y are the mouse position relative to the window.
w and h are the size of the window.