ovr_sdk
diff LibOVR/Src/OVR_CAPI_GL.h @ 0:1b39a1b46319
initial 0.4.4
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 14 Jan 2015 06:51:16 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/LibOVR/Src/OVR_CAPI_GL.h Wed Jan 14 06:51:16 2015 +0200 1.3 @@ -0,0 +1,76 @@ 1.4 +/************************************************************************************ 1.5 + 1.6 +Filename : OVR_CAPI_GL.h 1.7 +Content : GL specific structures used by the CAPI interface. 1.8 +Created : November 7, 2013 1.9 +Authors : Lee Cooper 1.10 + 1.11 +Copyright : Copyright 2013 Oculus VR, LLC. All Rights reserved. 1.12 + 1.13 +Use of this software is subject to the terms of the Oculus Inc license 1.14 +agreement provided at the time of installation or download, or which 1.15 +otherwise accompanies this software in either electronic or hard copy form. 1.16 + 1.17 +************************************************************************************/ 1.18 +#ifndef OVR_CAPI_GL_h 1.19 +#define OVR_CAPI_GL_h 1.20 + 1.21 +/// @file OVR_CAPI_GL.h 1.22 +/// OpenGL rendering support. 1.23 + 1.24 +#include "OVR_CAPI.h" 1.25 +#if defined(__APPLE__) 1.26 + #include <OpenGL/gl.h> 1.27 +#else 1.28 + #include <GL/gl.h> 1.29 +#endif 1.30 + 1.31 + 1.32 +/// Used to configure slave GL rendering (i.e. for devices created externally). 1.33 +typedef struct OVR_ALIGNAS(8) ovrGLConfigData_s 1.34 +{ 1.35 + /// General device settings. 1.36 + ovrRenderAPIConfigHeader Header; 1.37 + 1.38 +#if defined(OVR_OS_WIN32) 1.39 + /// The optional window handle. If unset, rendering will use the current window. 1.40 + HWND Window; 1.41 + /// The optional device context. If unset, rendering will use a new context. 1.42 + HDC DC; 1.43 +#elif defined (OVR_OS_LINUX) 1.44 + /// Optional display. If unset, will issue glXGetCurrentDisplay when context 1.45 + /// is current. 1.46 + struct _XDisplay* Disp; 1.47 +#endif 1.48 +} ovrGLConfigData; 1.49 + 1.50 +/// Contains OpenGL-specific rendering information. 1.51 +union ovrGLConfig 1.52 +{ 1.53 + /// General device settings. 1.54 + ovrRenderAPIConfig Config; 1.55 + /// OpenGL-specific settings. 1.56 + ovrGLConfigData OGL; 1.57 +}; 1.58 + 1.59 +/// Used to pass GL eye texture data to ovrHmd_EndFrame. 1.60 +typedef struct OVR_ALIGNAS(8) ovrGLTextureData_s 1.61 +{ 1.62 + /// General device settings. 1.63 + ovrTextureHeader Header; 1.64 + /// The OpenGL name for this texture. 1.65 + GLuint TexId; 1.66 +} ovrGLTextureData; 1.67 + 1.68 +static_assert(offsetof(ovrGLTextureData, TexId) == offsetof(ovrTexture, PlatformData), "Mismatch of structs that are presumed binary equivalents."); 1.69 + 1.70 +/// Contains OpenGL-specific texture information. 1.71 +typedef union ovrGLTexture_s 1.72 +{ 1.73 + /// General device settings. 1.74 + ovrTexture Texture; 1.75 + /// OpenGL-specific settings. 1.76 + ovrGLTextureData OGL; 1.77 +} ovrGLTexture; 1.78 + 1.79 +#endif // OVR_CAPI_GL_h