Path: blob/master/modules/openxr/openxr_platform_inc.h
10277 views
/**************************************************************************/1/* openxr_platform_inc.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132// In various places we need to include platform definitions but we can't33// include these in our normal header files as we'll end up with issues.3435#ifdef VULKAN_ENABLED36#define XR_USE_GRAPHICS_API_VULKAN37#include "drivers/vulkan/rendering_context_driver_vulkan.h"38#endif // VULKAN_ENABLED3940#ifdef METAL_ENABLED41#define XR_USE_GRAPHICS_API_METAL42#include "drivers/metal/rendering_context_driver_metal.h"43#endif // METAL_ENABLED4445#if defined(GLES3_ENABLED) && !defined(MACOS_ENABLED)46#ifdef ANDROID_ENABLED47#define XR_USE_GRAPHICS_API_OPENGL_ES48#include <EGL/egl.h>49#include <EGL/eglext.h>50#include <GLES3/gl3.h>51#include <GLES3/gl3ext.h>52#else53#define XR_USE_GRAPHICS_API_OPENGL54#endif // ANDROID_ENABLED55#if defined(LINUXBSD_ENABLED) && defined(EGL_ENABLED)56#ifdef GLAD_ENABLED57#include "thirdparty/glad/glad/egl.h"58#else59#include <EGL/egl.h>60#endif // GLAD_ENABLED61#endif // defined(LINUXBSD_ENABLED) && defined(EGL_ENABLED)62#ifdef X11_ENABLED63#define GL_GLEXT_PROTOTYPES 164#define GL3_PROTOTYPES 165#include "thirdparty/glad/glad/gl.h"66#include "thirdparty/glad/glad/glx.h"67#endif // X11_ENABLED68#endif // defined(GLES3_ENABLED) && !defined(MACOS_ENABLED)6970#ifdef D3D12_ENABLED71#define XR_USE_GRAPHICS_API_D3D1272#include "drivers/d3d12/rendering_context_driver_d3d12.h"73#endif // D3D12_ENABLED7475#ifdef X11_ENABLED76#include <X11/Xlib.h>77#endif // X11_ENABLED7879#ifdef WINDOWS_ENABLED80// Including windows.h here is absolutely evil, we shouldn't be doing this outside of platform81// however due to the way the openxr headers are put together, we have no choice.82#include <windows.h>83#endif // WINDOWS_ENABLED8485#ifdef ANDROID_ENABLED86// The jobject type from jni.h is used by openxr_platform.h on Android.87#include <jni.h>88#endif // ANDROID_ENABLED8990// Include platform dependent structs.91#include <openxr/openxr_platform.h>929394