Michaël Lemaire
ae91a39729
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@501 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
60 lines
1.3 KiB
C++
60 lines
1.3 KiB
C++
#ifndef _PAYSAGES_QT_WIDGETEXPLORER_H_
|
|
#define _PAYSAGES_QT_WIDGETEXPLORER_H_
|
|
|
|
#include <QGLWidget>
|
|
#include "baseexplorerchunk.h"
|
|
#include "../lib_paysages/camera.h"
|
|
#include "../lib_paysages/water.h"
|
|
#include "../lib_paysages/renderer.h"
|
|
#include "../lib_paysages/textures.h"
|
|
|
|
class WidgetExplorer : public QGLWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
WidgetExplorer(QWidget* parent, CameraDefinition* camera);
|
|
~WidgetExplorer();
|
|
|
|
void performChunksMaintenance();
|
|
|
|
public slots:
|
|
void resetCamera();
|
|
void validateCamera();
|
|
|
|
protected:
|
|
void keyPressEvent(QKeyEvent* event);
|
|
void mousePressEvent(QMouseEvent* event);
|
|
void mouseMoveEvent(QMouseEvent* event);
|
|
void wheelEvent(QWheelEvent* event);
|
|
void timerEvent(QTimerEvent *event);
|
|
|
|
void initializeGL();
|
|
void resizeGL(int w, int h);
|
|
void paintGL();
|
|
|
|
private:
|
|
void startThreads();
|
|
void stopThreads();
|
|
|
|
CameraDefinition _current_camera;
|
|
CameraDefinition* _base_camera;
|
|
|
|
Renderer* _renderer;
|
|
bool _updated;
|
|
|
|
QVector<BaseExplorerChunk*> _chunks;
|
|
QList<BaseExplorerChunk*> _updateQueue;
|
|
bool _alive;
|
|
QMutex _lock_chunks;
|
|
|
|
WaterDefinition _water;
|
|
TexturesDefinition _textures;
|
|
|
|
double _average_frame_time;
|
|
int _quality;
|
|
|
|
int _last_mouse_x;
|
|
int _last_mouse_y;
|
|
};
|
|
|
|
#endif
|