Skip to content

TSdlGLAttr

An enumeration of OpenGL configuration attributes.

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 TSdlGL.Attributes.

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.

Definition

Unit: Neslib.Sdl3.Video

type TSdlGLAttr = (RedSize, GreenSize, BlueSize, AlphaSize, BufferSize, DoubleBuffer, DepthSize, StencilSize, AccumRedSize, AccumGreenSize, AccumBlueSize, AccumAlphaSize, Stereo, MultisampleBuffers, MultipsampleSamples...)

Enumeration Values

RedSize = SDL_GL_RED_SIZE

The minimum number of bits for the red channel of the color buffer; defaults to 3.


GreenSize = SDL_GL_GREEN_SIZE

The minimum number of bits for the green channel of the color buffer; defaults to 3.


BlueSize = SDL_GL_BLUE_SIZE

The minimum number of bits for the blue channel of the color buffer; defaults to 2.


AlphaSize = SDL_GL_ALPHA_SIZE

The minimum number of bits for the alpha channel of the color buffer; defaults to 0.


BufferSize = SDL_GL_BUFFER_SIZE

The minimum number of bits for frame buffer size; defaults to 0.


DoubleBuffer = SDL_GL_DOUBLEBUFFER

Whether the output is single or double buffered; defaults to double buffering on.


DepthSize = SDL_GL_DEPTH_SIZE

The minimum number of bits in the depth buffer; defaults to 16.


StencilSize = SDL_GL_STENCIL_SIZE

The minimum number of bits in the stencil buffer; defaults to 0.


AccumRedSize = SDL_GL_ACCUM_RED_SIZE

The minimum number of bits for the red channel of the accumulation buffer; defaults to 0.


AccumGreenSize = SDL_GL_ACCUM_GREEN_SIZE

The minimum number of bits for the green channel of the accumulation buffer; defaults to 0.


AccumBlueSize = SDL_GL_ACCUM_BLUE_SIZE

The minimum number of bits for the blue channel of the accumulation buffer; defaults to 0.


AccumAlphaSize = SDL_GL_ACCUM_ALPHA_SIZE

The minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0.


Stereo = SDL_GL_STEREO

Whether the output is stereo 3D; defaults to off.


MultisampleBuffers = SDL_GL_MULTISAMPLEBUFFERS

The number of buffers used for multisample anti-aliasing; defaults to 0.


MultipsampleSamples = SDL_GL_MULTISAMPLESAMPLES

The number of samples used around the current pixel used for multisample anti-aliasing.


AcceleratedVisual = SDL_GL_ACCELERATED_VISUAL

Set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either.


ContextMajorVersion = SDL_GL_CONTEXT_MAJOR_VERSION

OpenGL context major version.


ContextMinorVersion = SDL_GL_CONTEXT_MINOR_VERSION

OpenGL context minor version.


ContextFlags = SDL_GL_CONTEXT_FLAGS

Some combination of 0 or more of elements of the TSdlGLContextFlag enumeration; defaults to [].


ContextProfileMask = SDL_GL_CONTEXT_PROFILE_MASK

Type of GL context (Core, Compatibility, ES). See TSdlGLProfile; default value depends on platform.


ShareWithCurrentContext = SDL_GL_SHARE_WITH_CURRENT_CONTEXT

OpenGL context sharing; defaults to 0.


FramebufferSrgbCapable = SDL_GL_FRAMEBUFFER_SRGB_CAPABLE

Requests sRGB capable visual; defaults to 0.


ContextReleaseBehavior = SDL_GL_CONTEXT_RELEASE_BEHAVIOR

Sets context the release behavior. See TSdlGLContextReleaseFlags; defaults to [Flush].


ContextResetNotification = SDL_GL_CONTEXT_RESET_NOTIFICATION

Set context reset notification. See TSdlGLContextResetNotification; defaults to NoNotification.


ContextNoError = SDL_GL_CONTEXT_NO_ERROR


FloatBuffers = SDL_GL_FLOATBUFFERS


EglPlatform = SDL_GL_EGL_PLATFORM