OpenCV image loading for OpenGL Texture
I want to load an image (jpg and png) with OpenCV as OpenGL Texture. Here is how I load the image to OpenGL: glEnable(GL_TEXTURE_2D); textureData = loadTextureData("textures/trashbin.png"); cv::Mat image = cv::imread("textures/trashbin.png"); if(image.empty()){ std::cout << "image empty" << std::endl; }else{ glGenTextures( 1, &textureTrash ); glBindTexture( GL_TEXTURE_2D, textureTrash ); glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S , GL_REPEAT ); glTexParameterf(