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 "GLHQLiteScaler.hh"
8#include "GLContext.hh"
9#include "RenderSettings.hh"
10#include "unreachable.hh"
11#include <memory>
12
14
15std::unique_ptr<GLScaler> createScaler(RenderSettings& renderSettings)
16{
17 GLScaler& fallback = gl::context->getFallbackScaler();
18 switch (renderSettings.getScaleAlgorithm()) {
20 return std::make_unique<GLSimpleScaler>(renderSettings, fallback);
22 return std::make_unique<GLRGBScaler>(renderSettings, fallback);
24 return std::make_unique<GLScaleNxScaler>(fallback);
26 return std::make_unique<GLTVScaler>(renderSettings);
28 return std::make_unique<GLHQScaler>(fallback);
30 return std::make_unique<GLHQLiteScaler>(fallback);
31 default:
33 }
34 return nullptr; // avoid warning
35}
36
37} // namespace openmsx::GLScalerFactory
Abstract base class for OpenGL scalers.
Definition GLScaler.hh:16
Class containing all settings for renderers.
ScaleAlgorithm getScaleAlgorithm() const
std::optional< Context > context
Definition GLContext.cc:10
std::unique_ptr< GLScaler > createScaler(RenderSettings &renderSettings)
Instantiates a Scaler.
#define UNREACHABLE