summaryrefslogtreecommitdiff
path: root/src/view_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/view_2d.cpp')
-rw-r--r--src/view_2d.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/view_2d.cpp b/src/view_2d.cpp
index 3f4325d..4a973d6 100644
--- a/src/view_2d.cpp
+++ b/src/view_2d.cpp
@@ -37,16 +37,19 @@ static mrb_value
cg_cView2D_initialize(mrb_state *mrb, mrb_value self)
{
std::shared_ptr<glm::vec4> *region;
+ mrb_float projection_width, projection_height;
std::shared_ptr<VK::View2D> *ptr;
- mrb_get_args(mrb, "d", &region, &cg_vector_4d_type);
+ mrb_get_args(mrb, "dff", &region, &cg_vector_4d_type,
+ &projection_width, &projection_height);
ptr = (std::shared_ptr<VK::View2D>*)DATA_PTR(self);
if(ptr) mrb_free(mrb, ptr);
ptr = (std::shared_ptr<VK::View2D>*)mrb_malloc(
mrb, sizeof(std::shared_ptr<VK::View2D>));
new(ptr)std::shared_ptr<VK::View2D>(
- std::make_shared<VK::View2D>(*region->get()));
+ std::make_shared<VK::View2D>(
+ *region->get(), projection_width, projection_height));
mrb_data_init(self, ptr, &cg_view_2d_type);
return self;
@@ -83,5 +86,5 @@ cg_view_2d_init(mrb_state *mrb)
cg_cView2D = mrb_define_class_under(mrb, cg_m, "View2D", mrb->object_class);
MRB_SET_INSTANCE_TT(cg_cView2D, MRB_TT_DATA);
mrb_define_method(
- mrb, cg_cView2D, "initialize", cg_cView2D_initialize, MRB_ARGS_REQ(1));
+ mrb, cg_cView2D, "initialize", cg_cView2D_initialize, MRB_ARGS_REQ(3));
}