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
7namespace openmsx {
8
9class OutputSurface;
10
12{
13public:
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 [[nodiscard]] 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
30protected:
32};
33
34} // namespace openmsx
35
36#endif
int g
void draw(OutputSurface &output, gl::ivec2 pos, uint8_t alpha=255)
Definition: BaseImage.hh:26
gl::ivec2 getSize() const
Definition: BaseImage.hh:24
gl::ivec2 size
Definition: BaseImage.hh:31
virtual void draw(OutputSurface &output, gl::ivec2 pos, uint8_t r, uint8_t g, uint8_t b, uint8_t alpha)=0
static void checkSize(gl::ivec2 size)
Performs a sanity check on image size.
Definition: BaseImage.cc:8
virtual ~BaseImage()=default
A frame buffer where pixels can be written to.
This file implemented 3 utility functions:
Definition: Autofire.cc:9