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 "span.hh"
7 #include <cstdint>
8 #include <string>
9 
10 class SDLSurfacePtr;
11 
12 namespace openmsx {
13 
14 class GLImage final : public BaseImage
15 {
16 public:
17  GLImage(OutputSurface& output, const std::string& filename);
19  GLImage(OutputSurface& output, const std::string& filename, float scaleFactor);
20  GLImage(OutputSurface& output, const std::string& filename, gl::ivec2 size);
21  GLImage(OutputSurface& output, gl::ivec2 size, unsigned rgba);
23  int borderSize, unsigned borderRGBA);
24 
25  void draw(OutputSurface& output, gl::ivec2 pos,
26  uint8_t r, uint8_t g, uint8_t b, uint8_t alpha) override;
27 
28 private:
29  void initBuffers();
30 
31 private:
32  gl::BufferObject vbo[3];
33  gl::BufferObject elementsBuffer;
34  gl::Texture texture; // must come after size
35  int borderSize;
36  int bgA[4], borderA;
37  uint8_t bgR[4], bgG[4], bgB[4];
38  uint8_t borderR, borderG, borderB;
39 };
40 
41 } // namespace openmsx
42 
43 #endif
string image
Definition: HDImageCLI.cc:15
int g
Wrapper around a SDL_Surface.
Most basic/generic texture: only contains a texture ID.
Definition: GLUtil.hh:41
gl::ivec2 size
Definition: BaseImage.hh:31
void draw(OutputSurface &output, gl::ivec2 pos, uint8_t r, uint8_t g, uint8_t b, uint8_t alpha) override
Definition: GLImage.cc:130
GLImage(OutputSurface &output, const std::string &filename)
Definition: GLImage.cc:56
A frame buffer where pixels can be written to.
Definition: span.hh:126
This file implemented 3 utility functions:
Definition: Autofire.cc:9
constexpr const char *const filename