Euphoria
viewportdef.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 #include "base/rect.h"
5 
6 namespace eu::core
7 {
9  {
11 
14 
18  [[nodiscard]]
20  (
21  float width,
22  float height,
23  int window_width,
24  int window_height
25  );
26 
30  [[nodiscard]]
32  (
33  float width,
34  float height,
35  int window_width,
36  int window_height
37  );
38 
41  [[nodiscard]] static ViewportDefinition from_screen_pixel
42  (
43  int window_width,
44  int window_height
45  );
46 
47  ViewportDefinition(const Recti& screen, float w, float h);
48  };
49 
50 }
51 
ViewportDefinition(const Recti &screen, float w, float h)
Definition: viewportdef.cc:99
static ViewportDefinition from_fit_with_black_bars(float width, float height, int window_width, int window_height)
The viewport is scaled, with aspect in mind, and centered.
Definition: viewportdef.cc:10
static ViewportDefinition from_screen_pixel(int window_width, int window_height)
The viewport matches the screen pixel by pixel.
Definition: viewportdef.cc:84
static ViewportDefinition from_extend(float width, float height, int window_width, int window_height)
The viewports height or width is extended to match the screen.
Definition: viewportdef.cc:55