diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2019-11-29 08:54:39 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2019-12-01 21:57:18 +0200 |
commit | 2ef8c5fac5db208e8b2220f67c666cb0934c9020 (patch) | |
tree | 31f4d2f8765f86ad8b870030eba044eaec206019 /servers/camera_server.h | |
parent | 52e3993eb0bc98b94c6d65e6901c38daae73b7fa (diff) | |
download | redot-engine-2ef8c5fac5db208e8b2220f67c666cb0934c9020.tar.gz |
iOS modular build and export implementation.
Diffstat (limited to 'servers/camera_server.h')
-rw-r--r-- | servers/camera_server.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/servers/camera_server.h b/servers/camera_server.h index c76d046e58..aa10f4dbb9 100644 --- a/servers/camera_server.h +++ b/servers/camera_server.h @@ -59,17 +59,36 @@ public: FEED_IMAGES = 2 }; + typedef CameraServer *(*CreateFunc)(); + private: protected: + static CreateFunc create_func; + Vector<Ref<CameraFeed> > feeds; static CameraServer *singleton; static void _bind_methods(); + template <class T> + static CameraServer *_create_builtin() { + return memnew(T); + } + public: static CameraServer *get_singleton(); + template <class T> + static void make_default() { + create_func = _create_builtin<T>; + } + + static CameraServer *create() { + CameraServer *server = create_func ? create_func() : memnew(CameraServer); + return server; + }; + // Right now we identify our feed by it's ID when it's used in the background. // May see if we can change this to purely relying on CameraFeed objects or by name. int get_free_id(); |