finished C shader loading logic