fix #337. fix init framebuffer functions.