I have an c++ application being built with Visual Studio, where I am trying to incorporate using OpenGL through Qt for 3D renderings. When I build my application, the shader files (shader.vert, shader.frag) are included, except it seems that an older version is cached or something similar, because none of the changes I make are applied. As well, when I output the text from the file which is read in, it is for sure the old file. If I rebuild the whole application (which I would like to avoid, it takes several minutes), they are re-included correctly.
Why might this be occurring? I have seen references to "Copy to Output Directory" option in the preferences, but that does not seem to exist in VS22.
QFile file(":/path_to/shader.vert");
if (!file.open(QIODevice::ReadOnly))
{
QMessageBox::information(0, "error", file.errorString());
}
QTextStream in(&file);
QOpenGLShader vertexShader(QOpenGLShader::Vertex);
QString str = in.readAll();
vertexShader.compileSourceCode(str);
QByteArray b = vertexShader.sourceCode();
Through reading the QByteArray b in debug mode (or the QString str), I see that the file contents are not correct, as they are continuously the unchanged file.
I'm using VS22, OpenGL 4.5, Qt 6.5, MSVC with c++17