openMSX
GLScalerFactory.cc
Go to the documentation of this file.
1#include "GLScalerFactory.hh"
2#include "GLSimpleScaler.hh"
3#include "GLRGBScaler.hh"
4#include "GLScaleNxScaler.hh"
5#include "GLTVScaler.hh"
6#include "GLHQScaler.hh"
7#include "GLContext.hh"
8#include "RenderSettings.hh"
9#include "unreachable.hh"
10#include <memory>
11
13
14std::unique_ptr<GLScaler> createScaler(
15 RenderSettings& renderSettings, unsigned maxWidth, unsigned maxHeight)
16{
17 GLScaler& fallback = gl::context->getFallbackScaler();
18 switch (renderSettings.getScaleAlgorithm()) {
20 case SIMPLE:
21 return std::make_unique<GLSimpleScaler>(renderSettings, fallback);
22 case RGBTRIPLET:
23 return std::make_unique<GLRGBScaler>(renderSettings, fallback);
24 case SCALE:
25 return std::make_unique<GLScaleNxScaler>(fallback);
26 case TV:
27 return std::make_unique<GLTVScaler>(renderSettings);
28 case HQ:
29 return std::make_unique<GLHQScaler>(fallback, maxWidth, maxHeight);
30 default:
32 }
33}
34
35} // namespace openmsx::GLScalerFactory
Abstract base class for OpenGL scalers.
Definition GLScaler.hh:16
Class containing all settings for renderers.
ScaleAlgorithm
Scaler algorithm.
ScaleAlgorithm getScaleAlgorithm() const
std::optional< Context > context
Definition GLContext.cc:10
std::unique_ptr< GLScaler > createScaler(RenderSettings &renderSettings, unsigned maxWidth, unsigned maxHeight)
Instantiates a Scaler.
#define UNREACHABLE