Class context#

Nested Relationships#

Nested Types#

Class Documentation#

class context#

Utility function that implements basic OpenGL context symbol resolvers.

These functions should be used only when the rendering context (the OpenGL window) isn’t managed by libf3d, but by the user directly. Therefore, the engine is created using f3d::engine::createExternal and the functions below can be used as argument of this factory. One can also create a custom functor returning a f3d::context::function.

Public Types

using fptr = void (*)()#
using function = std::function<fptr(const char*)>#

Public Static Functions

static function glx()#

Create a GLX context function. Only supported on Linux.

static function wgl()#

Create a WGL context function. Only supported on Windows.

static function cocoa()#

Create a COCOA context function. This is usually required when using a headless context and a GPU device. Only supported on macOS.

static function egl()#

Create a EGL context function. This is usually required when using a headless context and a GPU device. Only supported on Linux and Windows.

static function osmesa()#

Create a OSMesa context function. This is usually required when using a headless context and no GPU device. Only supported on Linux and Windows.

static function getSymbol(const std::string &lib, const std::string &func)#

Create a context function from a library name and a function name. The library name must be specified without its prefix and extension. For example, getSymbol("EGL", "eglGetProcAddress") looks for the symbol eglGetProcAddress in the library libEGL.so on Linux.

struct loading_exception : public f3d::exception#

An exception that can be thrown when the requested library cannot be loaded.

Public Functions

explicit loading_exception(const std::string &what = "")#
struct symbol_exception : public f3d::exception#

An exception that can be thrown when the symbol resolver cannot be found in the library.

Public Functions

explicit symbol_exception(const std::string &what = "")#