Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backend/glx: refactor glXChooseFBConfig's attrib_list
first, let's get rid of invalid attributes: * the EXT_framebuffer_sRGB extension specification doesn't say that the GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT token is accepted by the <attribList> parameter of glXChooseFBConfig. second, let's get rid of ignored attributes: * GLX_BUFFER_SIZE is ignored if GLX_COLOR_INDEX_BIT is not set in GLX_RENDER_TYPE and the default value of GLX_RENDER_TYPE is GLX_RGBA_BIT; * GLX_X_VISUAL_TYPE is ignored if GLX_DRAWABLE_TYPE is specified in attrib_list and the mask that follows does not have GLX_WINDOW_BIT set. third, let's get rid of attributes that are set to default values: * the default value of GLX_RENDER_TYPE is GLX_RGBA_BIT; * the default value of GLX_STENCIL_SIZE is 0; * the default value of GLX_DEPTH_SIZE is 0. fourth, let's set the GLX_CONFIG_CAVEAT attribute to GLX_NONE to match the eglChooseConfig's attrib_list and avoid getting slow or non conformant frame buffer configurations. fifth, let's use fancy constants Xlib gives us: True instead of true and None instead of 0. we're working closely with Xlib here after all. sixth, let's sort the attrib_list to match the order attributes are described in the glXChooseFBConfig function specification for easier lookup. references: https://registry.khronos.org/OpenGL-Refpages/gl2.1/xhtml/glXChooseFBConfig.xml https://registry.khronos.org/OpenGL/extensions/EXT/EXT_framebuffer_sRGB.txt
- Loading branch information