synchronize shutter glass

anyone has tried to write a 3d stereo program which also automatically synchronize with the shutter glass?