Screen Rotation (Windows Embedded CE 6.0)

1/6/2010

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

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

Note

If you use the /D 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.

Function Description

NumModes

Called from DrvGetModes, it returns 1.

SetMode

Called from DrvEnablePDEV and creates a palette based on bpp.

InVBlank

Determines 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.

SetPalette

Called from DrvSetPalette.

GetModeInfo

Called from DrvGetModes.

SetPointerShape

Called from DrvSetPointerShape and DrvSetPointerShape.

MovePointer

Called from DrvMovePointer calls this function, DrvSetPointerShape.

WaitForNotBusy

Called from EmulatedBltRotate in the GPERotate class.

IsBusy

Determines if the display controller is busy or if it can take another command.

GetPhysicalVideoMemory

Used 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.

Line

Called from DrvStrokePath.

BltPrepare

Called from DrvFillpath DrvAnyBlt.

BltComplete

Called from DrvFillpath DrvAnyBlt.

GetGraphicsCaps

Called from DrvEnablePDEV.

DrvEscape

Responds to rotation request messages DRVESC_GETSCREENROTATION and DRVESC_SETSCREENROTATION.

WrappedEmulatedLine

Wrapper function around the emulated line drawing function.

CursorOn

Turns on the hardware cursor.

CursorOff

Turns off the hardware cursor.

GetRotateModeFromReg

Called from RGPEFlat constructor, and is used to read the registry to get the initial rotation angle.

SetRotateParams

Called from RGPEFlat constructor to set up the screen width and height based on the current rotation angle.

DynRotate

Rotates the screen when DrvEscape gets a DRVESC_SETSCREENROTATION message.

The following shows the functions in the GPESurfRotate class.

Function Description

SetRotation

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

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

RotatePathData

This 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.

RotatePathdataBack

This is a helper function in GPESurfaceRotate used in DrvStrokePath.

This restores the PATHOBJ data after drawing the lines.

RotateRectl

This is a helper function in GPESurfaceRotate.

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

RotateRectlBack

This is a helper function in GPESurfaceRotate.

It restores the rectangle coordinates after drawing.

GetPtr

This 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.

Member Description

m_iRotate

The current rotation angle.

m_nScreenWidthSave

The physical screen width when the screen is not rotated.

It is used to calculate the coordinate transformation.

m_nScreenHeightSave

The physical screen height.

It is used to calculate the coordinate transformation.

RotateRectl

Helper function in GPERotate to perform rectangle coordinate transformation.

RotateRectlBack

Helper function in GPERotate.

It restores the rectangle coordinates.

EmulatedBltRotate

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

See Also

Reference

Concepts

Display Driver Extensions
Display Driver Registry Settings
Display Driver Escape Codes
Display Driver Development Concepts
Display Driver Samples

Other Resources

Loadcepc.exe Boot Loader Usage