text: // stdafx.cpp : source file that includes just the standard includes
  // COMP371_hw1.pch will be the pre-compiled header
  // stdafx.obj will contain the pre-compiled type information
  
  #include "stdafx.h"
  
  // TODO: reference any additional headers you need in STDAFX.H
  // and not in this file
  
  GLuint loadShaders(std::string vertex_shader_path, std::string fragment_shader_path) {
  	// Create the shaders
  	// Read the Vertex Shader code from the file
  	std::string VertexShaderCode;
  	std::ifstream VertexShaderStream(vertex_shader_path, std::ios::in);
  
  	if (VertexShaderStream.is_open()) {
  		std::string Line = "";
  		while (getline(VertexShaderStream, Line))
  			VertexShaderCode += "\n" + Line;
  		VertexShaderStream.close();
  	} else {
  		printf("Impossible to open %s. Are you in the right directory ?\n", vertex_shader_path.c_str());
  		getchar();
  		exit(-1);
  	}
  
  	// Read the Fragment Shader code from the file
  	std::string FragmentShaderCode;
  	std::ifstream FragmentShaderStream(fragment_shader_path, std::ios::in);
  
  	if (FragmentShaderStream.is_open()) {
  		std::string Line = "";
  		while (getline(FragmentShaderStream, Line))
  			FragmentShaderCode += "\n" + Line;
  		FragmentShaderStream.close();
  	} else {
  		printf("Impossible to open %s. Are you in the right directory?\n", fragment_shader_path.c_str());
  		getchar();
  		exit(-1);
  	}
  
  	GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER);
  	char const * VertexSourcePointer = VertexShaderCode.c_str();
  	glShaderSource(vertexShader, 1, &VertexSourcePointer, NULL);
  	glCompileShader(vertexShader);
  	// Check for compile time errors
  	GLint success;
  	GLchar infoLog[512];
  	glGetShaderiv(vertexShader, GL_COMPILE_STATUS, &success);
  	if (!success) {
  		glGetShaderInfoLog(vertexShader, 512, NULL, infoLog);
  		std::cout << "ERROR::SHADER::VERTEX::COMPILATION_FAILED\n" << infoLog << std::endl;
  	}
  	// Fragment shader
  	GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
  	char const * FragmentSourcePointer = FragmentShaderCode.c_str();
  	glShaderSource(fragmentShader, 1, &FragmentSourcePointer, NULL);
  	glCompileShader(fragmentShader);
  	// Check for compile time errors
  	glGetShaderiv(fragmentShader, GL_COMPILE_STATUS, &success);
  	if (!success) {
  		glGetShaderInfoLog(fragmentShader, 512, NULL, infoLog);
  		std::cout << "ERROR::SHADER::FRAGMENT::COMPILATION_FAILED\n" << infoLog << std::endl;
  	}
  	// Link shaders
  	GLuint shaderProgram = glCreateProgram();
  	glAttachShader(shaderProgram, vertexShader);
  	glAttachShader(shaderProgram, fragmentShader);
  	glLinkProgram(shaderProgram);
  	// Check for linking errors
  	glGetProgramiv(shaderProgram, GL_LINK_STATUS, &success);
  	if (!success) {
  		glGetProgramInfoLog(shaderProgram, 512, NULL, infoLog);
  		std::cout << "ERROR::SHADER::PROGRAM::LINKING_FAILED\n" << infoLog << std::endl;
  	}
  	glDeleteShader(vertexShader); //free up memory
  	glDeleteShader(fragmentShader);
  
  	return shaderProgram;
  }
  