summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/static_model.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/static_model.cpp b/src/static_model.cpp
index 25a08c7..5873792 100644
--- a/src/static_model.cpp
+++ b/src/static_model.cpp
@@ -85,6 +85,18 @@ cg_cStaticModel_set_position(mrb_state *mrb, mrb_value self)
}
static mrb_value
+cg_cStaticModel_set_texture(mrb_state *mrb, mrb_value self)
+{
+ auto ptr = (std::shared_ptr<VK::StaticModel>*)DATA_PTR(self);
+ std::shared_ptr<VK::Texture> *texture;
+
+ mrb_get_args(mrb, "d", &texture, &cg_texture_type);
+ (*ptr)->texture = *texture;
+
+ return self;
+}
+
+static mrb_value
cg_cStaticModel_draw(mrb_state *mrb, mrb_value self)
{
auto ptr = (std::shared_ptr<VK::StaticModel>*)DATA_PTR(self);
@@ -115,5 +127,8 @@ cg_static_model_init(mrb_state *mrb)
mrb, cg_cStaticModel, "rotation=", cg_cStaticModel_set_rotation,
MRB_ARGS_REQ(1));
mrb_define_method(
+ mrb, cg_cStaticModel, "texture=", cg_cStaticModel_set_texture,
+ MRB_ARGS_REQ(1));
+ mrb_define_method(
mrb, cg_cStaticModel, "draw", cg_cStaticModel_draw, MRB_ARGS_NONE());
}