openMSX
video
OffScreenSurface.cc
Go to the documentation of this file.
1
#include "
OffScreenSurface.hh
"
2
#include "
VisibleSurface.hh
"
3
#include "
GLUtil.hh
"
4
5
namespace
openmsx
{
6
7
OffScreenSurface::OffScreenSurface
(
const
OutputSurface
& output)
8
: fboTex(true)
// enable interpolation TODO why?
9
{
10
calculateViewPort
(output.
getLogicalSize
(), output.
getPhysicalSize
());
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
26
void
OffScreenSurface::saveScreenshot(
const
std::string& filename)
27
{
28
VisibleSurface::saveScreenshotGL
(*
this
, filename);
29
}
30
31
}
// namespace openmsx
GLUtil.hh
OffScreenSurface.hh
VisibleSurface.hh
gl::FrameBufferObject
Definition
GLUtil.hh:126
gl::FrameBufferObject::push
void push()
Definition
GLUtil.cc:128
gl::Texture::bind
void bind() const
Makes this texture the active GL texture.
Definition
GLUtil.hh:88
openmsx::OffScreenSurface::OffScreenSurface
OffScreenSurface(const OutputSurface &output)
Definition
OffScreenSurface.cc:7
openmsx::OutputSurface
A frame buffer where pixels can be written to.
Definition
OutputSurface.hh:21
openmsx::OutputSurface::getPhysicalSize
gl::ivec2 getPhysicalSize() const
Definition
OutputSurface.hh:34
openmsx::OutputSurface::getLogicalSize
gl::ivec2 getLogicalSize() const
Definition
OutputSurface.hh:33
openmsx::OutputSurface::calculateViewPort
void calculateViewPort(gl::ivec2 logSize, gl::ivec2 physSize)
Definition
OutputSurface.cc:6
openmsx::VisibleSurface::saveScreenshotGL
static void saveScreenshotGL(const OutputSurface &output, const std::string &filename)
Definition
VisibleSurface.cc:345
openmsx
This file implemented 3 utility functions:
Definition
Autofire.cc:11
Generated on Sat Dec 21 2024 14:13:52 for openMSX by
1.9.8