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