#include <cascade/graphics/CascadeScreen.h>
Inheritance diagram for CascadeScreen:
Public Types | |
enum | VideoConnector { kVGA = 0, kComponent = 1, kSVideo = 2, kComposite = 3, kNumConnectors = kComposite + 1 } |
enum | VideoMode { kNTSC = 0, kPAL = 1, kRGB = 2, kNumModes = kRGB + 1 } |
Public Member Functions | |
CascadeScreen () | |
virtual | ~CascadeScreen () |
virtual void | LockScreen () |
virtual void | UnlockScreen () |
virtual bool | SetScreenResolution (u32 index) |
virtual void | GetCurrentScreenResolution (u32 &index) |
virtual u32 | GetNumScreenResolutionsSupported () |
virtual bool | GetSupportedScreenResolutionAt (u32 nIndex, u32 &nWidthToSet, u32 &nHeightToSet, u8 &nBitDepthToSet, bool &bDoubleBufferedToSet) |
virtual void | SwapBuffers (const CascadeRect &afterSwapCopyRect) |
virtual bool | SetOutputResolution (u32 nIndex) |
virtual void | GetCurrentOutputResolution (u32 &nIndexToSet) |
virtual u32 | GetNumOutputResolutionsSupported () |
virtual bool | GetSupportedOutputResolutionAt (u32 nIndex, u32 &nWidthToSet, u32 &nHeightToSet, bool &bProgressiveToSet, VideoConnector &connectorToSet, VideoMode &modeToSet, u32 &nRefreshRateToSet) |
virtual bool | GetOutputResolutionScaleRect (u32 nIndex, CascadeRect &scaleRectToSet) |
virtual bool | SetOutputResolutionScaleRect (u32 nIndex, const CascadeRect &scaleRect) |
virtual bool | WaitForVBILineZero () |
virtual bool | SetBypassMode (bool bBypass) |
virtual bool | GetBypassMode () |
virtual bool | Create (const CascadeDims &dims, CascadeBitmap::RamType=CascadeBitmap::kEither) |
virtual bool | CreateFromBitmapFile (CascadeFile &bitmapFile, CascadeBitmap::RamType=CascadeBitmap::kEither) |
virtual bool | Destroy () |
virtual void | FrameRect (const CascadeRect &rect, const CascadeColor &color) |
virtual void | FillRect (const CascadeRect &rect, const CascadeColor &color) |
virtual void | DrawLine (const CascadePoint &start, const CascadePoint &end, const CascadeColor &color) |
virtual void | TextOut (const CascadePoint &point, const CascadeString &string, const CascadeFont &font, const CascadeColor &color, u32 nFlags=TEXTOUT_TOP) |
virtual bool | DrawText (CascadeFont &font, const CascadeRect &rect, const CascadeString &string, const CascadeColor &color, u32 nFlags) |
virtual void | Blit (const CascadePoint &point, const CascadeBitmap &source, const CascadeRect &sourceRect) |
virtual void | Blit (const CascadePoint &point, CascadeSharedMemZone &sourceZone, u32 nZoneOffset, u32 nPixelWidth, u32 nPixelHeight, u32 nBitDepth, const CascadeRect &sourceRect) |
virtual bool | GrabBits (const CascadeRect &sourceRect, CascadeSharedMemZone &destZone, u32 nZoneOffset) |
virtual void | GetPixel (const CascadePoint &point, CascadeColor &colorToSet) const |
virtual void | SetPixel (const CascadePoint &point, const CascadeColor &color) |
virtual CascadeDims | GetDims () const |
virtual u8 | GetColorDepth () const |
virtual void | Flush () |
virtual void * | GetMemory () |
CascadeScreen represents the physical screen and provides drawing onto the physical screen using the same semantics as drawing on a CascadeBitmap, from which CascadeScreen is derived. Drawing directly on a CascadeScreen results in drawing directly on the screen. Clients can instantiate as many instances of CascadeScreen as they like - each instance represents the same physical screen. Before the client can draw on or otherwise use the screen it must be locked. Only one instance of CascadeScreen can lock the screen at a time. After drawing is complete, clients must unlock the screen before anyone else can use on the screen. If a client calls a function with the screen unlocked, the function will lock the screen, perform the function, and unlock the screen. As a result it is usually a good idea to manually lock the screen around multiple consecutive drawing operations as it will yield better performance.
Example usage: MyDrawProc() { CascadeScreen screen; screen.Lock(); screen.FillRect(screen.GetRect(), CascadeColor(255, 0, 0)); screen.Unlock(); // unlock happens automatically when screen is destructed }
|
represents a type of Connector graphics output is being sent to VideoConnector is used as an argument to the GetSupportedOutputResolutionAt() function.
|
|
|
|
The CascadeScreen constructor - lightweight. This base class constructor is lightweight. |
|
Destructor. This destructor will automatically unlock the screen if it is locked. |
|
copies bits from a shared memory zone to the bitmap This version of Blit() operates on a source bitmap that is contained in a CascadeSharedMemZone and defined by the following parameters:
Reimplemented from CascadeBitmap. |
|
copies bits from bitmap to bitmap Blit does a simple SRCCOPY bit block transfer from the sourceRect on the bitmap described by source to the destination point.
Reimplemented from CascadeBitmap. |
|
overriden to make Create() a noop on screens Create() is overridden from CascadeBitmap to be a noop for CascadeScreen
|
|
overriden to make CreateFromBitmapFile() a noop on screens CreateFromBitmapFile() is overridden from CascadeBitmap to be a noop for CascadeScreen |
|
overriden to make Destroy() a noop on screens Destroy() is overridden from CascadeBitmap to be a noop for CascadeScreen
Reimplemented from CascadeBitmap. |
|
draws a 1 pixel line DrawLine() draws a 1 pixel width line from start to end in the color color
Reimplemented from CascadeBitmap. |
|
formats and draws a text string on the bitmap DrawText() is a text rendering primitive that allows the client to specify alignment, clipping, and wrapping of the text string. The output text is positioned relative to rectangle rect. The following flags are supported: TEXT_CENTER_VERTICALLY TEXT_CENTER_HORIZONTALLY TEXT_JUSTIFY_LEFT TEXT_JUSTIFY_TOP TEXT_JUSTIFY_BOTTOM TEXT_JUSTIFY_RIGHT TEXT_WORD_WRAP TEXT_CLIP TEXT_CLIP_WITH_DOTDOTDOT TEXT_MEASURE_ONLY
Reimplemented from CascadeBitmap. |
|
fills a rectangle with a color FillRect() fills the rectangle described by rect with the color color
Reimplemented from CascadeBitmap. |
|
flushes the pipeline of graphics drawing calls Flush() flushes the pipeline of graphics calls. It should only be needed in certain circumstances when writing to graphics memory directly.
Reimplemented from CascadeBitmap. |
|
draws a 1 pixel wide rectangle frame FrameRect() draws the 1-pixel outline of the rectangle described by rect with the color color
Reimplemented from CascadeBitmap. |
|
returns whether or not the screen is in video bypass mode GetBypassMode() returns true if the unit is in video bypass mode, false if the unit is not in video bypass mode (the default).
|
|
gets the color depth of the bitmap in bits-per-pixel GetColorDepth() returns the color depth of the bitmap in bits per pixel.
Reimplemented from CascadeBitmap. |
|
gets the current output resolution GetCurrentOutputResolution() sets the parameters passed in with the current output resolution settings.
|
|
gets the current screen resolution GetCurrentScreenResolution() sets the reference parameters passed in with the current screen resolution settings.
|
|
gets the dimensions of the bitmap GetDims() returns the dimensions of the bitmap.
Reimplemented from CascadeBitmap. |
|
returns a pointer to the screen memory GetMemory() is overridden from CascadeBitmap and returns a pointer to the screen memory. The screen memory is layed out as 32bpp ARGB with GetDims().h rows of GetDims().w 32 bit pixels. (Each row is GetDims().w * 4 bytes). The total number of bytes of memory is therefore 4 * GetDims().w * GetDims().h.
Reimplemented from CascadeBitmap. |
|
gets the number of output resolutions supported GetNumOutputResolutionsSupported() returns the number of discrete output resolutions supported. Use the return value from this function minus one as the upper bound to the function GetSupportedOutputResolutionAt().
|
|
gets the number of screen resolutions that are supported GetNumScreenResolutionsSupported() returns the number of discrete screen resolutions supported. Use the return value from this function minus one as the upper bound to the function GetSupportedScreenResolutionAt().
|
|
gets the output scale rect for a given output resolution GetOutputResolutionScaleRect() sets scaleRectToSet with the output resolution scaling rectangle for the output resolution identified by nIndex. For example, if the output resolution is set to 720p (1280x720), the output resolution scale rect by default will be CascadeRect(0, 0, 1280, 720). The output resolution scale rect is the rectangle that the output resolution will be scaled to on the display. The purpose for setting the output resolution scale rect is to center and size the output resolution on a display device.
|
|
gets the color of a pixel located at a specific point GetPixel() sets colorToSet with the color value of the pixel located at point.
Reimplemented from CascadeBitmap. |
|
gets the parameters of a specific supported output resolution GetSupportedOutputResolutionAt() sets the reference parameters passed in with the output resolution parameters for the supported output resolution at index nIndex. Valid values for nIndex are 0 to (the return value of GetNumOutputResolutionsSupported() - 1).
|
|
gets the parameters of a specific supported screen resolution GetSupportedResolutionAt() sets the reference parameters passed in with the screen resolution parameters for the supported screen resolution at index nIndex. Valid values for nIndex are 0 to (the return value of GetNumScreenResolutionsSupported() - 1).
|
|
copies bits from the bitmap to a shared memory zone GrabBits() copies bits from the sourceRect of this bitmap to the shared memory zone identified by destZone using the following parameters. If GrabBits() returns true, sourceRect.w * sourceRect.h 32bit RGBA words were copied to destZone starting at nZoneOffset.
Reimplemented from CascadeBitmap. |
|
locks the screen Call LockScreen() to lock the screen. LockScreen() will block the calling process until the screen lock is acquired. Calls to LockScreen() nest.
|
|
sets video bypass mode on or off SetBypassMode turns on or off bypass mode. If bypass mode is on, video input will be routed directly to video output (bypassing the internal video processor). If bypass mode is off (the default), then the internal video processor outputs to the video output.
|
|
sets the output resolution SetOutputResolution() causes the hardware output resolution (that sent to the output display device) to be set to the indexed resolution SetOutputResolution() returns true if successful, false otherwise. Call GetNumOutputResolutionsSupported() and GetSupportedOutputResolutionAt() to determine what output resolutions are supported. When the output resolution is changed successfully, a CascadeScreenMessage so indicating is broadcast to all wormholes on the local host.
|
|
sets the output scale rect for a given output resolution SetOutputResolutionScaleRect() sets the output resolution scale rect for a particular output resolution. The output resolution scale rect is the rectangle that the output resolution will be scaled to on the display. The output resolution scale rect is used to adjust the output resolution to fit on a particular display. By default the output resolution scale rect is set to the same as the output resolution. Once the output resolution scale rect is modified for a particular output resolution, that scale rect is remembered across boot sessions.
|
|
sets the color for a pixel located at a specific point SetPixel() sets the pixel located at point with the color value of color.
Reimplemented from CascadeBitmap. |
|
sets the screen resolution SetScreenResolution() causes the screen resolution to be set to nWidth x nHeight x nBitDepth returning true if successful, false otherwise. The SCREEN resolution is the resolution used for drawing onto the screen. Contrast this with the OUTPUT resolution which may be different (scaled) to match the resolution of the display device. Call GetNumScreenResolutionsSupported() and GetSupportedScreenResolutionAt() to determine what SCREEN resolutions are supported. When the screen changes resolution successfully, a CascadeScreenMessage so indicating is broadcast to all wormholes on the local host.
|
|
swaps the buffers of a double-buffered screen SwapBuffers() causes double-buffered screens to swap their buffers. If the screen is not double buffered, SwapBuffers() has no effect. After the buffers are swapped, afterSwapCopyRect bits are copied from the new front buffer to the new back buffer, so that subsequent drawing operations on the new back buffer are correct. To do a swap with no copy, pass in CascadeRect(0, 0, 0, 0) as your afterSwapCopyRect.
|
|
draws a text string on the bitmap TextOut() is a simple text output function that outputs the string string in the font font in the color color at the location point. Reimplemented from CascadeBitmap. |
|
unlocks the screen Call UnlockScreen() when you are finished using a screen for drawing.
|
|
blocks the calling process until VBI line 0 is reached WaitForVBILineZero() causes the calling process to block until the screen refresh reaches vbi line zero returning true if successful, false if the underlying hardware doesn't support waiting until VBI line zero is reached.
|