4 #include <QCoreApplication> 5 #include <QOpenGLWidget> 6 #include <QOpenGLFunctions> 7 #include <QOpenGLDebugLogger> 8 #include <QOpenGLVertexArrayObject> 9 #include <QOpenGLBuffer> 11 #include <QOpenGLShaderProgram> 12 #include <QElapsedTimer> 16 #include "linevertex.h" 23 class GLWidget :
public QOpenGLWidget,
protected QOpenGLFunctions
53 return this->grabFramebuffer();
61 clipPlaneNormal = camera.getRight();
77 void usedGPUMemoryChanged(
float size);
78 void totalGPUMemoryChanged(
float size);
79 void fpsChanged(
int fps);
80 void graphicsDeviceInfoChanged(QString
string);
84 void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
85 void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
87 void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
88 void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
90 void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
94 void paintGL() Q_DECL_OVERRIDE;
95 void initializeGL() Q_DECL_OVERRIDE;
96 void resizeGL(
int w,
int h) Q_DECL_OVERRIDE;
102 void allocateGPUBufferLineData();
112 std::vector<std::vector<LineVertex> > *
lines;
118 QOpenGLShaderProgram *shaderLinesWithHalos;
119 QOpenGLVertexArrayObject vaoLines;
120 QOpenGLBuffer vboLines;
127 size_t frameCount = 0;
129 qint64 previousTimeFPS;
130 QElapsedTimer fpsTimer;
133 bool GL_NVX_gpu_memory_info_supported =
false;
134 GLint total_mem_kb = 0;
135 GLint cur_avail_mem_kb = 0;
140 QOpenGLDebugLogger *logger;
141 void printDebugMsg(
const QOpenGLDebugMessage &msg) { qDebug() << qPrintable(msg.message()); }
Camera class.
Definition: camera.h:12
The MainWindow class.
Definition: mainwindow.h:24