Fixed build for windows

Call to fopen() needs to be replaced.
Merge pull request #17 from shadowpho/master

Added more logging to detect if we have HW window
More debugging for shaders.