-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcanvas.h
More file actions
40 lines (30 loc) · 690 Bytes
/
canvas.h
File metadata and controls
40 lines (30 loc) · 690 Bytes
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
//
// Created by 孙万捷 on 16/3/4.
//
#ifndef SUNVRVR_CANVAS_H
#define SUNVRVR_CANVAS_H
#include <QGLWidget>
#include <cuda_gl_interop.h>
#include "cuda_utils.h"
#include "pathtracer.h"
class Canvas : public QGLWidget
{
Q_OBJECT
public:
explicit Canvas(const QGLFormat& format, QWidget* parent = 0);
virtual ~Canvas();
protected:
void initializeGL();
void resizeGL(int w, int h);
void paintGL();
private:
GLuint leftPBO = 0;
GLuint rightPBO = 0;
cudaGraphicsResource* leftResource;
cudaGraphicsResource* rightResource;
uchar4* leftImg;
uchar4* rightImg;
cudaBox volumeBox;
cudaCamera camera;
};
#endif //SUNVRVR_CANVAS_H