diff options
author | Sven Gothel <[email protected]> | 2015-03-28 02:08:11 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-28 02:08:11 +0100 |
commit | 450aa6f7df9e67dd256b86f94e65eaf707032aad (patch) | |
tree | 04aa207d84ddc8ca246d2573aaaf756b3ce8a0b5 /LibOVR/Include/OVR_CAPI_GL.h | |
parent | 3c7b8a17e907f4ef2afd9f77db566a3f6179cbe4 (diff) | |
parent | 4207f9c279e832e3afcb3f5fc6cd8d84cb4cfe4c (diff) |
Merge branch 'vanilla_0.5.0.1' into jogamp_0.5.0.1
Conflicts:
LibOVR/Include/OVR_CAPI_0_5_0.h
LibOVR/Src/CAPI/CAPI_HMDState.cpp
LibOVR/Src/Displays/OVR_Win32_Dxgi_Display.h
LibOVR/Src/Kernel/OVR_System.cpp
LibOVR/Src/OVR_CAPI.cpp
LibOVR/Src/OVR_Profile.cpp
LibOVRKernel/Src/Kernel/OVR_ThreadsWinAPI.cpp
LibOVRKernel/Src/Kernel/OVR_Types.h
Diffstat (limited to 'LibOVR/Include/OVR_CAPI_GL.h')
-rw-r--r-- | LibOVR/Include/OVR_CAPI_GL.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/LibOVR/Include/OVR_CAPI_GL.h b/LibOVR/Include/OVR_CAPI_GL.h new file mode 100644 index 0000000..ef7cb45 --- /dev/null +++ b/LibOVR/Include/OVR_CAPI_GL.h @@ -0,0 +1,87 @@ +/************************************************************************************ + +Filename : OVR_CAPI_GL.h +Content : GL specific structures used by the CAPI interface. +Created : November 7, 2013 +Authors : Lee Cooper + +Copyright : Copyright 2013 Oculus VR, LLC. All Rights reserved. + +Use of this software is subject to the terms of the Oculus Inc license +agreement provided at the time of installation or download, or which +otherwise accompanies this software in either electronic or hard copy form. + +************************************************************************************/ +#ifndef OVR_CAPI_GL_h +#define OVR_CAPI_GL_h + +/// @file OVR_CAPI_GL.h +/// OpenGL rendering support. + +#include "OVR_CAPI.h" + +#if defined(OVR_OS_WIN32) + #include <Windows.h> + #include <gl/GL.h> +#elif defined(__APPLE__) + #include <OpenGL/gl.h> +#else + #include <GL/gl.h> +#endif + + +#if defined(_MSC_VER) + #pragma warning(push) + #pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + + +/// Used to configure slave GL rendering (i.e. for devices created externally). +typedef struct ovrGLConfigData_s +{ + ovrRenderAPIConfigHeader Header; ///< General device settings. + +#if defined(OVR_OS_WIN32) + HWND Window; ///< The optional window handle. If unset, rendering will use the current window. + HDC DC; ///< The optional device context. If unset, rendering will use a new context. +#elif defined (OVR_OS_LINUX) + struct _XDisplay* Disp; ///< Optional display. If unset, will issue glXGetCurrentDisplay when context is current. +#endif +} ovrGLConfigData; + +#if defined(__cplusplus) + static_assert(sizeof(ovrRenderAPIConfig) >= sizeof(ovrGLConfigData), "Insufficient size."); +#endif + +/// Contains OpenGL-specific rendering information. +union ovrGLConfig +{ + ovrRenderAPIConfig Config; ///< General device settings. + ovrGLConfigData OGL; ///< OpenGL-specific settings. +}; + +/// Used to pass GL eye texture data to ovrHmd_EndFrame. +typedef struct ovrGLTextureData_s +{ + ovrTextureHeader Header; ///< General device settings. + GLuint TexId; ///< The OpenGL name for this texture. +} ovrGLTextureData; + +#if defined(__cplusplus) + static_assert(sizeof(ovrTexture) >= sizeof(ovrGLTextureData), "Insufficient size."); +#endif + +/// Contains OpenGL-specific texture information. +typedef union ovrGLTexture_s +{ + ovrTexture Texture; ///< General device settings. + ovrGLTextureData OGL; ///< OpenGL-specific settings. +} ovrGLTexture; + + +#if defined(_MSC_VER) + #pragma warning(pop) +#endif + + +#endif // OVR_CAPI_GL_h |