Modules | Macros | Typedefs | Functions
Initialization, version and error reference

Functions and types related to initialization and error handling. More...

Collaboration diagram for Initialization, version and error reference:

Modules

 Error codes
 Error codes.
 

Macros

#define GLFW_COCOA_CHDIR_RESOURCES   0x00051001
 macOS specific init hint. More...
 
#define GLFW_COCOA_MENUBAR   0x00051002
 macOS specific init hint. More...
 
#define GLFW_FALSE   0
 Zero. More...
 
#define GLFW_JOYSTICK_HAT_BUTTONS   0x00050001
 Joystick hat buttons init hint. More...
 
#define GLFW_TRUE   1
 One. More...
 

Typedefs

typedef void(* GLFWerrorfun) (int, const char *)
 The function signature for error callbacks. More...
 

Functions

GLFWAPI int glfwGetError (const char **description)
 Returns and clears the last error for the calling thread. More...
 
GLFWAPI void glfwGetVersion (int *major, int *minor, int *rev)
 Retrieves the version of the GLFW library. More...
 
GLFWAPI const char * glfwGetVersionString (void)
 Returns a string describing the compile-time configuration. More...
 
GLFWAPI int glfwInit (void)
 Initializes the GLFW library. More...
 
GLFWAPI void glfwInitHint (int hint, int value)
 Sets the specified init hint to the desired value. More...
 
GLFWAPI GLFWerrorfun glfwSetErrorCallback (GLFWerrorfun cbfun)
 Sets the error callback. More...
 
GLFWAPI void glfwTerminate (void)
 Terminates the GLFW library. More...
 

GLFW version macros

#define GLFW_VERSION_MAJOR   3
 The major version number of the GLFW library. More...
 
#define GLFW_VERSION_MINOR   3
 The minor version number of the GLFW library. More...
 
#define GLFW_VERSION_REVISION   0
 The revision number of the GLFW library. More...
 

Detailed Description

Functions and types related to initialization and error handling.

This is the reference documentation for initialization and termination of the library, version management and error handling. For more task-oriented information, see the Introduction to the API.

Macro Definition Documentation

#define GLFW_COCOA_CHDIR_RESOURCES   0x00051001

macOS specific init hint.

macOS specific init hint

Definition at line 1072 of file glfw3.h.

#define GLFW_COCOA_MENUBAR   0x00051002

macOS specific init hint.

macOS specific init hint

Definition at line 1077 of file glfw3.h.

#define GLFW_FALSE   0

Zero.

This is only semantic sugar for the number 0. You can instead use 0 or false or _False or GL_FALSE or anything else that is equal to zero.

Definition at line 287 of file glfw3.h.

#define GLFW_JOYSTICK_HAT_BUTTONS   0x00050001

Joystick hat buttons init hint.

Joystick hat buttons init hint

Definition at line 1067 of file glfw3.h.

#define GLFW_TRUE   1

One.

This is only semantic sugar for the number 1. You can instead use 1 or true or _True or GL_TRUE or anything else that is equal to one.

Definition at line 279 of file glfw3.h.

#define GLFW_VERSION_MAJOR   3

The major version number of the GLFW library.

This is incremented when the API is changed in non-compatible ways.

Definition at line 255 of file glfw3.h.

#define GLFW_VERSION_MINOR   3

The minor version number of the GLFW library.

This is incremented when features are added to the API but it remains backward-compatible.

Definition at line 262 of file glfw3.h.

#define GLFW_VERSION_REVISION   0

The revision number of the GLFW library.

This is incremented when a bug fix release is made that does not contain any API changes.

Definition at line 269 of file glfw3.h.

Typedef Documentation

typedef void(* GLFWerrorfun) (int, const char *)

The function signature for error callbacks.

This is the function signature for error callback functions.

Parameters
[in]errorAn error code.
[in]descriptionA UTF-8 encoded string describing the error.
See also
Error handling
glfwSetErrorCallback
Since
Added in version 3.0.

Definition at line 1165 of file glfw3.h.

Function Documentation

GLFWAPI int glfwGetError ( const char **  description)

Returns and clears the last error for the calling thread.

This function returns and clears the error code of the last error that occurred on the calling thread, and optionally a UTF-8 encoded human-readable description of it. If no error has occurred since the last call, it returns GLFW_NO_ERROR (zero) and the description pointer is set to NULL.

Parameters
[in]descriptionWhere to store the error description pointer, or NULL.
Returns
The last error code for the calling thread, or GLFW_NO_ERROR (zero).

None.

The returned string is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the next error occurs or the library is terminated.

Remarks
This function may be called before glfwInit.

This function may be called from any thread.

See also
Error handling
glfwSetErrorCallback
Since
Added in version 3.3.

Definition at line 285 of file init.c.

GLFWAPI void glfwGetVersion ( int *  major,
int *  minor,
int *  rev 
)

Retrieves the version of the GLFW library.

This function retrieves the major, minor and revision numbers of the GLFW library. It is intended for when you are using GLFW as a shared library and want to ensure that you are using the minimum required version.

Any or all of the version arguments may be NULL.

Parameters
[out]majorWhere to store the major version number, or NULL.
[out]minorWhere to store the minor version number, or NULL.
[out]revWhere to store the revision number, or NULL.

None.

Remarks
This function may be called before glfwInit.

This function may be called from any thread.

See also
Version management
glfwGetVersionString
Since
Added in version 1.0.

Definition at line 270 of file init.c.

GLFWAPI const char* glfwGetVersionString ( void  )

Returns a string describing the compile-time configuration.

This function returns the compile-time generated version string of the GLFW library binary. It describes the version, platform, compiler and any platform-specific compile-time options. It should not be confused with the OpenGL or OpenGL ES version string, queried with glGetString.

Do not use the version string to parse the GLFW library version. The glfwGetVersion function provides the version of the running library binary in numerical format.

Returns
The ASCII encoded GLFW version string.

None.

Remarks
This function may be called before glfwInit.

The returned string is static and compile-time generated.

This function may be called from any thread.

See also
Version management
glfwGetVersion
Since
Added in version 3.0.

Definition at line 280 of file init.c.

GLFWAPI int glfwInit ( void  )

Initializes the GLFW library.

This function initializes the GLFW library. Before most GLFW functions can be used, GLFW must be initialized, and before an application terminates GLFW should be terminated in order to free any resources allocated during or after initialization.

If this function fails, it calls glfwTerminate before returning. If it succeeds, you should call glfwTerminate before the application exits.

Additional calls to this function after successful initialization but before termination will return GLFW_TRUE immediately.

Returns
GLFW_TRUE if successful, or GLFW_FALSE if an error occurred.

Possible errors include GLFW_PLATFORM_ERROR.

Remarks
This function will change the current directory of the application to the Contents/Resources subdirectory of the application's bundle, if present. This can be disabled with the GLFW_COCOA_CHDIR_RESOURCES init hint.

This function must only be called from the main thread.

See also
Initialization and termination
glfwTerminate
Since
Added in version 1.0.

Definition at line 198 of file init.c.

GLFWAPI void glfwInitHint ( int  hint,
int  value 
)

Sets the specified init hint to the desired value.

This function sets hints for the next initialization of GLFW.

The values you set hints to are never reset by GLFW, but they only take effect during initialization. Once GLFW has been initialized, any values you set will be ignored until the library is terminated and initialized again.

Some hints are platform specific. These may be set on any platform but they will only affect their specific platform. Other platforms will ignore them. Setting these hints requires no platform specific headers or functions.

Parameters
[in]hintThe init hint to set.
[in]valueThe new value of the init hint.

Possible errors include GLFW_INVALID_ENUM and GLFW_INVALID_VALUE.

Remarks
This function may be called before glfwInit.

This function must only be called from the main thread.

See also
init_hints
glfwInit
Since
Added in version 3.3.

Definition at line 251 of file init.c.

GLFWAPI GLFWerrorfun glfwSetErrorCallback ( GLFWerrorfun  cbfun)

Sets the error callback.

This function sets the error callback, which is called with an error code and a human-readable description each time a GLFW error occurs.

The error code is set before the callback is called. Calling glfwGetError from the error callback will return the same value as the error code argument.

The error callback is called on the thread where the error occurred. If you are using GLFW from multiple threads, your error callback needs to be written accordingly.

Because the description string may have been generated specifically for that error, it is not guaranteed to be valid after the callback has returned. If you wish to use it after the callback returns, you need to make a copy.

Once set, the error callback remains set even after the library has been terminated.

Parameters
[in]cbfunThe new callback, or NULL to remove the currently set callback.
Returns
The previously set callback, or NULL if no callback was set.

None.

Remarks
This function may be called before glfwInit.

This function must only be called from the main thread.

See also
Error handling
glfwGetError
Since
Added in version 3.0.

Definition at line 309 of file init.c.

GLFWAPI void glfwTerminate ( void  )

Terminates the GLFW library.

This function destroys all remaining windows and cursors, restores any modified gamma ramps and frees any other allocated resources. Once this function is called, you must again call glfwInit successfully before you will be able to use most GLFW functions.

If GLFW has been successfully initialized, this function should be called before the application exits. If initialization fails, there is no need to call this function, as it is called by glfwInit before it returns failure.

Possible errors include GLFW_PLATFORM_ERROR.

Remarks
This function may be called before glfwInit.
Warning
The contexts of any remaining windows must not be current on any other thread when this function is called.

This function must not be called from a callback.

This function must only be called from the main thread.

See also
Initialization and termination
glfwInit
Since
Added in version 1.0.

Definition at line 243 of file init.c.



librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:31