本文整理汇总了C++中SDL_VideoData::fbCreateWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ SDL_VideoData::fbCreateWindow方法的具体用法?C++ SDL_VideoData::fbCreateWindow怎么用?C++ SDL_VideoData::fbCreateWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SDL_VideoData
的用法示例。
在下文中一共展示了SDL_VideoData::fbCreateWindow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SDL_OutOfMemory
int
VIVANTE_CreateWindow(_THIS, SDL_Window * window)
{
SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
SDL_DisplayData *displaydata;
SDL_WindowData *data;
displaydata = SDL_GetDisplayDriverData(0);
/* Allocate window internal data */
data = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData));
if (data == NULL) {
return SDL_OutOfMemory();
}
/* Setup driver data for this window */
window->driverdata = data;
#if SDL_VIDEO_DRIVER_VIVANTE_VDK
data->native_window = vdkCreateWindow(displaydata->native_display, window->x, window->y, window->w, window->h);
#else
data->native_window = videodata->fbCreateWindow(displaydata->native_display, window->x, window->y, window->w, window->h);
#endif
if (!data->native_window) {
return SDL_SetError("VIVANTE: Can't create native window");
}
#if SDL_VIDEO_OPENGL_EGL
if (window->flags & SDL_WINDOW_OPENGL) {
data->egl_surface = SDL_EGL_CreateSurface(_this, data->native_window);
if (data->egl_surface == EGL_NO_SURFACE) {
return SDL_SetError("VIVANTE: Can't create EGL surface");
}
} else {
data->egl_surface = EGL_NO_SURFACE;
}
#endif
/* Window has been successfully created */
return 0;
}