Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented window specific behavior and fixed shader load #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

joshuang321
Copy link

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.

nl

Implemented type_of_file for windows and fixed shader bug when it fails to compile on load
Fixed file opening for 'normal' files in type_of_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant