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. <
Your error appears there, right?
if( texture_cv = imread("stones.jpg")) {
because in if(expr) expr must be bool or can be casted to bool. But there is no way to convert cv::Mat into boolean implicitly. But you can check the result of imread like that:
texture_cv = imread("stones.jpg");
if (texture_cv.empty()) {
// handle was an error
} else {
// do right job
}
See: cv::Mat::empty(), cv::imread
Hope that helped you.