Commit 96d19e89 authored by Adam Jackson's avatar Adam Jackson 🎧 Committed by Adam Jackson
Browse files

glx: Implement GLX_EXT_get_drawable_type

Trivial extension to let the client query whether this is a window
pixmap or pbuffer. Mostly for Mesa's convenience when setting up
drawable state, but plausibly useful for apps and middleware as well.

Upstream OpenGL Registry merge request:

https://github.com/KhronosGroup/OpenGL-Registry/pull/425
parent c15dd0ba
Pipeline #206738 passed with stages
in 5 minutes and 35 seconds
......@@ -86,6 +86,7 @@ static const struct extension_info known_glx_extensions[] = {
{ GLX(EXT_create_context_es2_profile), VER(0,0), N, },
{ GLX(EXT_fbconfig_packed_float), VER(0,0), N, },
{ GLX(EXT_framebuffer_sRGB), VER(0,0), N, },
{ GLX(EXT_get_drawable_type), VER(0,0), Y, },
{ GLX(EXT_import_context), VER(0,0), N, },
{ GLX(EXT_libglvnd), VER(0,0), N, },
{ GLX(EXT_no_config_context), VER(0,0), N, },
......
......@@ -47,6 +47,7 @@ enum {
EXT_create_context_es_profile_bit,
EXT_create_context_es2_profile_bit,
EXT_fbconfig_packed_float_bit,
EXT_get_drawable_type_bit,
EXT_import_context_bit,
EXT_libglvnd_bit,
EXT_no_config_context_bit,
......
......@@ -1860,7 +1860,7 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
xGLXGetDrawableAttributesReply reply;
__GLXdrawable *pGlxDraw = NULL;
DrawablePtr pDraw;
CARD32 attributes[18];
CARD32 attributes[20];
int num = 0, error;
if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY,
......@@ -1897,6 +1897,14 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
ATTRIB(GLX_STEREO_TREE_EXT, 0);
}
}
/* GLX_EXT_get_drawable_type */
if (!pGlxDraw || pGlxDraw->type == GLX_DRAWABLE_WINDOW)
ATTRIB(GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT);
else if (pGlxDraw->type == GLX_DRAWABLE_PIXMAP)
ATTRIB(GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT);
else if (pGlxDraw->type == GLX_DRAWABLE_PBUFFER)
ATTRIB(GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT);
#undef ATTRIB
reply = (xGLXGetDrawableAttributesReply) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment