Ejemplo n.º 1
0
  def attachCurrentTexture(self, target = GL_DRAW_FRAMEBUFFER):
    textureId =  ovr.getTextureSwapChainBufferGL(self.rift.session, self.pTextureSet, -1)
    # We switch textures every frame, so we need to bind the new texture here
    glFramebufferTexture2D(target, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureId, 0)

    # FIXME? validating every frame may be excessive
    fboStatus = glCheckFramebufferStatus(target)
    if (GL_FRAMEBUFFER_COMPLETE != fboStatus):
      raise Exception("Bad framebuffer setup")
Ejemplo n.º 2
0
    def attachCurrentTexture(self, target=GL_DRAW_FRAMEBUFFER):
        textureId = ovr.getTextureSwapChainBufferGL(self.rift.session,
                                                    self.pTextureSet, -1)
        # We switch textures every frame, so we need to bind the new texture here
        glFramebufferTexture2D(target, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
                               textureId, 0)

        # FIXME? validating every frame may be excessive
        fboStatus = glCheckFramebufferStatus(target)
        if (GL_FRAMEBUFFER_COMPLETE != fboStatus):
            raise Exception("Bad framebuffer setup")
Ejemplo n.º 3
0
 def get_current_texture_id_GL(self, textureSwapChain):
   return ovr.getTextureSwapChainBufferGL(self.session, textureSwapChain, -1)