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 "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  GLScaler& fallback = gl::context->getFallbackScaler();
22  switch (renderSettings.getScaleAlgorithm()) {
24  // disabled for now:
25  // - it doesn't work (yet) on ATI cards
26  // - it probably has some bugs because (on nvidia cards)
27  // it does not give the same result as the SW SaI scaler,
28  // although it's reasonably close
29  //return make_unique<GLSaIScaler>();
31  return make_unique<GLSimpleScaler>(renderSettings, fallback);
33  return make_unique<GLRGBScaler>(renderSettings, fallback);
35  return make_unique<GLScaleNxScaler>(fallback);
37  return make_unique<GLTVScaler>(renderSettings);
39  return make_unique<GLHQScaler>(fallback);
40  case RenderSettings::SCALER_MLAA: // fallback
42  return make_unique<GLHQLiteScaler>(fallback);
43  default:
45  }
46  return nullptr; // avoid warning
47 }
48 
49 } // namespace GLScalerFactory
50 } // 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:5
Abstract base class for OpenGL scalers.
Definition: GLScaler.hh:13
Class containing all settings for renderers.
ScaleAlgorithm getScaleAlgorithm() const
The current scaling algorithm.
#define UNREACHABLE
Definition: unreachable.hh:35