1 #ifndef _SX_SXWIDGET_H_
2 #define _SX_SXWIDGET_H_
9 #include <export/Export.h>
11 #include <sx/SXMath.h>
16 #include <QtOpenGL/QGLWidget>
17 #include <boost/unordered_map.hpp>
18 #include <boost/timer.hpp>
19 #include <boost/date_time/posix_time/posix_time.hpp>
22 using boost::posix_time::ptime;
23 using boost::posix_time::second_clock;
24 using boost::posix_time::to_simple_string;
26 using namespace boost;
51 static map<int,int> keys_qt2sx;
56 static map<int,int> initKeys_qt2sx();
58 void keyPressEvent(QKeyEvent * e);
60 void keyReleaseEvent(QKeyEvent * e);
62 void mousePressEvent(QMouseEvent * e);
64 void mouseReleaseEvent(QMouseEvent * e);
66 void mouseMoveEvent(QMouseEvent * e);
68 void wheelEvent(QWheelEvent * e);
100 void resizeGL(
int width,
int height);
130 bool processingListeners;
136 bool callStopAfterRender;
141 vector<SXRenderListener *> listeners;
146 vector<SXRenderListener *> initListeners;
158 boost::timer timeMeasurement;
163 double lastTimeRendered;
168 double currentTimeRendering;
198 double lastSetMouseTime;
203 vector<Vector> setMouseDeltas;
208 unordered_map<int,int> keys;
213 unordered_map<int,int> mouseKeys;
224 void addKey(
int key);
229 void removeKey(
int key);
262 EXW
void finishedRendering();
274 EXW
void wheelRotates(
float degrees);
293 EXW
void renderPeriodically(
float time);
298 EXW
void stopRenderPeriodically();
314 EXW
void deleteRenderListeners();
319 EXW
double getTime()
const;
324 EXW
double getDeltaTime()
const;
329 EXW
int getMouseX()
const;
334 EXW
int getMouseY()
const;
339 EXW
double getMouseDeltaX()
const;
344 EXW
double getMouseDeltaY()
const;
349 EXW
bool hasKey(
int key)
const;
359 EXW
int getWidth()
const;
364 EXW
int getHeight()
const;
369 EXW
void stopRendering();
374 EXW
void setMousePointer(
int x,
int y);
379 EXW
void setShowCursor(
bool showCursor);
MouseButton
Definition: SX.h:28
Definition: Exception.h:13