-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
31 lines (28 loc) · 1.12 KB
/
Copy pathmainwindow.cpp
File metadata and controls
31 lines (28 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QWidget(parent),
ui(new Ui::MainWindow) {
ui->setupUi(this);
// Control.
connect(ui->controls, SIGNAL(windToggled(bool)), ui->viewport, SLOT(setWindEnabled(bool)));
connect(ui->controls, SIGNAL(shiveringToggled(bool)), ui->viewport,
SLOT(setShiveringEnabled(bool)));
connect(ui->controls, SIGNAL(windTurbulenceChanged(int)), ui->viewport,
SLOT(setWindTurbulence(int)));
connect(ui->controls, SIGNAL(windSpeedChanged(int)), ui->viewport, SLOT(setWindSpeed(int)));
connect(ui->controls, SIGNAL(windDirChanged(GLfloat,GLfloat,GLfloat)), ui->viewport,
SLOT(setWindDirection(GLfloat,GLfloat,GLfloat)));
// Feedback.
connect(ui->viewport, SIGNAL(primitives(int)), ui->controls, SLOT(setTriangles(int)));
connect(ui->viewport, SIGNAL(fps(int)), ui->controls, SLOT(setFps(int)));
ui->viewport->setFocus();
}
MainWindow::~MainWindow() {
delete ui;
}
void MainWindow::keyPressEvent(QKeyEvent* ev) {
if(ev->key() == Qt::Key_Escape) {
QApplication::instance()->quit();
}
}