bgfx library. I moved a few things around to make it work well with project generator. also a few minor changes to code, all are marked and commented.