本文整理汇总了C++中doneCurrent函数的典型用法代码示例。如果您正苦于以下问题:C++ doneCurrent函数的具体用法?C++ doneCurrent怎么用?C++ doneCurrent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了doneCurrent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例2: makeCurrent
QFFmpegGLWidget::~QFFmpegGLWidget()
{
// And now release all OpenGL resources.
makeCurrent();
doneCurrent();
}
示例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());
}
示例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();
}
示例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;
}
示例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);
}
示例7: doneCurrent
Context::~Context()
{
doneCurrent();
wglDeleteContext(mHGLRC);
delete mHiddenWindow;
}
示例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;
}
示例9: doneCurrent
/*!
If this is the current context for the thread, doneCurrent is called
*/
QPlatformGLContext::~QPlatformGLContext()
{
if (QPlatformGLContext::currentContext() == this) {
doneCurrent();
}
}
示例10: makeCurrent
Scene::~Scene()
{
makeCurrent(); // тут используется текущий контекст системы, т.к. QOpenGLWidget::currentContext() уже нет
delete m_triangle;
delete spherepoints;
doneCurrent();
}
示例11: makeCurrent
void CompasWidget::cleanup(){
makeCurrent();
m_logoVbo.destroy();
delete m_program;
m_program = 0;
doneCurrent();
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}