summaryrefslogtreecommitdiff
path: root/src/OffscreenView.h
blob: 2f19a0c36fcd1f81e3333a23a1173b3279a4dc5f (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef OFFSCREENVIEW_H_
#define OFFSCREENVIEW_H_

#include "OffscreenContext.h"
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <string>
#ifndef _MSC_VER
#include <stdint.h>
#endif
#include "system-gl.h"
#include <iostream>

class OffscreenView
{
public:
	OffscreenView(size_t width, size_t height);
	~OffscreenView();
	void setRenderer(class Renderer* r);

	void setCamera(const Eigen::Vector3d &pos, const Eigen::Vector3d &center);
	void initializeGL();
	void resizeGL(int w, int h);

	void setupGimbalPerspective();
	void setupGimbalOrtho(double distance, bool offset=false);

	void setupPerspective();
	void setupOrtho(bool offset=false);

	void paintGL(); //
	bool save(const char *filename); //
	bool save(std::ostream &output); // not implemented in qgl?
	std::string getRendererInfo(); //

	GLint shaderinfo[11];  //

	OffscreenContext *ctx; // not
	size_t width;  // not
	size_t height; // not
private:
	Renderer *renderer;//
	double w_h_ratio;//

	bool orthomode;//
	bool showaxes;//
	bool showfaces;//
	bool showedges;//

	Eigen::Vector3d object_rot;//
	Eigen::Vector3d camera_eye;//
	Eigen::Vector3d camera_center;//
};

#endif
contact: Jan Huwald // Impressum