|
发表于 2011-1-27 18:16:41
|
显示全部楼层
没搞明白luminary的图形库里的函数输入参数里都有一个指针有什么用,请教?
//*****************************************************************************
//
//! This structure defines the characteristics of a display driver.
//
//*****************************************************************************
typedef struct
{
//
//! The size of this structure.
//
long lSize;
//
//! A pointer to display driver-specific data.
//
void *pvDisplayData;
//
//! The width of this display.
//
unsigned short usWidth;
//
//! The height of this display.
//
unsigned short usHeight;
//
//! A pointer to the function to draw a pixel on this display.
//
void (*pfnPixelDraw)(void *pvDisplayData, long lX, long lY,
unsigned long ulValue);
//
//! A pointer to the function to draw multiple pixels on this display.
//
void (*pfnPixelDrawMultiple)(void *pvDisplayData, long lX, long lY,
long lX0, long lCount, long lBPP,
const unsigned char *pucData,
const unsigned char *pucPalette);
//
//! A pointer to the function to draw a horizontal line on this display.
//
void (*pfnLineDrawH)(void *pvDisplayData, long lX1, long lX2, long lY,
unsigned long ulValue);
//
//! A pointer to the function to draw a vertical line on this display.
//
void (*pfnLineDrawV)(void *pvDisplayData, long lX, long lY1, long lY2,
unsigned long ulValue);
//
//! A pointer to the function to draw a filled rectangle on this display.
//
void (*pfnRectFill)(void *pvDisplayData, const tRectangle *pRect,
unsigned long ulValue);
//
//! A pointer to the function to translate 24-bit RGB colors to
//! display-specific colors.
//
unsigned long (*pfnColorTranslate)(void *pvDisplayData,
unsigned long ulValue);
//
//! A pointer to the function to flush any cached drawing operations on
//! this display.
//
void (*pfnFlush)(void *pvDisplayData);
}
tDisplay;
每个函数里都有void *pvDisplayData的输入参数但是又没有用到。 |
|