nuclear@0: /************************************************************************************ nuclear@0: nuclear@0: Filename : OVR_CAPI_GL.h nuclear@0: Content : GL specific structures used by the CAPI interface. nuclear@0: Created : November 7, 2013 nuclear@0: Authors : Lee Cooper nuclear@0: nuclear@0: Copyright : Copyright 2013 Oculus VR, LLC. All Rights reserved. nuclear@0: nuclear@0: Use of this software is subject to the terms of the Oculus Inc license nuclear@0: agreement provided at the time of installation or download, or which nuclear@0: otherwise accompanies this software in either electronic or hard copy form. nuclear@0: nuclear@0: ************************************************************************************/ nuclear@0: #ifndef OVR_CAPI_GL_h nuclear@0: #define OVR_CAPI_GL_h nuclear@0: nuclear@0: /// @file OVR_CAPI_GL.h nuclear@0: /// OpenGL rendering support. nuclear@0: nuclear@0: #include "OVR_CAPI.h" nuclear@0: #if defined(__APPLE__) nuclear@0: #include nuclear@0: #else nuclear@0: #include nuclear@0: #endif nuclear@0: nuclear@0: nuclear@0: /// Used to configure slave GL rendering (i.e. for devices created externally). nuclear@0: typedef struct OVR_ALIGNAS(8) ovrGLConfigData_s nuclear@0: { nuclear@0: /// General device settings. nuclear@0: ovrRenderAPIConfigHeader Header; nuclear@0: nuclear@0: #if defined(OVR_OS_WIN32) nuclear@0: /// The optional window handle. If unset, rendering will use the current window. nuclear@0: HWND Window; nuclear@0: /// The optional device context. If unset, rendering will use a new context. nuclear@0: HDC DC; nuclear@0: #elif defined (OVR_OS_LINUX) nuclear@0: /// Optional display. If unset, will issue glXGetCurrentDisplay when context nuclear@0: /// is current. nuclear@0: struct _XDisplay* Disp; nuclear@0: #endif nuclear@0: } ovrGLConfigData; nuclear@0: nuclear@0: /// Contains OpenGL-specific rendering information. nuclear@0: union ovrGLConfig nuclear@0: { nuclear@0: /// General device settings. nuclear@0: ovrRenderAPIConfig Config; nuclear@0: /// OpenGL-specific settings. nuclear@0: ovrGLConfigData OGL; nuclear@0: }; nuclear@0: nuclear@0: /// Used to pass GL eye texture data to ovrHmd_EndFrame. nuclear@0: typedef struct OVR_ALIGNAS(8) ovrGLTextureData_s nuclear@0: { nuclear@0: /// General device settings. nuclear@0: ovrTextureHeader Header; nuclear@0: /// The OpenGL name for this texture. nuclear@0: GLuint TexId; nuclear@0: } ovrGLTextureData; nuclear@0: nuclear@0: static_assert(offsetof(ovrGLTextureData, TexId) == offsetof(ovrTexture, PlatformData), "Mismatch of structs that are presumed binary equivalents."); nuclear@0: nuclear@0: /// Contains OpenGL-specific texture information. nuclear@0: typedef union ovrGLTexture_s nuclear@0: { nuclear@0: /// General device settings. nuclear@0: ovrTexture Texture; nuclear@0: /// OpenGL-specific settings. nuclear@0: ovrGLTextureData OGL; nuclear@0: } ovrGLTexture; nuclear@0: nuclear@0: #endif // OVR_CAPI_GL_h