/// //Initializes a material // //Parameters: // mat: A pointer to the material to initialize // t: A pointer to the texture which this material represents an instance of void Material_Initialize(Material* mat, Texture* t) { //Allocate & Initialize color matrix mat->colorMatrix = Matrix_Allocate(); Matrix_Initialize(mat->colorMatrix, 4, 4); //Allocate & initialize tile vector mat->tile = Vector_Allocate(); Vector_Initialize(mat->tile, 2); mat->tile->components[0] = mat->tile->components[1] = 1.0f; mat->texture = t; }
/// //Initializes all members of a Game Object (GObject) // //Parameters: // GO: The Game Object to initialize void GObject_Initialize(GObject* GO) { GO->frameOfReference = FrameOfReference_Allocate(); FrameOfReference_Initialize(GO->frameOfReference); GO->colorMatrix = Matrix_Allocate(); Matrix_Initialize(GO->colorMatrix, 4, 4); GO->states = LinkedList_Allocate(); LinkedList_Initialize(GO->states); GO->mesh = NULL; GO->texture = NULL; GO->body = NULL; GO->collider = NULL; }