| Flutter Impeller |

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

`#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 367 of file impeller.hpp.

## Constructor & Destructor Documentation

## ◆ Context()

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

Definition at line 369 of file impeller.hpp.

369 : 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 396 of file impeller.hpp.

396 {
397 return gGlobalProcTable.ImpellerContextGetVulkanInfo(Get(), &info);
398 }
IMPELLER_HPP_NAMESPACE::Object< ImpellerContext, ImpellerContextTraits >::Get
ImpellerContext Get() const
Definition: impeller.hpp:278
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 | ) |
| inlinestatic

See also
  ImpellerContextCreateOpenGLESNew

Definition at line 374 of file impeller.hpp.

375 {
376 struct UserData {
377 std::function<void*(const char*)> resolver;
378 };
379 UserData user_data;
380 user_data.resolver = gl_proc_address_resolver;
381 ImpellerProcAddressCallback callback = [](const char* proc_name,
382 void* user_data) -> void* {
383 return reinterpret_cast<UserData*>(user_data)->resolver(proc_name);
384 };
385 return Context(
386 gGlobalProcTable.ImpellerContextCreateOpenGLESNew(IMPELLER_VERSION, //
387 callback, //
388 &user_data //
389 ),
390 AdoptTag::kAdopt);
391 }
IMPELLER_HPP_NAMESPACE::Context::Context
Context(ImpellerContext context, AdoptTag tag)
Definition: impeller.hpp:369
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:347
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