📄 pdpstub.cpp
字号:
/**************************************************************************
Name : PDPstub.cpp
Title : PDP C Stub functions
Author : Paul Buxton
Created : 30 October 2002
Copyright : 2002 by Imaginationc Technologies Limited. All rights reserved.
: No part of this software, either material or conceptual
: may be copied or distributed, transmitted, transcribed,
: stored in a retrieval system or translated into any
: human or computer language in any form by any means,
: electronic, mechanical, manual or other-wise, or
: disclosed to third parties without the express written
: permission of Imagination Technologies Limited, Unit 8, HomePark
: Industrial Estate, King's Langley, Hertfordshire,
: WD4 8LZ, U.K.
Description : PDP Abstraction Layer C stub functions
Platform : Independent
**************************************************************************/
#include <windows.h>
#include <winddi.h>
extern "C"
{
#include "services_headers.h"
#include "pdpal.h"
}
// Temporarily create a Handle to be used globally
PDPHANDLE g_PDPHandle;
/*****************************************************************************
FUNCTION : PDP_SetMode
DESCRIPTION: Gets/Sets the displaymode for the display pipeline.
PARAMETERS : PPDP_SETMODE psModeStruct
BOOL bGet
PDPHANDLE pHandle
RETURNS : PDP_ERROR_OK, or an error code.
*****************************************************************************/
PDP_ERROR PDP_SetMode (PDPHANDLE pHandle,PPDP_SETMODE psModeStruct, BOOL bGet)
{
return ((PDPApi*)pHandle)-> PDP_SetMode ( psModeStruct, bGet);
}
/*****************************************************************************
FUNCTION : PDP_Palette
DESCRIPTION: Sets/Gets the Current Hardware Palette
PARAMETERS : PPDP_PALETTE psPalette
BYTE byStart
BYTE byCount
BOOL bGet
PDPHANDLE pHandle
RETURNS : PDP_ERROR_OK
*****************************************************************************/
PDP_ERROR PDP_Palette(PDPHANDLE pHandle,PPDP_PALETTE psPalette,WORD Start,WORD Count, BOOL bGet)
{
return ((PDPApi*)pHandle)-> PDP_Palette( psPalette, Start, Count, bGet);
}
/*****************************************************************************
FUNCTION : PDP_CursorPos
DESCRIPTION: Get/Set the current cursor position
PARAMETERS : PPDP_CURSORPOS psCursorPos
BOOL bGet
PDPHANDLE pHandle
RETURNS : PDP_ERROR_OK
*****************************************************************************/
PDP_ERROR PDP_CursorPos(PDPHANDLE pHandle,PPDP_CURSORPOS psCursorPos, BOOL bGet)
{
return ((PDPApi*)pHandle)-> PDP_CursorPos( psCursorPos, bGet);
}
/*****************************************************************************
FUNCTION : PDP_CursorProperties
DESCRIPTION: Gets/Sets the current cursor properties.
PARAMETERS : PPDP_CURSOR_PROPERTIES pCursorProperties
BOOL bGet
PDPHANDLE pHandle
RETURNS : PDP_ERROR_OK
*****************************************************************************/
PDP_ERROR PDP_CursorProperties(PDPHANDLE pHandle,PPDP_CURSOR_PROPERTIES pCursorProperties, BOOL bGet)
{
PDP_ERROR eRtn = PDP_ERROR_OK+3;
PDP_CURSOR_SHAPEINFO sShapeInfo;
SURFOBJ * pMask;
if (pCursorProperties)
{
pMask = (SURFOBJ *)pCursorProperties->AndXorMask;
if (bGet)
{
eRtn = ((PDPApi*)pHandle)->PDP_CursorProperties(&sShapeInfo, bGet);
if (pMask)
{
pMask->sizlBitmap.cy = sShapeInfo.Height;
pMask->sizlBitmap.cx = sShapeInfo.Width;
pMask->lDelta = sShapeInfo.StrideBytes;
pMask->pvScan0 = sShapeInfo.pvScan0;
}
}
else
{
if (pMask)
{
sShapeInfo.Height = pMask->sizlBitmap.cy;
sShapeInfo.Width = pMask->sizlBitmap.cx;
sShapeInfo.StrideBytes = pMask->lDelta;
sShapeInfo.pvScan0 = pMask->pvScan0;
sShapeInfo.Colors = (BOOL)(pCursorProperties->Colors != NULL);
}
else
{
sShapeInfo.pvScan0 = NULL;
}
eRtn = ((PDPApi*)pHandle)->PDP_CursorProperties(&sShapeInfo, bGet);
}
}
return (eRtn);
}
/*****************************************************************************
FUNCTION : PDP_Init
DESCRIPTION: Initialsed the PDP Pipeline
PARAMETERS : PDPHANDLE pHandle
RETURNS : PDP_ERROR_OK
*****************************************************************************/
PDP_ERROR PDP_Init(PDPHANDLE pHandle)
{
return ((PDPApi*)pHandle)-> PDP_Init();//Terry
}
/******************************** Display Adjustment**************************/
/*****************************************************************************
FUNCTION : PDP_Contrast
DESCRIPTION: Gets/Sets the Contrast for the current Display
PARAMETERS : PPDP_CONTRAST pContrast
BOOL bGet
PDPHANDLE pHandle
RETURNS : PDP_ERROR_OK
*****************************************************************************/
PDP_ERROR PDP_Contrast(PDPHANDLE pHandle,PPDP_CONTRAST pContrast, BOOL bGet)
{
return ((PDPApi*)pHandle)-> PDP_Contrast( pContrast, bGet);
}
/*****************************************************************************
FUNCTION : PDP_Gamma
DESCRIPTION: Gets/Sets the Gamma for the current display
PARAMETERS : PPDP_GAMMA pGamma
BOOL bGet
PDPHANDLE pHandle
RETURNS : PDP_ERROR_OK
*****************************************************************************/
PDP_ERROR PDP_Gamma(PDPHANDLE pHandle,PPDP_GAMMA pGamma, BOOL bGet)
{
return ((PDPApi*)pHandle)-> PDP_Gamma( pGamma, bGet);
}
/*****************************************************************************
FUNCTION : PDP_Brightness
Description: Get/Set the Brightness of the Display
PARAMETERS : PPDP_BRIGHTNESS pBrightness
BOOL bGet
PDPHANDLE pHandle
RETURNS : PDP_ERROR_OK
*****************************************************************************/
PDP_ERROR PDP_Brightness(PDPHANDLE pHandle,PPDP_BRIGHTNESS pBrightness, BOOL bGet)
{
return ((PDPApi*)pHandle)-> PDP_Brightness( pBrightness, bGet);
}
/*************************************** Power Management ********************/
#ifdef SUPPORT_POWER_STATE
/*****************************************************************************
FUNCTION : PDP_ScreenPowerOff
DESCRIPTION: Sets the PowerState of the Current Display
PARAMETERS : BOOL bOff
PDPHANDLE pHandle
RETURNS : PDP_ERROR_OK
*****************************************************************************/
PDP_ERROR PDP_ScreenPowerOff(PDPHANDLE pHandle,BOOL bOff)
{
return ((PDPApi*)pHandle)-> PDP_ScreenPowerOff( bOff);
}
#endif
PDP_ERROR PDP_PrePLLChange(PDPHANDLE pHandle)
{
return ((PDPApi*)pHandle)-> PDP_PrePLLChange();
}
PDP_ERROR PDP_PostPLLChange(PDPHANDLE pHandle)
{
return ((PDPApi*)pHandle)-> PDP_PostPLLChange();
}
/******************************* Overlay support *******************************/
/*****************************************************************************
FUNCTION : PDP_SetOverlayAttributes
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -