openMSX
GLImage.hh
Go to the documentation of this file.
1 #ifndef GLTEXTURE_HH
2 #define GLTEXTURE_HH
3 
4 #include "BaseImage.hh"
5 #include "GLUtil.hh"
6 #include <cstdint>
7 #include <string>
8 
9 class SDLSurfacePtr;
10 
11 namespace openmsx {
12 
13 class GLImage final : public BaseImage
14 {
15 public:
16  GLImage(OutputSurface& output, const std::string& filename);
17  GLImage(OutputSurface& output, SDLSurfacePtr image);
18  GLImage(OutputSurface& output, const std::string& filename, float scaleFactor);
19  GLImage(OutputSurface& output, const std::string& filename, gl::ivec2 size);
20  GLImage(OutputSurface& output, gl::ivec2 size, unsigned rgba);
21  GLImage(OutputSurface& output, gl::ivec2 size, const unsigned* rgba,
22  int borderSize, unsigned borderRGBA);
23 
24  void draw(OutputSurface& output, gl::ivec2 pos,
25  uint8_t r, uint8_t g, uint8_t b, uint8_t alpha) override;
26 
27 private:
28  gl::Texture texture; // must come after size
29  int borderSize;
30  int bgA[4], borderA;
31  uint8_t bgR[4], bgG[4], bgB[4];
32  uint8_t borderR, borderG, borderB;
33 };
34 
35 } // namespace openmsx
36 
37 #endif
Most basic/generic texture: only contains a texture ID.
Definition: GLUtil.hh:35
A frame buffer where pixels can be written to.
Wrapper around a SDL_Surface.
constexpr const char *const filename
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
int g
GLImage(OutputSurface &output, const std::string &filename)
Definition: GLImage.cc:55
void draw(OutputSurface &output, gl::ivec2 pos, uint8_t r, uint8_t g, uint8_t b, uint8_t alpha) override
Definition: GLImage.cc:117
gl::ivec2 size
Definition: BaseImage.hh:31