Ejemplo n.º 1
0
Archivo: ctx.c Proyecto: cloudhead/px
void ctx_identity(struct context *ctx)
{
	*ctx->transform = mat4identity();

	if (ctx->program)
		set_uniform_mat4(ctx->program, "transform", ctx->transform);
}
Ejemplo n.º 2
0
Archivo: ctx.c Proyecto: cloudhead/px
void ctx_save(struct context *ctx)
{
	mat4_t *m = malloc(sizeof(*m));

	if (ctx->transforms == NULL) {
		*m = mat4identity();
	} else {
		*m = *(mat4_t *)ctx->transforms->head;
	}
	list_push(&ctx->transforms, m);
	ctx->transform = m;
}
Ejemplo n.º 3
0
Archivo: light.c Proyecto: m-nez/engine
void light_init_at(light_t* light, int i) {
	mat4identity(light->pos[i]);
	vec4set(light->col[i], 1, 1, 1, 1);
	light->user_ptr[i] = NULL;
}