Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Before - Broken
- const char* vertTmp = vertContents.c_str();
- const char* fragTmp = fragContents.c_str();
- glShaderSource( vert, 1, &vertTmp, NULL ); // If it's NULL, then the string is NULL-terminated
- glShaderSource( frag, 1, &fragTmp, NULL );
- // After - Fixed
- const char* vertTmp = vertContents.c_str(); int vertLen = vertContents.length()-1;
- const char* fragTmp = fragContents.c_str(); int fragLen = fragContents.length()-1;
- glShaderSource( vert, 1, &vertTmp, &vertLen ); // Telling it the length of the string, or length - 1 ?
- glShaderSource( frag, 1, &fragTmp, &fragLen );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement