Screen Rotation (Windows CE 5.0)

Windows CE 5.0
Send Feedback

Single screen devices support screen rotation. The functionality is built into the GDI in GWES. The desktop and shell respond to screen rotation.

The RFlat sample driver in %_WINCEROOT%\Public\Common\OAK\Drivers\Display\RFlat supports screen rotation, as do the Geode and MediaGx drivers in %_WINCEROOT%\Public\Common\OAK\CSP\i486\Geode\GXvideo.

To enable screen rotation, link with GPERotate.lib and EmulRotate.lib. The entry point is RGPEFlat.

Note   If you use the
switch to specify the display mode with LoadCEPC.exe, you cannot use the DDI_FLAT driver.

For the VGA flat driver, the RGPEFlat class is derived from the GPERotate class, and RGPEFlatSurf is derived from the GPESurfRotate class.

The following table shows the display driver functions for the RGPEFlat class.

NumModesCalled from DrvGetModes, it returns 1.
SetModeCalled from DrvEnablePDEV and creates a palette based on bpp.
InVBlankDetermines if the CRT is in the middle of a vertical blank when the electron beam is off and traversing from the lower right corner to the upper left.

During this interval page flipping, animation can be performed to avoid tearing the image.

SetPaletteCalled from DrvSetPalette.
GetModeInfoCalled from DrvGetModes.
SetPointerShapeCalled from DrvSetPointerShape and DrvSetPointerShape.
MovePointerCalled from DrvMovePointer calls this function, DrvSetPointerShape.
WaitForNotBusyCalled from EmulatedBltRotate in the GPERotate class.
IsBusyDetermines if the display controller is busy or if it can take another command.
GetPhysicalVideoMemoryUsed by the Direct Draw Hardware Abstraction Layer (DDHAL).

When implementing, do not return a bus address or physical address. Instead, return the virtual address of video memory, an address that the CPU can dereference.

LineCalled from DrvStrokePath.
BltPrepareCalled from DrvFillpath DrvAnyBlt.
BltCompleteCalled from DrvFillpath DrvAnyBlt.
GetGraphicsCapsCalled from DrvEnablePDEV.
DrvEscapeResponds to rotation request messages DRVESC_GETSCREENROTATION and DRVESC_SETSCREENROTATION.
WrappedEmulatedLineWrapper function around the emulated line drawing function.
CursorOnTurns on the hardware cursor.
CursorOffTurns off the hardware cursor.
GetRotateModeFromRegCalled from RGPEFlat constructor, and is used to read the registry to get the initial rotation angle.
SetRotateParamsCalled from RGPEFlat constructor to set up the screen width and height based on the current rotation angle.
DynRotateRotates the screen when DrvEscape gets a DRVESC_SETSCREENROTATION message.

The following shows the functions in the GPESurfRotate class.

SetRotationCalled in the display driver when the display angle has changed.

The driver calls this function to reset some member variables in the GPESurfaceRotate instance.

RotatePathDataThis is a helper function in GPESurfaceRotate used in DrvStrokePath.

It rotates the coordinates of the PATHOBJ structure so the lines can be drawn as not rotated.

RotatePathdataBackThis is a helper function in GPESurfaceRotate used in DrvStrokePath.

This restores the PATHOBJ data after drawing the lines.

RotateRectlThis is a helper function in GPESurfaceRotate.

It is called during a physical drawing and the rectangle needs to be in the real physical orientation.

RotateRectlBackThis is a helper function in GPESurfaceRotate.

It restores the rectangle coordinates after drawing.

GetPtrThis is a helper function in GPESurfaceRotate.

It passes the pixel coordinates based on the screen the user views, and it returns a pointer to the corresponding place in video memory.

The following table shows the members in the GPERotate class, which is derived from the GPE class.

m_iRotateThe current rotation angle.
m_nScreenWidthSaveThe physical screen width when the screen is not rotated.

It is used to calculate the coordinate transformation.

m_nScreenHeightSaveThe physical screen height.

It is used to calculate the coordinate transformation.

RotateRectlHelper function in GPERotate to perform rectangle coordinate transformation.
RotateRectlBackHelper function in GPERotate.

It restores the rectangle coordinates.

EmulatedBltRotateThis function is called from BltPrepare and blits in place of EmulatedBlt when the screen is rotated.

See Also

Display Driver Registry Settings | Display Driver Escape Codes | Display Driver Development Concepts | Display Driver Extensions | Display Driver Samples | Loadcepc.exe Boot Loader Usage | How to Implement Screen Rotation

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.