framebuffer type changed to bitmap
#88 finished, minor native optimizations and nullchecks added