After 10.7 (and certainly post-Metal) I don't think the framebuffer is accessible via userspace, you'd probably need to create a kernel extension to expose it somehow.
Although windowserver must write to the framebuffer somehow so there's probably a private API as well