OXYGENHUB
◆ main openmsx / src / video / ld / LDRenderer.hh
1010 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef LDRENDERER_HH
2
#define LDRENDERER_HH
3
4
#include "EmuTime.hh"
5
6
namespace openmsx {
7
8
class RawFrame;
9
10
/** Abstract base class for LDRenderers.
11
  * A LDRenderer is a class that converts VDP state to visual
12
  * information (for example, pixels on a screen).
13
  *
14
  * The update methods are called exactly before the change occurs in
15
  * the VDP, so that the renderer can update itself to the specified
16
  * time using the old settings.
17
  */
18
class LDRenderer
19
{
20
public:
21
	virtual ~LDRenderer() = default;
22
23
	/** Signals the start of a new frame.
24
	  * The LDRenderer can use this to get fixed-per-frame settings from
25
	  * the VDP, such as PAL/NTSC timing.
26
	  * @param time The moment in emulated time the frame starts.
27
	  */
28
	virtual void frameStart(EmuTime time) = 0;
29
30
	/** Signals the end of a frame.
31
	  */
32
	virtual void frameEnd() = 0;
33
34
	virtual void drawBlank(int r, int g, int b) = 0;
35
36
	[[nodiscard]] virtual RawFrame* getRawFrame() = 0;
37
38
protected:
39
	LDRenderer() = default;
40
};
41
42
} // namespace openmsx
43
44
#endif