mimic opengl functionality