2014-02-10 12:41:05 +00:00
|
|
|
#include "ViewerWidget.hpp"
|
|
|
|
|
|
|
|
void ViewerWidget::initializeGL()
|
|
|
|
{
|
2014-02-10 17:22:07 +00:00
|
|
|
QGLWidget::initializeGL();
|
|
|
|
timer.setInterval(16);
|
|
|
|
connect(&timer, SIGNAL(timeout()), SLOT(updateGL()));
|
|
|
|
timer.start();
|
2014-02-10 12:41:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ViewerWidget::resizeGL(int w, int h)
|
|
|
|
{
|
2014-02-10 17:22:07 +00:00
|
|
|
QGLWidget::resizeGL(w, h);
|
2014-02-10 12:41:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ViewerWidget::paintGL()
|
|
|
|
{
|
|
|
|
glClearColor(0.3f, 0.3f, 0.3f, 1.f);
|
|
|
|
glClear(GL_COLOR_BUFFER_BIT);
|
2014-02-10 17:22:07 +00:00
|
|
|
|
|
|
|
if( !currentFile.empty() ) {
|
|
|
|
QString dbg;
|
|
|
|
dbg.append("Viewing: ");
|
|
|
|
dbg.append(currentFile.c_str());
|
|
|
|
renderText(5, height() - 5, dbg);
|
|
|
|
}
|
2014-02-10 12:41:05 +00:00
|
|
|
}
|
2014-02-10 17:22:07 +00:00
|
|
|
|
|
|
|
void ViewerWidget::showFile(const std::string& file)
|
|
|
|
{
|
|
|
|
currentFile = file;
|
|
|
|
}
|