CS 3451 homework1 similar to writing functions from openGL