• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ doneCurrent函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中doneCurrent函数的典型用法代码示例。如果您正苦于以下问题:C++ doneCurrent函数的具体用法?C++ doneCurrent怎么用?C++ doneCurrent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: makeCurrent

void MythRenderOpenGL1::EnableShaderObject(uint obj)
{
    if ((!obj && !m_active_prog) ||
        (obj && (obj == m_active_prog)))
        return;

    makeCurrent();

    if (!obj && m_active_prog)
    {
        glDisable(GL_FRAGMENT_PROGRAM_ARB);
        m_active_prog = 0;
        doneCurrent();
        return;
    }

    if (!m_programs.contains(obj))
        return;

    if (!m_active_prog)
        glEnable(GL_FRAGMENT_PROGRAM_ARB);

    if (obj != m_active_prog)
    {
        m_glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, obj);
        m_active_prog = obj;
    }

    doneCurrent();
}
开发者ID:mdda,项目名称:mythtv,代码行数:30,代码来源:mythrender_opengl1.cpp


示例2: makeCurrent

QFFmpegGLWidget::~QFFmpegGLWidget()
{
    // And now release all OpenGL resources.
    makeCurrent();

    doneCurrent();
}
开发者ID:shujaatak,项目名称:QFFmpeg,代码行数:7,代码来源:QFFmpegGLWidget.cpp


示例3: Q_XCB_NOOP

void QGLXContext::swapBuffers()
{
    Q_XCB_NOOP(m_screen->connection());
    glXSwapBuffers(DISPLAY_FROM_XCB(m_screen), m_drawable);
    doneCurrent();
    Q_XCB_NOOP(m_screen->connection());
}
开发者ID:Blizzard,项目名称:qt4,代码行数:7,代码来源:qglxintegration.cpp


示例4: makeCurrent

void POIsImageWidget::paintEvent(QPaintEvent *paintEvent) {

	//--- Make this widget the current context for OpenGL drawing
	makeCurrent();

	//Save current state, QPainter modifies MODELVIEW matrix.
	glMatrixMode(GL_MODELVIEW);
	glPushMatrix();

	setupViewPort(width(), height());

	glClear(GL_COLOR_BUFFER_BIT| GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();

	drawBackgroundImage();

	//Restore state after drawing pure openGL
	glMatrixMode(GL_MODELVIEW);
	glPopMatrix();

	QPainter painter;
	painter.begin(this);
	drawPOIs(&painter);
	painter.end();

	//--- Set OpenGL drawing context to no area
	doneCurrent();

}
开发者ID:M-Samoht,项目名称:OpenMocap,代码行数:29,代码来源:POIsImageWidget.cpp


示例5: paintGL

/*!
    Returns the registered object that is under the mouse position
    specified by \a point.  This function may need to regenerate
    the contents of the pick buffer by repainting the scene
    with paintGL().

    \sa registerObject()
*/
QObject *QGLView::objectForPoint(const QPoint &point)
{
    // Check the window boundaries in case a mouse move has
    // moved the pointer outside the window.
    if (!rect().contains(point))
        return 0;

    // Do we need to refresh the pick buffer contents?
    QGLPainter painter(this);
    if (d->pickBufferForceUpdate) {
        // Initialize the painter, which will make the window context current.
        painter.setPicking(true);
        painter.clearPickObjects();

        // Create a framebuffer object as big as the window to act
        // as the pick buffer if we are single buffered.  If we are
        // double-buffered, then use the window back buffer.
        bool useBackBuffer = doubleBuffer();
        if (!useBackBuffer) {
            QSize fbosize = size();
            fbosize = QSize(powerOfTwo(fbosize.width()), powerOfTwo(fbosize.height()));
            if (!d->fbo) {
                d->fbo = new QGLFramebufferObject(fbosize, QGLFramebufferObject::CombinedDepthStencil);
            } else if (d->fbo->size() != fbosize) {
                delete d->fbo;
                d->fbo = new QGLFramebufferObject(fbosize, QGLFramebufferObject::CombinedDepthStencil);
            }
        }

        // Render the pick version of the scene into the framebuffer object.
        if (d->fbo)
            d->fbo->bind();
        painter.clear();
        painter.setEye(QGL::NoEye);
        painter.setCamera(d->camera);
        paintGL(&painter);
        painter.setPicking(false);

        // The pick buffer contents are now valid, unless we are using
        // the back buffer - we cannot rely upon it being valid next time.
        d->pickBufferForceUpdate = useBackBuffer;
        d->pickBufferMaybeInvalid = false;
    } else {
        // Bind the framebuffer object to the window's context.
        makeCurrent();
        if (d->fbo)
            d->fbo->bind();
    }

    // Pick the object under the mouse.
    int objectId = painter.pickObject(point.x(), height() - 1 - point.y());
    QObject *object = d->objects.value(objectId, 0);
    
    // Release the framebuffer object and return.
    painter.end();
    if (d->fbo)
        d->fbo->release();
    doneCurrent();
    return object;
}
开发者ID:slavablind91,项目名称:code,代码行数:68,代码来源:qglview.cpp


示例6: ContextSysBase

	Context::Context(Context *shared)
		: ContextSysBase()
	{
		assert( Context::current() == shared );

		mTarget = nullptr;
		mGLFormat = shared->mGLFormat;
		GPU::RenderTargetWin* previousSharedTarget = shared->mTarget;
		
		init();

		if ( shared->mGLFormat.versionMajor >= 3 )
		{
			initNewContext(shared->mHGLRC);
		}
		else
		{
			initOldContext();
			wglShareLists(shared->mHGLRC, mHGLRC);
		}

		shared->doneCurrent();

		makeCurrent();
		{
			GLenum wglewInitResult = wglewInit();
			GLenum glewInitResult = glewInit();
			assert(GLEW_OK == wglewInitResult && GLEW_OK == glewInitResult);
		}
		doneCurrent();

		shared->makeCurrent(previousSharedTarget);
	}
开发者ID:AaronMK,项目名称:Meega,代码行数:33,代码来源:Context.cpp


示例7: doneCurrent

	Context::~Context()
	{
		doneCurrent();
		wglDeleteContext(mHGLRC);

		delete mHiddenWindow;
	}
开发者ID:AaronMK,项目名称:Meega,代码行数:7,代码来源:Context.cpp


示例8: cleanupGL

GlxBackend::~GlxBackend()
{
    if (isFailed()) {
        m_overlayWindow->destroy();
    }
    // TODO: cleanup in error case
    // do cleanup after initBuffer()
    cleanupGL();
    doneCurrent();

    gs_tripleBufferUndetected = true;
    gs_tripleBufferNeedsDetection = false;

    if (ctx)
        glXDestroyContext(display(), ctx);

    if (glxWindow)
        glXDestroyWindow(display(), glxWindow);

    if (window)
        XDestroyWindow(display(), window);

    overlayWindow()->destroy();
    delete m_overlayWindow;
}
开发者ID:CyberShadow,项目名称:kwin,代码行数:25,代码来源:glxbackend.cpp


示例9: doneCurrent

/*!
  If this is the current context for the thread, doneCurrent is called
*/
QPlatformGLContext::~QPlatformGLContext()
{
    if (QPlatformGLContext::currentContext() == this) {
        doneCurrent();
    }

}
开发者ID:BGmot,项目名称:Qt,代码行数:10,代码来源:qplatformglcontext_qpa.cpp


示例10: makeCurrent

Scene::~Scene()
{
makeCurrent();      // тут используется текущий контекст системы, т.к. QOpenGLWidget::currentContext() уже нет
delete m_triangle;
    delete spherepoints;
doneCurrent();
}
开发者ID:paraschenkodn,项目名称:karta,代码行数:7,代码来源:scene.cpp


示例11: makeCurrent

void CompasWidget::cleanup(){
	makeCurrent();
	m_logoVbo.destroy();
	delete m_program;
	m_program = 0;
	doneCurrent();
}
开发者ID:mrdeveloperdude,项目名称:OctoMY,代码行数:7,代码来源:CompasWidget.cpp


示例12: QGLWidget

GLSubView::GLSubView(Session *sPtr, QWidget *parent) :
    QGLWidget(parent),
    sessionPtr(sPtr)
{
    makeCurrent();

    initializeOpenGLFunctions();

    glGenBuffers(1, &gratVBO);
    glGenBuffers(1, &gratBorderVBO);

    glBindBuffer(GL_ARRAY_BUFFER, gratVBO);
    glBufferData(GL_ARRAY_BUFFER, sizeof(linearInnerPoints),
                 linearInnerPoints, GL_DYNAMIC_DRAW);
    glBindBuffer(GL_ARRAY_BUFFER, gratBorderVBO);
    glBufferData(GL_ARRAY_BUFFER, sizeof(linearBorderPoints),
                 linearBorderPoints, GL_DYNAMIC_DRAW);

    innerGratPoints = linearInnerCount;
    borderGratPoints = linearBorderCount;

    doneCurrent();

    setAutoFillBackground(false);
}
开发者ID:hendorog,项目名称:BBApp,代码行数:25,代码来源:gl_sub_view.cpp


示例13: qGLContextDebug

bool QQnxGLContext::makeCurrent(QPlatformSurface *surface)
{
    qGLContextDebug() << Q_FUNC_INFO;

    Q_ASSERT(surface->surface()->surfaceType() == QSurface::OpenGLSurface);

    // Set current rendering API
    EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
    if (eglResult != EGL_TRUE)
        qFatal("QQnxGLContext: failed to set EGL API, err=%d", eglGetError());

    QQnxEglWindow *platformWindow = dynamic_cast<QQnxEglWindow*>(surface);
    if (!platformWindow)
        return false;

    platformWindow->setPlatformOpenGLContext(this);

    if (m_currentEglSurface == EGL_NO_SURFACE || m_currentEglSurface != platformWindow->getSurface()) {
        m_currentEglSurface = platformWindow->getSurface();
        doneCurrent();
    }

    eglResult = eglMakeCurrent(ms_eglDisplay, m_currentEglSurface, m_currentEglSurface, m_eglContext);
    if (eglResult != EGL_TRUE) {
        checkEGLError("eglMakeCurrent");
        qWarning("QQNX: failed to set current EGL context, err=%d", eglGetError());
        return false;
    }
    return (eglResult == EGL_TRUE);
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:30,代码来源:qqnxglcontext.cpp


示例14: makeCurrent

void
AGLViewer::getCurrentViewImageBuffer(size_t &aWidth, size_t &aHeight, boost::shared_array< uint8 > &aBuffer )
{
	makeCurrent();
	soglu::getImageBufferFromTexture(aWidth, aHeight, aBuffer, mFrameBufferObject.GetColorBuffer());	
	doneCurrent();
}
开发者ID:JanKolomaznik,项目名称:MedV4D,代码行数:7,代码来源:AGLViewer.cpp


示例15: makeCurrent

void ImageViewerPanel::updateTexture()
{
	makeCurrent();
	if (textures != nullptr)
	{
		switch (texType)
		{
		case DISPLAY_TYPE::BEAUTY:
			glTextureStorage2D(tex, 1, GL_RGBA32F, imgsize[0], imgsize[1]);
			glTextureSubImage2D(tex, 0, 0, 0, imgsize[0], imgsize[1], GL_RGBA, GL_FLOAT, textures);
			break;
		case DISPLAY_TYPE::P:
		case DISPLAY_TYPE::N:
		case DISPLAY_TYPE::DPDU:
		case DISPLAY_TYPE::DPDV:
			glTextureStorage2D(tex, 1, GL_RGB32F, imgsize[0], imgsize[1]);
			glTextureSubImage2D(tex, 0, 0, 0, imgsize[0], imgsize[1], GL_RGB, GL_FLOAT, textures);
			break;
		default:
			break;
		}
		
	}
	else
	{
		glTextureStorage2D(tex, 1, GL_RGBA32F, 0, 0);
		glTextureSubImage2D(tex, 0, 0, 0, 0, 0, GL_RGBA, GL_FLOAT, 0);
	}
	doneCurrent();
}
开发者ID:ShenyaoKe,项目名称:Kaguya,代码行数:30,代码来源:ImageViewer.cpp


示例16: QGLWidget

RendererWidget::RendererWidget(QWidget *parent) : QGLWidget(parent)

{
    setMinimumSize(100,100);
    setAutoBufferSwap(false);
    doneCurrent();
}
开发者ID:williamallas,项目名称:TIMEngine2,代码行数:7,代码来源:RendererWidget.cpp


示例17: Q_D

void QGLContext::reset()
{
    Q_D(QGLContext);
    if (!d->valid)
        return;
    d->cleanup();

    d->crWin = false;
    d->sharing = false;
    d->valid = false;
    d->transpColor = QColor();
    d->initDone = false;
    QGLContextGroup::removeShare(this);
    if (d->guiGlContext) {
        if (QOpenGLContext::currentContext() == d->guiGlContext)
            doneCurrent();
        if (d->ownContext) {
            if (d->guiGlContext->thread() == QThread::currentThread())
                delete d->guiGlContext;
            else
                d->guiGlContext->deleteLater();
        } else
            d->guiGlContext->setQGLContextHandle(0,0);
        d->guiGlContext = 0;
    }
    d->ownContext = false;
}
开发者ID:ghjinlei,项目名称:qt5,代码行数:27,代码来源:qgl_qpa.cpp


示例18: makeCurrent

MythRenderOpenGL2::~MythRenderOpenGL2()
{
    if (!isValid())
        return;
    makeCurrent();
    DeleteOpenGLResources();
    doneCurrent();
}
开发者ID:mdda,项目名称:mythtv,代码行数:8,代码来源:mythrender_opengl2.cpp


示例19: makeCurrent

void StreamViewer::bindStreamData(const unsigned char* data) {
	makeCurrent();
	glBindTexture(GL_TEXTURE_2D, textureId);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width(), height(),
                 0, GL_BGRA, GL_UNSIGNED_BYTE, (GLvoid*) data);
	update();
	doneCurrent();
}
开发者ID:jinghuaguo,项目名称:PrimeSenseTest,代码行数:8,代码来源:StreamViewer.cpp


示例20: makeCurrent

Visualizer::~Visualizer()
{
    arrayBuf.destroy();
       indexBuf.destroy();
       makeCurrent();
          delete texture;
          doneCurrent();
}
开发者ID:Zakhrov,项目名称:WebPhonon-Android-Audio-Edition,代码行数:8,代码来源:visualizer.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ done_testing函数代码示例发布时间:2022-05-30
下一篇:
C++ done函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap