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 
14 using std::unique_ptr;
15 
17 
18 unique_ptr<GLScaler> createScaler(RenderSettings& renderSettings)
19 {
20  GLScaler& fallback = gl::context->getFallbackScaler();
21  switch (renderSettings.getScaleAlgorithm()) {
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 std::make_unique<GLSaIScaler>();
30  return std::make_unique<GLSimpleScaler>(renderSettings, fallback);
32  return std::make_unique<GLRGBScaler>(renderSettings, fallback);
34  return std::make_unique<GLScaleNxScaler>(fallback);
36  return std::make_unique<GLTVScaler>(renderSettings);
38  return std::make_unique<GLHQScaler>(fallback);
39  case RenderSettings::SCALER_MLAA: // fallback
41  return std::make_unique<GLHQLiteScaler>(fallback);
42  default:
44  }
45  return nullptr; // avoid warning
46 }
47 
48 } // namespace openmsx::GLScalerFactory
openmsx::RenderSettings
Class containing all settings for renderers.
Definition: RenderSettings.hh:21
openmsx::GLScalerFactory::createScaler
unique_ptr< GLScaler > createScaler(RenderSettings &renderSettings)
Instantiates a Scaler.
Definition: GLScalerFactory.cc:18
GLRGBScaler.hh
GLHQScaler.hh
openmsx::RenderSettings::SCALER_SCALE
Definition: RenderSettings.hh:37
UNREACHABLE
#define UNREACHABLE
Definition: unreachable.hh:38
openmsx::GLScalerFactory
Definition: GLScalerFactory.cc:16
openmsx::RenderSettings::SCALER_TV
Definition: RenderSettings.hh:38
openmsx::RenderSettings::SCALER_RGBTRIPLET
Definition: RenderSettings.hh:38
openmsx::RenderSettings::SCALER_HQLITE
Definition: RenderSettings.hh:38
openmsx::RenderSettings::SCALER_HQ
Definition: RenderSettings.hh:38
RenderSettings.hh
openmsx::RenderSettings::SCALER_SAI
Definition: RenderSettings.hh:37
gl::context
std::unique_ptr< Context > context
Definition: GLContext.cc:9
GLHQLiteScaler.hh
openmsx::RenderSettings::SCALER_MLAA
Definition: RenderSettings.hh:38
GLSimpleScaler.hh
openmsx::GLScaler
Abstract base class for OpenGL scalers.
Definition: GLScaler.hh:13
openmsx::RenderSettings::SCALER_SIMPLE
Definition: RenderSettings.hh:37
GLScalerFactory.hh
unreachable.hh
GLTVScaler.hh
openmsx::RenderSettings::getScaleAlgorithm
ScaleAlgorithm getScaleAlgorithm() const
The current scaling algorithm.
Definition: RenderSettings.hh:114
GLContext.hh
GLSaIScaler.hh
GLScaleNxScaler.hh