-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOpenGLDisplay.h
37 lines (29 loc) · 907 Bytes
/
OpenGLDisplay.h
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
#ifndef OPENGLDISPLAY_H
#define OPENGLDISPLAY_H
#include <QOpenGLWidget>
#include <QOpenGLFunctions>
#include <QScopedPointer>
#include <QException>
class OpenGLDisplay : public QOpenGLWidget, public QOpenGLFunctions
{
public:
explicit OpenGLDisplay(QWidget* parent = nullptr);
~OpenGLDisplay();
void InitDrawBuffer(unsigned bsize);
void DisplayVideoFrame(unsigned char *data, int frameWidth, int frameHeight);
protected:
void initializeGL() override;
void resizeGL(int w, int h) override;
void paintGL() override;
private:
struct OpenGLDisplayImpl;
QScopedPointer<OpenGLDisplayImpl> impl;
};
/***********************************************************************/
class OpenGlException: public QException
{
public:
void raise() const { throw *this; }
OpenGlException *clone() const { return new OpenGlException(*this); }
};
#endif // OPENGLDISPLAY_H