openMSX
DirectScalerOutput.cc
Go to the documentation of this file.
1 #include "DirectScalerOutput.hh"
2 #include "SDLOutputSurface.hh"
3 #include "MemoryOps.hh"
4 #include "build-info.hh"
5 #include <cstdint>
6 
7 namespace openmsx {
8 
9 template<typename Pixel>
11  : output(output_), pixelAccess(output.getDirectPixelAccess())
12 {
13 }
14 
15 template<typename Pixel>
17 {
18  return output.getLogicalWidth();
19 }
20 
21 template<typename Pixel>
23 {
24  return output.getLogicalHeight();
25 }
26 
27 template<typename Pixel>
29 {
30  return pixelAccess.getLinePtr<Pixel>(y);
31 }
32 
33 template<typename Pixel>
34 void DirectScalerOutput<Pixel>::releaseLine(unsigned /*y*/, Pixel* /*buf*/)
35 {
36  // nothing
37 }
38 
39 template<typename Pixel>
41 {
42  auto* dstLine = pixelAccess.getLinePtr<Pixel>(y);
44  memset(dstLine, output.getLogicalWidth(), color);
45 }
46 
47 
48 // Force template instantiation.
49 #if HAVE_16BPP
50 template class DirectScalerOutput<uint16_t>;
51 #endif
52 #if HAVE_32BPP
53 template class DirectScalerOutput<uint32_t>;
54 #endif
55 
56 } // namespace openmsx
openmsx::DirectScalerOutput::DirectScalerOutput
DirectScalerOutput(SDLOutputSurface &output)
Definition: DirectScalerOutput.cc:10
MemoryOps.hh
DirectScalerOutput.hh
openmsx::DirectScalerOutput::getWidth
unsigned getWidth() const override
Definition: DirectScalerOutput.cc:16
openmsx::DirectScalerOutput
Definition: DirectScalerOutput.hh:10
openmsx::Pixel
uint32_t Pixel
Definition: GLHQLiteScaler.cc:93
openmsx::DirectScalerOutput::fillLine
void fillLine(unsigned y, Pixel color) override
Definition: DirectScalerOutput.cc:40
openmsx::MemoryOps::MemSet
Definition: MemoryOps.hh:8
openmsx::DirectScalerOutput::getHeight
unsigned getHeight() const override
Definition: DirectScalerOutput.cc:22
SDLOutputSurface.hh
openmsx::SDLOutputSurface
A frame buffer where pixels can be written to.
Definition: SDLOutputSurface.hh:29
build-info.hh
openmsx::DirectScalerOutput::releaseLine
void releaseLine(unsigned y, Pixel *buf) override
Definition: DirectScalerOutput.cc:34
openmsx::DirectScalerOutput::acquireLine
Pixel * acquireLine(unsigned y) override
Definition: DirectScalerOutput.cc:28
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5