Commit cd5a1798 authored by Tim Übelhör's avatar Tim Übelhör

fixed recalculating the texture dimensions on set

parent c4d83bee
......@@ -84,8 +84,8 @@ public:
size_t get_views_per_column() const;
size_t get_view_width() const;
size_t get_view_height() const;
void set_views_per_row(size_t n_views);
void set_views_per_column(size_t n_views);
void set_views_per_row(size_t views_per_row);
void set_views_per_column(size_t views_per_column);
void set_view_width(size_t width);
void set_view_height(size_t height);
......
......@@ -10,12 +10,11 @@ Rasterizer::Rasterizer()
Rasterizer::Rasterizer(size_t width, size_t height, size_t views_per_row,
size_t views_per_column)
: width(width), height(height),
views_per_row(views_per_row), views_per_column(views_per_column)
{
// create the offscreen render object
texture_width = width * views_per_row;
texture_height = height * views_per_column;
set_view_width(width);
set_view_height(height);
set_views_per_row(views_per_row);
set_views_per_column(views_per_column);
}
void Rasterizer::activate_view(size_t row, size_t column)
......@@ -72,21 +71,25 @@ size_t Rasterizer::get_view_height() const
{
return height;
}
void Rasterizer::set_views_per_row(size_t n_views)
void Rasterizer::set_views_per_row(size_t views_per_row)
{
views_per_row = n_views;
this->views_per_row = views_per_row;
texture_width = views_per_row * width;
}
void Rasterizer::set_views_per_column(size_t n_views)
void Rasterizer::set_views_per_column(size_t views_per_column)
{
views_per_column = n_views;
this->views_per_column = views_per_column;
texture_height = views_per_column * height;
}
void Rasterizer::set_view_width(size_t width)
{
this->width = width;
texture_width = views_per_row * width;
}
void Rasterizer::set_view_height(size_t height)
{
this->height = height;
texture_height = views_per_column * height;
}
Rasterizer::ImageHeader Rasterizer::get_view_image(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment