diff options
author | David Robillard <d@drobilla.net> | 2020-10-22 14:25:47 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-22 14:25:47 +0200 |
commit | eadf8e9a92414a7443440c810662a30af5ff3c77 (patch) | |
tree | 8c6a2f87dce804487edd595b6067d2029218a469 /include/pugl/detail | |
parent | 336ab6bcf31df95edccc8bafce11149650ddeb46 (diff) | |
download | pugl-eadf8e9a92414a7443440c810662a30af5ff3c77.tar.gz pugl-eadf8e9a92414a7443440c810662a30af5ff3c77.tar.bz2 pugl-eadf8e9a92414a7443440c810662a30af5ff3c77.zip |
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.
Diffstat (limited to 'include/pugl/detail')
-rw-r--r-- | include/pugl/detail/implementation.c | 22 |
1 files changed, 6 insertions, 16 deletions
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) { |