openMSX
OffScreenSurface.cc
Go to the documentation of this file.
1#include "OffScreenSurface.hh"
2#include "VisibleSurface.hh"
3#include "GLUtil.hh"
4
5namespace openmsx {
6
8 : fboTex(true) // enable interpolation TODO why?
9{
11 auto [w, h] = getPhysicalSize();
12 fboTex.bind();
13 glTexImage2D(GL_TEXTURE_2D, // target
14 0, // level
15 GL_RGB, // internal format
16 w, // width
17 h, // height
18 0, // border
19 GL_RGB, // format
20 GL_UNSIGNED_BYTE, // type
21 nullptr); // data
22 fbo = gl::FrameBufferObject(fboTex);
23 fbo.push();
24}
25
26void OffScreenSurface::saveScreenshot(const std::string& filename)
27{
28 VisibleSurface::saveScreenshotGL(*this, filename);
29}
30
31} // namespace openmsx
void bind() const
Makes this texture the active GL texture.
Definition GLUtil.hh:88
OffScreenSurface(const OutputSurface &output)
A frame buffer where pixels can be written to.
gl::ivec2 getPhysicalSize() const
gl::ivec2 getLogicalSize() const
void calculateViewPort(gl::ivec2 logSize, gl::ivec2 physSize)
static void saveScreenshotGL(const OutputSurface &output, const std::string &filename)
This file implemented 3 utility functions:
Definition Autofire.cc:11