Exemple #1
0
void ctx_identity(struct context *ctx)
{
	*ctx->transform = mat4identity();

	if (ctx->program)
		set_uniform_mat4(ctx->program, "transform", ctx->transform);
}
Exemple #2
0
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;
}
Exemple #3
0
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;
}