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) / 2.0f;
21 m_viewOffset = round(viewOffset);
22}
23
25{
27 32,
28 Endian::BIG ? 0xFF000000 : 0x000000FF, Endian::BIG ? 24 : 0, 0,
29 Endian::BIG ? 0x00FF0000 : 0x0000FF00, Endian::BIG ? 16 : 8, 0,
30 Endian::BIG ? 0x0000FF00 : 0x00FF0000, Endian::BIG ? 8 : 16, 0,
31 Endian::BIG ? 0x000000FF : 0xFF000000, Endian::BIG ? 0 : 24, 0));
32}
33
34} // namespace openmsx
void setPixelFormat(const PixelFormat &format)
void calculateViewPort(gl::ivec2 logSize, gl::ivec2 physSize)
Definition: OutputSurface.cc:6
constexpr bool BIG
Definition: endian.hh:15
constexpr T min_component(const vecN< N, T > &x)
Definition: gl_vec.hh:276
vecN< 2, float > vec2
Definition: gl_vec.hh:150
constexpr mat4 scale(const vec3 &xyz)
Definition: gl_transform.hh:19
This file implemented 3 utility functions:
Definition: Autofire.cc:9