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


C++ eglTerminate函数代码示例

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


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

示例1: engine_term_display

static void engine_term_display(struct engine* engine)
{
	if (engine->display != EGL_NO_DISPLAY)
	{
		eglMakeCurrent(engine->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
		if (engine->context != EGL_NO_CONTEXT)
		{
			eglDestroyContext(engine->display, engine->context);
		}
		if (engine->surface != EGL_NO_SURFACE)
		{
			eglDestroySurface(engine->display, engine->surface);
		}
		eglTerminate(engine->display);
	}
	engine->animating = 0;
	engine->display = EGL_NO_DISPLAY;
	engine->context = EGL_NO_CONTEXT;
	engine->surface = EGL_NO_SURFACE;

	renderer_destroy_callback();
}
开发者ID:ColinGilbert,项目名称:noobEngine,代码行数:22,代码来源:main.cpp

示例2: main

int main () {
	display = wl_display_connect (NULL);
	struct wl_registry *registry = wl_display_get_registry (display);
	wl_registry_add_listener (registry, &registry_listener, NULL);
	wl_display_roundtrip (display);
	
	egl_display = eglGetDisplay (display);
	eglInitialize (egl_display, NULL, NULL);
	
	struct window window;
	create_window (&window, WIDTH, HEIGHT);
	
	while (running) {
		wl_display_dispatch_pending (display);
		draw_window (&window);
	}
	
	delete_window (&window);
	eglTerminate (egl_display);
	wl_display_disconnect (display);
	return 0;
}
开发者ID:eyelash,项目名称:tutorials,代码行数:22,代码来源:wayland-egl.c

示例3: drm_egl_uninit

static void drm_egl_uninit(MPGLContext *ctx)
{
    struct priv *p = ctx->priv;
    crtc_release(ctx);

    if (p->vt_switcher_active)
        vt_switcher_destroy(&p->vt_switcher);

    eglMakeCurrent(p->egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
    eglDestroyContext(p->egl.display, p->egl.context);
    eglDestroySurface(p->egl.display, p->egl.surface);
    gbm_surface_destroy(p->gbm.surface);
    eglTerminate(p->egl.display);
    gbm_device_destroy(p->gbm.device);
    p->egl.context = EGL_NO_CONTEXT;
    eglDestroyContext(p->egl.display, p->egl.context);

    if (p->kms) {
        kms_destroy(p->kms);
        p->kms = 0;
    }
}
开发者ID:yoimbert,项目名称:mpv,代码行数:22,代码来源:drm_egl.c

示例4: exit_func

static void exit_func(void)
// Function to be passed to atexit().
{
   if (eglImage != 0)
   {
      if (!eglDestroyImageKHR(state->display, (EGLImageKHR) eglImage))
         printf("eglDestroyImageKHR failed.");
   }


   // clear screen
   glClear( GL_COLOR_BUFFER_BIT );
   eglSwapBuffers(state->display, state->surface);

   // Release OpenGL resources
   eglMakeCurrent( state->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT );
   eglDestroySurface( state->display, state->surface );
   eglDestroyContext( state->display, state->context );
   eglTerminate( state->display );

   printf("\ncube closed\n");
} // exit_func()
开发者ID:balamark,项目名称:firmware,代码行数:22,代码来源:triangle.c

示例5: system_leave

static DFBResult
system_leave( bool emergency )
{
     DFBResult   ret;

     AndroidDataShared *shared;
     D_ASSERT( m_data != NULL );

     shared = m_data->shared;
     D_ASSERT( shared != NULL );

     dfb_surface_pool_leave( shared->pool );

     /* cleanup EGL related stuff */
     eglDestroyContext( m_data->dpy, m_data->ctx );
     eglTerminate( m_data->dpy );

     D_FREE( m_data );
     m_data = NULL;

     return DFB_OK;
}
开发者ID:lelou6666,项目名称:DirectFB-1.6.3-ab,代码行数:22,代码来源:android_system.c

示例6: gl_terminate

void gl_terminate(screen_window_t *screen_win) {
	// Borrowed from bbutil.c
    // EGL cleanup
    if (egl_disp != EGL_NO_DISPLAY) {
        eglMakeCurrent(egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
        if (egl_surf != EGL_NO_SURFACE) {
            eglDestroySurface(egl_disp, egl_surf);
            egl_surf = EGL_NO_SURFACE;
        }
        if (egl_ctx != EGL_NO_CONTEXT) {
            eglDestroyContext(egl_disp, egl_ctx);
            egl_ctx = EGL_NO_CONTEXT;
        }
        if (screen_win != NULL) {
            screen_destroy_window(*screen_win);
            screen_win = NULL;
        }
        eglTerminate(egl_disp);
        egl_disp = EGL_NO_DISPLAY;
    }
    eglReleaseThread();
}
开发者ID:AppDev666,项目名称:Core-Native-Community-Samples,代码行数:22,代码来源:main.c

示例7: wfdDestroyEvent

QOpenWFDDevice::~QOpenWFDDevice()
{
    delete mEventSocketNotifier;
    wfdDestroyEvent(mDevice,mEvent);

    for (int i = 0; i < mPorts.size(); i++) {
        //probably don't need to remove them from the list
        QList <WFDint> keys = mUsedPipelines.keys(mPorts.at(i));
        for (int keyIndex = 0; keyIndex < keys.size(); keyIndex++) {
            mUsedPipelines.remove(keys.at(keyIndex));
        }
        //but we have to delete them :)
        delete mPorts[i];
    }

    eglDestroyContext(mEglDisplay,mEglContext);
    eglTerminate(mEglDisplay);

    gbm_device_destroy(mGbmDevice);

    wfdDestroyDevice(mDevice);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:22,代码来源:qopenwfddevice.cpp

示例8: closeOpenGL

void closeOpenGL()
{
    if (!is_initialized)
        return;

    EGLDisplay eglDpy = eglGetCurrentDisplay();
    if( eglDpy==EGL_NO_DISPLAY )
        return;

    // get current context
    EGLContext eglCtx = eglGetCurrentContext();

    // release context
    eglMakeCurrent(eglDpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);

    // destroy context if valid
    if( eglCtx!=EGL_NO_CONTEXT )
        eglDestroyContext(eglDpy, eglCtx);

    // terminate display
    eglTerminate(eglDpy);
}
开发者ID:jeffkaufman,项目名称:mujoco-py,代码行数:22,代码来源:eglshim.c

示例9: IJK_EGL_terminate

void IJK_EGL_terminate(IJK_EGL* egl)
{
    if (!IJK_EGL_isValid(egl))
        return;

    if (egl->opaque)
        IJK_GLES2_Renderer_freeP(&egl->opaque->renderer);

    if (egl->display) {
        eglMakeCurrent(egl->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
        if (egl->context)
            eglDestroyContext(egl->display, egl->context);
        if (egl->surface)
            eglDestroySurface(egl->display, egl->surface);
        eglTerminate(egl->display);
        eglReleaseThread(); // FIXME: call at thread exit
    }

    egl->context = EGL_NO_CONTEXT;
    egl->surface = EGL_NO_SURFACE;
    egl->display = EGL_NO_DISPLAY;
}
开发者ID:317394245,项目名称:ijkplayer,代码行数:22,代码来源:ijksdl_egl.c

示例10: _DestroyThreadData

static void
_DestroyThreadData(
    gcsTLS_PTR TLS
    )
{
    gcmHEADER_ARG("TLS=0x%x", TLS);

    if (TLS->context != gcvNULL)
    {
        /*VEGLThreadData thread;*/
        VEGLDisplay head;

        /*thread = (VEGLThreadData) TLS->context;*/

        head = (VEGLDisplay) gcoOS_GetPLSValue(gcePLS_VALUE_EGL_DISPLAY_INFO);

        while (head != EGL_NO_DISPLAY)
        {
            VEGLDisplay display = head;

            if (display->ownerThread == gcoOS_GetCurrentThreadID())
            {
                /* This thread has not eglTerminated the display.*/
                eglTerminate(display);
            }

            head = display->next;
            if (TLS->ProcessExiting)
            {
                gcmVERIFY_OK(gcmOS_SAFE_FREE(gcvNULL, display));
                gcoOS_SetPLSValue(gcePLS_VALUE_EGL_DISPLAY_INFO, (gctPOINTER) head);
            }
        }

        TLS->context = gcvNULL;
    }

    gcmFOOTER_NO();
}
开发者ID:Astralix,项目名称:hardware_drivers,代码行数:39,代码来源:gc_egl.c

示例11: eglMakeCurrent

void GLContext::Terminate()
{
    if( display_ != EGL_NO_DISPLAY )
    {
        eglMakeCurrent( display_, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT );
        if( context_ != EGL_NO_CONTEXT )
        {
            eglDestroyContext( display_, context_ );
        }

        if( surface_ != EGL_NO_SURFACE )
        {
            eglDestroySurface( display_, surface_ );
        }
        eglTerminate( display_ );
    }

    display_ = EGL_NO_DISPLAY;
    context_ = EGL_NO_CONTEXT;
    surface_ = EGL_NO_SURFACE;
    context_valid_ = false;

}
开发者ID:007gzs,项目名称:android-platform-ndk,代码行数:23,代码来源:GLContext.cpp

示例12: gdk_wayland_display_dispose

static void
gdk_wayland_display_dispose (GObject *object)
{
  GdkDisplayWayland *display_wayland = GDK_DISPLAY_WAYLAND (object);

  _gdk_wayland_display_manager_remove_display (gdk_display_manager_get (),
					       GDK_DISPLAY (display_wayland));
  g_list_foreach (display_wayland->input_devices,
		  (GFunc) g_object_run_dispose, NULL);

  _gdk_screen_close (display_wayland->screen);

  if (display_wayland->event_source)
    {
      g_source_destroy (display_wayland->event_source);
      g_source_unref (display_wayland->event_source);
      display_wayland->event_source = NULL;
    }

  eglTerminate(display_wayland->egl_display);

  G_OBJECT_CLASS (_gdk_display_wayland_parent_class)->dispose (object);
}
开发者ID:dieterv,项目名称:gtk,代码行数:23,代码来源:gdkdisplay-wayland.c

示例13: engine_term_display

// Tear down the EGL context currently associated with the display.
static void engine_term_display(struct engine* engine) 
{
	glDeleteTextures(1, &g_img);

    if (engine->display != EGL_NO_DISPLAY) 
	{
        eglMakeCurrent(engine->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
        if (engine->context != EGL_NO_CONTEXT) 
		{
            eglDestroyContext(engine->display, engine->context);
        }
        if (engine->surface != EGL_NO_SURFACE) 
		{
            eglDestroySurface(engine->display, engine->surface);
        }
        eglTerminate(engine->display);
    }

    engine->animating = 0;
    engine->display = EGL_NO_DISPLAY;
    engine->context = EGL_NO_CONTEXT;
    engine->surface = EGL_NO_SURFACE;
}
开发者ID:zhaozw,项目名称:pathogenandroid,代码行数:24,代码来源:main.cpp

示例14: engine_term_display

// EGL情報を破棄する
static void engine_term_display(struct engine* engine) {
  if (engine->display != EGL_NO_DISPLAY) {
    // EGLレンダリングコンテキストとEGLサーフェイスの関連を外す
    eglMakeCurrent(engine->display, 
                   EGL_NO_SURFACE, 
                   EGL_NO_SURFACE,
                   EGL_NO_CONTEXT);
    // EGLレンダリングコンテキストを破棄する
    if (engine->context != EGL_NO_CONTEXT) 
      eglDestroyContext(engine->display, engine->context);
    // EGLサーフェイスを破棄する
    if (engine->surface != EGL_NO_SURFACE) 
      eglDestroySurface(engine->display, engine->surface);
    // EGLディスプレイを破棄する
    eglTerminate(engine->display);
  }
  // アニメーション停止
  engine->animating = 0;
  // EGL関連データを破棄
  engine->display = EGL_NO_DISPLAY;
  engine->context = EGL_NO_CONTEXT;
  engine->surface = EGL_NO_SURFACE;
}
开发者ID:fukusyo,项目名称:NDKBook_2nd,代码行数:24,代码来源:main.c

示例15: wglDeleteContext

SkOSWindow::~SkOSWindow() {
#if SK_SUPPORT_GPU
    if (NULL != fHGLRC) {
        wglDeleteContext((HGLRC)fHGLRC);
    }
#if SK_ANGLE
    if (EGL_NO_CONTEXT != fContext) {
        eglDestroyContext(fDisplay, fContext);
        fContext = EGL_NO_CONTEXT;
    }

    if (EGL_NO_SURFACE != fSurface) {
        eglDestroySurface(fDisplay, fSurface);
        fSurface = EGL_NO_SURFACE;
    }

    if (EGL_NO_DISPLAY != fDisplay) {
        eglTerminate(fDisplay);
        fDisplay = EGL_NO_DISPLAY;
    }
#endif // SK_ANGLE
#endif // SK_SUPPORT_GPU
}
开发者ID:hgl888,项目名称:RuntimeCanvas,代码行数:23,代码来源:SkOSWindow_win.cpp


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