⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qgl.cpp

📁 奇趣公司比较新的qt/emd版本
💻 CPP
📖 第 1 页 / 共 5 页
字号:
    \sa setAlpha(), setAlphaBufferSize()*//*!    If \a enable is true enables the alpha buffer; otherwise disables    the alpha buffer.    The alpha buffer is disabled by default.    The alpha buffer is typically used for implementing transparency    or translucency. The A in RGBA specifies the transparency of a    pixel.    \sa alpha(), setAlphaBufferSize()*/void QGLFormat::setAlpha(bool enable){    setOption(enable ? QGL::AlphaChannel : QGL::NoAlphaChannel);}/*!    \fn bool QGLFormat::accum() const    Returns true if the accumulation buffer is enabled; otherwise    returns false. The accumulation buffer is disabled by default.    \sa setAccum(), setAccumBufferSize()*//*!    If \a enable is true enables the accumulation buffer; otherwise    disables the accumulation buffer.    The accumulation buffer is disabled by default.    The accumulation buffer is used to create blur effects and    multiple exposures.    \sa accum(), setAccumBufferSize()*/void QGLFormat::setAccum(bool enable){    setOption(enable ? QGL::AccumBuffer : QGL::NoAccumBuffer);}/*!    \fn bool QGLFormat::stencil() const    Returns true if the stencil buffer is enabled; otherwise returns    false. The stencil buffer is disabled by default.    \sa setStencil(), setStencilBufferSize()*//*!    If \a enable is true enables the stencil buffer; otherwise    disables the stencil buffer.    The stencil buffer is disabled by default.    The stencil buffer masks certain parts of the drawing area so that    masked parts are not drawn on.    \sa stencil(), setStencilBufferSize()*/void QGLFormat::setStencil(bool enable){    setOption(enable ? QGL::StencilBuffer: QGL::NoStencilBuffer);}/*!    \fn bool QGLFormat::stereo() const    Returns true if stereo buffering is enabled; otherwise returns    false. Stereo buffering is disabled by default.    \sa setStereo()*//*!    If \a enable is true enables stereo buffering; otherwise disables    stereo buffering.    Stereo buffering is disabled by default.    Stereo buffering provides extra color buffers to generate left-eye    and right-eye images.    \sa stereo()*/void QGLFormat::setStereo(bool enable){    setOption(enable ? QGL::StereoBuffers : QGL::NoStereoBuffers);}/*!    \fn bool QGLFormat::directRendering() const    Returns true if direct rendering is enabled; otherwise returns    false.    Direct rendering is enabled by default.    \sa setDirectRendering()*//*!    If \a enable is true enables direct rendering; otherwise disables    direct rendering.    Direct rendering is enabled by default.    Enabling this option will make OpenGL bypass the underlying window    system and render directly from hardware to the screen, if this is    supported by the system.    \sa directRendering()*/void QGLFormat::setDirectRendering(bool enable){    setOption(enable ? QGL::DirectRendering : QGL::IndirectRendering);}/*!    \fn bool QGLFormat::sampleBuffers() const    Returns true if multisample buffer support is enabled; otherwise    returns false.    The multisample buffer is disabled by default.    \sa setSampleBuffers()*//*!    If \a enable is true, a GL context with multisample buffer support    is picked; otherwise ignored.    \sa sampleBuffers(), setSamples(), samples()*/void QGLFormat::setSampleBuffers(bool enable){    setOption(enable ? QGL::SampleBuffers : QGL::NoSampleBuffers);}/*!    Returns the number of samples per pixel when multisampling is    enabled. By default, the highest number of samples that is    available is used.    \sa setSampleBuffers(), sampleBuffers(), setSamples()*/int QGLFormat::samples() const{   return d->numSamples;}/*!    Set the preferred number of samples per pixel when multisampling    is enabled to \a numSamples. By default, the highest number of    samples available is used.    \sa setSampleBuffers(), sampleBuffers(), samples()*/void QGLFormat::setSamples(int numSamples){    if (numSamples < 0) {        qWarning("QGLFormat::setSamples: Cannot have negative number of samples per pixel %d", numSamples);        return;    }    d->numSamples = numSamples;}/*!    \since 4.2    Set the preferred swap interval. This can be used to sync the GL    drawing into a system window to the vertical refresh of the screen.    Setting an \a interval value of 0 will turn the vertical refresh syncing    off, any value higher than 0 will turn the vertical syncing on.    Under Windows, where the \c{WGL_EXT_swap_control} extension is    used, the \a interval parameter can be used to set the minimum    number of video frames that are displayed before a buffer swap    will occur. In effect, setting the \a interval to 10, means there    will be 10 vertical retraces between every buffer swap.    Note that setting the swap interval is only supported under    Windows and on Mac OS X. Under Windows the    \c{WGL_EXT_swap_control} extension has to be present.*/void QGLFormat::setSwapInterval(int interval){    d->swapInterval = interval;}/*!    \since 4.2    Returns the currently set swap interval. -1 is returned if setting    the swap interval isn't supported in the system GL implementation    (e.g. under X11).*/int QGLFormat::swapInterval() const{    return d->swapInterval;}/*!    \fn bool QGLFormat::hasOverlay() const    Returns true if overlay plane is enabled; otherwise returns false.    Overlay is disabled by default.    \sa setOverlay()*//*!    If \a enable is true enables an overlay plane; otherwise disables    the overlay plane.    Enabling the overlay plane will cause QGLWidget to create an    additional context in an overlay plane. See the QGLWidget    documentation for further information.    \sa hasOverlay()*/void QGLFormat::setOverlay(bool enable){    setOption(enable ? QGL::HasOverlay : QGL::NoOverlay);}/*!    Returns the plane of this format. The default for normal formats    is 0, which means the normal plane. The default for overlay    formats is 1, which is the first overlay plane.    \sa setPlane()*/int QGLFormat::plane() const{    return d->pln;}/*!    Sets the requested plane to \a plane. 0 is the normal plane, 1 is    the first overlay plane, 2 is the second overlay plane, etc.; -1,    -2, etc. are underlay planes.    Note that in contrast to other format specifications, the plane    specifications will be matched exactly. This means that if you    specify a plane that the underlying OpenGL system cannot provide,    an \link QGLWidget::isValid() invalid\endlink QGLWidget will be    created.    \sa plane()*/void QGLFormat::setPlane(int plane){    d->pln = plane;}/*!    Sets the format option to \a opt.    \sa testOption()*/void QGLFormat::setOption(QGL::FormatOptions opt){    if (opt & 0xffff)        d->opts |= opt;    else       d->opts &= ~(opt >> 16);}/*!    Returns true if format option \a opt is set; otherwise returns false.    \sa setOption()*/bool QGLFormat::testOption(QGL::FormatOptions opt) const{    if (opt & 0xffff)       return (d->opts & opt) != 0;    else       return (d->opts & (opt >> 16)) == 0;}/*!    Set the preferred depth buffer size to \a size.    \sa depthBufferSize(), setDepth(), depth()*/void QGLFormat::setDepthBufferSize(int size){    if (size < 0) {        qWarning("QGLFormat::setDepthBufferSize: Cannot set negative depth buffer size %d", size);        return;    }    d->depthSize = size;}/*!    Returns the depth buffer size.    \sa depth(), setDepth(), setDepthBufferSize()*/int QGLFormat::depthBufferSize() const{   return d->depthSize;}/*!    \since 4.2    Set the preferred red buffer size to \a size.    \sa setGreenBufferSize(), setBlueBufferSize(), setAlphaBufferSize()*/void QGLFormat::setRedBufferSize(int size){    if (size < 0) {        qWarning("QGLFormat::setRedBufferSize: Cannot set negative red buffer size %d", size);        return;    }    d->redSize = size;}/*!    \since 4.2    Returns the red buffer size.    \sa setRedBufferSize()*/int QGLFormat::redBufferSize() const{   return d->redSize;}/*!    \since 4.2    Set the preferred green buffer size to \a size.    \sa setRedBufferSize(), setBlueBufferSize(), setAlphaBufferSize()*/void QGLFormat::setGreenBufferSize(int size){    if (size < 0) {        qWarning("QGLFormat::setGreenBufferSize: Cannot set negative green buffer size %d", size);        return;    }    d->greenSize = size;}/*!    \since 4.2    Returns the green buffer size.    \sa setGreenBufferSize()*/int QGLFormat::greenBufferSize() const{   return d->greenSize;}/*!    \since 4.2    Set the preferred blue buffer size to \a size.    \sa setRedBufferSize(), setGreenBufferSize(), setAlphaBufferSize()*/void QGLFormat::setBlueBufferSize(int size){    if (size < 0) {        qWarning("QGLFormat::setBlueBufferSize: Cannot set negative blue buffer size %d", size);        return;    }    d->blueSize = size;}/*!    \since 4.2    Returns the blue buffer size.    \sa setBlueBufferSize()*/int QGLFormat::blueBufferSize() const{   return d->blueSize;}/*!    Set the preferred alpha buffer size to \a size.    This function implicitly enables the alpha channel.    \sa setRedBufferSize(), setGreenBufferSize(), alphaBufferSize()*/void QGLFormat::setAlphaBufferSize(int size){    if (size < 0) {        qWarning("QGLFormat::setAlphaBufferSize: Cannot set negative alpha buffer size %d", size);        return;    }    d->alphaSize = size;    setOption(QGL::AlphaChannel);}/*!    Returns the alpha buffer size.    \sa alpha(), setAlpha(), setAlphaBufferSize()*/int QGLFormat::alphaBufferSize() const{   return d->alphaSize;}/*!    Set the preferred accumulation buffer size, where \a size is the    bit depth for each RGBA component.    \sa accum(), setAccum(), accumBufferSize()*/void QGLFormat::setAccumBufferSize(int size){    if (size < 0) {        qWarning("QGLFormat::setAccumBufferSize: Cannot set negative accumulate buffer size %d", size);        return;    }    d->accumSize = size;}/*!    Returns the accumulation buffer size.    \sa setAccumBufferSize(), accum(), setAccum()*/int QGLFormat::accumBufferSize() const{   return d->accumSize;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -