Loading texture for OpenGL with OpenCV

后端 未结 4 1808
南方客
南方客 2020-12-25 10:15

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. <

4条回答
  •  天涯浪人
    2020-12-25 10:50

    Another short question... I think you may need to use

    glTexImage2D(GL_TEXTURE_2D, 0, 3, texture_cv.cols, texture_cv.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, texture_cv.ptr());
    

    instead of

    glTexImage2D(GL_TEXTURE_2D, 0, 3, texture_cv.cols, texture_cv.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, texture_cv.data);
    

提交回复
热议问题