SDL_video: Added SDL_GL_FLOATBUFFERS to allow Cocoa GL contexts to use EDR

This commit is contained in:
Shootfast
2022-07-06 20:12:30 +01:00
committed by Sam Lantinga
parent 0b9868b026
commit 60d1944e46
6 changed files with 38 additions and 2 deletions

View File

@@ -118,6 +118,16 @@ typedef GLXContext(*PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display * dpy,
#endif
#endif
#ifndef GLX_ARB_fbconfig_float
#define GLX_ARB_fbconfig_float
#ifndef GLX_RGBA_FLOAT_TYPE_ARB
#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
#endif
#ifndef GLX_RGBA_FLOAT_BIT_ARB
#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004
#endif
#endif
#ifndef GLX_ARB_create_context_no_error
#define GLX_ARB_create_context_no_error
#ifndef GLX_CONTEXT_OPENGL_NO_ERROR_ARB
@@ -492,7 +502,11 @@ X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int si
/* Setup our GLX attributes according to the gl_config. */
if( for_FBConfig ) {
attribs[i++] = GLX_RENDER_TYPE;
attribs[i++] = GLX_RGBA_BIT;
if (_this->gl_config.floatbuffers) {
attribs[i++] = GLX_RGBA_FLOAT_BIT_ARB;
} else {
attribs[i++] = GLX_RGBA_BIT;
}
} else {
attribs[i++] = GLX_RGBA;
}
@@ -560,6 +574,10 @@ X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int si
attribs[i++] = _this->gl_config.multisamplesamples;
}
if (_this->gl_config.floatbuffers) {
attribs[i++] = GLX_RGBA_FLOAT_TYPE_ARB;
}
if (_this->gl_config.framebuffer_srgb_capable) {
attribs[i++] = GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB;
attribs[i++] = True; /* always needed, for_FBConfig or not! */