openMSX
SDLGLOutputSurface.hh
Go to the documentation of this file.
1 #ifndef SDLGLOUTPUTSURFACE_HH
2 #define SDLGLOUTPUTSURFACE_HH
3 
4 #include "GLUtil.hh"
5 #include "MemBuffer.hh"
6 #include <string>
7 
8 namespace openmsx {
9 
10 class OutputSurface;
11 
17 {
18 public:
23 
24  FrameBuffer getFrameBufferType() const { return frameBuffer; }
25 
26 protected:
27  explicit SDLGLOutputSurface(FrameBuffer frameBuffer = FB_NONE);
28  ~SDLGLOutputSurface() = default;
29 
30  void init(OutputSurface& output);
31  void flushFrameBuffer(unsigned width, unsigned height);
32  void clearScreen();
33  void saveScreenshot(const std::string& filename,
34  const OutputSurface& output) const;
35 
36 private:
37  float texCoordX, texCoordY;
38  gl::Texture fbTex;
39  MemBuffer<char> fbBuf;
40  const FrameBuffer frameBuffer;
41 };
42 
43 } // namespace openmsx
44 
45 #endif
void flushFrameBuffer(unsigned width, unsigned height)
Most basic/generic texture: only contains a texture ID.
Definition: GLUtil.hh:35
A frame buffer where pixels can be written to.
void init(OutputSurface &output)
void saveScreenshot(const std::string &filename, const OutputSurface &output) const
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
SDLGLOutputSurface(FrameBuffer frameBuffer=FB_NONE)
This is a common base class for SDLGLVisibleSurface and SDLGLOffScreenSurface.
FrameBuffer getFrameBufferType() const
FrameBuffer
These correspond respectively with the renderers: SDLGL-PP, SDLGL-FB16, SDLGL-FB32.