主要实现了3个内容:
1。surface的绘图函数 2。如何在surface中获取类似framebuffer的绘制内存地址(去掉代码中的注释) 3。eventbuffer的使用,按escape退出,移动鼠标绘点
代码: #include “directfb.h” #include 'stdio.h'static IDirectFB *dfb = NULL;static IDirectFBDisplayLayer *layer = NULL;static IDirectFBSurface *surface = NULL;static IDirectFBEventBuffer *events = NULL;int main( int argc, char *argv[]){ void *point = NULL; int pitch; int i,j; int quit=0; int x=0; int y=0; DirectFBInit(&argc,&argv); DirectFBCreate(&dfb); dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer); dfb->CreateInputEventBuffer(dfb,DICAPS_ALL,DFB_TRUE,&events);
|