|
1 | 1 | #include "qt_renderercommon.hpp" |
2 | 2 | #include "qt_mainwindow.hpp" |
3 | 3 |
|
| 4 | +#include <QCoreApplication> |
4 | 5 | #include <QMessageBox> |
5 | 6 | #include <QWindow> |
6 | 7 | #include <QPainter> |
@@ -131,6 +132,7 @@ OpenGLRendererPCem::create_program(struct shader_program *program) |
131 | 132 | glw.glGetProgramiv(program->id, GL_INFO_LOG_LENGTH, &maxLength); |
132 | 133 | char *log = (char *) malloc(maxLength); |
133 | 134 | glw.glGetProgramInfoLog(program->id, maxLength, &length, log); |
| 135 | + QMessageBox::critical((QWidget *) qApp->findChild<QWindow *>(), tr("GLSL Error"), tr("Program not linked:\n%1").arg(log)); |
134 | 136 | // wx_simple_messagebox("GLSL Error", "Program not linked:\n%s", log); |
135 | 137 | free(log); |
136 | 138 | return 0; |
@@ -175,6 +177,7 @@ OpenGLRendererPCem::compile_shader(GLenum shader_type, const char *prepend, cons |
175 | 177 | glw.glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length); |
176 | 178 | char *log = (char *) malloc(length); |
177 | 179 | glw.glGetShaderInfoLog(shader, length, &length, log); |
| 180 | + QMessageBox::critical((QWidget *) qApp->findChild<QWindow *>(), tr("GLSL Error"), tr("Could not compile shader:\n%1").arg(log)); |
178 | 181 | // wx_simple_messagebox("GLSL Error", "Could not compile shader:\n%s", log); |
179 | 182 |
|
180 | 183 | pclog("Could not compile shader: %s\n", log); |
@@ -577,7 +580,7 @@ OpenGLRendererPCem::load_glslp(glsl_t *glsl, int num_shader, const char *f) |
577 | 580 | pclog("Load texture %s...\n", file); |
578 | 581 |
|
579 | 582 | if (!load_texture(file, &tex->texture)) { |
580 | | - // wx_simple_messagebox("GLSL Error", "Could not load texture: %s", file); |
| 583 | + QMessageBox::critical((QWidget *) qApp->findChild<QWindow *>(), tr("GLSL Error"), tr("Could not load texture: %s").arg(file)); |
581 | 584 | pclog("Could not load texture %s!\n", file); |
582 | 585 | failed = 1; |
583 | 586 | break; |
@@ -623,6 +626,7 @@ OpenGLRendererPCem::load_glslp(glsl_t *glsl, int num_shader, const char *f) |
623 | 626 | pclog("Creating pass %u (%s)\n", (i + 1), pass->alias); |
624 | 627 | pclog("Loading shader %s...\n", shader->shader_fn); |
625 | 628 | if (!shader->shader_program) { |
| 629 | + QMessageBox::critical((QWidget *) qApp->findChild<QWindow *>(), tr("GLSL Error"), tr("Could not load shader: %1").arg(shader->shader_fn)); |
626 | 630 | // wx_simple_messagebox("GLSL Error", "Could not load shader: %s", shader->shader_fn); |
627 | 631 | pclog("Could not load shader %s\n", shader->shader_fn); |
628 | 632 | failed = 1; |
@@ -1337,10 +1341,10 @@ OpenGLRendererPCem::render() |
1337 | 1341 | struct { |
1338 | 1342 | uint32_t x, y, w, h; |
1339 | 1343 | } rect, video_rect; |
1340 | | - rect.x = destination.x(); |
1341 | | - rect.y = destination.y(); |
1342 | | - rect.w = destination.width(); |
1343 | | - rect.h = destination.height(); |
| 1344 | + rect.x = 0; |
| 1345 | + rect.y = 0; |
| 1346 | + rect.w = source.width(); |
| 1347 | + rect.h = source.height(); |
1344 | 1348 |
|
1345 | 1349 | video_rect.x = source.x(); |
1346 | 1350 | video_rect.y = source.y(); |
|
0 commit comments