These were the codes I wrote in a small drawing system implemented by OpenGL.