Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fShaderFile.exceptions (ifstream::failbit | ifstream::badbit);
- try
- {
- // open files
- vShaderFile.open(vertexPath);
- fShaderFile.open(fragmentPath);
- stringstream vShaderStream, fShaderStream;
- // read file's buffer contents into streams
- vShaderStream << vShaderFile.rdbuf();
- fShaderStream << fShaderFile.rdbuf();
- // close file handlers
- vShaderFile.close();
- fShaderFile.close();
- // convert stream into string
- vertexCode = vShaderStream.str();
- fragmentCode = fShaderStream.str();
- print("ac");
- }
- catch (ifstream::failure e)
- {
- cout << "ERROR::SHADER::FILE_NOT_SUCCESFULLY_READ" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement