Open3D (C++ API)  0.19.0
FilamentEngine.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <memory>
11 #include <string>
12 
14 
15 namespace filament {
16 class Engine;
17 namespace backend {
18 class Platform;
19 } // namespace backend
20 } // namespace filament
21 
22 namespace open3d {
23 namespace visualization {
24 namespace rendering {
25 
26 class FilamentResourceManager;
27 
29 public:
30  // Selects backend to use.
31  // Should be called before instance usage.
32  // If not called, platform available default backend will be used.
33  static void SelectBackend(RenderingType type);
34 
35  // Specifies path to load shaders and skyboxes from. Must be called before
36  // instance usage, or default path will be used.
37  static void SetResourcePath(const std::string& resource_path);
38  static const std::string& GetResourcePath();
39  static void SetSharedContext(void* shared_context);
40  static void* GetSharedContext();
41 
42  static filament::Engine& GetInstance();
44  static filament::backend::Platform* GetPlatform();
45 
46  static RenderingType GetBackendType() { return type_; }
47 
51  static void DestroyInstance();
52 
54 
55 private:
56  static EngineInstance& Get();
57 
59 
60  static RenderingType type_;
61  static std::string resource_path_;
62  static void* shared_context_;
63  filament::Engine* engine_;
64  FilamentResourceManager* resource_manager_;
65 };
66 
67 } // namespace rendering
68 } // namespace visualization
69 } // namespace open3d
static void DestroyInstance()
Definition: FilamentEngine.cpp:98
static void SelectBackend(RenderingType type)
Definition: FilamentEngine.cpp:45
static void SetResourcePath(const std::string &resource_path)
Definition: FilamentEngine.cpp:47
static void * GetSharedContext()
Definition: FilamentEngine.cpp:61
static FilamentResourceManager & GetResourceManager()
Definition: FilamentEngine.cpp:65
static const std::string & GetResourcePath()
Definition: FilamentEngine.cpp:55
static filament::backend::Platform * GetPlatform()
Definition: FilamentEngine.cpp:69
static void SetSharedContext(void *shared_context)
Definition: FilamentEngine.cpp:57
static RenderingType GetBackendType()
Definition: FilamentEngine.h:46
static filament::Engine & GetInstance()
Definition: FilamentEngine.cpp:63
~EngineInstance()
Definition: FilamentEngine.cpp:73
Definition: FilamentResourceManager.h:50
char type
Definition: FilePCD.cpp:41
Definition: FilamentEngine.h:15
RenderingType
Definition: Renderer.h:57
Definition: PinholeCameraIntrinsic.cpp:16