19 #ifndef SIMULANT_VIEWPORT_H
20 #define SIMULANT_VIEWPORT_H
24 #include "generic/managed.h"
25 #include "interfaces.h"
32 VIEWPORT_TYPE_BLACKBAR_4_BY_3,
33 VIEWPORT_TYPE_BLACKBAR_16_BY_9,
34 VIEWPORT_TYPE_BLACKBAR_16_BY_10,
35 VIEWPORT_TYPE_VERTICAL_SPLIT_LEFT,
36 VIEWPORT_TYPE_VERTICAL_SPLIT_RIGHT,
37 VIEWPORT_TYPE_HORIZONTAL_SPLIT_TOP,
38 VIEWPORT_TYPE_HORIZONTAL_SPLIT_BOTTOM,
42 void calculate_ratios_from_viewport(ViewportType type,
float& x,
float& y,
float& width,
float& height);
50 Viewport(ViewportType type,
const Colour& colour=smlt::Colour::BLACK);
51 Viewport(Ratio x, Ratio y, Ratio width, Ratio height,
const Colour& colour=smlt::Colour::BLACK);
53 Ratio x()
const {
return x_; }
54 Ratio y()
const {
return y_; }
55 Ratio width()
const {
return width_; }
56 Ratio height()
const {
return height_; }
58 void clear(
const RenderTarget& target, uint32_t clear_flags);
61 uint32_t width_in_pixels(
const RenderTarget& target)
const;
62 uint32_t height_in_pixels(
const RenderTarget& target)
const;
64 ViewportType type()
const {
return type_; }