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 ()
 
- 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 12 of file playground_impl_gles.h.

Constructor & Destructor Documentation

◆ PlaygroundImplGLES()

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

Definition at line 54 of file playground_impl_gles.cc.

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

◆ ~PlaygroundImplGLES()

impeller::PlaygroundImplGLES::~PlaygroundImplGLES ( )
default

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