本文整理汇总了C++中IDirectFB::SetVideoMode方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirectFB::SetVideoMode方法的具体用法?C++ IDirectFB::SetVideoMode怎么用?C++ IDirectFB::SetVideoMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDirectFB
的用法示例。
在下文中一共展示了IDirectFB::SetVideoMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
if ((bestVideoMode == -1) ||
((fixedVideoMode.width != videoModes[bestVideoMode].width) ||
(fixedVideoMode.height != videoModes[bestVideoMode].height) ||
(fixedVideoMode.bpp != videoModes[bestVideoMode].bpp)))
{
printf("Error: the specified fixed video mode is not available!\n");
exit(-1);
}
} else
{
initialVideoMode = getBestVideoMode(640, 480, 16);
if (initialVideoMode == -1)
{
printf("Error: initial video mode 640x480x16 is not available!\n");
exit(-1);
}
}
dsc.flags = DSDESC_CAPS;
dsc.caps = DSCAPS_PRIMARY;
DFBCHECK(dfb->CreateSurface(dfb, &dsc, &surface));
DFBCHECK(surface->Clear(surface, 0, 0, 0, 0));
DFBCHECK(surface->GetSize(surface, &screen_width, &screen_height));
DFBCHECK(dfb->GetInputDevice(dfb, DIDID_KEYBOARD, &dfbKeyboard));
DFBCHECK(dfbKeyboard->CreateEventBuffer(dfbKeyboard, &dfbEventBuffer));
DFBCHECK(dfb->GetInputDevice(dfb, DIDID_MOUSE, &dfbMouse));
DFBCHECK(dfbMouse->AttachEventBuffer(dfbMouse, dfbEventBuffer));
if (useFixedVideoMode)
{
printf("Information: setting video mode to %ux%ux%u\n", fixedVideoMode.width,
fixedVideoMode.height, fixedVideoMode.bpp);
DFBCHECK(dfb->SetVideoMode(dfb, fixedVideoMode.width,
fixedVideoMode.height, fixedVideoMode.bpp));
} else
{
printf("Information: starting with default video mode %ux%ux%u\n",
videoModes[initialVideoMode].width, videoModes[initialVideoMode].height,
videoModes[initialVideoMode].bpp);
DFBCHECK(dfb->SetVideoMode(dfb, videoModes[initialVideoMode].width,
videoModes[initialVideoMode].height,
videoModes[initialVideoMode].bpp));
}
// register our framebuffer
frameBuffer = new VBoxDirectFB(dfb, surface);
display->SetFramebuffer(0, frameBuffer);
/**
* Start the VM execution thread
*/
console->PowerUp(NULL);
console->GetKeyboard(getter_AddRefs(keyboard));
console->GetMouse(getter_AddRefs(mouse));
/**
* Main event loop
*/
#define MAX_KEYEVENTS 10
PRInt32 keyEvents[MAX_KEYEVENTS];
int numKeyEvents;
while (!quit)
{