17 lines
500 B
C
17 lines
500 B
C
#include <kinc/graphics5/shader.h>
|
|
|
|
void kinc_g5_shader_init(kinc_g5_shader_t *shader, const void *source, size_t length, kinc_g5_shader_type_t type) {
|
|
shader->impl.length = (int)length;
|
|
shader->impl.id = 0;
|
|
shader->impl.source = (char *)malloc(length + 1);
|
|
for (int i = 0; i < length; ++i) {
|
|
shader->impl.source[i] = ((char *)source)[i];
|
|
}
|
|
shader->impl.source[length] = 0;
|
|
}
|
|
|
|
void kinc_g5_shader_destroy(kinc_g5_shader_t *shader) {
|
|
free(shader->impl.source);
|
|
shader->impl.source = NULL;
|
|
}
|