summaryrefslogtreecommitdiffstats
path: root/src/glx/dri_glx.c
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2010-07-23 16:15:31 -0400
committerKristian Høgsberg <[email protected]>2010-07-23 22:05:53 -0400
commit6ec39db726beead21d97bf64ddbe1f0b2d2d6ca1 (patch)
tree65a665c1d10ab43618a2c508081a7cc7d31ab9ab /src/glx/dri_glx.c
parentb5dedd7c3b4425127d8b85b7e8df0ecda4009fd7 (diff)
glx: Refactor and simplify context creation
This lets us better separate context creation between the different backends.
Diffstat (limited to 'src/glx/dri_glx.c')
-rw-r--r--src/glx/dri_glx.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c
index ff7ca5ef7d6..95cded792d9 100644
--- a/src/glx/dri_glx.c
+++ b/src/glx/dri_glx.c
@@ -550,9 +550,9 @@ static const struct glx_context_vtable dri_context_vtable = {
};
static __GLXcontext *
-driCreateContext(__GLXscreenConfigs *base,
- const __GLcontextModes * mode,
- GLXContext shareList, int renderType)
+dri_create_context(__GLXscreenConfigs *base,
+ const __GLcontextModes *mode,
+ GLXContext shareList, int renderType)
{
struct dri_context *pcp, *pcp_shared;
struct dri_screen *psc = (struct dri_screen *) base;
@@ -821,6 +821,10 @@ driBindExtensions(struct dri_screen *psc, const __DRIextension **extensions)
}
}
+static const struct glx_screen_vtable dri_screen_vtable = {
+ dri_create_context
+};
+
static __GLXscreenConfigs *
driCreateScreen(int screen, __GLXdisplayPrivate *priv)
{
@@ -882,13 +886,13 @@ driCreateScreen(int screen, __GLXdisplayPrivate *priv)
extensions = psc->core->getExtensions(psc->driScreen);
driBindExtensions(psc, extensions);
+ psc->base.vtable = &dri_screen_vtable;
psp = &psc->vtable;
psc->base.driScreen = psp;
if (psc->driCopySubBuffer)
psp->copySubBuffer = driCopySubBuffer;
psp->destroyScreen = driDestroyScreen;
- psp->createContext = driCreateContext;
psp->createDrawable = driCreateDrawable;
psp->swapBuffers = driSwapBuffers;