CSFML - C binding of the Simple and Fast Multimedia Library

CSFML 3.0.0

- Main Page
- Classes
- Files

- File List
- File Members

Loading...
Searching...
No Matches
Typedefs | Functions
Context.h File Reference
`#include <CSFML/Window/Export.h>`
`#include <CSFML/Window/Types.h>`
`#include <CSFML/Window/Window.h>`

Go to the source code of this file.

## Typedefs
typedef void(* | sfGlFunctionPointer) (void)

## Functions
sfContext * | sfContext_create (void)
| Create a new context.
void | sfContext_destroy (const sfContext *context)
| Destroy a context.
bool | sfContext_isExtensionAvailable (const char *name)
| Check whether a given OpenGL extension is available.
bool | sfContext_setActive (sfContext *context, bool active)
| Activate or deactivate explicitly a context.
sfGlFunctionPointer | sfContext_getFunction (const char *name)
| Get the address of an OpenGL function.
sfContextSettings | sfContext_getSettings (const sfContext *context)
| Get the settings of the context.
uint64_t | sfContext_getActiveContextId (void)
| Get the currently active context's ID.

## Typedef Documentation

## ◆ sfGlFunctionPointer

typedef void(* sfGlFunctionPointer) (void)

Definition at line 35 of file Context.h.

## Function Documentation

## ◆ sfContext_create()

sfContext * sfContext_create | ( | void |  | ) |

Create a new context.

This function activates the new context.

Returns
  New sfContext object

## ◆ sfContext_destroy()

void sfContext_destroy | ( | const sfContext * | context | ) |

Destroy a context.

Parameters

  context | Context to destroy

## ◆ sfContext_getActiveContextId()

uint64_t sfContext_getActiveContextId | ( | void |  | ) |

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

## ◆ sfContext_getFunction()

sfGlFunctionPointer 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

## ◆ sfContext_getSettings()

sfContextSettings sfContext_getSettings | ( | const sfContext * | context | ) |

Get the settings of the context.

Parameters

  context | Context object

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

## ◆ sfContext_isExtensionAvailable()

bool sfContext_isExtensionAvailable | ( | const char * | name | ) |

Check whether a given OpenGL extension is available.

Parameters

  name | Name of the extension to check for

Returns
  True if available, false if unavailable

## ◆ sfContext_setActive()

bool sfContext_setActive | ( | sfContext * | context,
|  | bool | active )

Activate or deactivate explicitly a context.

Parameters

  context | Context object
  active | true to activate, false to deactivate

Returns
  true on success, false on failure