Difference between revisions of "API-Truecolor"

Jump to navigation Jump to search
652 bytes removed ,  02:46, 13 July 2009
removed references to convertScreenRect, which was removed as bloat
(removed references to convertScreenRect, which was removed as bloat)
Line 20: Line 20:
*Backends '''''must''''' place the highest color mode that is supported by the backend and the hardware at the beginning of the list returned by getSupportedFormats.
*Backends '''''must''''' place the highest color mode that is supported by the backend and the hardware at the beginning of the list returned by getSupportedFormats.
*Backends ''should'' support graphics in RGB(A) color order, even if their hardware uses a different color order, but are not required to.
*Backends ''should'' support graphics in RGB(A) color order, even if their hardware uses a different color order, but are not required to.
*Backends supporting color order conversion ''should'' do so by calling convertScreenRect from copyRectToScreen when conversion is necessary, but are not required to.
*Backends supporting color order conversion with limited hardware may use crossBlit, but are '''strongly recommended''' to use platform-optimized code.
*Backends supporting color order conversion with limited hardware ''should'' override convertScreenRect with platform-optimized code, but are not required to.


== Truecolor API initialization protocol ==
== Truecolor API initialization protocol ==
Line 181: Line 180:
**Backends which do not support fast conversion '''''must''''' put all modes directly supported in hardware, (and CLUT8), before modes that will require conversion during copyRectToScreen.
**Backends which do not support fast conversion '''''must''''' put all modes directly supported in hardware, (and CLUT8), before modes that will require conversion during copyRectToScreen.
**Backends which support fast conversion ''should'' put larger colorspaces before smaller color spaces, but are not required to.
**Backends which support fast conversion ''should'' put larger colorspaces before smaller color spaces, but are not required to.
*virtual bool OSystem::convertScreenRect(byte *dstbuf, const byte *srcbuf, int dstpitch, int srcpitch, int w, int h, Graphics::PixelFormat hwFmt)
**Blits a rect from screen format known by the game to the hardware format known by the backend.
**This '''''must''''' return false if the blit fails (due to unsupported format conversion).
**This '''''must''''' return true if the blit succeeds.
**This ''should'' be overridden by backends where helpful, but is not required to be.


==== Graphics::PixelFormat ====
==== Graphics::PixelFormat ====
20

edits

Navigation menu