本文整理汇总了C++中eglDestroyContext函数的典型用法代码示例。如果您正苦于以下问题:C++ eglDestroyContext函数的具体用法?C++ eglDestroyContext怎么用?C++ eglDestroyContext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eglDestroyContext函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eglMakeCurrent
CTSmallWindowOpenVG::~CTSmallWindowOpenVG()
{
// Make sure that this egl status is active
eglMakeCurrent(iDisplay, iSurface, iSurface, iContextVG);
vgDestroyPaint(iFillPaint);
vgDestroyPaint(iStrokePaint);
vgDestroyPath(iPath);
if (iContextVG != EGL_NO_CONTEXT)
{
eglDestroyContext(iDisplay,iContextVG);
}
if (iSurface != EGL_NO_SURFACE)
{
eglDestroySurface(iDisplay,iSurface);
}
// Call eglMakeCurrent() to ensure the surfaces and contexts are truly destroyed.
eglMakeCurrent(iDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
//eglTerminate(iDisplay);
eglReleaseThread();
}
示例2: eglMakeCurrent
void CEGLGraphicsInterface::Terminate()
{
if (iEglDisplay != EGL_NO_DISPLAY)
{
eglMakeCurrent(iEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT );
if (iEglContext)
{
eglDestroyContext(iEglDisplay, iEglContext);
iEglContext = EGL_NO_CONTEXT;
}
if (iEglSurface)
{
eglDestroySurface(iEglDisplay, iEglSurface);
iEglSurface = EGL_NO_SURFACE;
}
eglTerminate(iEglDisplay);
eglReleaseThread();
iEglDisplay = EGL_NO_DISPLAY;
}
}
示例3: eglMakeCurrent
// -----------------------------------------------------------------------------
// CGameController::~CGameController
// Destructor.
// -----------------------------------------------------------------------------
//
CGameController::~CGameController()
{
// EGL related cleanup.
eglMakeCurrent( iEglDisplay, EGL_NO_SURFACE,
EGL_NO_SURFACE, EGL_NO_CONTEXT
);
eglDestroySurface( iEglDisplay, iEglSurface );
eglDestroyContext( iEglDisplay, iEglContext );
// Destroy the RWindow.
if( iWindow != NULL )
{
iWindow->SetOrdinalPosition( KOrdinalPositionSwitchToOwningWindow );
iWindow->Close();
delete iWindow;
iWindow = NULL;
}
delete iWsEventReceiver;
}
示例4: OpenGLES_DestroyContext
void OpenGLES_DestroyContext()
{
if (EGL_NO_CONTEXT != es_context.eglContext)
{
eglDestroyContext(es_context.eglDisplay, es_context.eglContext);
es_context.eglContext = EGL_NO_CONTEXT;
}
if (EGL_NO_SURFACE != es_context.eglSurface)
{
eglDestroySurface(es_context.eglDisplay, es_context.eglSurface);
es_context.eglSurface = EGL_NO_SURFACE;
}
if (EGL_NO_DISPLAY != es_context.eglDisplay)
{
eglTerminate(es_context.eglDisplay);
es_context.eglDisplay = EGL_NO_DISPLAY;
}
}
示例5: kill_GLES2
void kill_GLES2() {
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();
}
示例6: exit_func
static void exit_func(void)
// Function to be passed to atexit().
{
// 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 );
// release texture buffers
free(state->tex_buf1);
free(state->tex_buf2);
free(state->tex_buf3);
printf("\ncube closed\n");
} // exit_func()
示例7: eglMakeCurrent
void OpenGL::Teardown()
{
if (eglDisplay != EGL_NO_DISPLAY)
{
eglMakeCurrent( eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if ( eglContext != EGL_NO_CONTEXT)
{
eglDestroyContext(eglDisplay, eglContext);
}
if ( eglSurface != EGL_NO_SURFACE)
{
eglDestroySurface(eglDisplay, eglSurface);
}
eglTerminate(eglDisplay);
}
eglDisplay = EGL_NO_DISPLAY;
eglContext = EGL_NO_CONTEXT;
eglSurface = EGL_NO_SURFACE;
}
示例8: engine_term_display
void engine_term_display(void)
{
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;
}
示例9: pi_deinit
void pi_deinit(void) {
gles2_destroy();
// Release OpenGL resources
eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroySurface(display, surface);
eglDestroyContext(display, context);
eglTerminate(display);
dispman_update = vc_dispmanx_update_start(0);
vc_dispmanx_element_remove(dispman_update, dispman_element);
vc_dispmanx_element_remove(dispman_update, dispman_element_bg);
vc_dispmanx_update_submit_sync(dispman_update);
vc_dispmanx_resource_delete(resource0);
vc_dispmanx_resource_delete(resource1);
vc_dispmanx_resource_delete(resource_bg);
vc_dispmanx_display_close(dispman_display);
if (VideoBuffer) free(VideoBuffer);
VideoBuffer = 0;
}
示例10: GAPI_ReleaseOGL_ES
void GAPI_ReleaseOGL_ES(GAPIPriv *ctx, Bool offscreen_only)
{
if (ctx->egldpy) {
eglMakeCurrent(ctx->egldpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (ctx->eglctx) eglDestroyContext(ctx->egldpy, ctx->eglctx);
ctx->eglctx = 0;
if (ctx->surface) eglDestroySurface(ctx->egldpy, ctx->surface);
ctx->surface = 0;
if (ctx->egldpy) eglTerminate(ctx->egldpy);
ctx->egldpy = 0;
}
if (ctx->gl_bitmap) DeleteObject(ctx->gl_bitmap);
ctx->gl_bitmap = NULL;
if (offscreen_only) return;
if (ctx->bitmap) DeleteObject(ctx->bitmap);
ctx->bitmap = NULL;
}
示例11: gst_gl_context_egl_destroy_context
static void
gst_gl_context_egl_destroy_context (GstGLContext * context)
{
GstGLContextEGL *egl;
egl = GST_GL_CONTEXT_EGL (context);
gst_gl_context_egl_activate (context, FALSE);
if (egl->egl_surface)
eglDestroySurface (egl->egl_surface, egl->egl_display);
if (egl->egl_context)
eglDestroyContext (egl->egl_display, egl->egl_context);
if (egl->egl_display) {
eglTerminate (egl->egl_display);
eglReleaseThread ();
}
}
示例12: wl_subsurface_destroy
WaylandEGLContext::~WaylandEGLContext ()
{
if (subsurface)
wl_subsurface_destroy (subsurface);
if (region)
wl_region_destroy (region);
if (child)
wl_surface_destroy (child);
if (egl_context)
eglDestroyContext (egl_display, egl_context);
if (egl_surface)
eglDestroySurface (egl_display, egl_surface);
if (egl_window)
wl_egl_window_destroy (egl_window);
}
示例13: TEST_F
TEST_F(EGLCreateContextTest, BadAttributeFails) {
// First check that we can successfully create a context
EGLint attribs[5] = {
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE, EGL_NONE, EGL_NONE,
};
mEglContext = eglCreateContext(mEglDisplay, mEglConfig, EGL_NO_CONTEXT,
attribs);
ASSERT_NE(mEglContext, EGL_NO_CONTEXT);
ASSERT_EQ(eglGetError(), EGL_SUCCESS);
ASSERT_EQ(EGL_TRUE, eglDestroyContext(mEglDisplay, mEglContext));
mEglContext = EGL_NO_CONTEXT;
// Now add an invalid attribute and make sure eglCreateContext fails
attribs[2] = EGL_BAD_ATTRIBUTE; // error code, not a valid attribute
mEglContext = eglCreateContext(mEglDisplay, mEglConfig, EGL_NO_CONTEXT,
attribs);
ASSERT_EQ(mEglContext, EGL_NO_CONTEXT);
ASSERT_EQ(eglGetError(), EGL_BAD_ATTRIBUTE);
}
示例14: gst_imx_egl_viv_sink_egl_platform_shutdown_window
gboolean gst_imx_egl_viv_sink_egl_platform_shutdown_window(GstImxEglVivSinkEGLPlatform *platform)
{
Display *x11_display = (Display *)(platform->native_display);
Window x11_window = (Window)(platform->native_window);
if (platform->native_window == 0)
return TRUE;
eglMakeCurrent(platform->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (platform->egl_context != EGL_NO_CONTEXT)
eglDestroyContext(platform->egl_display, platform->egl_context);
if (platform->egl_surface != EGL_NO_SURFACE)
eglDestroySurface(platform->egl_display, platform->egl_surface);
if (platform->egl_display != EGL_NO_DISPLAY)
eglTerminate(platform->egl_display);
platform->egl_display = EGL_NO_DISPLAY;
platform->egl_context = EGL_NO_CONTEXT;
platform->egl_surface = EGL_NO_SURFACE;
EGL_PLATFORM_LOCK(platform);
XSelectInput(x11_display, x11_window, 0);
while (XPending(x11_display))
{
XEvent xevent;
XNextEvent(x11_display, &xevent);
}
XDestroyWindow(x11_display, x11_window);
platform->native_window = 0;
EGL_PLATFORM_UNLOCK(platform);
return TRUE;
}
示例15: close_ogl
static void
close_ogl (void)
{
#if defined (USE_OMX_TARGET_RPI)
DISPMANX_UPDATE_HANDLE_T dispman_update;
#endif
if (state->fshader) {
glDeleteShader (state->fshader);
glDetachShader (state->program, state->fshader);
}
if (state->vshader) {
glDeleteShader (state->vshader);
glDetachShader (state->program, state->vshader);
}
if (state->program)
glDeleteProgram (state->program);
if (state->tex)
glDeleteTextures (1, &state->tex);
/* 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);
gst_object_unref (state->gst_display);
#if defined (USE_OMX_TARGET_RPI)
dispman_update = vc_dispmanx_update_start (0);
vc_dispmanx_element_remove (dispman_update, state->dispman_element);
vc_dispmanx_update_submit_sync (dispman_update);
vc_dispmanx_display_close (state->dispman_display);
#endif
}