Share via


DDGPE Derivation (Windows Embedded CE 6.0)

1/6/2010

Making minor changes and additions to your DDGPE-based driver will add greater functionality and power to your implementation. These changes include functions you can override, member variables you can set, and functions you can call.

Functions You Should Override

These are the DDGPE class functions your DDGPE-based display driver can override and implement to improve its DDGPE support:

  • AllocSurface
    The DDGPE::AllocSurface function allows the EDDGPEPixelFormat data type to be integrated into your driver. With the addition of this data type, your driver can begin to support a wide variety of surface types.

    virtual SCODE AllocSurface (
    DDGPESurf **ppSurf,
    int width,
    int height,
    EGPEFormat format,
    EDDGPEPixelFormat pixelFormat,
    int surfaceFlags
    );
    
  • GetModeInfoEx
    The DDGPE::GetModeInfoEx function provides DDGPE with extended pixel format information that applies to a specific mode. This is useful to both DDGPE classes and the DDGPE DDHAL implementation. To override this function, you need to store detailed information about the different modes that are supported by your driver.

  • SetVisibleSurface
    The DDGPE::SetVisibleSurface function has been added by DDGPE. By default, the DDGPE implementation of this function does nothing. However, to support DirectDraw surface flips, you should implement this function. It should change the display to show the selected surface. The current GDI primary surface should not be changed.

    virtual void SetVisibleSurface (
    GPESurf *pSurf,
    BOOL bWaitForVBlank = FALSE
    );
    

Member Variables You Should Set

These are DDGPE member variables with explanations of when and why they should be updated:

  • m_pModeEx
    This member variable should always point to the extended mode information for GDI's current display mode. You should update it at initialization time and whenever the GDI primary surface's mode is changed. As a rule, the m_pModeEx member variable should be updated whenever the GPE member variable m_pMode is updated.

    Note

    Because of the structure of GPEModeEx, m_pModeEx and m_pMode can point to the same block of memory.

    To support this member variable, you will need to store extended information for all modes supported by your driver.

    GPEModeEx m_pModeEx;
    
  • m_dwPhysicalModeID
    The m_dwPhysicalModeID member variable indicates the index of the mode that is displayed on the screen. This does not necessarily correspond to the current mode of the GDI primary surface.
    This value should be updated whenever the hardware's display mode changes regardless of whether or not the pixel format of the GDI primary surface has changed.

    DWORD m_dwPhysicalModeID;
    

Functions You Should Call

  • SetDriverGUID
    You should call the SetDriverGUID function to supply the DDGPE object with a unique way to identify your driver from other drivers. DDGPESurf objects that your driver creates should also be tagged with this GUID.

    virtual void SetDriverGUID (
    GUID guidDriverGUID
    );
    

See Also

Concepts

Driver Extension Using DDGPE
DirectDraw Driver Samples