本文整理汇总了C++中SDL_VideoData::fbGetDisplayInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ SDL_VideoData::fbGetDisplayInfo方法的具体用法?C++ SDL_VideoData::fbGetDisplayInfo怎么用?C++ SDL_VideoData::fbGetDisplayInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SDL_VideoData
的用法示例。
在下文中一共展示了SDL_VideoData::fbGetDisplayInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SDL_OutOfMemory
static int
VIVANTE_AddVideoDisplays(_THIS)
{
SDL_VideoData *videodata = _this->driverdata;
SDL_VideoDisplay display;
SDL_DisplayMode current_mode;
SDL_DisplayData *data;
int pitch = 0, bpp = 0;
unsigned long pixels = 0;
data = (SDL_DisplayData *) SDL_calloc(1, sizeof(SDL_DisplayData));
if (data == NULL) {
return SDL_OutOfMemory();
}
SDL_zero(current_mode);
#if SDL_VIDEO_DRIVER_VIVANTE_VDK
data->native_display = vdkGetDisplay(videodata->vdk_private);
vdkGetDisplayInfo(data->native_display, ¤t_mode.w, ¤t_mode.h, &pixels, &pitch, &bpp);
#else
data->native_display = videodata->fbGetDisplayByIndex(0);
videodata->fbGetDisplayInfo(data->native_display, ¤t_mode.w, ¤t_mode.h, &pixels, &pitch, &bpp);
#endif /* SDL_VIDEO_DRIVER_VIVANTE_VDK */
switch (bpp)
{
default: /* Is another format used? */
case 32:
current_mode.format = SDL_PIXELFORMAT_ARGB8888;
break;
case 16:
current_mode.format = SDL_PIXELFORMAT_RGB565;
break;
}
/* FIXME: How do we query refresh rate? */
current_mode.refresh_rate = 60;
SDL_zero(display);
display.name = VIVANTE_GetDisplayName(_this);
display.desktop_mode = current_mode;
display.current_mode = current_mode;
display.driverdata = data;
SDL_AddVideoDisplay(&display);
return 0;
}