MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / glXQueryDrawable

Function glXQueryDrawable

server/faker-glx.cpp:2007–2062  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2005// GLX_SWAP_INTERVAL_EXT is emulated.
2006
2007void glXQueryDrawable(Display *dpy, GLXDrawable draw, int attribute,
2008 unsigned int *value)
2009{
2010 GLXDrawable glxDraw = draw;
2011
2012 TRY();
2013
2014 if(IS_EXCLUDED(dpy))
2015 {
2016 _glXQueryDrawable(dpy, draw, attribute, value);
2017 return;
2018 }
2019
2020 /////////////////////////////////////////////////////////////////////////////
2021 OPENTRACE(glXQueryDrawable); PRARGD(dpy); PRARGX(draw);
2022 PRARGIX(attribute); STARTTRACE();
2023 /////////////////////////////////////////////////////////////////////////////
2024
2025 if(!value) goto done;
2026
2027 // GLX_EXT_swap_control attributes
2028 if(attribute == GLX_SWAP_INTERVAL_EXT)
2029 {
2030 faker::VirtualWin *vw;
2031 if((vw = WINHASH.find(dpy, draw)) != NULL)
2032 *value = vw->getSwapInterval();
2033 else
2034 *value = 0;
2035 goto done;
2036 }
2037 else if(attribute == GLX_MAX_SWAP_INTERVAL_EXT)
2038 {
2039 *value = VGL_MAX_SWAP_INTERVAL;
2040 goto done;
2041 }
2042 else
2043 {
2044 faker::VirtualWin *vw; faker::VirtualPixmap *vpm;
2045
2046 if((vw = WINHASH.find(dpy, draw)) != NULL)
2047 glxDraw = vw->getGLXDrawable();
2048 else if((vpm = PMHASH.find(dpy, draw)) != NULL)
2049 glxDraw = vpm->getGLXDrawable();
2050
2051 backend::queryDrawable(dpy, glxDraw, attribute, value);
2052 }
2053
2054 done:
2055 /////////////////////////////////////////////////////////////////////////////
2056 STOPTRACE(); PRARGX(glxDraw);
2057 if(value) { PRARGIX(*value); } else { PRARGX(value); }
2058 CLOSETRACE();
2059 /////////////////////////////////////////////////////////////////////////////
2060
2061 CATCH();
2062}
2063
2064#if defined(GLX_GLXEXT_VERSION) && GLX_GLXEXT_VERSION >= 20190000

Callers 5

offScreenTestFunction · 0.85
extensionQueryTestFunction · 0.85
glXQueryGLXPbufferSGIXFunction · 0.85
mainFunction · 0.85
SetupFunction · 0.85

Calls 4

queryDrawableFunction · 0.85
getSwapIntervalMethod · 0.80
findMethod · 0.45
getGLXDrawableMethod · 0.45

Tested by

no test coverage detected