Michaël Lemaire
4f55c9e2a6
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@253 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
43 lines
918 B
C++
43 lines
918 B
C++
#ifndef _PAYSAGES_QT_WIDGETWANDERER_H_
|
|
#define _PAYSAGES_QT_WIDGETWANDERER_H_
|
|
|
|
#include <QGLWidget>
|
|
#include "../lib_paysages/camera.h"
|
|
#include "../lib_paysages/terrain.h"
|
|
#include "../lib_paysages/water.h"
|
|
|
|
class WidgetWanderer : public QGLWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
WidgetWanderer(QWidget* parent, CameraDefinition* camera);
|
|
|
|
public slots:
|
|
void resetCamera();
|
|
void validateCamera();
|
|
|
|
protected:
|
|
void keyPressEvent(QKeyEvent* event);
|
|
void mousePressEvent(QMouseEvent* event);
|
|
void mouseMoveEvent(QMouseEvent* event);
|
|
void wheelEvent(QWheelEvent* event);
|
|
|
|
void initializeGL();
|
|
void resizeGL(int w, int h);
|
|
void paintGL();
|
|
|
|
private:
|
|
CameraDefinition _current_camera;
|
|
CameraDefinition* _base_camera;
|
|
|
|
TerrainDefinition terrain;
|
|
WaterDefinition water;
|
|
|
|
double average_frame_time;
|
|
int quality;
|
|
|
|
int last_mouse_x;
|
|
int last_mouse_y;
|
|
};
|
|
|
|
#endif
|