Пример #1
0
void ResourceManager::recover() 
{
	if (sTextureList.size())
		glDeleteTextures( (GLsizei) sTextureList.size(), &(*sTextureList.begin()));

	if (sAsmProgramList.size())
		glDeleteProgramsARB( (GLsizei) sAsmProgramList.size(), &(*sAsmProgramList.begin()));


	for (std::vector<GLuint>::iterator it=sProgramList.begin(); it<sProgramList.end(); it++) {
		glDeleteObject( *it); 
	}
	{
		for (std::vector<GLuint>::iterator it=sShaderList.begin(); it<sShaderList.end(); it++) {
			glDeleteObject( *it); 
		}
	}

	sTextureList.clear();
	sAsmProgramList.clear();
	sProgramList.clear();
	sShaderList.clear();
	
	GL_CHECK;
}
Пример #2
0
static void
_cogl_program_free (CoglProgram *program)
{
  /* Frees program resources but its handle is not
     released! Do that separately before this! */
  _COGL_GET_CONTEXT (ctx, NO_RETVAL);
  glDeleteObject (program->gl_handle);

  g_slice_free (CoglProgram, program);
}