| Flutter Impeller |

Public Member Functions | Static Public Member Functions | List of all members
IMPELLER_HPP_NAMESPACE::Context Class Referencefinal

`#include <impeller.hpp>`

Inheritance diagram for IMPELLER_HPP_NAMESPACE::Context:

## Public Member Functions
| Context (ImpellerContext context, AdoptTag tag)
Public Member Functions inherited from IMPELLER_HPP_NAMESPACE::Object< ImpellerContext, ImpellerContextTraits >
| Object ()=default
| Object (ImpellerContext object)
| Object (ImpellerContext object, AdoptTag)
| Object (Object &&other)
| Object (const Object &other)
| ~Object ()
Object & | operator= (Object &&other)
Object & | operator= (const Object &other)
ImpellerContext | Get () const
| operator bool () const

## Static Public Member Functions
static Context | OpenGLES (const std::function< void *(const char *)> &gl_proc_address_resolver)

## Detailed Description

See also
  ImpellerContext

Definition at line 313 of file impeller.hpp.

## Constructor & Destructor Documentation

## ◆ Context()

IMPELLER_HPP_NAMESPACE::Context::Context | ( | ImpellerContext | context,
|  | AdoptTag | tag
| ) |  |
| inline

Definition at line 315 of file impeller.hpp.

315 : Object(context, tag) {}
IMPELLER_HPP_NAMESPACE::Object< ImpellerContext, ImpellerContextTraits >::Object
Object()=default

Referenced by OpenGLES().

## Member Function Documentation

## ◆ OpenGLES()

static Context IMPELLER_HPP_NAMESPACE::Context::OpenGLES | ( | const std::function< void *(const char *)> & | gl_proc_address_resolver | ) |
| inline static

See also
  ImpellerContextCreateOpenGLESNew

Definition at line 320 of file impeller.hpp.

321 {
322 struct UserData {
323 std::function<void*(const char*)> resolver;
324 };
325 UserData user_data;
326 user_data.resolver = gl_proc_address_resolver;
327 ImpellerProcAddressCallback callback = [](const char* proc_name,
328 void* user_data) -> void* {
329 return reinterpret_cast<UserData*>(user_data)->resolver(proc_name);
330 };
331 return Context(
332 gGlobalProcTable.ImpellerContextCreateOpenGLESNew(IMPELLER_VERSION, //
333 callback, //
334 &user_data //
335 ),
336 AdoptTag::kAdopt);
337 }
IMPELLER_HPP_NAMESPACE::Context::Context
Context(ImpellerContext context, AdoptTag tag)
Definition: impeller.hpp:315
IMPELLER_VERSION
#define IMPELLER_VERSION
Definition: impeller.h:101
ImpellerProcAddressCallback
void *IMPELLER_NULLABLE(* ImpellerProcAddressCallback)(const char *IMPELLER_NONNULL proc_name, void *IMPELLER_NULLABLE user_data)
Definition: impeller.h:310
IMPELLER_HPP_NAMESPACE::AdoptTag::kAdopt
@ kAdopt
IMPELLER_HPP_NAMESPACE::gGlobalProcTable
ProcTable gGlobalProcTable
Definition: playground_test.cc:10

References Context(), IMPELLER_HPP_NAMESPACE::gGlobalProcTable, IMPELLER_VERSION, and IMPELLER_HPP_NAMESPACE::kAdopt.

The documentation for this class was generated from the following file:

- impeller/toolkit/interop/impeller.hpp