openMSX
Public Member Functions | List of all members
openmsx::SDLRasterizer< Pixel > Class Template Referencefinal

Rasterizer using a frame buffer approach: it writes pixels to a single rectangular pixel buffer. More...

#include <SDLRasterizer.hh>

Inheritance diagram for openmsx::SDLRasterizer< Pixel >:
Inheritance graph
[legend]
Collaboration diagram for openmsx::SDLRasterizer< Pixel >:
Collaboration graph
[legend]

Public Member Functions

 SDLRasterizer (const SDLRasterizer &)=delete
 
SDLRasterizeroperator= (const SDLRasterizer &)=delete
 
 SDLRasterizer (VDP &vdp, Display &display, VisibleSurface &screen, std::unique_ptr< PostProcessor > postProcessor)
 
 ~SDLRasterizer () override
 
PostProcessorgetPostProcessor () const override
 See VDP::getPostProcessor(). More...
 
bool isActive () override
 Will the output of this Rasterizer be displayed? There is no point in producing a frame that will not be displayed. More...
 
void reset () override
 Resynchronize with VDP: all cached states are flushed. More...
 
void frameStart (EmuTime::param time) override
 Indicates the start of a new frame. More...
 
void frameEnd () override
 Indicates the end of the current frame. More...
 
void setDisplayMode (DisplayMode mode) override
 Precalc several values that depend on the display mode. More...
 
void setPalette (int index, int grb) override
 Change an entry in the palette. More...
 
void setBackgroundColor (int index) override
 Changes the background color. More...
 
void setHorizontalAdjust (int adjust) override
 
void setHorizontalScrollLow (byte scroll) override
 
void setBorderMask (bool masked) override
 
void setTransparency (bool enabled) override
 
void setSuperimposeVideoFrame (const RawFrame *videoSource) override
 
void drawBorder (int fromX, int fromY, int limitX, int limitY) override
 Render a rectangle of border pixels on the host screen. More...
 
void drawDisplay (int fromX, int fromY, int displayX, int displayY, int displayWidth, int displayHeight) override
 Render a rectangle of display pixels on the host screen. More...
 
void drawSprites (int fromX, int fromY, int displayX, int displayY, int displayWidth, int displayHeight) override
 Render a rectangle of sprite pixels on the host screen. More...
 
bool isRecording () const override
 Is video recording active? More...
 
- Public Member Functions inherited from openmsx::Rasterizer
virtual ~Rasterizer ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from openmsx::Rasterizer
 Rasterizer ()=default
 

Detailed Description

template<class Pixel>
class openmsx::SDLRasterizer< Pixel >

Rasterizer using a frame buffer approach: it writes pixels to a single rectangular pixel buffer.

Definition at line 28 of file SDLRasterizer.hh.

Constructor & Destructor Documentation

◆ SDLRasterizer() [1/2]

template<class Pixel >
openmsx::SDLRasterizer< Pixel >::SDLRasterizer ( const SDLRasterizer< Pixel > &  )
delete

◆ SDLRasterizer() [2/2]

template<class Pixel >
openmsx::SDLRasterizer< Pixel >::SDLRasterizer ( VDP vdp,
Display display,
VisibleSurface screen,
std::unique_ptr< PostProcessor postProcessor 
)

◆ ~SDLRasterizer()

template<class Pixel >
openmsx::SDLRasterizer< Pixel >::~SDLRasterizer ( )
override

Member Function Documentation

◆ drawBorder()

template<class Pixel >
void openmsx::SDLRasterizer< Pixel >::drawBorder ( int  fromX,
int  fromY,
int  limitX,
int  limitY 
)
overridevirtual

Render a rectangle of border pixels on the host screen.

The units are absolute lines (Y) and VDP clockticks (X).

Parameters
fromXX coordinate of render start (inclusive).
fromYY coordinate of render start (inclusive).
limitXX coordinate of render end (exclusive).
limitYY coordinate of render end (exclusive).

Implements openmsx::Rasterizer.

Definition at line 444 of file SDLRasterizer.cc.

References openmsx::VDP::getDisplayMode(), openmsx::DisplayMode::getLineWidth(), gl::max(), gl::min(), openmsx::VDP::TICKS_PER_LINE, and openmsx::x.

◆ drawDisplay()

template<class Pixel >
void openmsx::SDLRasterizer< Pixel >::drawDisplay ( int  fromX,
int  fromY,
int  displayX,
int  displayY,
int  displayWidth,
int  displayHeight 
)
overridevirtual

Render a rectangle of display pixels on the host screen.

Parameters
fromXX coordinate of render start in VDP ticks.
fromYY coordinate of render start in absolute lines.
displayXdisplay coordinate of render start: [0..512).
displayYdisplay coordinate of render start: [0..256).
displayWidthrectangle width in pixels (512 per line).
displayHeightrectangle height in lines.

Implements openmsx::Rasterizer.

Definition at line 487 of file SDLRasterizer.cc.

References openmsx::VDP::getDisplayMode(), openmsx::VDP::getEvenOddMask(), openmsx::VDP::getHorizontalScrollHigh(), openmsx::VDP::getLeftBackground(), openmsx::DisplayMode::getLineWidth(), openmsx::VRAMWindow::getMask(), openmsx::DisplayMode::isBitmapMode(), openmsx::VDP::isMSX1VDP(), openmsx::VDP::isMultiPageScrolling(), openmsx::DisplayMode::isPlanar(), openmsx::DisplayMode::isTextMode(), gl::min(), openmsx::VDPVRAM::nameTable, and openmsx::x.

◆ drawSprites()

template<class Pixel >
void openmsx::SDLRasterizer< Pixel >::drawSprites ( int  fromX,
int  fromY,
int  displayX,
int  displayY,
int  displayWidth,
int  displayHeight 
)
overridevirtual

Render a rectangle of sprite pixels on the host screen.

Although the parameters are very similar to drawDisplay, the displayX and displayWidth use range [0..256) instead of [0..512) because VDP sprite coordinates work that way.

Parameters
fromXX coordinate of render start in VDP ticks.
fromYY coordinate of render start in absolute lines.
displayXdisplay coordinate of render start: [0..256).
displayYdisplay coordinate of render start: [0..256).
displayWidthrectangle width in pixels (256 per line).
displayHeightrectangle height in lines.

Implements openmsx::Rasterizer.

Definition at line 619 of file SDLRasterizer.cc.

References openmsx::DisplayMode::getByte(), openmsx::VDP::getDisplayMode(), openmsx::VDP::getLeftSprites(), openmsx::DisplayMode::getLineWidth(), openmsx::DisplayMode::getSpriteMode(), openmsx::DisplayMode::GRAPHIC5, openmsx::DisplayMode::GRAPHIC6, openmsx::VDP::isMSX1VDP(), and gl::min().

◆ frameEnd()

template<class Pixel >
void openmsx::SDLRasterizer< Pixel >::frameEnd ( )
overridevirtual

Indicates the end of the current frame.

The rasterizer can perform image post processing.

Implements openmsx::Rasterizer.

Definition at line 186 of file SDLRasterizer.cc.

References openmsx::DisplayMode::getByte(), openmsx::VDP::getDisplayMode(), openmsx::VDP::getHorizontalAdjust(), openmsx::VDP::getHorizontalScrollLow(), and openmsx::VDP::isBorderMasked().

◆ frameStart()

template<class Pixel >
void openmsx::SDLRasterizer< Pixel >::frameStart ( EmuTime::param  time)
overridevirtual

◆ getPostProcessor()

template<class Pixel >
PostProcessor * openmsx::SDLRasterizer< Pixel >::getPostProcessor ( ) const
overridevirtual

See VDP::getPostProcessor().

Implements openmsx::Rasterizer.

Definition at line 110 of file SDLRasterizer.cc.

◆ isActive()

template<class Pixel >
bool openmsx::SDLRasterizer< Pixel >::isActive ( )
overridevirtual

Will the output of this Rasterizer be displayed? There is no point in producing a frame that will not be displayed.

TODO: Is querying the next pipeline step the best way to solve this, or is it better to explicitly disable the first step in the pipeline?

Implements openmsx::Rasterizer.

Definition at line 116 of file SDLRasterizer.cc.

References openmsx::MSXDevice::getMotherBoard(), openmsx::MSXMotherBoard::isActive(), and openmsx::MSXMotherBoard::isFastForwarding().

◆ isRecording()

template<class Pixel >
bool openmsx::SDLRasterizer< Pixel >::isRecording ( ) const
overridevirtual

◆ operator=()

template<class Pixel >
SDLRasterizer& openmsx::SDLRasterizer< Pixel >::operator= ( const SDLRasterizer< Pixel > &  )
delete

◆ reset()

template<class Pixel >
void openmsx::SDLRasterizer< Pixel >::reset ( )
overridevirtual

◆ setBackgroundColor()

template<class Pixel >
void openmsx::SDLRasterizer< Pixel >::setBackgroundColor ( int  index)
overridevirtual

Changes the background color.

Parameters
indexPalette index of the new background color.

Implements openmsx::Rasterizer.

Definition at line 253 of file SDLRasterizer.cc.

References openmsx::DisplayMode::getByte(), openmsx::VDP::getDisplayMode(), openmsx::VDP::getTransparency(), openmsx::DisplayMode::GRAPHIC7, and openmsx::VDP::isSuperimposing().

◆ setBorderMask()

template<class Pixel >
void openmsx::SDLRasterizer< Pixel >::setBorderMask ( bool  masked)
overridevirtual

Implements openmsx::Rasterizer.

Definition at line 275 of file SDLRasterizer.cc.

◆ setDisplayMode()

template<class Pixel >
void openmsx::SDLRasterizer< Pixel >::setDisplayMode ( DisplayMode  mode)
overridevirtual

◆ setHorizontalAdjust()

template<class Pixel >
void openmsx::SDLRasterizer< Pixel >::setHorizontalAdjust ( int  adjust)
overridevirtual

Implements openmsx::Rasterizer.

Definition at line 263 of file SDLRasterizer.cc.

◆ setHorizontalScrollLow()

template<class Pixel >
void openmsx::SDLRasterizer< Pixel >::setHorizontalScrollLow ( byte  scroll)
overridevirtual

Implements openmsx::Rasterizer.

Definition at line 269 of file SDLRasterizer.cc.

◆ setPalette()

template<class Pixel >
void openmsx::SDLRasterizer< Pixel >::setPalette ( int  index,
int  grb 
)
overridevirtual

Change an entry in the palette.

Parameters
indexThe index [0..15] in the palette that changes.
grbThe new definition for the changed palette index: bit 10..8 is green, bit 6..4 is red and bit 2..0 is blue; all other bits are zero.

Implements openmsx::Rasterizer.

Definition at line 238 of file SDLRasterizer.cc.

References openmsx::VDP::getBackgroundColor(), openmsx::VDP::getDisplayMode(), openmsx::VDP::getTransparency(), and openmsx::VDP::isSuperimposing().

Referenced by openmsx::SDLRasterizer< Pixel >::reset().

◆ setSuperimposeVideoFrame()

template<class Pixel >
void openmsx::SDLRasterizer< Pixel >::setSuperimposeVideoFrame ( const RawFrame videoSource)
overridevirtual

◆ setTransparency()

template<class Pixel >
void openmsx::SDLRasterizer< Pixel >::setTransparency ( bool  enabled)
overridevirtual

The documentation for this class was generated from the following files: