openMSX
video
SDLGLOffScreenSurface.cc
Go to the documentation of this file.
1
#include "
SDLGLOffScreenSurface.hh
"
2
#include "
SDLGLVisibleSurface.hh
"
3
#include "
GLUtil.hh
"
4
5
namespace
openmsx
{
6
7
SDLGLOffScreenSurface::SDLGLOffScreenSurface
(
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
setOpenGlPixelFormat
();
26
}
27
28
void
SDLGLOffScreenSurface::saveScreenshot(
const
std::string& filename)
29
{
30
SDLGLVisibleSurface::saveScreenshotGL
(*
this
, filename);
31
}
32
33
}
// namespace openmsx
GLUtil.hh
SDLGLOffScreenSurface.hh
SDLGLVisibleSurface.hh
gl::FrameBufferObject
Definition:
GLUtil.hh:119
gl::FrameBufferObject::push
void push()
Definition:
GLUtil.cc:114
gl::Texture::bind
void bind()
Makes this texture the active GL texture.
Definition:
GLUtil.hh:81
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:31
openmsx::OutputSurface::getLogicalSize
gl::ivec2 getLogicalSize() const
Definition:
OutputSurface.hh:30
openmsx::OutputSurface::calculateViewPort
void calculateViewPort(gl::ivec2 logSize, gl::ivec2 physSize)
Definition:
OutputSurface.cc:6
openmsx::OutputSurface::setOpenGlPixelFormat
void setOpenGlPixelFormat()
Definition:
OutputSurface.cc:24
openmsx::SDLGLOffScreenSurface::SDLGLOffScreenSurface
SDLGLOffScreenSurface(const OutputSurface &output)
Definition:
SDLGLOffScreenSurface.cc:7
openmsx::SDLGLVisibleSurface::saveScreenshotGL
static void saveScreenshotGL(const OutputSurface &output, const std::string &filename)
Definition:
SDLGLVisibleSurface.cc:125
openmsx
This file implemented 3 utility functions:
Definition:
Autofire.cc:9
Generated on Wed Oct 4 2023 23:13:13 for openMSX by
1.9.4