Exemplo n.º 1
0
PvrQwsDrawable *pvrQwsCreatePixmap(int width, int height, int screen)
{
    PvrQwsDrawable *drawable;

    if (!pvrQwsEnsureScreen(screen))
        return 0;

    drawable = (PvrQwsDrawable *)calloc(1, sizeof(PvrQwsDrawable));
    if (!drawable)
        return 0;

    drawable->type = PvrQwsPixmap;
    drawable->screen = screen;
    drawable->pixelFormat = pvrQwsDisplay.screens[screen].pixelFormat;
    drawable->rect.x = 0;
    drawable->rect.y = 0;
    drawable->rect.width = width;
    drawable->rect.height = height;

    if (!pvrQwsAddDrawable()) {
        free(drawable);
        return 0;
    }

    return drawable;
}
Exemplo n.º 2
0
PvrQwsDrawable *pvrQwsScreenWindow(int screen)
{
    PvrQwsDrawable *drawable;

    if (!pvrQwsEnsureScreen(screen))
        return 0;

    drawable = pvrQwsDisplay.screens[screen].screenDrawable;
    if (drawable)
        return drawable;

    drawable = (PvrQwsDrawable *)calloc(1, sizeof(PvrQwsDrawable));
    if (!drawable)
        return 0;

    drawable->type = PvrQwsScreen;
    drawable->screen = screen;
    drawable->pixelFormat = pvrQwsDisplay.screens[screen].pixelFormat;
    drawable->rect = pvrQwsDisplay.screens[screen].screenRect;
    drawable->visibleRects[0] = drawable->rect;
    drawable->numVisibleRects = 1;
    drawable->isFullScreen = 1;

    if (!pvrQwsAddDrawable()) {
        free(drawable);
        return 0;
    }

    pvrQwsDisplay.screens[screen].screenDrawable = drawable;

    return drawable;
}
Exemplo n.º 3
0
PvrQwsDrawable *pvrQwsCreateWindow(int screen, long winId, const PvrQwsRect *rect)
{
    PvrQwsDrawable *drawable;

    if (!pvrQwsEnsureScreen(screen))
        return 0;

    drawable = (PvrQwsDrawable *)calloc(1, sizeof(PvrQwsDrawable));
    if (!drawable)
        return 0;

    drawable->type = PvrQwsWindow;
    drawable->winId = winId;
    drawable->refCount = 1;
    drawable->screen = screen;
    drawable->pixelFormat = pvrQwsDisplay.screens[screen].pixelFormat;
    drawable->rect = *rect;

    if (!pvrQwsAddDrawable()) {
        free(drawable);
        return 0;
    }

    drawable->nextWinId = pvrQwsDisplay.firstWinId;
    pvrQwsDisplay.firstWinId = drawable;

    return drawable;
}
Exemplo n.º 4
0
PvrQwsDrawable *pvrQwsCreateWindow(int screen, long winId, const PvrQwsRect *rect)
{
#ifdef QT_WEBOS
	printf("Creating a native EGL window\n");
#endif // QT_WEBOS
    PvrQwsDrawable *drawable;

    if (!pvrQwsEnsureScreen(screen))
        return 0;

    drawable = (PvrQwsDrawable *)calloc(1, sizeof(PvrQwsDrawable));
    if (!drawable)
        return 0;

    drawable->type = PvrQwsWindow;
    drawable->winId = winId;
    drawable->refCount = 1;
    drawable->screen = screen;
    drawable->pixelFormat = pvrQwsDisplay.screens[screen].pixelFormat;
    drawable->rect = *rect;
#ifdef QT_WEBOS 
    drawable->isFullScreen = 1;
#endif // QT_WEBOS

    if (!pvrQwsAddDrawable()) {
        free(drawable);
        return 0;
    }

    drawable->nextWinId = pvrQwsDisplay.firstWinId;
    pvrQwsDisplay.firstWinId = drawable;

    return drawable;
}