Flutter Impeller
impeller::PlaygroundImplGLES Class Referencefinal

#include <playground_impl_gles.h>

Inheritance diagram for impeller::PlaygroundImplGLES:
impeller::PlaygroundImpl

Classes

class  ReactorWorker
 

Public Member Functions

 PlaygroundImplGLES (PlaygroundSwitches switches)
 
 ~PlaygroundImplGLES ()
 
fml::Status SetCapabilities (const std::shared_ptr< Capabilities > &capabilities) override
 
- Public Member Functions inherited from impeller::PlaygroundImpl
virtual ~PlaygroundImpl ()
 
Vector2 GetContentScale () const
 

Additional Inherited Members

- Public Types inherited from impeller::PlaygroundImpl
using WindowHandle = void *
 
- Static Public Member Functions inherited from impeller::PlaygroundImpl
static std::unique_ptr< PlaygroundImplCreate (PlaygroundBackend backend, PlaygroundSwitches switches)
 
- Protected Member Functions inherited from impeller::PlaygroundImpl
 PlaygroundImpl (PlaygroundSwitches switches)
 
- Protected Attributes inherited from impeller::PlaygroundImpl
const PlaygroundSwitches switches_
 

Detailed Description

Definition at line 13 of file playground_impl_gles.h.

Constructor & Destructor Documentation

◆ PlaygroundImplGLES()

impeller::PlaygroundImplGLES::PlaygroundImplGLES ( PlaygroundSwitches  switches)
explicit

Definition at line 56 of file playground_impl_gles.cc.

57  : PlaygroundImpl(switches),
58  handle_(nullptr, &DestroyWindowHandle),
59  worker_(std::shared_ptr<ReactorWorker>(new ReactorWorker())) {
60  ::glfwDefaultWindowHints();
61 
62 #if FML_OS_MACOSX
63  // ES Profiles are not supported on Mac.
64  ::glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
65 #else // FML_OS_MACOSX
66  ::glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
67  ::glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
68  ::glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
69 #endif // FML_OS_MACOSX
70  ::glfwWindowHint(GLFW_RED_BITS, 8);
71  ::glfwWindowHint(GLFW_GREEN_BITS, 8);
72  ::glfwWindowHint(GLFW_BLUE_BITS, 8);
73  ::glfwWindowHint(GLFW_ALPHA_BITS, 8);
74  ::glfwWindowHint(GLFW_DEPTH_BITS, 32); // 32 bit depth buffer
75  ::glfwWindowHint(GLFW_STENCIL_BITS, 8); // 8 bit stencil buffer
76  ::glfwWindowHint(GLFW_SAMPLES, 4); // 4xMSAA
77 
78  ::glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
79 
80  auto window = ::glfwCreateWindow(1, 1, "Test", nullptr, nullptr);
81 
82  ::glfwMakeContextCurrent(window);
83  worker_->SetReactionsAllowedOnCurrentThread(true);
84 
85  handle_.reset(window);
86 }

◆ ~PlaygroundImplGLES()

impeller::PlaygroundImplGLES::~PlaygroundImplGLES ( )
default

Member Function Documentation

◆ SetCapabilities()

fml::Status impeller::PlaygroundImplGLES::SetCapabilities ( const std::shared_ptr< Capabilities > &  capabilities)
overridevirtual

Implements impeller::PlaygroundImpl.

Definition at line 159 of file playground_impl_gles.cc.

160  {
161  return fml::Status(
162  fml::StatusCode::kUnimplemented,
163  "PlaygroundImplGLES doesn't support setting the capabilities.");
164 }

The documentation for this class was generated from the following files:
impeller::PlaygroundImpl::PlaygroundImpl
PlaygroundImpl(PlaygroundSwitches switches)
Definition: playground_impl.cc:48