+/* Called by window system/device driver (via gc->exports.loseCurrent())
+ * when the rendering context is made non-current.
+ */
+GLboolean
+_mesa_loseCurrent(__GLcontext *gc)
+{
+ /* XXX unbind context from thread */
+ return GL_TRUE;
+}
+
+/* Called by window system/device driver (via gc->exports.makeCurrent())
+ * when the rendering context is made current.
+ */
+GLboolean
+_mesa_makeCurrent(__GLcontext *gc)
+{
+ /* XXX bind context to thread */
+ return GL_TRUE;
+}
+
+/* Called by window system/device driver - yadda, yadda, yadda.
+ * See above comments.
+ */
+GLboolean
+_mesa_shareContext(__GLcontext *gc, __GLcontext *gcShare)
+{
+ if (gc && gcShare && gc->Shared && gcShare->Shared) {
+ gc->Shared->RefCount--;
+ if (gc->Shared->RefCount == 0) {
+ free_shared_state(gc, gc->Shared);
+ }
+ gc->Shared = gcShare->Shared;
+ gc->Shared->RefCount++;
+ return GL_TRUE;
+ }
+ else {
+ return GL_FALSE;
+ }
+}
+
+GLboolean
+_mesa_copyContext(__GLcontext *dst, const __GLcontext *src, GLuint mask)
+{
+ if (dst && src) {
+ _mesa_copy_context( src, dst, mask );
+ return GL_TRUE;
+ }
+ else {
+ return GL_FALSE;
+ }
+}
+
+GLboolean
+_mesa_forceCurrent(__GLcontext *gc)
+{
+ return GL_TRUE;
+}
+
+GLboolean
+_mesa_notifyResize(__GLcontext *gc)
+{
+ GLint x, y;
+ GLuint width, height;
+ __GLdrawablePrivate *d = gc->imports.getDrawablePrivate(gc);
+ if (!d || !d->getDrawableSize)
+ return GL_FALSE;
+ d->getDrawableSize( d, &x, &y, &width, &height );
+ /* update viewport, resize software buffers, etc. */
+ return GL_TRUE;
+}
+
+void
+_mesa_notifyDestroy(__GLcontext *gc)
+{
+}
+
+/* Called by window system just before swapping buffers.
+ * We have to finish any pending rendering.
+ */
+void
+_mesa_notifySwapBuffers(__GLcontext *gc)
+{
+ FLUSH_VERTICES( gc, 0 );
+}
+
+struct __GLdispatchStateRec *
+_mesa_dispatchExec(__GLcontext *gc)
+{
+ return NULL;
+}
+
+void
+_mesa_beginDispatchOverride(__GLcontext *gc)
+{
+}
+
+void
+_mesa_endDispatchOverride(__GLcontext *gc)
+{
+}
+
+/* Setup the exports. The window system will call these functions
+ * when it needs Mesa to do something.
+ * NOTE: Device drivers should override these functions! For example,
+ * the Xlib driver should plug in the XMesa*-style functions into this
+ * structure. The XMesa-style functions should then call the _mesa_*
+ * version of these functions. This is an approximation to OO design
+ * (inheritance and virtual functions).
+ */
+static void
+_mesa_init_default_exports(__GLexports *exports)
+{
+ exports->destroyContext = _mesa_destroyContext;
+ exports->loseCurrent = _mesa_loseCurrent;
+ exports->makeCurrent = _mesa_makeCurrent;
+ exports->shareContext = _mesa_shareContext;
+ exports->copyContext = _mesa_copyContext;
+ exports->forceCurrent = _mesa_forceCurrent;
+ exports->notifyResize = _mesa_notifyResize;
+ exports->notifyDestroy = _mesa_notifyDestroy;
+ exports->notifySwapBuffers = _mesa_notifySwapBuffers;
+ exports->dispatchExec = _mesa_dispatchExec;
+ exports->beginDispatchOverride = _mesa_beginDispatchOverride;
+ exports->endDispatchOverride = _mesa_endDispatchOverride;
+}
+
+