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.
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.