void kmGLFreeAll() { //Clear the matrix stacks km_mat4_stack_release(&modelview_matrix_stack); km_mat4_stack_release(&projection_matrix_stack); km_mat4_stack_release(&texture_matrix_stack); //Delete the matrices initialized = 0; //Set to uninitialized current_stack = NULL; //Set the current stack to point nowhere }
void kmGLClearContext(km_mat4_stack_context *context) { /* Unlink current context from linked list*/ if (context->entry->prev) context->entry->prev->next = context->entry->next; /*Clear the matrix stacks*/ km_mat4_stack_release(&context->modelview_matrix_stack); km_mat4_stack_release(&context->projection_matrix_stack); km_mat4_stack_release(&context->texture_matrix_stack); /*Delete the matrices*/ context->initialized = 0; /*Set the current stack to point nowhere*/ context->current_stack = NULL; /* Free the list entry, including its stacks*/ free(context->entry); }