VideoSystem.hh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef VIDEOSYSTEM_HH
  2. #define VIDEOSYSTEM_HH
  3. #include <string>
  4. #include <memory>
  5. #include "components.hh"
  6. namespace openmsx {
  7. class Rasterizer;
  8. class VDP;
  9. class V9990Rasterizer;
  10. class LDRasterizer;
  11. class V9990;
  12. class LaserdiscPlayer;
  13. class OutputSurface;
  14. /** Video back-end system.
  15. */
  16. class VideoSystem
  17. {
  18. public:
  19. virtual ~VideoSystem() = default;
  20. /** Create the rasterizer selected by the current renderer setting.
  21. * Video systems that use a rasterizer must override this method.
  22. * @param vdp The VDP whose display will be rendered.
  23. * @return The rasterizer created.
  24. */
  25. virtual std::unique_ptr<Rasterizer> createRasterizer(VDP& vdp) = 0;
  26. /** Create the V9990 rasterizer selected by the current renderer setting.
  27. * Video systems that use a rasterizer must override this method.
  28. * @param vdp The V9990 whose display will be rendered.
  29. * @return The rasterizer created.
  30. */
  31. virtual std::unique_ptr<V9990Rasterizer> createV9990Rasterizer(
  32. V9990& vdp) = 0;
  33. #if COMPONENT_LASERDISC
  34. virtual std::unique_ptr<LDRasterizer> createLDRasterizer(
  35. LaserdiscPlayer &ld) = 0;
  36. #endif
  37. /** Requests that this renderer checks its settings against the
  38. * current RenderSettings. If possible, update the settings of this
  39. * renderer.
  40. * The implementation in the Renderer base class checks whether the
  41. * right renderer is selected. Subclasses are encouraged to check
  42. * more settings.
  43. * @return True if the settings were still in sync
  44. * or were succesfully synced;
  45. * false if the renderer is unable to bring the settings in sync.
  46. * TODO: Text copied from Renderer interface,
  47. * if this stays here then rewrite text accordingly.
  48. */
  49. virtual bool checkSettings();
  50. /** Finish pending drawing operations and make them visible to the user.
  51. */
  52. virtual void flush() = 0;
  53. /** Take a screenshot.
  54. * The default implementation throws an exception.
  55. * @param filename Name of the file to save the screenshot to.
  56. * @param withOsd Should OSD elements be included in the screenshot.
  57. * @throws MSXException If taking the screen shot fails.
  58. */
  59. virtual void takeScreenShot(const std::string& filename, bool withOsd);
  60. /** Called when the window title string has changed.
  61. */
  62. virtual void updateWindowTitle();
  63. /** TODO */
  64. virtual OutputSurface* getOutputSurface() = 0;
  65. virtual void showCursor(bool show) = 0;
  66. virtual void repaint() = 0;
  67. protected:
  68. VideoSystem() = default;
  69. };
  70. } // namespace openmsx
  71. #endif