コード例 #1
0
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;
}
コード例 #2
0
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;
}
コード例 #3
0
ファイル: Material.c プロジェクト: stuckie/glesgae
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;
}
コード例 #4
0
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;
}
コード例 #5
0
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;
}
コード例 #6
0
ファイル: Controller.c プロジェクト: stuckie/glesgae
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;
}