| 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)
bool | GetVulkanInfo (ImpellerContextVulkanInfo &info) const
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 351 of file impeller.hpp.

## Constructor & Destructor Documentation

## ◆ Context()

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

Definition at line 353 of file impeller.hpp.

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

Referenced by OpenGLES().

## Member Function Documentation

## ◆ GetVulkanInfo()

bool IMPELLER_HPP_NAMESPACE::Context::GetVulkanInfo | ( | ImpellerContextVulkanInfo & | info | ) | const
| inline

See also
  ImpellerContextGetVulkanInfo

Definition at line 380 of file impeller.hpp.

380 {
381 return gGlobalProcTable.ImpellerContextGetVulkanInfo(Get(), &info);
382 }
IMPELLER_HPP_NAMESPACE::Object< ImpellerContext, ImpellerContextTraits >::Get
ImpellerContext Get() const
Definition: impeller.hpp:269
IMPELLER_HPP_NAMESPACE::gGlobalProcTable
ProcTable gGlobalProcTable
Definition: playground_test.cc:25

References IMPELLER_HPP_NAMESPACE::Object< ImpellerContext, ImpellerContextTraits >::Get(), and IMPELLER_HPP_NAMESPACE::gGlobalProcTable.

## ◆ 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 358 of file impeller.hpp.

359 {
360 struct UserData {
361 std::function<void*(const char*)> resolver;
362 };
363 UserData user_data;
364 user_data.resolver = gl_proc_address_resolver;
365 ImpellerProcAddressCallback callback = [](const char* proc_name,
366 void* user_data) -> void* {
367 return reinterpret_cast<UserData*>(user_data)->resolver(proc_name);
368 };
369 return Context(
370 gGlobalProcTable.ImpellerContextCreateOpenGLESNew(IMPELLER_VERSION, //
371 callback, //
372 &user_data //
373 ),
374 AdoptTag::kAdopt);
375 }
IMPELLER_HPP_NAMESPACE::Context::Context
Context(ImpellerContext context, AdoptTag tag)
Definition: impeller.hpp:353
IMPELLER_VERSION
#define IMPELLER_VERSION
Definition: impeller.h:103
ImpellerProcAddressCallback
void *IMPELLER_NULLABLE(* ImpellerProcAddressCallback)(const char *IMPELLER_NONNULL proc_name, void *IMPELLER_NULLABLE user_data)
Definition: impeller.h:338
IMPELLER_HPP_NAMESPACE::AdoptTag::kAdopt
@ kAdopt

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