Implemented window specific behavior and fixed shader load #91
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implemented type_of_file for windows and fixed shader bug where it fails to compile on load
Description of bug:
Programs abnormally terminates when it is ran.
Explanation and Solution:
TLDR: Shader is not compiled properly due to garbage values. String is not terminated properly.
File is loaded as a text file, so \r\n gets translated to \n, meaning string count > characters read, leading to glShaderSource reading uninitialized memory on Windows. Also, null was passed to the last argument of glShaderSource meaning the string is read as a null terminated (was supposed to be a counted), fixed by passing String_Builder to pass .count. Still works (unexpectedly), but you shouldn't count the os to give you zeroed out memory (unless you use os specific calls that give you that, eg. VirtualAlloc). Following is a hex dump of both text and binary mode on Windows.