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

C++ eglGetCurrentSurface函数代码示例

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

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



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

示例1: _glitz_egl_make_current

static void
_glitz_egl_make_current (void *abstract_drawable,
			 void *abstract_context)
{
    glitz_egl_context_t  *context = (glitz_egl_context_t *) abstract_context;
    glitz_egl_surface_t *drawable = (glitz_egl_surface_t *) abstract_drawable;
    glitz_egl_display_info_t *display_info =
	drawable->screen_info->display_info;

    if (drawable->base.width  != drawable->width ||
	drawable->base.height != drawable->height)
	_glitz_egl_drawable_update_size (drawable,
					 drawable->base.width,
					 drawable->base.height);

    if ((eglGetCurrentContext () != context->egl_context) ||
	(eglGetCurrentSurface ( EGL_READ ) != drawable->egl_surface))
    {
	if (display_info->thread_info->cctx)
	{
	    glitz_context_t *ctx = display_info->thread_info->cctx;

	    if (ctx->lose_current)
		ctx->lose_current (ctx->closure);
	}

	eglMakeCurrent (display_info->egl_display, drawable->egl_surface,
			drawable->egl_surface, context->egl_context);
    }

    display_info->thread_info->cctx = &context->base;
}
开发者ID:bonzini,项目名称:glitz,代码行数:32,代码来源:glitz_egl_context.c


示例2: jni_eglGetCurrentSurface

static jlong jni_eglGetCurrentSurface(JNIEnv *_env, jobject _this, jint readdraw) {
    if ((readdraw != EGL_READ) && (readdraw != EGL_DRAW)) {
        jniThrowException(_env, "java/lang/IllegalArgumentException", NULL);
        return 0;
    }
    return reinterpret_cast<jlong>(eglGetCurrentSurface(readdraw));
}
开发者ID:1477584437,项目名称:platform_frameworks_base,代码行数:7,代码来源:com_google_android_gles_jni_EGLImpl.cpp


示例3: Java_org_yabause_android_YabauseRunnable_initViewport

int Java_org_yabause_android_YabauseRunnable_initViewport()
{
   int error;
   char * buf;

   g_Display = eglGetCurrentDisplay();
   g_Surface = eglGetCurrentSurface(EGL_READ);
   g_Context = eglGetCurrentContext();

   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();
   glOrthof(0, 320, 224, 0, 1, 0);
   
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();

   glMatrixMode(GL_TEXTURE);
   glLoadIdentity();
   
   glDisable(GL_BLEND);
   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
   
   yprintf(glGetString(GL_VENDOR));
   yprintf(glGetString(GL_RENDERER));
   yprintf(glGetString(GL_VERSION));
   yprintf(glGetString(GL_EXTENSIONS));
   yprintf(eglQueryString(g_Display,EGL_EXTENSIONS));
   eglSwapInterval(g_Display,0);
   eglMakeCurrent(g_Display,EGL_NO_SURFACE,EGL_NO_SURFACE,EGL_NO_CONTEXT);
   return 0;
}
开发者ID:d356,项目名称:yabause-ci-test,代码行数:31,代码来源:yui.c


示例4: CopyBitmapL

void CEGLGraphicsInterface::CopyBitmapL(CFbsBitmap* aPixMap, CFbsBitmap* )
    {
    if (eglCopyBuffers(iEglDisplay, eglGetCurrentSurface(EGL_READ), aPixMap) == EGL_FALSE)
        {
        User::Leave(MapEGLErrorCodeToSymbian(eglGetError()));
        }
    aPixMap->SetDisplayMode(aPixMap->DisplayMode());
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:8,代码来源:eglgraphicsinterface.cpp


示例5: ASSERT

void EGLDisplayOpenVG::removeSurface(const EGLSurface& surface, bool destroySurface)
{
    ASSERT(surface != EGL_NO_SURFACE);

#if PLATFORM(OLYMPIA)
    if (destroySurface) {
        // Work around a bug in our EGL implementation where the VGImage
        // referenced by eglCreatePbufferFromClientBuffer is not released
        // when destroying the context, RIM Bug #1591.
        // The context that created the VGImage needs to be current for
        // it to be released.
        sharedPlatformSurface()->makeResourceCreationContextCurrent();
    } else
#endif
    if (eglGetCurrentSurface(EGL_DRAW) == surface) {
        eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
        ASSERT_EGL_NO_ERROR();
    }

    // Destroy the context associated to the surface, if we already created one.
    if (m_surfaceConfigIds.contains(surface)) {
        EGLint surfaceConfigId = m_surfaceConfigIds.take(surface); // take = get and remove
        bool isContextReferenced = false;

        if (m_compatibleConfigIds.contains(surfaceConfigId))
            surfaceConfigId = m_compatibleConfigIds.get(surfaceConfigId);

        HashMap<EGLSurface, EGLint>::iterator end = m_surfaceConfigIds.end();

        // ...but only if there's no other surfaces associated to that context.
        for (HashMap<EGLSurface, EGLint>::iterator it = m_surfaceConfigIds.begin(); it != end; ++it) {
            if ((*it).second == surfaceConfigId) {
                isContextReferenced = true;
                break;
            }
        }
        if (!isContextReferenced && m_contexts.contains(surfaceConfigId)) {
            EGLContext context = m_contexts.take(surfaceConfigId);
            eglDestroyContext(m_display, context);
            ASSERT_EGL_NO_ERROR();
        }
    }

    m_platformSurfaces.remove(surface);

    HashMap<EGLNativeWindowType, EGLSurface>::iterator end = m_windowSurfaces.end();
    for (HashMap<EGLNativeWindowType, EGLSurface>::iterator it = m_windowSurfaces.begin(); it != end; ++it) {
        if ((*it).second == surface) {
            m_windowSurfaces.remove(it);
            break;
        }
    }

    if (destroySurface) {
        eglDestroySurface(m_display, surface);
        ASSERT_EGL_NO_ERROR();
    }
}
开发者ID:azrul2202,项目名称:WebKit-Smartphone,代码行数:58,代码来源:EGLDisplayOpenVG.cpp


示例6: Q_ASSERT

bool QEGLPlatformContext::makeCurrent(QPlatformSurface *surface)
{
    Q_ASSERT(surface->surface()->supportsOpenGL());

    eglBindAPI(m_api);

    EGLSurface eglSurface = eglSurfaceForPlatformSurface(surface);

    if (eglSurface == EGL_NO_SURFACE)
        return false;

    // shortcut: on some GPUs, eglMakeCurrent is not a cheap operation
    if (eglGetCurrentContext() == m_eglContext &&
        eglGetCurrentDisplay() == m_eglDisplay &&
        eglGetCurrentSurface(EGL_READ) == eglSurface &&
        eglGetCurrentSurface(EGL_DRAW) == eglSurface) {
        return true;
    }

    const bool ok = eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_eglContext);
    if (ok) {
        if (!m_swapIntervalEnvChecked) {
            m_swapIntervalEnvChecked = true;
            if (qEnvironmentVariableIsSet("QT_QPA_EGLFS_SWAPINTERVAL")) {
                QByteArray swapIntervalString = qgetenv("QT_QPA_EGLFS_SWAPINTERVAL");
                bool intervalOk;
                const int swapInterval = swapIntervalString.toInt(&intervalOk);
                if (intervalOk)
                    m_swapIntervalFromEnv = swapInterval;
            }
        }
        const int requestedSwapInterval = m_swapIntervalFromEnv >= 0
            ? m_swapIntervalFromEnv
            : surface->format().swapInterval();
        if (requestedSwapInterval >= 0 && m_swapInterval != requestedSwapInterval) {
            m_swapInterval = requestedSwapInterval;
            if (eglSurface != EGL_NO_SURFACE) // skip if using surfaceless context
                eglSwapInterval(eglDisplay(), m_swapInterval);
        }
    } else {
        qWarning("QEGLPlatformContext: eglMakeCurrent failed: %x", eglGetError());
    }

    return ok;
}
开发者ID:Sagaragrawal,项目名称:2gisqt5android,代码行数:45,代码来源:qeglplatformcontext.cpp


示例7: eglGetCurrentSurface

/* EGLSurface eglGetCurrentSurface ( EGLint readdraw ) */
static jobject
android_eglGetCurrentSurface
  (JNIEnv *_env, jobject _this, jint readdraw) {
    EGLSurface _returnValue = (EGLSurface) 0;
    _returnValue = eglGetCurrentSurface(
        (EGLint)readdraw
    );
    return toEGLHandle(_env, eglsurfaceClass, eglsurfaceConstructor, _returnValue);
}
开发者ID:shashlik,项目名称:old-gentroid-frameworks-base,代码行数:10,代码来源:android_opengl_EGL14.cpp


示例8: evgl_eng_make_current

static int 
evgl_eng_make_current(void *data, void *surface, void *ctxt, int flush)
{
   Render_Engine *re;
   Outbuf *ob;
   EGLContext ctx;
   EGLSurface surf;
   int ret = 0;

   if (!(re = (Render_Engine *)data)) return 0;
   if (!(ob = eng_get_ob(re))) return 0;

   ctx = (EGLContext)ctxt;
   surf = (EGLSurface)surface;

   if ((!ctxt) && (!surface))
     {
        ret = 
          eglMakeCurrent(ob->egl_disp, EGL_NO_SURFACE, 
                         EGL_NO_SURFACE, EGL_NO_CONTEXT);
        if (!ret)
          {
             ERR("eglMakeCurrent Failed: %#x", eglGetError());
             return 0;
          }
        return 1;
     }

   if ((eglGetCurrentContext() != ctx) || 
       (eglGetCurrentSurface(EGL_READ) != surf) || 
       (eglGetCurrentSurface(EGL_DRAW) != surf))
     {
        if (flush) eng_window_use(NULL);

        ret = eglMakeCurrent(ob->egl_disp, surf, surf, ctx);
        if (!ret)
          {
             ERR("eglMakeCurrent Failed: %#x", eglGetError());
             return 0;
          }
     }

   return 1;
}
开发者ID:FlorentRevest,项目名称:EFL,代码行数:44,代码来源:evas_engine.c


示例9: defined

void
TopCanvas::Resume()
{
#if defined(ANDROID) && defined(USE_EGL)
  surface = eglGetCurrentSurface(EGL_DRAW);
#endif

  OpenGL::SetupContext();
  OpenGL::SetupViewport(UnsignedPoint2D(size.cx, size.cy));
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:10,代码来源:TopCanvas.cpp


示例10: eglGetCurrentSurface

    void EGLWindow::setVSyncEnabled(bool vsync) {
        mVSync = vsync;
        // we need to make our context current to set vsync
        // store previous context to restore when finished.
        ::EGLSurface oldRead = eglGetCurrentSurface(EGL_READ);
        EGL_CHECK_ERROR
        ::EGLSurface oldDraw = eglGetCurrentSurface(EGL_DRAW);
        EGL_CHECK_ERROR
        ::EGLContext  oldContext  = eglGetCurrentContext();
        EGL_CHECK_ERROR
        ::EGLDisplay dpy = mGLSupport->getGLDisplay();

        mContext->setCurrent();

        if (! mIsExternalGLControl )
        {
            eglSwapInterval(dpy, vsync ? mVSyncInterval : 0);
            EGL_CHECK_ERROR
        }
开发者ID:yiliu1203,项目名称:OGRE,代码行数:19,代码来源:OgreEGLWindow.cpp


示例11: recreate

    void recreate(void)
    {
        EGLContext currentContext = eglGetCurrentContext();
        EGLSurface currentDrawSurface = eglGetCurrentSurface(EGL_DRAW);
        EGLSurface currentReadSurface = eglGetCurrentSurface(EGL_READ);
        bool rebindDrawSurface = currentDrawSurface == surface;
        bool rebindReadSurface = currentReadSurface == surface;

        if (rebindDrawSurface || rebindReadSurface) {
            eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
            eglDestroySurface(eglDisplay, surface);
        }

        const EglVisual * eglVisual = static_cast<const EglVisual *>(visual);
        ANativeWindow_setBuffersGeometry(window.get(), 0, 0, eglVisual->format);
        surface = eglCreateWindowSurface(eglDisplay, eglVisual->config, (EGLNativeWindowType)window.get(), NULL);

        if (rebindDrawSurface || rebindReadSurface)
            eglMakeCurrent(eglDisplay, surface, surface, currentContext);
    }
开发者ID:goneflash,项目名称:apitrace,代码行数:20,代码来源:glws_egl_android.cpp


示例12: FScopeContext

	FScopeContext(FPlatformOpenGLContext* PlatformContext)
	{
		check(PlatformContext);
		LastContext = eglGetCurrentContext();
		LastSurface = eglGetCurrentSurface(EGL_DRAW);
		bSameContextAndSurface = (LastContext == PlatformContext->eglContext) && (LastSurface == PlatformContext->eglSurface);
		if (!bSameContextAndSurface)
		{
			eglMakeCurrent(AndroidEGL::GetInstance()->GetDisplay(), PlatformContext->eglSurface, PlatformContext->eglSurface, PlatformContext->eglContext);
		}
	}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:11,代码来源:AndroidES31OpenGL.cpp


示例13: eglGetDisplay

void
TopCanvas::Create(PixelSize new_size, bool full_screen, bool resizable)
{
#ifdef USE_EGL
  display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
  surface = eglGetCurrentSurface(EGL_DRAW);
#endif

  OpenGL::SetupContext();
  SetupViewport(new_size);
}
开发者ID:nkgautam,项目名称:XCSoar,代码行数:11,代码来源:TopCanvas.cpp


示例14: GLimp_EndFrame

/*
** GLimp_EndFrame
*/
void GLimp_EndFrame (void)
{
	  if (!androidSwapped)
	    	eglSwapBuffers( eglGetCurrentDisplay(), eglGetCurrentSurface( EGL_DRAW ) );

	    androidSwapped = false;


	// check logging
	QGL_EnableLogging( r_logFile->integer );
}
开发者ID:emileb,项目名称:JK3,代码行数:14,代码来源:android_glimp.cpp


示例15: _Create

    bool DiWin32EGLWindow::Create(uint32& width, uint32& height, const DiString& title, bool fullscreen)
    {
        ::EGLContext eglContext = 0;
        if (!mEglConfig)
        {
            uint32 samples = 0;
            int minAttribs[] = 
            {
                EGL_LEVEL, 0,
                EGL_DEPTH_SIZE, 16,
                EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
                EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
                EGL_NATIVE_RENDERABLE, EGL_FALSE,
                EGL_DEPTH_SIZE, EGL_DONT_CARE,
                EGL_NONE
            };

            int maxAttribs[] = 
            {
                EGL_SAMPLES, samples,
                EGL_STENCIL_SIZE, INT_MAX,
                EGL_NONE
            };

            mEglConfig = mGLSupport->SelectGLConfig(minAttribs, maxAttribs);
        }

        bool ret = _Create(width, height, title, fullscreen);

        mContext = CreateEGLContext();
        mContext->BeginContext();
        ::EGLSurface oldDrawableDraw = eglGetCurrentSurface(EGL_DRAW);
        ::EGLSurface oldDrawableRead = eglGetCurrentSurface(EGL_READ);
        ::EGLContext oldContext = eglGetCurrentContext();

        int glConfigID;
        mGLSupport->GetGLConfigAttrib(mEglConfig, EGL_CONFIG_ID, &glConfigID);

        DI_INFO("EGLWindow::create used FBConfigID = %d", glConfigID);
        return ret;
    }
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:41,代码来源:Win32EGLWindow.cpp


示例16: Java_javax_microedition_khronos_egl_EGL10Impl__1getCurrentSurface

/*  private native int _getCurrentSurface ( int readdraw ) ; */
KNIEXPORT KNI_RETURNTYPE_INT
Java_javax_microedition_khronos_egl_EGL10Impl__1getCurrentSurface() {

    jint readdraw = KNI_GetParameterAsInt(1);

    jint returnValue = (jint)eglGetCurrentSurface((EGLint)readdraw);
#ifdef DEBUG
    printf("eglGetCurrentSurface(%d) = %d\n", readdraw, returnValue);
#endif

    KNI_ReturnInt(returnValue);
}
开发者ID:Sektor,项目名称:phoneme-qtopia,代码行数:13,代码来源:JSR239-KNIEGL11Impl.c


示例17: recreate

    void
    recreate(void) {
        EGLContext currentContext = eglGetCurrentContext();
        EGLSurface currentDrawSurface = eglGetCurrentSurface(EGL_DRAW);
        EGLSurface currentReadSurface = eglGetCurrentSurface(EGL_READ);
        bool rebindDrawSurface = currentDrawSurface == surface;
        bool rebindReadSurface = currentReadSurface == surface;

        if (rebindDrawSurface || rebindReadSurface) {
            eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
        }

        eglDestroySurface(eglDisplay, surface);

        EGLConfig config = static_cast<const EglVisual *>(visual)->config;
        surface = eglCreateWindowSurface(eglDisplay, config, (EGLNativeWindowType)window, NULL);

        if (rebindDrawSurface || rebindReadSurface) {
            eglMakeCurrent(eglDisplay, surface, surface, currentContext);
        }
    }
开发者ID:Hsaniva,项目名称:apitrace,代码行数:21,代码来源:glws_egl_xlib.cpp


示例18: eglGetCurrentDisplay

bool GLEnv::InitWithCurrentContext() {
  if (IsInitialized())
    return true;

  display_     = eglGetCurrentDisplay();
  contexts_[0] = eglGetCurrentContext();
  surfaces_[0] = SurfaceWindowPair(eglGetCurrentSurface(EGL_DRAW), NULL);

  return (context() != EGL_NO_CONTEXT) &&
         (display() != EGL_NO_DISPLAY) &&
         (surface() != EGL_NO_SURFACE);
}
开发者ID:AlanCheen,项目名称:platform_frameworks_base,代码行数:12,代码来源:gl_env.cpp


示例19: TEST_F

// Test a bug in our EGL TLS implementation.
TEST_F(EGLThreadTest, ThreadInitCrash)
{
    std::thread runner(&EGLThreadTest::threadingTest, this);

    // wait for signal from thread
    runner.join();

    // crash, because the TLS value is NULL on main thread
    eglGetCurrentSurface(EGL_DRAW);
    eglGetCurrentContext();

    eglTerminate(mDisplay);
}
开发者ID:null77,项目名称:angle,代码行数:14,代码来源:EGLThreadTest.cpp


示例20: android_view_HardwareRenderer_preserveBackBuffer

static jboolean android_view_HardwareRenderer_preserveBackBuffer(JNIEnv* env, jobject clazz) {
    EGLDisplay display = eglGetCurrentDisplay();
    EGLSurface surface = eglGetCurrentSurface(EGL_DRAW);

    eglGetError();
    eglSurfaceAttrib(display, surface, EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);

    EGLint error = eglGetError();
    if (error != EGL_SUCCESS) {
        RENDERER_LOGD("Could not enable buffer preserved swap behavior (%x)", error);
    }

    return error == EGL_SUCCESS;
}
开发者ID:LuckJC,项目名称:pro-fw,代码行数:14,代码来源:android_view_HardwareRenderer.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ eglGetError函数代码示例发布时间:2022-05-30
下一篇:
C++ eglGetCurrentContext函数代码示例发布时间: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