openMSX
GLScalerFactory.cc
Go to the documentation of this file.
1 #include "GLScalerFactory.hh"
2 #include "GLSimpleScaler.hh"
3 #include "GLRGBScaler.hh"
4 #include "GLSaIScaler.hh"
5 #include "GLScaleNxScaler.hh"
6 #include "GLTVScaler.hh"
7 #include "GLHQScaler.hh"
8 #include "GLHQLiteScaler.hh"
9 #include "GLContext.hh"
10 #include "RenderSettings.hh"
11 #include "unreachable.hh"
12 #include <memory>
13 
15 
16 std::unique_ptr<GLScaler> createScaler(RenderSettings& renderSettings)
17 {
18  GLScaler& fallback = gl::context->getFallbackScaler();
19  switch (renderSettings.getScaleAlgorithm()) {
21  // disabled for now:
22  // - it doesn't work (yet) on ATI cards
23  // - it probably has some bugs because (on nvidia cards)
24  // it does not give the same result as the SW SaI scaler,
25  // although it's reasonably close
26  //return std::make_unique<GLSaIScaler>();
28  return std::make_unique<GLSimpleScaler>(renderSettings, fallback);
30  return std::make_unique<GLRGBScaler>(renderSettings, fallback);
32  return std::make_unique<GLScaleNxScaler>(fallback);
34  return std::make_unique<GLTVScaler>(renderSettings);
36  return std::make_unique<GLHQScaler>(fallback);
37  case RenderSettings::SCALER_MLAA: // fallback
39  return std::make_unique<GLHQLiteScaler>(fallback);
40  default:
42  }
43  return nullptr; // avoid warning
44 }
45 
46 } // namespace openmsx::GLScalerFactory
Abstract base class for OpenGL scalers.
Definition: GLScaler.hh:15
Class containing all settings for renderers.
ScaleAlgorithm getScaleAlgorithm() const
The current scaling algorithm.
std::optional< Context > context
Definition: GLContext.cc:9
std::unique_ptr< GLScaler > createScaler(RenderSettings &renderSettings)
Instantiates a Scaler.
#define UNREACHABLE
Definition: unreachable.hh:38