mirror of
				https://github.com/MichaelFisher1997/opengl-cpp.git
				synced 2025-10-18 12:17:45 +00:00 
			
		
		
		
	fized our error message make added a glDeleteProgram call when the application ends
This commit is contained in:
		| @@ -125,6 +125,7 @@ void SdlWindow::run() { | ||||
|     update(); | ||||
|     render(); | ||||
|   } | ||||
|   glDeleteProgram(shader); | ||||
| } | ||||
|  | ||||
| void SdlWindow::processEvents() { | ||||
| @@ -225,7 +226,7 @@ unsigned int SdlWindow::compileShader(unsigned int type, const std::string& sour | ||||
|     glGetShaderiv(id, GL_INFO_LOG_LENGTH, &length); | ||||
|     char* message = (char*)alloca(length * sizeof(char)); //do i need to deallocate this?? | ||||
|     glGetShaderInfoLog(id, length, &length, message); | ||||
|     std::cout << "Failed to compile" << (type == GL_VERTEX_SHADER ? "vertex":"fragment") << "shader" << std::endl; // print out what type of shader it is | ||||
|     std::cout << "Failed to compile " << (type == GL_VERTEX_SHADER ? "vertex":"fragment") << " shader" << std::endl; // print out what type of shader it is | ||||
|     std::cout << message << std::endl; | ||||
|     glDeleteShader(id); | ||||
|     return 0; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MichaelFisher1997
					MichaelFisher1997