diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-11-06 16:57:33 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-11-06 16:57:33 -0400 |
commit | d7e9d913730b96a83751863ad896648488296532 (patch) | |
tree | 14d16fc53339b272fef7d33092dd5eb89da9d5e6 /libdimension/texture.c | |
parent | fd741e79c56c78de91ab3cbcbeaee28eddcee2dd (diff) | |
download | dimension-d7e9d913730b96a83751863ad896648488296532.tar.xz |
Add pattern framework, impelement checker pattern.
Diffstat (limited to 'libdimension/texture.c')
-rw-r--r-- | libdimension/texture.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libdimension/texture.c b/libdimension/texture.c index 1d0f3cd..7a012b5 100644 --- a/libdimension/texture.c +++ b/libdimension/texture.c @@ -26,6 +26,7 @@ dmnsn_pigment * dmnsn_new_pigment() { dmnsn_pigment *pigment = dmnsn_malloc(sizeof(dmnsn_pigment)); + pigment->init_fn = NULL; pigment->free_fn = NULL; pigment->trans = dmnsn_identity_matrix(); return pigment; @@ -47,6 +48,10 @@ dmnsn_delete_pigment(dmnsn_pigment *pigment) void dmnsn_pigment_init(dmnsn_pigment *pigment) { + if (pigment->init_fn) { + (*pigment->init_fn)(pigment); + } + pigment->trans_inv = dmnsn_matrix_inverse(pigment->trans); } |