logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_GLAttr - An enumeration of OpenGL configuration attributes.

Availability

       This enum is available since SDL 3.2.0.

Simple Directmedia Layer                           SDL 3.2.20                                  SDL_GLAttr(3type)

Description

       While  you  can set most OpenGL attributes normally, the attributes listed above must be known before SDL
       creates the window that will be used with the OpenGL context. These attributes  are  set  and  read  with
       SDL_GL_SetAttribute() and SDL_GL_GetAttribute().

       In  some  cases,  these attributes are minimum requests; the GL does not promise to give you exactly what
       you asked for. It's possible to ask for a 16-bit depth buffer and get a 24-bit one instead, for  example,
       or  to  ask  for  no  stencil buffer and still have one available. Context creation should fail if the GL
       can't provide your requested attributes at a minimum, but you should check to see exactly what you got.

Name

       SDL_GLAttr - An enumeration of OpenGL configuration attributes.

Synopsis

#include<SDL3/SDL_video.h>typedefenumSDL_GLAttr{SDL_GL_RED_SIZE,/**<theminimumnumberofbitsfortheredchannelofthecolorbuffer;defaultsto8.*/SDL_GL_GREEN_SIZE,/**<theminimumnumberofbitsforthegreenchannelofthecolorbuffer;defaultsto8.*/SDL_GL_BLUE_SIZE,/**<theminimumnumberofbitsforthebluechannelofthecolorbuffer;defaultsto8.*/SDL_GL_ALPHA_SIZE,/**<theminimumnumberofbitsforthealphachannelofthecolorbuffer;defaultsto8.*/SDL_GL_BUFFER_SIZE,/**<theminimumnumberofbitsforframebuffersize;defaultsto0.*/SDL_GL_DOUBLEBUFFER,/**<whethertheoutputissingleordoublebuffered;defaultstodoublebufferingon.*/SDL_GL_DEPTH_SIZE,/**<theminimumnumberofbitsinthedepthbuffer;defaultsto16.*/SDL_GL_STENCIL_SIZE,/**<theminimumnumberofbitsinthestencilbuffer;defaultsto0.*/SDL_GL_ACCUM_RED_SIZE,/**<theminimumnumberofbitsfortheredchanneloftheaccumulationbuffer;defaultsto0.*/SDL_GL_ACCUM_GREEN_SIZE,/**<theminimumnumberofbitsforthegreenchanneloftheaccumulationbuffer;defaultsto0.*/SDL_GL_ACCUM_BLUE_SIZE,/**<theminimumnumberofbitsforthebluechanneloftheaccumulationbuffer;defaultsto0.*/SDL_GL_ACCUM_ALPHA_SIZE,/**<theminimumnumberofbitsforthealphachanneloftheaccumulationbuffer;defaultsto0.*/SDL_GL_STEREO,/**<whethertheoutputisstereo3D;defaultstooff.*/SDL_GL_MULTISAMPLEBUFFERS,/**<thenumberofbuffersusedformultisampleanti-aliasing;defaultsto0.*/SDL_GL_MULTISAMPLESAMPLES,/**<thenumberofsamplesusedaroundthecurrentpixelusedformultisampleanti-aliasing.*/SDL_GL_ACCELERATED_VISUAL,/**<setto1torequirehardwareacceleration,setto0toforcesoftwarerendering;defaultstoalloweither.*/SDL_GL_RETAINED_BACKING,/**<notused(deprecated).*/SDL_GL_CONTEXT_MAJOR_VERSION,/**<OpenGLcontextmajorversion.*/SDL_GL_CONTEXT_MINOR_VERSION,/**<OpenGLcontextminorversion.*/SDL_GL_CONTEXT_FLAGS,/**<somecombinationof0ormoreofelementsoftheSDL_GLContextFlagenumeration;defaultsto0.*/SDL_GL_CONTEXT_PROFILE_MASK,/**<typeofGLcontext(Core,Compatibility,ES).SeeSDL_GLProfile;defaultvaluedependsonplatform.*/SDL_GL_SHARE_WITH_CURRENT_CONTEXT,/**<OpenGLcontextsharing;defaultsto0.*/SDL_GL_FRAMEBUFFER_SRGB_CAPABLE,/**<requestssRGBcapablevisual;defaultsto0.*/SDL_GL_CONTEXT_RELEASE_BEHAVIOR,/**<setscontextthereleasebehavior.SeeSDL_GLContextReleaseFlag;defaultstoFLUSH.*/SDL_GL_CONTEXT_RESET_NOTIFICATION,/**<setcontextresetnotification.SeeSDL_GLContextResetNotification;defaultstoNO_NOTIFICATION.*/SDL_GL_CONTEXT_NO_ERROR,SDL_GL_FLOATBUFFERS,SDL_GL_EGL_PLATFORM}SDL_GLAttr;

See Also