本文整理汇总了C++中DFBCHECK函数的典型用法代码示例。如果您正苦于以下问题:C++ DFBCHECK函数的具体用法?C++ DFBCHECK怎么用?C++ DFBCHECK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DFBCHECK函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DFBCHECK
void IDirectFBSurface::SetColor (DFBColor &color)
{
DFBCHECK( iface->SetColor (iface, color.r, color.g, color.b, color.a) );
}
示例2: DFBCHECK
void IDirectFBScreen::GetMixerConfiguration (int mixer,
DFBScreenMixerConfig *config)
{
DFBCHECK( iface->GetMixerConfiguration (iface, mixer, config) );
}
示例3: DFBCHECK
void IDirectFBInputDevice::GetXY (int *x, int *y)
{
DFBCHECK( iface->GetXY (iface, x, y) );
}
示例4: main
int main( int argc, char *argv[] )
{
IDirectFB *dfb;
IDirectFBDisplayLayer *layer;
IDirectFBSurface *bgsurface;
IDirectFBImageProvider *provider;
IDirectFBWindow *window1;
IDirectFBWindow *window2;
IDirectFBSurface *window_surface1;
IDirectFBSurface *window_surface2;
IDirectFBEventBuffer *buffer;
DFBDisplayLayerConfig layer_config;
#if ((DIRECTFB_MAJOR_VERSION == 0) && (DIRECTFB_MINOR_VERSION == 9) && (DIRECTFB_MICRO_VERSION < 23))
DFBCardCapabilities caps;
#else
DFBGraphicsDeviceDescription caps;
#endif
IDirectFBWindow* upper;
DFBWindowID id1;
IDirectFBFont *font;
int fontheight;
int err;
int quit = 0;
DFBCHECK(DirectFBInit( &argc, &argv ));
DFBCHECK(DirectFBCreate( &dfb ));
#if ((DIRECTFB_MAJOR_VERSION == 0) && (DIRECTFB_MINOR_VERSION == 9) && (DIRECTFB_MICRO_VERSION < 23))
dfb->GetCardCapabilities( dfb, &caps );
#else
dfb->GetDeviceDescription( dfb, &caps );
#endif
dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer );
if (!((caps.blitting_flags & DSBLIT_BLEND_ALPHACHANNEL) &&
(caps.blitting_flags & DSBLIT_BLEND_COLORALPHA )))
{
layer_config.flags = DLCONF_BUFFERMODE;
layer_config.buffermode = DLBM_BACKSYSTEM;
layer->SetConfiguration( layer, &layer_config );
}
layer->GetConfiguration( layer, &layer_config );
layer->EnableCursor ( layer, 1 );
{
DFBFontDescription desc;
desc.flags = DFDESC_HEIGHT;
desc.height = layer_config.width/50;
DFBCHECK(dfb->CreateFont( dfb, PACKAGE_DATA_DIR"/grunge.ttf", &desc, &font ));
font->GetHeight( font, &fontheight );
}
{
DFBSurfaceDescription desc;
DFBCHECK(dfb->CreateImageProvider( dfb,
PACKAGE_DATA_DIR"/bg.png",
&provider ));
desc.flags = DSDESC_WIDTH | DSDESC_HEIGHT;
desc.width = layer_config.width;
desc.height = layer_config.height;
DFBCHECK(dfb->CreateSurface( dfb, &desc, &bgsurface ) );
provider->RenderTo( provider, bgsurface, NULL );
provider->Release( provider );
DFBCHECK(bgsurface->SetFont( bgsurface, font ));
bgsurface->SetColor( bgsurface, 0xCF, 0xCF, 0xFF, 0xFF );
bgsurface->DrawString( bgsurface,
"Move the mouse over a window to activate it.",
-1, 10, 0, DSTF_LEFT | DSTF_TOP );
bgsurface->SetColor( bgsurface, 0xFF, 0xCF, 0xFF, 0xFF );
bgsurface->DrawString( bgsurface,
"You can drag them around, too, if you want.",
-1, 10 , 40, DSTF_LEFT | DSTF_TOP );
bgsurface->SetColor( bgsurface, 0xCF, 0xCF, 0xFF, 0xFF );
bgsurface->DrawString( bgsurface,
"The one with funky stuff happening and things flying around is an evas.",
-1, 10, 80, DSTF_LEFT | DSTF_TOP );
//.........这里部分代码省略.........
示例5: DFBCHECK
int DFBFontProvider::getMaxAdvance() {
int maxAdvance = 0;
DFBCHECK(font->GetMaxAdvance(font, &maxAdvance));
return maxAdvance;
}
示例6: main
int main(int argc, char *argv[])
{
int quit = 0;
DFBResult err;
DFBSurfaceDescription dsc;
DFBCHECK(DirectFBInit(&argc, &argv));
// create the super interface
DFBCHECK(DirectFBCreate(&dfb));
// create an event buffer for all devices with these caps
DFBCHECK(dfb->CreateInputEventBuffer(dfb, DICAPS_KEYS | DICAPS_AXES, DFB_FALSE, &events));
// set our cooperative level to DFSCL_FULLSCREEN for exclusive access to the primary layer
dfb->SetCooperativeLevel(dfb, DFSCL_FULLSCREEN);
// get the primary surface, i.e. the surface of the primary layer we have exclusive access to
dsc.flags = DSDESC_CAPS;
dsc.caps = DSCAPS_PRIMARY | DSCAPS_DOUBLE | DSCAPS_OPENGL_HINT;
DFBCHECK(dfb->CreateSurface(dfb, &dsc, &primary));
// get the size of the surface and fill it
DFBCHECK(primary->GetSize(primary, &screen_width, &screen_height));
DFBCHECK(primary->FillRectangle(primary, 0, 0, screen_width, screen_height));
primary->Flip(primary, NULL, 0);
// create the default font and set it
DFBCHECK(dfb->CreateFont(dfb, NULL, NULL, &font));
DFBCHECK(primary->SetFont(primary, font));
// get the GL context
DFBCHECK(primary->GetGL(primary, &primary_gl));
DFBCHECK(primary_gl->Lock(primary_gl));
init(argc, argv);
reshape(screen_width, screen_height);
DFBCHECK(primary_gl->Unlock(primary_gl));
T0 = get_millis();
while (!quit)
{
DFBInputEvent evt;
unsigned long t;
DFBCHECK(primary_gl->Lock(primary_gl));
draw();
DFBCHECK(primary_gl->Unlock(primary_gl));
if (fps)
{
char buf[64];
snprintf(buf, 64, "%4.1f FPS\n", fps);
primary->SetColor(primary, 0xff, 0, 0, 0xff);
primary->DrawString(primary, buf, -1, screen_width - 5, 5, DSTF_TOPRIGHT);
}
primary->Flip(primary, NULL, 0);
Frames++;
t = get_millis();
if (t - T0 >= 2000)
{
GLfloat seconds = (t - T0) / 1000.0;
fps = Frames / seconds;
T0 = t;
Frames = 0;
}
while (events->GetEvent(events, DFB_EVENT(&evt)) == DFB_OK)
{
switch (evt.type)
{
case DIET_KEYPRESS:
switch (evt.key_symbol)
{
case DIKS_ESCAPE:
quit = 1;
break;
case DIKS_CURSOR_UP:
inc_y = 0.1;
break;
case DIKS_CURSOR_DOWN:
inc_y = -0.1;
break;
case DIKS_CURSOR_LEFT:
inc_x = -0.1;
break;
//.........这里部分代码省略.........
示例7: main
int main( int argc, char *argv[] )
{
char *filename = NULL;
pthread_t demo_loop_thread = (pthread_t) -1;
DFBResult err;
int quit = 0;
if (argc > 1) {
filename = argv[1];
} else {
filename = "./smokey_light.jpg";
}
DFBSurfaceDescription dsc;
srand((long)time(0));
DFBCHECK(DirectFBInit( &argc, &argv ));
/* create the super interface */
DFBCHECK(DirectFBCreate( &dfb ));
/* get an interface to the primary keyboard and create an
input buffer for it */
// DFBCHECK(dfb->GetInputDevice( dfb, DIDID_KEYBOARD, &keyboard ));
// DFBCHECK(keyboard->CreateEventBuffer( keyboard, &keybuffer ));
/* set our cooperative level to DFSCL_FULLSCREEN for exclusive access to
the primary layer */
err = dfb->SetCooperativeLevel( dfb, DFSCL_FULLSCREEN );
if (err)
DirectFBError( "Failed to get exclusive access", err );
/* get the primary surface, i.e. the surface of the primary layer we have
exclusive access to */
dsc.flags = DSDESC_CAPS;
dsc.caps = DSCAPS_PRIMARY | DSCAPS_DOUBLE | DSCAPS_VIDEOONLY;
DFBCHECK(dfb->CreateSurface( dfb, &dsc, &primary ));
/* set our desired video mode */
DFBCHECK(primary->GetSize( primary, &xres, &yres ));
/* load font */
{
DFBFontDescription desc;
desc.flags = DFDESC_HEIGHT;
desc.height = yres/10;
DFBCHECK(dfb->CreateFont( dfb, "./decker.ttf", &desc, &font ));
DFBCHECK(primary->SetFont( primary, font ));
}
/* load smokey_light */
DFBCHECK(dfb->CreateImageProvider( dfb, filename,
&provider ));
DFBCHECK(provider->GetSurfaceDescription (provider, &dsc));
DFBCHECK(dfb->CreateSurface( dfb, &dsc, &smokey_light ));
DFBCHECK(provider->RenderTo( provider, smokey_light, NULL ));
provider->Release( provider );
/* main loop */
while (1) {
DFBInputEvent evt;
if ((int)demo_loop_thread == -1)
pthread_create( &demo_loop_thread, NULL, demo_loop, NULL );
sleep(5);
#if (0)
keybuffer->WaitForEvent( keybuffer );
/* process keybuffer */
while (keybuffer->GetEvent( keybuffer, DFB_EVENT(&evt)) == DFB_OK) {
if (evt.type == DIET_KEYPRESS) {
switch (evt.key_id) {
case DIKI_ESCAPE:
/* quit main loop */
quit = 1;
pthread_cancel( demo_loop_thread );
pthread_join( demo_loop_thread, NULL );
break;
default:
break;
}
}
}
#endif
}
smokey_light->Release( smokey_light );
keybuffer->Release( keybuffer );
keyboard->Release( keyboard );
primary->Release( primary );
//.........这里部分代码省略.........