Esempio n. 1
0
IoGLScissor *IoGLScissor_proto(void *state)
{
	IoObject *self = IoObject_new(state);
	IoObject_tag_(self, IoGLScissor_newTag(state));

	IoObject_setDataPointer_(self, calloc(1, sizeof(IoGLScissorData)));

	DATA(self)->rect    = IoBox_new(state);
	DATA(self)->tmpRect = IoBox_new(state);

	IoState_registerProtoWithFunc_(state, self, IoGLScissor_proto);

	{
	IoMethodTable methodTable[] = {
	{"sync", IoGLScissor_sync},
	{"set", IoGLScissor_set},
	{"on", IoGLScissor_on},
	{"off", IoGLScissor_off},
	{"isOn", IoGLScissor_isOn},
	{"push", IoGLScissor_push},
	{"pop", IoGLScissor_pop},
	{"isVisible", IoGLScissor_isVisible},

	{"rect", IoGLScissor_rect},
	{"setRect", IoGLScissor_setScreenRect},
	{"setViewRect", IoGLScissor_setViewRect},
	{"unionWithViewRect", IoGLScissor_unionWithViewRect},
	{"unionWithScreenRect", IoGLScissor_unionWithScreenRect},
	{NULL, NULL},
	};
	IoObject_addMethodTable_(self, methodTable);
	}
	return self;
}
Esempio n. 2
0
File: IoBox.c Progetto: ADTSH/io
IoBox *IoBox_newSet(void *state,
				NUM_TYPE x,
				NUM_TYPE y,
				NUM_TYPE z,
				NUM_TYPE w,
				NUM_TYPE h,
				NUM_TYPE d)
{
	vec3f xyz = { x, y, z};
	vec3f whd = { w, h, d};
	IoBox *self = IoBox_new(state);
	IoSeq_setVec3f_(DATA(self)->origin, xyz);
	IoSeq_setVec3f_(DATA(self)->size,   whd);
	return self;
}