I have seen many code samples for loading textures for OpenGL, many of them a bit complicated to understand or requiring new functions with a lot of code. <
The assignment operator
texture_cv = imread("stones.jpg")
returns a cv::Mat
that can't be used in a conditional expression. You should write something like
if((texture_cv = imread("stones.jpg")) != /* insert condition here */ ) {
//...
}
or
texture = imread("stone.jpg");
if(!texture.empty()) {
//...
}