summaryrefslogtreecommitdiff
path: root/src/gui/Stage.cc
blob: 318c2b89aba752a57dc9a5ec7670b5c3ac241be2 (plain) (blame)
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
32
33
34
35
36
37
38
39
/*
 * Stage.cc
 *
 *  Created on: Apr 6, 2011
 *      Author: jakob
 */


#include "Stage.h"

namespace vhc {

Stage::Stage(QWidget* parent): QGLWidget (parent), elements(0), camera(), elementRenderer(new ElementRenderer), particleRenderer(), wireframe(false) {
	setMouseTracking(true);
}

Stage::~Stage() {
	delete elementRenderer; elementRenderer = NULL;
};

void Stage::initializeGL () {
	glEnable (GL_DEPTH_TEST);
	glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
	glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
	gluPerspective(65.0, 1.6, 0.1, 10000.0);
	glClearColor (0, 0, 0, 1.0);
}

void Stage::resizeGL (int width, int height) {
	glViewport (0, 0, width, height);
	glMatrixMode (GL_PROJECTION);
	glLoadIdentity();
	gluPerspective(65.0, 1, 1.0, 10000.0);
	glMatrixMode (GL_MODELVIEW);
}



}