本文整理汇总了C++中SDL_DFB_WINDOWDATA函数的典型用法代码示例。如果您正苦于以下问题:C++ SDL_DFB_WINDOWDATA函数的具体用法?C++ SDL_DFB_WINDOWDATA怎么用?C++ SDL_DFB_WINDOWDATA使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SDL_DFB_WINDOWDATA函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DirectFB_GL_CreateContext
SDL_GLContext
DirectFB_GL_CreateContext(_THIS, SDL_Window * window)
{
//SDL_DFB_DEVICEDATA(_this);
SDL_DFB_WINDOWDATA(window);
DirectFB_GLContext *context;
SDL_DFB_ALLOC_CLEAR(context, sizeof(DirectFB_GLContext));
SDL_DFB_CHECKERR(windata->surface->GetGL(windata->surface,
&context->context));
if (!context->context)
return NULL;
context->is_locked = 0;
context->sdl_window = window;
context->next = _this->gl_data->firstgl;
_this->gl_data->firstgl = context;
SDL_DFB_CHECK(context->context->Unlock(context->context));
if (DirectFB_GL_MakeCurrent(_this, window, context) < 0) {
DirectFB_GL_DeleteContext(_this, context);
return NULL;
}
return context;
error:
return NULL;
}
示例2: DirectFB_RestoreWindow
void
DirectFB_RestoreWindow(_THIS, SDL_Window * window)
{
SDL_DFB_WINDOWDATA(window);
DFBWindowOptions wopts;
/* Set Options */
SDL_DFB_CHECK(windata->dfbwin->GetOptions(windata->dfbwin, &wopts));
wopts &= ~(DWOP_KEEP_SIZE | DWOP_KEEP_POSITION);
SDL_DFB_CHECK(windata->dfbwin->SetOptions(windata->dfbwin, wopts));
/* Window layout */
DirectFB_WM_AdjustWindowLayout(window, window->flags & ~(SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED),
windata->restore.w, windata->restore.h);
SDL_DFB_CHECK(windata->dfbwin->Resize(windata->dfbwin, windata->restore.w,
windata->restore.h));
SDL_DFB_CHECK(windata->dfbwin->MoveTo(windata->dfbwin, windata->restore.x,
windata->restore.y));
if (!(window->flags & SDL_WINDOW_RESIZABLE))
wopts |= DWOP_KEEP_SIZE;
if (window->flags & SDL_WINDOW_FULLSCREEN)
wopts |= DWOP_KEEP_POSITION | DWOP_KEEP_SIZE;
SDL_DFB_CHECK(windata->dfbwin->SetOptions(windata->dfbwin, wopts));
}
示例3: DirectFB_HideWindow
void
DirectFB_HideWindow(_THIS, SDL_Window * window)
{
SDL_DFB_WINDOWDATA(window);
windata->window->GetOpacity(windata->window, &windata->opacity);
windata->window->SetOpacity(windata->window, 0);
}
示例4: DirectFB_ShowWindow
void
DirectFB_ShowWindow(_THIS, SDL_Window * window)
{
SDL_DFB_WINDOWDATA(window);
windata->window->SetOpacity(windata->window, windata->opacity);
}
示例5: DirectFB_HideWindow
void
DirectFB_HideWindow(_THIS, SDL_Window * window)
{
SDL_DFB_WINDOWDATA(window);
SDL_DFB_CHECK(windata->dfbwin->GetOpacity(windata->dfbwin, &windata->opacity));
SDL_DFB_CHECK(windata->dfbwin->SetOpacity(windata->dfbwin, 0));
}
示例6: DirectFB_RaiseWindow
void
DirectFB_RaiseWindow(_THIS, SDL_Window * window)
{
SDL_DFB_WINDOWDATA(window);
SDL_DFB_CHECK(windata->dfbwin->RaiseToTop(windata->dfbwin));
SDL_DFB_CHECK(windata->dfbwin->RequestFocus(windata->dfbwin));
}
示例7: DirectFB_RaiseWindow
void
DirectFB_RaiseWindow(_THIS, SDL_Window * window)
{
SDL_DFB_WINDOWDATA(window);
windata->window->RaiseToTop(windata->window);
windata->window->RequestFocus(windata->window);
}
示例8: DirectFB_RestoreWindow
void
DirectFB_RestoreWindow(_THIS, SDL_Window * window)
{
SDL_DFB_WINDOWDATA(window);
if (windata->is_managed) {
DirectFB_WM_RestoreWindow(_this, window);
} else
SDL_Unsupported();
}
示例9: DirectFB_SetWindowTitle
void
DirectFB_SetWindowTitle(_THIS, SDL_Window * window)
{
SDL_DFB_WINDOWDATA(window);
if (windata->is_managed) {
windata->wm_needs_redraw = 1;
} else
SDL_Unsupported();
}
示例10: DirectFB_ActivateRenderer
static void
DirectFB_ActivateRenderer(SDL_Renderer * renderer)
{
SDL_DFB_RENDERERDATA(renderer);
SDL_Window *window = renderer->window;
SDL_DFB_WINDOWDATA(window);
if (renddata->size_changed /* || windata->wm_needs_redraw */) {
renddata->size_changed = SDL_FALSE;
}
}
示例11: DirectFB_SetWindowOpacity
int
DirectFB_SetWindowOpacity(_THIS, SDL_Window * window, float opacity)
{
const Uint8 alpha = (Uint8) ((unsigned int) (opacity * 255.0f));
SDL_DFB_WINDOWDATA(window);
SDL_DFB_CHECKERR(windata->dfbwin->SetOpacity(windata->dfbwin, alpha));
windata->opacity = alpha;
return 0;
error:
return -1;
}
示例12: DirectFB_AdjustWindowSurface
void
DirectFB_AdjustWindowSurface(SDL_Window * window)
{
SDL_DFB_WINDOWDATA(window);
int adjust = windata->wm_needs_redraw;
int cw, ch;
DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h);
SDL_DFB_CHECKERR(windata->
window_surface->GetSize(windata->window_surface, &cw,
&ch));
if (cw != windata->size.w || ch != windata->size.h) {
adjust = 1;
}
if (adjust) {
#if SDL_DIRECTFB_OPENGL
DirectFB_GL_FreeWindowContexts(SDL_GetVideoDevice(), window);
#endif
#if (DFB_VERSION_ATLEAST(1,2,1))
SDL_DFB_CHECKERR(windata->dfbwin->ResizeSurface(windata->dfbwin,
windata->size.w,
windata->size.h));
SDL_DFB_CHECKERR(windata->surface->MakeSubSurface(windata->surface,
windata->
window_surface,
&windata->client));
#else
DFBWindowOptions opts;
SDL_DFB_CHECKERR(windata->dfbwin->GetOptions(windata->dfbwin, &opts));
/* recreate subsurface */
SDL_DFB_RELEASE(windata->surface);
if (opts & DWOP_SCALE)
SDL_DFB_CHECKERR(windata->dfbwin->ResizeSurface(windata->dfbwin,
windata->size.w,
windata->size.h));
SDL_DFB_CHECKERR(windata->window_surface->
GetSubSurface(windata->window_surface,
&windata->client, &windata->surface));
#endif
DirectFB_WM_RedrawLayout(SDL_GetVideoDevice(), window);
#if SDL_DIRECTFB_OPENGL
DirectFB_GL_ReAllocWindowContexts(SDL_GetVideoDevice(), window);
#endif
}
error:
return;
}
示例13: DirectFB_SetWindowPosition
void
DirectFB_SetWindowPosition(_THIS, SDL_Window * window)
{
SDL_DFB_WINDOWDATA(window);
int x, y;
x = window->x;
y = window->y;
DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h);
SDL_DFB_CHECK(windata->dfbwin->MoveTo(windata->dfbwin, x, y));
}
示例14: DirectFB_ActivateRenderer
static int
DirectFB_ActivateRenderer(SDL_Renderer * renderer)
{
SDL_DFB_RENDERERDATA(renderer);
SDL_Window *window = SDL_GetWindowFromID(renderer->window);
SDL_DFB_WINDOWDATA(window);
if (renddata->size_changed || windata->wm_needs_redraw) {
DirectFB_AdjustWindowSurface(window);
}
return 0;
}
示例15: DirectFB_SetWindowIcon
void
DirectFB_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
{
SDL_DFB_DEVICEDATA(_this);
SDL_DFB_WINDOWDATA(window);
SDL_Surface *surface = NULL;
DFBResult ret;
if (icon) {
SDL_PixelFormat format;
DFBSurfaceDescription dsc;
Uint32 *dest;
Uint32 *p;
int pitch, i;
/* Convert the icon to ARGB for modern window managers */
SDL_InitFormat(&format, 32, 0x00FF0000, 0x0000FF00, 0x000000FF,
0xFF000000);
surface = SDL_ConvertSurface(icon, &format, 0);
if (!surface) {
return;
}
dsc.flags =
DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_CAPS;
dsc.caps = DSCAPS_VIDEOONLY;
dsc.width = surface->w;
dsc.height = surface->h;
dsc.pixelformat = DSPF_ARGB;
SDL_DFB_CHECKERR(devdata->dfb->CreateSurface(devdata->dfb, &dsc,
&windata->icon));
SDL_DFB_CHECKERR(windata->icon->Lock(windata->icon, DSLF_WRITE,
(void *) &dest, &pitch));
p = surface->pixels;
for (i = 0; i < surface->h; i++)
memcpy((char *) dest + i * pitch,
(char *) p + i * surface->pitch, 4 * surface->w);
windata->icon->Unlock(windata->icon);
SDL_FreeSurface(surface);
} else {
SDL_DFB_RELEASE(windata->icon);
}
return;
error:
if (surface)
SDL_FreeSurface(surface);
SDL_DFB_RELEASE(windata->icon);
return;
}