, m_texture(0)
, m_display_ratio(4.0 / 3.0)
, m_backgroundColor(Qt::gray)
-{
+{
setAttribute(Qt::WA_PaintOnScreen);
setAttribute(Qt::WA_OpaquePaintEvent);
}
}
void VideoGLWidget::resizeGL(int width, int height)
{
-
double this_aspect = (double) width / height;
// Special case optimisation to negate odd effect of sample aspect ratio
glClear(GL_COLOR_BUFFER_BIT);
}
+void VideoGLWidget::activateMonitor()
+{
+ makeCurrent();
+ glViewport(0, 0, width(), height());
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ gluOrtho2D(0, width(), height(), 0);
+ glMatrixMode(GL_MODELVIEW);
+ glClear(GL_COLOR_BUFFER_BIT);
+}
+
void VideoGLWidget::paintGL()
{
if (m_texture) {
{
m_image_width = image.width();
m_image_height = image.height();
-
makeCurrent();
if (m_texture)
glDeleteTextures(1, &m_texture);