コード例 #1
0
YUV420PGrabber::~YUV420PGrabber() {
  deleteShader(frag_y);
  deleteShader(vert_yuv);
  deleteShader(frag_u);
  deleteShader(frag_v);
  deleteShader(frag_pt);
  deleteProgram(prog_y);
  deleteProgram(prog_u);
  deleteProgram(prog_v);
  deleteProgram(prog_pt);
  deleteTexture(yuv_tex);
  deleteTexture(scene_tex);

  if(scene_fbo) {
    glDeleteFramebuffers(1, &scene_fbo);
  }

  if(scene_depth) {
    glDeleteRenderbuffers(1, &scene_depth);
  }

  if(vao) {
#if YUV420P_USE_APPLE_VAO
    glDeleteVertexArraysAPPLE(1, &vao);
#else
    glDeleteVertexArrays(1, &vao);
#endif  
  }

  if(outfile_set && ofs.is_open()) {
    ofs.close();
  }

  if(image) {
    delete[] image;
  }

  outfile_set = false;
  win_w = 0;
  win_h = 0;
  vid_w = 0;
  vid_h = 0;
  uv_w = 0;
  uv_h = 0;
  yuv_tex = 0;
  scene_fbo = 0;
  scene_depth = 0;
  scene_tex = 0;
  vao = 0;
  fps = 0;
  tex_w = 0;
  tex_h = 0;
  image = NULL;
  frame_timeout = 0;
  frame_prev_timeout = 0;
  frame_delay = 0;
  frame_delay_adjusted = 0;
  frame_diff = 0;
  frame_diff_avg = 0;
}
コード例 #2
0
ファイル: GLResources.cpp プロジェクト: nidium/Nidium
GLResources::Resource::~Resource()
{
    switch (m_Type) {
        case GLResources::RPROGRAM:
            glDeleteProgram(m_Glid);
            break;
        case GLResources::RSHADER:
            glDeleteShader(m_Glid);
            break;
        case GLResources::RTEXTURE:
            glDeleteTextures(1, &m_Glid);
            break;
        case GLResources::RBUFFER:
            glDeleteBuffers(1, &m_Glid);
            break;
        case GLResources::RVERTEX_ARRAY:
#if NIDIUM_OPENGLES2
            glDeleteVertexArraysOES(1, &m_Glid);
#elif __APPLE__
            glDeleteVertexArraysAPPLE(1, &m_Glid);
#else
            glDeleteVertexArrays(1, &m_Glid);
#endif
            break;
        default:
            break;
    }
}
コード例 #3
0
//-------------------------------------------
void ofxAssimpModelLoader::deleteGLResources(){

    ofLog(OF_LOG_VERBOSE, "deleting gl resources");

    for (unsigned int i = 0; i < modelMeshes.size(); ++i){
    
        ofxAssimpMeshHelper meshHelper = modelMeshes[i];
        
        const GLuint indexBuffer = meshHelper.indexBuffer;
        const GLuint vertexBuffer = meshHelper.vertexBuffer;
        const GLuint normalBuffer = meshHelper.normalBuffer;
        const GLuint vaoHandle = meshHelper.vao;
        
        glDeleteBuffers(1, &vertexBuffer);
        glDeleteBuffers(1, &indexBuffer);
        glDeleteBuffers(1, &normalBuffer);
        glDeleteVertexArraysAPPLE(1, &vaoHandle);
        
        meshHelper.indexBuffer = 0;
        meshHelper.vertexBuffer = 0;
        meshHelper.normalBuffer = 0;
        meshHelper.vao = 0; 
        meshHelper.mesh = NULL;
        
        meshHelper.textureIndex = -1;
    }
    
    // clear out our meshes array.
    modelMeshes.clear();
    
    // clear out our textures (ofImages)
    textures.clear();
}
コード例 #4
0
ファイル: VertexArray.cpp プロジェクト: JoshuaBrookover/Jatta
_JATTA_EXPORT void Jatta::OpenGL::VertexArray::Delete()
{
#   ifdef JATTA_MACOS
    glDeleteVertexArraysAPPLE(1, &vertexArray);
#   else
    glDeleteVertexArrays(1, &vertexArray);
#   endif
    GLCHECK("Failed to delete vertex array.");
}
コード例 #5
0
void Extensions3DOpenGL::deleteVertexArrayOES(Platform3DObject array)
{
    if (!array)
        return;
    
    m_context->makeContextCurrent();
#if !PLATFORM(GTK) && !PLATFORM(QT) && defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
    glDeleteVertexArraysAPPLE(1, &array);
#endif
}
コード例 #6
0
Track::~Track() {
    
    setLoader(nullptr);
    
    // clean up vertex array, which is generated in the constructor
    glDeleteVertexArraysAPPLE(1, &vertexArrayObjectHandle);
    glDeleteBuffers(1, &vertexBuffer);
    glDeleteBuffers(1, &normalBuffer);
    glDeleteBuffers(1, &indexBuffer);
}
コード例 #7
0
void Extensions3DOpenGL::deleteVertexArrayOES(Platform3DObject array)
{
    if (!array)
        return;
    
    m_context->makeContextCurrent();
#if GL_APPLE_vertex_array_object
    glDeleteVertexArraysAPPLE(1, &array);
#else
#endif
}
コード例 #8
0
void Extensions3DOpenGL::deleteVertexArrayOES(Platform3DObject array)
{
    if (!array)
        return;

    m_context->makeContextCurrent();
#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX) || PLATFORM(JS))
    if (isVertexArrayObjectSupported())
        glDeleteVertexArrays(1, &array);
#elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
    glDeleteVertexArraysAPPLE(1, &array);
#endif
}
コード例 #9
0
void Extensions3DOpenGL::deleteVertexArrayOES(Platform3DObject array)
{
    if (!array)
        return;

    m_context->makeContextCurrent();
#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN))
    if (isVertexArrayObjectSupported())
        glDeleteVertexArrays(1, &array);
#elif PLATFORM(QT)
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
    if (isVertexArrayObjectSupported())
        m_vaoFunctions->glDeleteVertexArrays(1, &array);
#endif
#elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
    glDeleteVertexArraysAPPLE(1, &array);
#endif
}
コード例 #10
0
ファイル: Texture2D.cpp プロジェクト: fatdai/D2DEngine_V2
 //-------------------------------------------
 TextureAtlas::~TextureAtlas(){
     if (_quads) {
         delete [] _quads;
         _quads = nullptr;
     }
     if (_indices) {
         delete [] _indices;
         _indices = nullptr;
     }
     if (_vao > 0) {
         glDeleteVertexArraysAPPLE(1,&_vao);
         _vao = 0;
     }
     
     if (_bufferVBO[0] > 0) {
         glDeleteBuffers(2,&_bufferVBO[0]);
         _bufferVBO[0] = _bufferVBO[1] = 0;
     }
 }
コード例 #11
0
void HSWDisplay::UnloadGraphics()
{
    if(pTexture) // If initialized...
    {
        Context currentGLContext;
        currentGLContext.InitFromCurrent();
        GLContext.Bind();

        // RenderParams: No need to clear.
        if(FrameBuffer != 0)
        {
            glDeleteFramebuffers(1, &FrameBuffer);
            FrameBuffer = 0;
        }
        pTexture.Clear();
        pShaderSet.Clear();
        pVertexShader.Clear();
        pFragmentShader.Clear();
        pVB.Clear();
        if(VAO)
        {
            #ifdef OVR_OS_MAC
                if(GLVersionInfo.WholeVersion >= 302)
                    glDeleteVertexArrays(1, &VAO);
                else
                    glDeleteVertexArraysAPPLE(1, &VAO);
            #else
                glDeleteVertexArrays(1, &VAO);
            #endif
            
            VAO = 0;
            VAOInitialized = false;
        }
        // OrthoProjection: No need to clear.
        
        currentGLContext.Bind();
        GLContext.Destroy();
    }
}
コード例 #12
0
ファイル: mesh.cpp プロジェクト: e-dant/ogle-0-4-3
Mesh::~Mesh()
{
	glDeleteBuffers(NUM_BUFFERS, m_vertexArrayBuffers);
	glDeleteVertexArraysAPPLE(1, &m_vertexArrayObject);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_APPLEVertexArrayObject_nglDeleteVertexArraysAPPLE(JNIEnv *env, jclass clazz, jint n, jlong arrays, jlong function_pointer) {
	const GLuint *arrays_address = (const GLuint *)(intptr_t)arrays;
	glDeleteVertexArraysAPPLEPROC glDeleteVertexArraysAPPLE = (glDeleteVertexArraysAPPLEPROC)((intptr_t)function_pointer);
	glDeleteVertexArraysAPPLE(n, arrays_address);
}
コード例 #14
0
ファイル: gl_lib.cpp プロジェクト: csulmone/emilib
	VAO::~VAO()
	{
		glDeleteVertexArraysAPPLE(1, &_id);
	}
コード例 #15
0
ファイル: vao-02.c プロジェクト: nobled/piglit
void
piglit_init(int argc, char **argv)
{
	GLuint obj;
	int pass = 1;
	void * ptr;
	GLenum err;

	piglit_require_extension("GL_APPLE_vertex_array_object");

	glGenVertexArraysAPPLE(1, & obj);
	glBindVertexArrayAPPLE(obj);
	glVertexPointer(4, GL_FLOAT, sizeof(GLfloat) * 4, (void *) 0xDEADBEEF);
	glEnableClientState(GL_VERTEX_ARRAY);

	glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);

	glDeleteVertexArraysAPPLE(1, & obj);
   
	err = glGetError();
	if (err) {
		printf("glGetError incorrectly returned 0x%04x.\n", err);
		pass = 0;
	}

	if ((*glIsVertexArrayAPPLE)(obj)) {
		printf("Array object is incorrectly still valid.\n");
		pass = 0;
	}

	err = glGetError();
	if (err) {
		printf("glGetError incorrectly returned 0x%04x.\n", err);
		pass = 0;
	}

	glPopClientAttrib();

	err = glGetError();
	if (err) {
		printf("glGetError incorrectly returned 0x%04x.\n", err);
		pass = 0;
	}

	if (! glIsVertexArrayAPPLE(obj)) {
		printf("Array object is incorrectly invalid.\n");
		pass = 0;
	}

	if (! glIsEnabled(GL_VERTEX_ARRAY)) {
		printf("Array state is incorrectly disabled.\n");
		pass = 0;
	}

	glGetPointerv(GL_VERTEX_ARRAY_POINTER, & ptr);
	if (ptr != (void *) 0xDEADBEEF) {
		printf("Array pointer is incorrectly set to 0x%p.\n", ptr);
		pass = 0;
	}

	if (! pass) {
		piglit_report_result(PIGLIT_FAIL);
	} else {
		piglit_report_result(PIGLIT_PASS);
	}
}