本文整理汇总了C++中IDirectFB::GetInterface方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirectFB::GetInterface方法的具体用法?C++ IDirectFB::GetInterface怎么用?C++ IDirectFB::GetInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDirectFB
的用法示例。
在下文中一共展示了IDirectFB::GetInterface方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int
main( int argc, char *argv[] )
{
DFBResult ret;
DFBSurfaceDescription desc;
IDirectFB *dfb;
IDirectFBSurface *surface;
IWater *water;
D_INFO( "Tests/Water: Starting up...\n" );
/* Initialize DirectFB including command line parsing. */
ret = DirectFBInit( &argc, &argv );
if (ret) {
DirectFBError( "DirectFBInit() failed", ret );
return -1;
}
/* Parse the command line. */
if (!parse_command_line( argc, argv ))
return -2;
/* Create the super interface. */
ret = DirectFBCreate( &dfb );
if (ret) {
DirectFBError( "DirectFBCreate() failed", ret );
return -3;
}
/* Fill surface description, flipping primary. */
desc.flags = DSDESC_CAPS;
desc.caps = DSCAPS_PRIMARY | DSCAPS_FLIPPING;
/* Set width or height? */
if (m_width > 0) {
desc.flags |= DSDESC_WIDTH;
desc.width = m_width;
}
if (m_height > 0) {
desc.flags |= DSDESC_HEIGHT;
desc.height = m_height;
}
/* Set pixel format? */
if (m_format != DSPF_UNKNOWN) {
desc.flags |= DSDESC_PIXELFORMAT;
desc.pixelformat = m_format;
}
dfb->SetCooperativeLevel( dfb, DFSCL_FULLSCREEN );
/* Create a primary surface. */
ret = dfb->CreateSurface( dfb, &desc, &surface );
if (ret) {
D_DERROR( ret, "IDirectFB::CreateSurface() failed!\n" );
dfb->Release( dfb );
return -4;
}
/* Get the extended rendering interface. */
ret = dfb->GetInterface( dfb, "IWater", NULL, dfb, (void**) &water );
if (ret) {
DirectFBError( "IDirectFB::GetInterface( 'IWater' ) failed", ret );
surface->Release( surface );
dfb->Release( dfb );
return -5;
}
D_INFO( "Tests/Water: Got render interface, running tests...\n" );
RunTest( Test_Simple, water, surface );
RunTest( Test_RenderElement, water, surface );
RunTest( Test_RenderElements, water, surface );
RunTest( Test_RenderShape, water, surface );
RunTest( Test_RenderShapes, water, surface );
D_INFO( "Tests/Water: Dumping surface...\n" );
unlink( "dfbrender.pgm" );
unlink( "dfbrender.ppm" );
surface->Dump( surface, "dfbrender", NULL );
D_INFO( "Tests/Water: Shutting down...\n" );
/* Release the render interface. */
water->Release( water );
/* Release the surface. */
surface->Release( surface );
/* Release the super interface. */
dfb->Release( dfb );
//.........这里部分代码省略.........