summaryrefslogtreecommitdiffstats
path: root/src/glx/glxcmds.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-02-04 16:28:52 -0800
committerIan Romanick <[email protected]>2010-02-11 15:40:29 -0800
commit8bffadbc83d19ecd8be8f0107d51463e36477666 (patch)
treeac92bf1410b4ecd061690a14c0a21e2096917aeb /src/glx/glxcmds.c
parent68fef184390da2fd67acfd99fba0a2dbe4a3b875 (diff)
glx: Pass opcode to CreateContext instead of use_glx_1_3 parameter
Passing the opcode directly instead of having CreateContext infer it from the value of fbconfig and the use_glx_1_3 flag will simplify some changes that are coming.
Diffstat (limited to 'src/glx/glxcmds.c')
-rw-r--r--src/glx/glxcmds.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index c429545f99a..e3f77a08410 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -366,7 +366,7 @@ CreateContext(Display * dpy, XVisualInfo * vis,
const __GLcontextModes * const fbconfig,
GLXContext shareList,
Bool allowDirect, GLXContextID contextID,
- Bool use_glx_1_3, int renderType)
+ unsigned code, int renderType)
{
GLXContext gc;
#ifdef GLX_DIRECT_RENDERING
@@ -425,7 +425,8 @@ CreateContext(Display * dpy, XVisualInfo * vis,
#endif
LockDisplay(dpy);
- if (fbconfig == NULL) {
+ switch (code) {
+ case X_GLXCreateContext: {
xGLXCreateContextReq *req;
/* Send the glXCreateContext request */
@@ -437,8 +438,10 @@ CreateContext(Display * dpy, XVisualInfo * vis,
req->screen = vis->screen;
req->shareList = shareList ? shareList->xid : None;
req->isDirect = GC_IS_DIRECT(gc);
+ break;
}
- else if (use_glx_1_3) {
+
+ case X_GLXCreateNewContext: {
xGLXCreateNewContextReq *req;
/* Send the glXCreateNewContext request */
@@ -451,8 +454,10 @@ CreateContext(Display * dpy, XVisualInfo * vis,
req->renderType = renderType;
req->shareList = shareList ? shareList->xid : None;
req->isDirect = GC_IS_DIRECT(gc);
+ break;
}
- else {
+
+ case X_GLXvop_CreateContextWithConfigSGIX: {
xGLXVendorPrivateWithReplyReq *vpreq;
xGLXCreateContextWithConfigSGIXReq *req;
@@ -470,6 +475,14 @@ CreateContext(Display * dpy, XVisualInfo * vis,
req->renderType = renderType;
req->shareList = shareList ? shareList->xid : None;
req->isDirect = GC_IS_DIRECT(gc);
+ break;
+ }
+
+ default:
+ /* What to do here? This case is the sign of an internal error. It
+ * should never be reachable.
+ */
+ break;
}
UnlockDisplay(dpy);
@@ -491,7 +504,7 @@ glXCreateContext(Display * dpy, XVisualInfo * vis,
GLXContext shareList, Bool allowDirect)
{
return CreateContext(dpy, vis, NULL, shareList, allowDirect, None,
- False, 0);
+ X_GLXCreateContext, 0);
}
_X_HIDDEN void
@@ -1740,7 +1753,8 @@ glXImportContextEXT(Display * dpy, GLXContextID contextID)
return NULL;
}
- ctx = CreateContext(dpy, NULL, NULL, NULL, False, contextID, False, 0);
+ ctx = CreateContext(dpy, NULL, NULL, NULL, False, contextID,
+ X_GLXCreateContext, 0);
if (NULL != ctx) {
if (Success != __glXQueryContextInfo(dpy, ctx)) {
return NULL;
@@ -1790,7 +1804,7 @@ glXCreateNewContext(Display * dpy, GLXFBConfig config,
int renderType, GLXContext shareList, Bool allowDirect)
{
return CreateContext(dpy, NULL, (__GLcontextModes *) config, shareList,
- allowDirect, None, True, renderType);
+ allowDirect, None, X_GLXCreateNewContext, renderType);
}
@@ -2278,7 +2292,8 @@ glXCreateContextWithConfigSGIX(Display * dpy,
if ((psc != NULL)
&& __glXExtensionBitIsEnabled(psc, SGIX_fbconfig_bit)) {
gc = CreateContext(dpy, NULL, (__GLcontextModes *) config, shareList,
- allowDirect, None, False, renderType);
+ allowDirect, None,
+ X_GLXvop_CreateContextWithConfigSGIX, renderType);
}
return gc;