openMSX
video
OutputSurface.cc
Go to the documentation of this file.
1
#include "
OutputSurface.hh
"
2
#include "
endian.hh
"
3
4
namespace
openmsx
{
5
6
void
OutputSurface::calculateViewPort
(
gl::ivec2
logSize_,
gl::ivec2
physSize_)
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) * 0.5f;
21
m_viewOffset = round(viewOffset);
22
}
23
24
}
// namespace openmsx
OutputSurface.hh
gl::vecN
Definition
gl_vec.hh:32
openmsx::OutputSurface::calculateViewPort
void calculateViewPort(gl::ivec2 logSize, gl::ivec2 physSize)
Definition
OutputSurface.cc:6
endian.hh
gl::vec2
vecN< 2, float > vec2
Definition
gl_vec.hh:382
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