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 "EnumSetting.hh"
12 #include "memory.hh"
13 #include "unreachable.hh"
14 
15 using std::unique_ptr;
16 
17 namespace openmsx {
18 namespace GLScalerFactory {
19 
20 unique_ptr<GLScaler> createScaler(RenderSettings& renderSettings)
21 {
22  GLScaler& fallback = gl::context->getFallbackScaler();
23  switch (renderSettings.getScaleAlgorithm().getEnum()) {
25  // disabled for now:
26  // - it doesn't work (yet) on ATI cards
27  // - it probably has some bugs because (on nvidia cards)
28  // it does not give the same result as the SW SaI scaler,
29  // although it's reasonably close
30  //return make_unique<GLSaIScaler>();
32  return make_unique<GLSimpleScaler>(renderSettings, fallback);
34  return make_unique<GLRGBScaler>(renderSettings, fallback);
36  return make_unique<GLScaleNxScaler>(fallback);
38  return make_unique<GLTVScaler>(renderSettings);
40  return make_unique<GLHQScaler>(fallback);
41  case RenderSettings::SCALER_MLAA: // fallback
43  return make_unique<GLHQLiteScaler>(fallback);
44  default:
46  }
47  return nullptr; // avoid warning
48 }
49 
50 } // namespace GLScalerFactory
51 } // namespace openmsx
unique_ptr< GLScaler > createScaler(RenderSettings &renderSettings)
Instantiates a Scaler.
std::unique_ptr< Context > context
Definition: GLContext.cc:9
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:7
EnumSetting< ScaleAlgorithm > & getScaleAlgorithm() const
The current scaling algorithm.
Abstract base class for OpenGL scalers.
Definition: GLScaler.hh:13
Class containing all settings for renderers.
#define UNREACHABLE
Definition: unreachable.hh:35