From eadf8e9a92414a7443440c810662a30af5ff3c77 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 22 Oct 2020 14:25:47 +0200 Subject: Resurrect puglEnterContext() and puglLeaveContext() Even though loading is now better handled with create events, there are still situations with OpenGL where it's difficult to avoid explicitly entering and leaving the context. So, resurrect these functions, but remove the drawing parameter to make it clear that they must never be used for drawing. This breaks the deprecated API since the drawing parameter would be inappropriate for the stable API, and a decent alternative name isn't available. --- include/pugl/detail/implementation.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'include/pugl/detail') diff --git a/include/pugl/detail/implementation.c b/include/pugl/detail/implementation.c index 6a5f932..e9a3450 100644 --- a/include/pugl/detail/implementation.c +++ b/include/pugl/detail/implementation.c @@ -331,30 +331,20 @@ puglDispatchEvents(PuglWorld* world) return puglUpdate(world, 0.0); } +#endif + PuglStatus -puglEnterContext(PuglView* view, bool drawing) +puglEnterContext(PuglView* view) { - const PuglEventExpose expose = { - PUGL_EXPOSE, 0, 0.0, 0.0, view->frame.width, view->frame.height}; - - view->backend->enter(view, drawing ? &expose : NULL); - - return PUGL_SUCCESS; + return view->backend->enter(view, NULL); } PuglStatus -puglLeaveContext(PuglView* view, bool drawing) +puglLeaveContext(PuglView* view) { - const PuglEventExpose expose = { - PUGL_EXPOSE, 0, 0.0, 0.0, view->frame.width, view->frame.height}; - - view->backend->leave(view, drawing ? &expose : NULL); - - return PUGL_SUCCESS; + return view->backend->leave(view, NULL); } -#endif - PuglStatus puglSetEventFunc(PuglView* view, PuglEventFunc eventFunc) { -- cgit v1.2.1