add some functions for opengl