String geometry and BPS state counting