diff --git a/src/qt/qt_glsl_parser.cpp b/src/qt/qt_glsl_parser.cpp index f43897506..a39e6d7bc 100644 --- a/src/qt/qt_glsl_parser.cpp +++ b/src/qt/qt_glsl_parser.cpp @@ -1,3 +1,10 @@ +#include "qt_mainwindow.hpp" +#include +#include +#include + +extern MainWindow* main_window; + #include #include #include @@ -137,6 +144,7 @@ static glslp_t *glsl_parse(const char *f) { strcpy(shader->shader_fn, f); shader->shader_program = load_file(f); if (!shader->shader_program) { + QMessageBox::critical((QWidget *) qApp->findChild(), QObject::tr("GLSL error"), QObject::tr("Could not load shader %s").arg(shader->shader_fn)); //wx_simple_messagebox("GLSL error", "Could not load shader %s\n", shader->shader_fn); glslp_free(glslp); return 0; diff --git a/src/qt/qt_openglrenderer_pcem.cpp b/src/qt/qt_openglrenderer_pcem.cpp index e53b8b77b..4644dc7be 100644 --- a/src/qt/qt_openglrenderer_pcem.cpp +++ b/src/qt/qt_openglrenderer_pcem.cpp @@ -1,6 +1,7 @@ #include "qt_renderercommon.hpp" #include "qt_mainwindow.hpp" +#include #include #include #include @@ -131,6 +132,7 @@ OpenGLRendererPCem::create_program(struct shader_program *program) glw.glGetProgramiv(program->id, GL_INFO_LOG_LENGTH, &maxLength); char *log = (char *) malloc(maxLength); glw.glGetProgramInfoLog(program->id, maxLength, &length, log); + QMessageBox::critical((QWidget *) qApp->findChild(), tr("GLSL Error"), tr("Program not linked:\n%1").arg(log)); // wx_simple_messagebox("GLSL Error", "Program not linked:\n%s", log); free(log); return 0; @@ -175,6 +177,7 @@ OpenGLRendererPCem::compile_shader(GLenum shader_type, const char *prepend, cons glw.glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length); char *log = (char *) malloc(length); glw.glGetShaderInfoLog(shader, length, &length, log); + QMessageBox::critical((QWidget *) qApp->findChild(), tr("GLSL Error"), tr("Could not compile shader:\n%1").arg(log)); // wx_simple_messagebox("GLSL Error", "Could not compile shader:\n%s", log); pclog("Could not compile shader: %s\n", log); @@ -577,7 +580,7 @@ OpenGLRendererPCem::load_glslp(glsl_t *glsl, int num_shader, const char *f) pclog("Load texture %s...\n", file); if (!load_texture(file, &tex->texture)) { - // wx_simple_messagebox("GLSL Error", "Could not load texture: %s", file); + QMessageBox::critical((QWidget *) qApp->findChild(), tr("GLSL Error"), tr("Could not load texture: %s").arg(file)); pclog("Could not load texture %s!\n", file); failed = 1; break; @@ -623,6 +626,7 @@ OpenGLRendererPCem::load_glslp(glsl_t *glsl, int num_shader, const char *f) pclog("Creating pass %u (%s)\n", (i + 1), pass->alias); pclog("Loading shader %s...\n", shader->shader_fn); if (!shader->shader_program) { + QMessageBox::critical((QWidget *) qApp->findChild(), tr("GLSL Error"), tr("Could not load shader: %1").arg(shader->shader_fn)); // wx_simple_messagebox("GLSL Error", "Could not load shader: %s", shader->shader_fn); pclog("Could not load shader %s\n", shader->shader_fn); failed = 1; @@ -1337,10 +1341,10 @@ OpenGLRendererPCem::render() struct { uint32_t x, y, w, h; } rect, video_rect; - rect.x = destination.x(); - rect.y = destination.y(); - rect.w = destination.width(); - rect.h = destination.height(); + rect.x = 0; + rect.y = 0; + rect.w = source.width(); + rect.h = source.height(); video_rect.x = source.x(); video_rect.y = source.y();