GAE_Joystick_t* GAE_Joystick_create(const unsigned int axes, const unsigned int buttons) { GAE_Joystick_t* joystick = (GAE_Joystick_t*)malloc(sizeof(GAE_Joystick_t)); joystick->axes = GAE_Array_create(sizeof(float)); GAE_Array_reserve(joystick->axes, axes); joystick->buttons = GAE_Array_create(sizeof(float)); GAE_Array_reserve(joystick->buttons, buttons); return joystick; }
GAE_Pointer_t* GAE_Pointer_create(const unsigned int axes, const unsigned int buttons) { GAE_Pointer_t* pointer = (GAE_Pointer_t*)malloc(sizeof(GAE_Pointer_t)); unsigned int index = 0U; float depressed = 0.0F; pointer->axes = GAE_Array_create(sizeof(float)); for (index = 0U; index < axes; ++index) GAE_Array_push(pointer->axes, (void*)&depressed); pointer->buttons = GAE_Array_create(sizeof(float)); for (index = 0U; index < buttons; ++index) GAE_Array_push(pointer->buttons, (void*)&depressed); return pointer; }
GAE_Material_t* GAE_Material_create(void) { GAE_Material_t* material = malloc(sizeof(GAE_Material_t)); material->shader = 0; material->textures = GAE_Array_create(sizeof(GAE_Texture_t)); return material; }
GAE_Pad_t* GAE_Pad_create(const unsigned int buttons) { GAE_Pad_t* pad = (GAE_Pad_t*)malloc(sizeof(GAE_Pad_t)); pad->buttons = GAE_Array_create(sizeof(float)); GAE_Array_reserve(pad->buttons, buttons); return pad; }
GAE_StateStack_t* GAE_StateStack_create(void) { GAE_StateStack_t* stack = malloc(sizeof(GAE_StateStack_t)); stack->stack = GAE_Array_create(sizeof(GAE_State_t)); stack->lastState = 0; return stack; }
GAE_Pointer_t* GAE_Pointer_create(const unsigned int axes, const unsigned int buttons) { GAE_Pointer_t* pointer = malloc(sizeof(GAE_Pointer_t)); unsigned int index = 0U; pointer->axes = GAE_Array_create(sizeof(float)); for (index = 0U; index < axes; ++index) { float* value = malloc(sizeof(float)); *value = 0.0F; GAE_Array_push(pointer->axes, value); } pointer->buttons = GAE_Array_create(sizeof(float)); for (index = 0U; index < buttons; ++index) { float* value = malloc(sizeof(float)); *value = 0.0F; GAE_Array_push(pointer->buttons, value); } return pointer; }