16 lines
377 B
C
16 lines
377 B
C
#include "material.h"
|
|
#include <stdlib.h>
|
|
|
|
Material* material_create(Shader* shader, Texture* texture) {
|
|
Material* m = (Material*)calloc(1, sizeof(Material));
|
|
m->shader = shader;
|
|
m->texture = texture;
|
|
m->color = (Vec4){1.0f, 1.0f, 1.0f, 1.0f};
|
|
m->use_texture = (texture != NULL) ? 1 : 0;
|
|
return m;
|
|
}
|
|
|
|
void material_destroy(Material* m) {
|
|
free(m);
|
|
}
|