mirror of https://github.com/adamdruppe/arsd.git
Add convenience constructors to PixelPresenter
This commit is contained in:
parent
3f0e52f875
commit
f29fcd25d8
|
@ -609,6 +609,39 @@ final class PixelPresenter {
|
|||
}
|
||||
}
|
||||
|
||||
// additional convience ctors
|
||||
public {
|
||||
|
||||
///
|
||||
this(
|
||||
string title,
|
||||
const Size resolution,
|
||||
const Size initialWindowSize,
|
||||
Scaling scaling = Scaling.contain,
|
||||
ScalingFilter filter = ScalingFilter.nearest,
|
||||
) {
|
||||
auto cfg = PresenterConfig();
|
||||
|
||||
cfg.window.title = title;
|
||||
cfg.renderer.resolution = resolution;
|
||||
cfg.window.size = initialWindowSize;
|
||||
cfg.renderer.scaling = scaling;
|
||||
cfg.renderer.filter = filter;
|
||||
|
||||
this(cfg);
|
||||
}
|
||||
|
||||
///
|
||||
this(
|
||||
string title,
|
||||
const Size resolution,
|
||||
Scaling scaling = Scaling.contain,
|
||||
ScalingFilter filter = ScalingFilter.nearest,
|
||||
) {
|
||||
this(title, resolution, resolution, scaling, filter,);
|
||||
}
|
||||
}
|
||||
|
||||
// public functions
|
||||
public {
|
||||
|
||||
|
|
Loading…
Reference in New Issue