Context#

Typedefs

typedef void (*GlFunctionPointer)()#

Functions

sfContext *sfContext_create(void)#

Create a new context.

This function activates the new context.

Returns:

New sfContext object

void sfContext_destroy(sfContext *context)#

Destroy a context.

Parameters:
  • context – Context to destroy

sfBool sfContext_isExtensionAvailable(const char *name)#

Check whether a given OpenGL extension is available.

Parameters:
  • Name – of the extension to check for

Returns:

True if available, false if unavailable

sfBool sfContext_setActive(sfContext *context, sfBool active)#

Activate or deactivate explicitely a context.

Parameters:
  • context – Context object

  • active – sfTrue to activate, sfFalse to deactivate

Returns:

sfTrue on success, sfFalse on failure

GlFunctionPointer sfContext_getFunction(const char *name)#

Get the address of an OpenGL function.

Parameters:
  • name – Name of the function to get the address of

Returns:

Address of the OpenGL function, 0 on failure

sfContextSettings sfContext_getSettings(const sfContext *context)#

Get the settings of the context.

Note that these settings may be different than the ones passed to the constructor; they are indeed adjusted if the original settings are not directly supported by the system.

Returns:

Structure containing the settings

sfUint64 sfContext_getActiveContextId()#

Get the currently active context’s ID.

The context ID is used to identify contexts when managing unshareable OpenGL resources.

Returns:

The active context’s ID or 0 if no context is currently active