From f18d7ca5c487c54a7948179f68fb9d2e5616d98e Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 8 Aug 2017 18:04:38 +0200 Subject: [PATCH] Save a glGetIntegerv() call every time we draw. --- glwidget.cpp | 4 +++- glwidget.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/glwidget.cpp b/glwidget.cpp index 31018d6..e7f56b3 100644 --- a/glwidget.cpp +++ b/glwidget.cpp @@ -90,6 +90,8 @@ void GLWidget::initializeGL() void GLWidget::resizeGL(int width, int height) { + current_width = width; + current_height = height; glViewport(0, 0, width, height); } @@ -111,7 +113,7 @@ void GLWidget::paintGL() check_error(); glDisable(GL_FRAMEBUFFER_SRGB); check_error(); - frame.chain->render_to_screen(); + frame.chain->render_to_fbo(0, current_width, current_height); check_error(); if (resource_pool == nullptr) { diff --git a/glwidget.h b/glwidget.h index d71f3c8..ed67ae8 100644 --- a/glwidget.h +++ b/glwidget.h @@ -62,6 +62,7 @@ private: GLuint vao, program_num; GLuint position_vbo, texcoord_vbo; movit::ResourcePool *resource_pool = nullptr; + int current_width = 1, current_height = 1; }; #endif -- 2.39.2