openMSX
OutputSurface.cc
Go to the documentation of this file.
1 #include "OutputSurface.hh"
2 #include "build-info.hh"
3 
4 namespace openmsx {
5 
7 {
8  m_logicalSize = logSize_;
9  m_physSize = physSize_;
10 
11  gl::vec2 logSize(logSize_); // convert int->float
12  gl::vec2 physSize(physSize_);
13 
14  float scale = min_component(physSize / logSize);
15  m_viewScale = gl::vec2(scale); // for now always same X and Y scale
16 
17  gl::vec2 viewSize = logSize * scale;
18  m_viewSize = round(viewSize);
19 
20  gl::vec2 viewOffset = (physSize - viewSize) / 2.0f;
21  m_viewOffset = round(viewOffset);
22 }
23 
25 {
27  32,
28  OPENMSX_BIGENDIAN ? 0xFF000000 : 0x000000FF, OPENMSX_BIGENDIAN ? 24 : 0, 0,
29  OPENMSX_BIGENDIAN ? 0x00FF0000 : 0x0000FF00, OPENMSX_BIGENDIAN ? 16 : 8, 0,
30  OPENMSX_BIGENDIAN ? 0x0000FF00 : 0x00FF0000, OPENMSX_BIGENDIAN ? 8 : 16, 0,
31  OPENMSX_BIGENDIAN ? 0x000000FF : 0xFF000000, OPENMSX_BIGENDIAN ? 0 : 24, 0));
32 }
33 
34 } // namespace openmsx
openmsx::OutputSurface::calculateViewPort
void calculateViewPort(gl::ivec2 logSize, gl::ivec2 physSize)
Definition: OutputSurface.cc:6
openmsx::OutputSurface::setPixelFormat
void setPixelFormat(const PixelFormat &format)
Definition: OutputSurface.hh:112
gl::min_component
T min_component(const vecN< N, T > &x)
Definition: gl_vec.hh:283
openmsx::PixelFormat
Definition: PixelFormat.hh:9
openmsx::OutputSurface::setOpenGlPixelFormat
void setOpenGlPixelFormat()
Definition: OutputSurface.cc:24
gl::vecN
Definition: gl_vec.hh:36
build-info.hh
OutputSurface.hh
gl::scale
mat4 scale(const vec3 &xyz)
Definition: gl_transform.hh:19
gl::vec2
vecN< 2, float > vec2
Definition: gl_vec.hh:144
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5