openMSX
BaseImage.hh
Go to the documentation of this file.
1 #ifndef BASEIMAGE_HH
2 #define BASEIMAGE_HH
3 
4 #include "gl_vec.hh"
5 #include <cstdint>
6 
7 namespace openmsx {
8 
9 class OutputSurface;
10 
11 class BaseImage
12 {
13 public:
19  static void checkSize(gl::ivec2 size);
20 
21  virtual ~BaseImage() = default;
22  virtual void draw(OutputSurface& output, gl::ivec2 pos,
23  uint8_t r, uint8_t g, uint8_t b, uint8_t alpha) = 0;
24  gl::ivec2 getSize() const { return size; }
25 
26  void draw(OutputSurface& output, gl::ivec2 pos, uint8_t alpha = 255) {
27  draw(output, pos, 255, 255, 255, alpha);
28  }
29 
30 protected:
32 };
33 
34 } // namespace openmsx
35 
36 #endif
virtual void draw(OutputSurface &output, gl::ivec2 pos, uint8_t r, uint8_t g, uint8_t b, uint8_t alpha)=0
A frame buffer where pixels can be written to.
static void checkSize(gl::ivec2 size)
Performs a sanity check on image size.
Definition: BaseImage.cc:8
gl::ivec2 getSize() const
Definition: BaseImage.hh:24
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
virtual ~BaseImage()=default
int g
void draw(OutputSurface &output, gl::ivec2 pos, uint8_t alpha=255)
Definition: BaseImage.hh:26
gl::ivec2 size
Definition: BaseImage.hh:31