Flutter Impeller
IMPELLER_HPP_NAMESPACE::Context Class Referencefinal

#include <impeller.hpp>

Inheritance diagram for IMPELLER_HPP_NAMESPACE::Context:
IMPELLER_HPP_NAMESPACE::Object< ImpellerContext, ImpellerContextTraits >

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 ()
 
Objectoperator= (Object &&other)
 
Objectoperator= (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.

Referenced by OpenGLES().

Member Function Documentation

◆ GetVulkanInfo()

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

◆ 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 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  ),
375  }
Context(ImpellerContext context, AdoptTag tag)
Definition: impeller.hpp:353
#define IMPELLER_VERSION
Definition: impeller.h:103
void *IMPELLER_NULLABLE(* ImpellerProcAddressCallback)(const char *IMPELLER_NONNULL proc_name, void *IMPELLER_NULLABLE user_data)
Definition: impeller.h:338

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


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