当前位置: 首页>>代码示例>>C++>>正文


C++ Display::getVisualInfo方法代码示例

本文整理汇总了C++中Display::getVisualInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ Display::getVisualInfo方法的具体用法?C++ Display::getVisualInfo怎么用?C++ Display::getVisualInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Display的用法示例。


在下文中一共展示了Display::getVisualInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DefaultRootWindow

Window::Window (Display& display, int width, int height, ::Visual* visual)
    : m_display		(display)
    , m_colormap	(None)
    , m_window		(None)
    , m_visible		(false)
{
    XSetWindowAttributes	swa;
    ::Display* const		dpy					= m_display.getXDisplay();
    ::Window				root				= DefaultRootWindow(dpy);
    unsigned long			mask				= CWBorderPixel | CWEventMask;

    // If redirect is enabled, window size can't be guaranteed and it is up to
    // the window manager to decide whether to honor sizing requests. However,
    // overriding that causes window to appear as an overlay, which causes
    // other issues, so this is disabled by default.
    const bool				overrideRedirect	= false;

    if (overrideRedirect)
    {
        mask |= CWOverrideRedirect;
        swa.override_redirect = true;
    }

    if (visual == DE_NULL)
        visual = CopyFromParent;
    else
    {
        XVisualInfo	info	= XVisualInfo();
        bool		succ	= display.getVisualInfo(XVisualIDFromVisual(visual), info);

        TCU_CHECK_INTERNAL(succ);

        root				= RootWindow(dpy, info.screen);
        m_colormap			= XCreateColormap(dpy, root, visual, AllocNone);
        swa.colormap		= m_colormap;
        mask |= CWColormap;
    }

    swa.border_pixel	= 0;
    swa.event_mask		= ExposureMask|KeyPressMask|KeyReleaseMask|StructureNotifyMask;

    if (width == glu::RenderConfig::DONT_CARE)
        width = DEFAULT_WINDOW_WIDTH;
    if (height == glu::RenderConfig::DONT_CARE)
        height = DEFAULT_WINDOW_HEIGHT;

    m_window = XCreateWindow(dpy, root, 0, 0, width, height, 0,
                             CopyFromParent, InputOutput, visual, mask, &swa);
    TCU_CHECK(m_window);

    Atom deleteAtom = m_display.getDeleteAtom();
    XSetWMProtocols(dpy, m_window, &deleteAtom, 1);
}
开发者ID:crucible,项目名称:deqp,代码行数:53,代码来源:tcuX11.cpp

示例2: DefaultRootWindow

Window::Window (Display& display, int width, int height, ::Visual* visual)
    : m_display		(display)
    , m_colormap	(None)
    , m_window		(None)
    , m_visible		(false)
{
    XSetWindowAttributes	swa;
    ::Display*				dpy	= m_display.getXDisplay();
    ::Window				root = DefaultRootWindow(dpy);
    unsigned long			mask = CWBorderPixel | CWEventMask;

    if (visual == DE_NULL)
        visual = CopyFromParent;
    else
    {
        XVisualInfo	info	= XVisualInfo();
        bool		succ	= display.getVisualInfo(XVisualIDFromVisual(visual), info);

        TCU_CHECK_INTERNAL(succ);

        root				= RootWindow(dpy, info.screen);
        m_colormap			= XCreateColormap(dpy, root, visual, AllocNone);
        swa.colormap		= m_colormap;
        mask |= CWColormap;
    }

    swa.border_pixel	= 0;
    swa.event_mask		= ExposureMask|KeyPressMask|KeyReleaseMask|StructureNotifyMask;

    mask |= CWOverrideRedirect;
    swa.override_redirect = true;

    if (width == glu::RenderConfig::DONT_CARE)
        width = DEFAULT_WINDOW_WIDTH;
    if (height == glu::RenderConfig::DONT_CARE)
        height = DEFAULT_WINDOW_HEIGHT;

    m_window = XCreateWindow(dpy, root, 0, 0, width, height, 0,
                             CopyFromParent, InputOutput, visual, mask, &swa);
    TCU_CHECK(m_window);

    Atom deleteAtom = m_display.getDeleteAtom();
    XSetWMProtocols(dpy, m_window, &deleteAtom, 1);

}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_deqp,代码行数:45,代码来源:tcuX11.cpp


注:本文中的Display::getVisualInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。