summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/qcam/viewfinder_gl.cpp5
-rw-r--r--src/qcam/viewfinder_gl.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp
index a6aa2b44..6d1d80bd 100644
--- a/src/qcam/viewfinder_gl.cpp
+++ b/src/qcam/viewfinder_gl.cpp
@@ -131,6 +131,9 @@ bool ViewFinderGL::selectFormat(const libcamera::PixelFormat &format)
/* Set min/mag filters to GL_LINEAR by default. */
textureMinMagFilters_ = GL_LINEAR;
+ /* Use identity.vert as the default vertex shader. */
+ vertexShaderFile_ = ":identity.vert";
+
fragmentShaderDefines_.clear();
switch (format) {
@@ -292,7 +295,7 @@ bool ViewFinderGL::createVertexShader()
vertexShader_ = std::make_unique<QOpenGLShader>(QOpenGLShader::Vertex, this);
/* Compile the vertex shader */
- if (!vertexShader_->compileSourceFile(":identity.vert")) {
+ if (!vertexShader_->compileSourceFile(vertexShaderFile_)) {
qWarning() << "[ViewFinderGL]:" << vertexShader_->log();
return false;
}
diff --git a/src/qcam/viewfinder_gl.h b/src/qcam/viewfinder_gl.h
index 508155b1..bce94c87 100644
--- a/src/qcam/viewfinder_gl.h
+++ b/src/qcam/viewfinder_gl.h
@@ -73,6 +73,7 @@ private:
QOpenGLShaderProgram shaderProgram_;
std::unique_ptr<QOpenGLShader> vertexShader_;
std::unique_ptr<QOpenGLShader> fragmentShader_;
+ QString vertexShaderFile_;
QString fragmentShaderFile_;
QStringList fragmentShaderDefines_;