Flutter Impeller
IMPELLER_HPP_NAMESPACE::Context Class Reference

#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 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.

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 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  ),
391  }
Context(ImpellerContext context, AdoptTag tag)
Definition: impeller.hpp:369
#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:347

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


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