[Re] DirectFB로 도형그리는 소스의 에러질문입니다.
글 잘못 올렸는데 KLDP는 글수정이나 삭제가 안되네요;;
해서 다시 올립니다.
아래 소스에서
dsc.caps = DSCAPS_PRIMARY | DSCAPS_FLIPPING; 이부분에서
invalid conversion from 'int' to
'DFBSurfaceCapabilities' [-fpermissive]에러가 발생합니다.
이 에러가 왜 발생하였고 어떻게 해결하면 되는지 알려주세요~
#include
#include
#include
static IDirectFB *dfb = NULL;
static IDIrectFBSurface *primary = NULL;
static int width = 0;
static int height = 0;
static IDirectFBSurface *logo = NULL;
#define DFBCHECK(x...) \ { \ DFBResult err = x; \ \ if (err != DFB_OK) \ { \ fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \ DirectFBErrorFatal( #x, err ); \ } \ }
int main(int argc, char **argv)
{
int i;
DFBSurfaceDescription dsc;
IDirectFBImageProvider *provider;
DFBCHECK(DirectFBInit (&argc, &argv));
DFBCHECK(DirectFBCreate(&dfb));
DFBCHECK(dfb->SetCooperativeLevel(dfb, DFSCL_FULLSCREEN));
dsc.flags = DSDESC_CAPS;
dsc.caps = DSCAPS_PRIMARY | DSCAPS_FLIPPING;
DFBCHECK(dfb->CreateSurface(dfb, &dsc, &primary));
DFBCHECK(primary->GetSize(primary, &width, &height));
DFBCHECK(dfb->CreateImageProvider(dfb, ImageFileName, &provider));
** Example) DFBCHECK(dfb->CreateImageProvider(dfb, “/home/a.jpg”, &provider));
DFBCHECK(provider->GetSurfaceDescription(provider, &dsc));
DFBCHECK(dfb->CreateSurface(dfb, &dsc, &logo));
DFBCHECK(provider->RenderTo(provider, logo, NULL));
provider->Release(provider);
for(i = -dsc.width; i < width; i++)
{
DFBCHECK(primary->FillRectangle(primary, 0, 0, width, height));
DFBCHECK(primary->Blit(primary, logo, NULL, i, (height – dsc.height) / 2));
DFBCHECK(primary->Flip(primary, NULL, DSFLIP_WAITFORSYNC));
}
logo->Release(logo);
primary->Release(primary);
dfb->Release(dfb);
return 23;
}
에고 또 잘못 올라갔네요;;
잘리는 부분은 어떻게 할수가 없네요;;
잘리는 부분은 DFBCHECK(x) #define해준것입니다.
DFBCHECK(x)는 x가 에러면 해당 파일과 라인을 출력해주는것 같습니다.
당연히 다 아시겠지만 혹시나 해서 ㅎㅎ;;
======================================================================
main함수 위의 잘린부분 소스입니다.
#include
#include
#include
static IDirectFB *dfb = NULL;
static IDIrectFBSurface *primary = NULL;
static int width = 0;
static int height = 0;
static IDirectFBSurface *logo = NULL;
#define DFBCHECK(x...)
{
DFBResult err = x;
if (err != DFB_OK)
{
fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ );
DirectFBErrorFatal( #x, err );
}
}
반갑습니다. ^_^
댓글 달기