コード例 #1
0
//release all allocated resources
void OnShutdown() {

	glDeleteTextures(1, &shadowMapTexID);

	//Destroy shader
	shader.DeleteShaderProgram();
	flatshader.DeleteShaderProgram();

	//Destroy vao and vbo
	glDeleteBuffers(1, &sphereVerticesVBO);
	glDeleteBuffers(1, &sphereIndicesVBO);
	glDeleteVertexArrays(1, &sphereVAOID);

	glDeleteBuffers(1, &cubeVerticesVBO);
	glDeleteBuffers(1, &cubeIndicesVBO);
	glDeleteVertexArrays(1, &cubeVAOID);

	glDeleteBuffers(1, &planeVerticesVBO);
	glDeleteBuffers(1, &planeIndicesVBO);
	glDeleteVertexArrays(1, &planeVAOID);

	glDeleteVertexArrays(1, &lightVAOID);
	glDeleteBuffers(1, &lightVerticesVBO);

	glDeleteFramebuffers(1,&fboID);

	cout<<"Shutdown successfull"<<endl;
}
コード例 #2
0
ファイル: main.cpp プロジェクト: mattbti/OpenGL
//release all allocated resources here
void OnShutdown() {
	//delete all textures
	size_t total_textures = materialMap.size();
	for(size_t i=0;i<total_textures;i++) {
		if(materialNames[i].length()>0)
			glDeleteTextures(1, &materialMap[materialNames[i]]);
	}
	materialNames.clear();
	materialMap.clear();
	submeshes.clear();
	vertices.clear();
	indices.clear();
	skeleton.clear();
	animations.clear();

	dualQuaternions.clear();
	animatedXform.clear();
	skeleton.clear();
	bindPose.clear();
	invBindPose.clear();

	//Destroy shader
	shader.DeleteShaderProgram();
	flatShader.DeleteShaderProgram();

	//Destroy vao and vbo
	glDeleteBuffers(1, &vboVerticesID);
	glDeleteBuffers(1, &vboIndicesID);
	glDeleteVertexArrays(1, &vaoID);

	glDeleteVertexArrays(1, &lightVAOID);
	glDeleteVertexArrays(1, &lightVerticesVBO);

	cout<<"Shutdown successfull"<<endl;
}
コード例 #3
0
//release all allocated resources
void OnShutdown() {
	shader.DeleteShaderProgram();
	glDeleteVertexArrays(1, &volumeMarcherVAO);
	glDeleteBuffers(1, &volumeMarcherVBO);

	delete grid;
	delete marcher;
	cout<<"Shutdown successfull"<<endl;
}
コード例 #4
0
//release all allocated resources
void OnShutdown() {
	//Destroy shader
	shader.DeleteShaderProgram();
	cubemapShader.DeleteShaderProgram();

	//Destroy vao and vbo
	glDeleteBuffers(1, &sphereVerticesVBO);
	glDeleteBuffers(1, &sphereIndicesVBO);
	glDeleteVertexArrays(1, &sphereVAOID);

	delete grid;
	delete cube;

	glDeleteTextures(1, &dynamicCubeMapID);


	glDeleteFramebuffers(1, &fboID);
	glDeleteRenderbuffers(1, &rboID);
	cout<<"Shutdown successfull"<<endl;
}
コード例 #5
0
//delete all allocated resources
void OnShutdown() {
	//Destroy shader
	shader.DeleteShaderProgram();

	//Destroy vao and vbo
	glDeleteBuffers(1, &vboVerticesID);
	glDeleteBuffers(1, &vboIndicesID);
	glDeleteVertexArrays(1, &vaoID);

	cout<<"Shutdown successfull"<<endl;
}
コード例 #6
0
//release all allocated resources
void OnShutdown() {
    shader.DeleteShaderProgram();

    glDeleteVertexArrays(1, &cubeVAOID);
    glDeleteBuffers(1, &cubeVBOID);
    glDeleteBuffers(1, &cubeIndicesID);

    glDeleteTextures(1, &textureID);
    delete grid;
    cout<<"Shutdown successfull"<<endl;
}
コード例 #7
0
ファイル: main.cpp プロジェクト: mattbti/OpenGL
//release all allocated resources
void OnShutdown() {

	glDeleteVertexArrays(1, &quadVAOID);
	glDeleteBuffers(1, &quadVBOID);
	glDeleteBuffers(1, &quadIndicesID);

	//delete all textures
	glDeleteTextures(1, &textureID);

	//delete all meshes
	size_t total_meshes = meshes.size();
	for(size_t i=0;i<total_meshes;i++) {
		delete meshes[i];
		meshes[i]=0;
	}
	meshes.clear();

	size_t total_materials = materials.size();
	for( size_t i=0;i<total_materials;i++) {
		delete materials[i];
		materials[i] = 0;
	}
	materials.clear();

	//Destroy shader
	shader.DeleteShaderProgram();
	raytraceShader.DeleteShaderProgram();
	flatShader.DeleteShaderProgram();

	//Destroy vao and vbo
	glDeleteBuffers(1, &vboVerticesID);
	glDeleteBuffers(1, &vboIndicesID);
	glDeleteVertexArrays(1, &vaoID);

	glDeleteVertexArrays(1, &lightVAOID);
	glDeleteBuffers(1, &lightVerticesVBO);

	glDeleteTextures(1, &texVerticesID);
	glDeleteTextures(1, &texTrianglesID);
	cout<<"Shutdown successfull"<<endl;
}
コード例 #8
0
//release all allocated resources
void OnShutdown() {
	cubeShader.DeleteShaderProgram();
	frontPeelShader.DeleteShaderProgram();
	blendShader.DeleteShaderProgram();
	finalShader.DeleteShaderProgram();

	shutdownFBO();
	glDeleteQueries(1, &queryId);

	glDeleteVertexArrays(1, &quadVAOID);
	glDeleteBuffers(1, &quadVBOID);
	glDeleteBuffers(1, &quadIndicesID);

	glDeleteVertexArrays(1, &cubeVAOID);
	glDeleteBuffers(1, &cubeVBOID);
	glDeleteBuffers(1, &cubeIndicesID);


	delete grid;
	cout<<"Shutdown successfull"<<endl;
}
コード例 #9
0
//release all allocated resources
void OnShutdown() {
	//Destroy shader
	shader.DeleteShaderProgram();
	//Destroy vao and vbo
	glDeleteBuffers(1, &sphereVerticesVBO);
	glDeleteBuffers(1, &sphereIndicesVBO);
	glDeleteVertexArrays(1, &sphereVAOID);

	glDeleteBuffers(1, &cubeVerticesVBO);
	glDeleteBuffers(1, &cubeIndicesVBO);
	glDeleteVertexArrays(1, &cubeVAOID);

	delete grid;
	cout<<"Shutdown successfull"<<endl;
}
コード例 #10
0
//delete all allocated objects
void OnShutdown() {
	X.clear();
	X_last.clear();
	F.clear();
	indices.clear();
	springs.clear();

	glDeleteQueries(1, &query);
	glDeleteQueries(1, &t_query);

	glDeleteTextures( 2, texPosID);
	glDeleteTextures( 2, texPrePosID);

	glDeleteVertexArrays(2, vaoUpdateID);
	glDeleteVertexArrays(2, vaoRenderID);
	glDeleteVertexArrays(1, &clothVAOID);
	glDeleteVertexArrays(1, &gridVAOID);
	glDeleteVertexArrays(1, &sphereVAOID);

	glDeleteBuffers( 1, &gridVBOVerticesID);
	glDeleteBuffers( 1, &gridVBOIndicesID);
	glDeleteBuffers( 1, &clothVBOVerticesID);
	glDeleteBuffers( 1, &clothVBOIndicesID);
	glDeleteBuffers( 1, &sphereVerticesID);
	glDeleteBuffers( 1, &sphereIndicesID);

    glDeleteBuffers( 2, vboID_Pos);
	glDeleteBuffers( 2, vboID_PrePos);
	glDeleteBuffers( 1, &vboIndices);

	glDeleteTransformFeedbacks(1, &tfID);
	renderShader.DeleteShaderProgram();
	massSpringShader.DeleteShaderProgram();
	particleShader.DeleteShaderProgram();
	printf("Shutdown successful");
}
コード例 #11
0
//release al allocated resources
void OnShutdown() {
	ShutdownFBO();

	//delete all textures
	size_t total_textures = textures.size();
	for(size_t i=0;i<total_textures;i++) {
		glDeleteTextures(1, &textures[i]);
	}
	textures.clear();

	//delete all meshes
	size_t total_meshes = meshes.size();
	for(size_t i=0;i<total_meshes;i++) {
		delete meshes[i];
		meshes[i]=0;
	}
	meshes.clear();

	size_t total_materials = materials.size();
	for( size_t i=0;i<total_materials;i++) {
		delete materials[i];
		materials[i] = 0;
	}
	materials.clear();

	//Delete textures
	glDeleteTextures(1, &noiseTexID);

	//Destroy shader
	shader.DeleteShaderProgram();
	ssaoFirstShader.DeleteShaderProgram();
	ssaoSecondShader.DeleteShaderProgram();
	gaussianH_shader.DeleteShaderProgram();
	gaussianV_shader.DeleteShaderProgram();
	finalShader.DeleteShaderProgram();
	flatShader.DeleteShaderProgram();

	//Destroy vao and vbo
	glDeleteBuffers(1, &vboVerticesID);
	glDeleteBuffers(1, &vboIndicesID);
	glDeleteVertexArrays(1, &vaoID);

	glDeleteVertexArrays(1, &quadVAOID);
	glDeleteBuffers(1, &quadVBOID);
	glDeleteBuffers(1, &quadIndicesID);

	glDeleteVertexArrays(1, &lightVAOID);
	glDeleteBuffers(1, &lightVerticesVBO);
	cout<<"Shutdown successfull"<<endl;
}