www.pudn.com > DualDisplay.rar > DisplayConfig.h


/****************************************************************************** 
** Copyright (C) 2004. Intel Corporation. All Rights Reserved.  
** 
** The source code contained or described herein and all documents related to the 
** source code ("Material") are owned by Intel Corporation or its suppliers or  
** licensors. Title to the Material remains with Intel Corporation or its suppliers 
** and licensors. The Material contains trade secrets and proprietary and  
** confidential information of Intel or its suppliers and licensors. The Material  
** is protected by worldwide copyright and trade secret laws and treaty provisions. 
** No part of the Material may be used, copied, reproduced, modified, published,  
** uploaded, posted, transmitted, distributed, or disclosed in any way without  
** Intel’s prior express written permission. 
**  
** No license under any patent, copyright, trade secret or other intellectual  
** property right is granted to or conferred upon you by disclosure or delivery  
** of the Materials, either expressly, by implication, inducement, estoppel or  
** otherwise. Any license under such intellectual property rights must be express  
** and approved by Intel in writing. 
******************************************************************************/ 
// DisplayConfig.h: interface for the CDisplayConfig class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_DISPLAYCONFIG_H__4668C769_6235_49DF_BE29_BDED75CC40ED__INCLUDED_) 
#define AFX_DISPLAYCONFIG_H__4668C769_6235_49DF_BE29_BDED75CC40ED__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
#include  // RawFrameBufferInfo is defined in new MS GAPI header 
 
// remove this if using new/updated gx.h 
#ifndef GETRAWFRAMEBUFFER 
    #define GETRAWFRAMEBUFFER   0x00020001 
    typedef struct _RawFrameBufferInfo 
    { 
	    WORD wFormat; 
	    WORD wBPP; 
	    VOID *pFramePointer; 
	    int	cxStride; 
	    int	cyStride; 
        int cxPixels; 
        int cyPixels; 
    } RawFrameBufferInfo; 
 
    #define FORMAT_565 1 
    #define FORMAT_555 2 
    #define FORMAT_OTHER 3 
#endif 
 
 
#include "dispconfig.h" 
 
class CDisplayConfig   
{ 
 
public: 
	HDC CreateSecondMarathonHDC(WORD wWidth, WORD wHeight); 
	void FreeMarathonFrameBufferResources(); 
	CDisplayConfig(); 
	virtual ~CDisplayConfig(); 
	void CopyDesktopToXScale(); 
	RawFrameBufferInfo* CreateMarathonFrameBuffer(WORD wWidth, WORD wHeight); 
	RawFrameBufferInfo* GetDesktopFrameBuffer(); 
	RawFrameBufferInfo* GetXScaleFrameBuffer(); 
	void SetExternalSource(DCFG_LCD_SOURCE eSource); 
	void SetInternalSource(DCFG_LCD_SOURCE eSource); 
 
private: 
	void AcquireLock(BOOL bAcquire); 
	PWORD ConvertSurfaceInfoToRawFrameBuffer(const DISPCFG_GET_SURFACE_INFO &surfinfo, RawFrameBufferInfo &raw); 
	DWORD GetCurrentOSOrientation(); 
	RawFrameBufferInfo m_RFBDesktop;	// marathon frame buffer Windows draws to 
	PWORD m_pBufDesktop;				// ptr to marathon frame memory 
	RawFrameBufferInfo m_RFBXScale;		// SDRAM frame buffer displayed by XScale 
	PWORD m_pBufXScale;					// ptr to SDRAM frame buffer memory 
	RawFrameBufferInfo m_RFBSecondary;	// marathon frame buffer other than desktop 
	PWORD m_pBufSecondary;				// ptr to marathon frame secondary memory 
	DWORD m_dwOrigPhysRotation; 
	HBITMAP m_hbmSecondary; 
	HBITMAP m_hbmOldBitmap; 
	HDC m_hdcMarathon; // This HDC is also the "desktop" 
	HDC m_hdcXScale; 
	HDC m_hdcSecondaryMem; 
}; 
 
#endif // !defined(AFX_DISPLAYCONFIG_H__4668C769_6235_49DF_BE29_BDED75CC40ED__INCLUDED_)