From 2ef8c5fac5db208e8b2220f67c666cb0934c9020 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Fri, 29 Nov 2019 08:54:39 +0200 Subject: iOS modular build and export implementation. --- servers/camera_server.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'servers/camera_server.h') 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 > feeds; static CameraServer *singleton; static void _bind_methods(); + template + static CameraServer *_create_builtin() { + return memnew(T); + } + public: static CameraServer *get_singleton(); + template + static void make_default() { + create_func = _create_builtin; + } + + 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(); -- cgit v1.2.3