Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-03-17 22:10:57 +0300
committerJulian Eisel <julian@blender.org>2020-03-17 23:39:59 +0300
commit406bfd43040a5526702b51f88f1491cb61aecedb (patch)
tree980c77919f9930d51c5f4f411d2e658f66a263e5 /intern/ghost/GHOST_IXrContext.h
parentc9a8de1d704b807460a7a6838db28f7ae2472200 (diff)
Ghost: Ghost-XR API to abstract away and access OpenXR functionality
Extends Ghost to include an abstraction for OpenXR, which I refer to as Ghost-XR. Such an API is the base for the following commit, which introduces VR support to Blender. Main features: * Simple and high-level interface for Blender specific code to call. * Extensible for muliple graphics backends, currently OpenGL and a DirectX compatibility layer are supported. * Carefully designed error handling strategy allowing Blender to handle errors gracefully and with useful error messages. * OpenXR extension and API-layer management. * OpenXR session management. * Basic OpenXR event management. * Debug utilities for Ghost-XR and OpenXR For more information on this API, check https://wiki.blender.org/wiki/Source/Interface/XR. Reviewed by: Brecht Van Lommel Differential Revision: https://developer.blender.org/D6188
Diffstat (limited to 'intern/ghost/GHOST_IXrContext.h')
-rw-r--r--intern/ghost/GHOST_IXrContext.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/intern/ghost/GHOST_IXrContext.h b/intern/ghost/GHOST_IXrContext.h
new file mode 100644
index 00000000000..362bc923ee8
--- /dev/null
+++ b/intern/ghost/GHOST_IXrContext.h
@@ -0,0 +1,42 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/** \file
+ * \ingroup GHOST
+ */
+
+#ifndef __GHOST_IXRCONTEXT_H__
+#define __GHOST_IXRCONTEXT_H__
+
+#include "GHOST_Types.h"
+
+class GHOST_IXrContext {
+ public:
+ virtual ~GHOST_IXrContext() = default;
+
+ virtual void startSession(const GHOST_XrSessionBeginInfo *begin_info) = 0;
+ virtual void endSession() = 0;
+ virtual bool isSessionRunning() const = 0;
+ virtual void drawSessionViews(void *draw_customdata) = 0;
+
+ virtual void dispatchErrorMessage(const class GHOST_XrException *) const = 0;
+
+ virtual void setGraphicsContextBindFuncs(GHOST_XrGraphicsContextBindFn bind_fn,
+ GHOST_XrGraphicsContextUnbindFn unbind_fn) = 0;
+ virtual void setDrawViewFunc(GHOST_XrDrawViewFn draw_view_fn) = 0;
+};
+
+#endif // __GHOST_IXRCONTEXT_H__