on opening scanning screen second time , it crashes

0 votes
asked Jul 16, 2019 by caglobal (190 points)

        glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * 12, vertices, GL_DYNAMIC_DRAW);

        glBindBuffer(GL_ARRAY_BUFFER, background_texture_vbo_);

        glEnableVertexAttribArray(background_texture_location_);

        glVertexAttribPointer(background_texture_location_, 2, GL_FLOAT, GL_FALSE, 0, 0);

        switch (background_shader_) {

        case FrameShader_RGB:

            glActiveTexture(GL_TEXTURE0);

            glBindTexture(GL_TEXTURE_2D, background_texture_id_);

            break;

        case FrameShader_YUV:

            glActiveTexture(GL_TEXTURE0);

            glBindTexture(GL_TEXTURE_2D, background_texture_id_);

            if (current_format_ == easyar_PixelFormat_YUV_NV21 || current_format_ == easyar_PixelFormat_YUV_NV12) {

                glActiveTexture(GL_TEXTURE1);

                glBindTexture(GL_TEXTURE_2D, background_texture_uv_id_);

            } else {

                glActiveTexture(GL_TEXTURE1);

                glBindTexture(GL_TEXTURE_2D, background_texture_u_id_);

                glActiveTexture(GL_TEXTURE2);

                glBindTexture(GL_TEXTURE_2D, background_texture_v_id_);

            }

            break;

        }

//          NSLog(@"GL_TRIANGLE_FAN",glDrawArrays(GL_TRIANGLE_FAN, 0, 4));

      

        

          glDrawArrays(GL_TRIANGLE_FAN, 0, 4);

  

Please log in or register to answer this question.

Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...