ultimatepp/bazaar/FTGL_Demo/TrackBall.h
micio 2c4e23d3d8 Bazaar/FTGL_Demo : a demo application for FTGL library
git-svn-id: svn://ultimatepp.org/upp/trunk@3872 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2011-09-17 17:41:26 +00:00

50 lines
779 B
C++

#ifndef _FTGL_Demo_TrackBall_h_
#define _FTGL_Demo_TrackBall_h_
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
class TrackBall
{
private:
Ctrl *owner;
Time lastTime;
float curquat[4];
float lastquat[4];
int beginx, beginy;
int width;
int height;
int button;
bool tracking;
bool animate;
void _Animate(void);
void _StartMotion(int x, int y, Time time);
void _StopMotion(Time time);
bool enableAnimCb;
protected:
public:
typedef TrackBall CLASSNAME;
void Matrix(void);
void Reshape(int width, int height);
void Animate(bool animate);
void SetButton(int but = Ctrl::LEFT) { button = but; }
virtual Image MouseEvent(int event, Point p, int zdelta, dword keyflags);
TrackBall(Ctrl *owner);
};
#endif