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 "RenderSettings.hh"
10 #include "EnumSetting.hh"
11 #include "memory.hh"
12 #include "unreachable.hh"
13 
14 using std::unique_ptr;
15 
16 namespace openmsx {
17 namespace GLScalerFactory {
18 
19 unique_ptr<GLScaler> createScaler(RenderSettings& renderSettings)
20 {
21  switch (renderSettings.getScaleAlgorithm().getEnum()) {
23  // disabled for now:
24  // - it doesn't work (yet) on ATI cards
25  // - it probably has some bugs because (on nvidia cards)
26  // it does not give the same result as the SW SaI scaler,
27  // although it's reasonably close
28  //return make_unique<GLSaIScaler>();
30  return make_unique<GLSimpleScaler>(renderSettings);
32  return make_unique<GLRGBScaler>(renderSettings);
34  return make_unique<GLScaleNxScaler>();
36  return make_unique<GLTVScaler>(renderSettings);
38  return make_unique<GLHQScaler>();
39  case RenderSettings::SCALER_MLAA: // fallback
41  return make_unique<GLHQLiteScaler>();
42  default:
44  }
45  return nullptr; // avoid warning
46 }
47 
48 } // namespace GLScalerFactory
49 } // namespace openmsx
unique_ptr< GLScaler > createScaler(RenderSettings &renderSettings)
Instantiates a Scaler.
EnumSetting< ScaleAlgorithm > & getScaleAlgorithm() const
The current scaling algorithm.
Class containing all settings for renderers.
#define UNREACHABLE
Definition: unreachable.hh:56