OpenGL glTexStorage2D错误1282无效操作

时间:2018-08-06 13:37:47

标签: python opengl

嗨,我正在尝试使用OpenGl在我的HTC Vive设备上渲染几个图像。

我一直收到如下错误:

  

err = 1282,description ='无效操作',baseOperation = glTexStorage2D,cArguments =(GL_TEXTURE_2D,1,GL_RGBA8,1827L,2030L,)

发生错误的代码片段-

    image_right = cv2.imread('./sample.png')
    image_left = cv2.imread('./sample_left.jpg')

    height, width, channels = image_left.shape

    cv2.cvtColor(image_left,cv2.COLOR_BGR2RGB)
    cv2.cvtColor(image_right,cv2.COLOR_BGR2RGB)

    w, h = self.vr_system.getRecommendedRenderTargetSize()

    glBindTexture(GL_TEXTURE_2D, self.zedTextureID_L);
    glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, w, h);
    glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_BGRA, GL_UNSIGNED_BYTE, image_left)


    glBindTexture(GL_TEXTURE_2D, self.zedTextureID_R);
    glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, w, h);
    glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_BGRA, GL_UNSIGNED_BYTE, image_right)


    self.texture_t_left.handle = self.zedTextureID_L
    self.texture_t_right.handle = self.zedTextureID_R

关于出什么问题的任何想法?我将非常感谢您的帮助。 我也可以发送其余代码,但是它很大。...

0 个答案:

没有答案