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

Function queryDrawable

server/backend.cpp:940–978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

938
939
940void queryDrawable(Display *dpy, GLXDrawable draw, int attribute,
941 unsigned int *value)
942{
943 if(fconfig.egl)
944 {
945 FakePbuffer *pb = NULL;
946
947 if(!value) return;
948
949 if(!draw || (pb = PBHASHEGL.find(draw)) == NULL)
950 {
951 faker::sendGLXError(dpy, X_GLXGetDrawableAttributes, GLXBadDrawable,
952 false);
953 return;
954 }
955
956 switch(attribute)
957 {
958 case GLX_WIDTH:
959 *value = pb->getWidth();
960 return;
961 case GLX_HEIGHT:
962 *value = pb->getHeight();
963 return;
964 case GLX_PRESERVED_CONTENTS:
965 *value = 1;
966 return;
967 case GLX_LARGEST_PBUFFER:
968 *value = 0;
969 return;
970 case GLX_FBCONFIG_ID:
971 *value = pb->getFBConfig() ? pb->getFBConfig()->id : 0;
972 return;
973 default:
974 return;
975 }
976 }
977 else _glXQueryDrawable(DPY3D, draw, attribute, value);
978}
979
980
981Bool queryExtension(Display *dpy, int *majorOpcode, int *eventBase,

Callers 1

glXQueryDrawableFunction · 0.85

Calls 5

sendGLXErrorFunction · 0.85
findMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45
getFBConfigMethod · 0.45

Tested by

no test coverage detected