Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Shader::loadFromFile(const string &filename)
- {
- std::ifstream file;
- file.open(filename.c_str());
- if (!file.good())
- {
- std::cout << "Failed to open file: " << filename << std::endl;
- return;
- }
- std::stringstream stream;
- stream << file.rdbuf();
- file.close();
- const char *sourceChars = stream.str.c_str();
- glShaderSource(id, 1, &sourceChars, NULL);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement