sdlGlSetAttribute function

int sdlGlSetAttribute(
  1. int attr,
  2. int value
)

Set an OpenGL window attribute before window creation.

This function sets the OpenGL attribute attr to value. The requested attributes should be set before creating an OpenGL window. You should use SDL_GL_GetAttribute() to check the values after creating the OpenGL context, since the values obtained can differ from the requested ones.

\param attr an SDL_GLattr enum value specifying the OpenGL attribute to set \param value the desired value for the attribute \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

\sa SDL_GL_GetAttribute \sa SDL_GL_ResetAttributes

extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value)

Implementation

int sdlGlSetAttribute(int attr, int value) {
  final sdlGlSetAttributeLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Int32 attr, Int32 value),
      int Function(int attr, int value)>('SDL_GL_SetAttribute');
  return sdlGlSetAttributeLookupFunction(attr, value);
}