ovr_sdk

annotate 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
rev   line source
nuclear@0 1 /************************************************************************************
nuclear@0 2
nuclear@0 3 Filename : OVR_CAPI_GL.h
nuclear@0 4 Content : GL specific structures used by the CAPI interface.
nuclear@0 5 Created : November 7, 2013
nuclear@0 6 Authors : Lee Cooper
nuclear@0 7
nuclear@0 8 Copyright : Copyright 2013 Oculus VR, LLC. All Rights reserved.
nuclear@0 9
nuclear@0 10 Use of this software is subject to the terms of the Oculus Inc license
nuclear@0 11 agreement provided at the time of installation or download, or which
nuclear@0 12 otherwise accompanies this software in either electronic or hard copy form.
nuclear@0 13
nuclear@0 14 ************************************************************************************/
nuclear@0 15 #ifndef OVR_CAPI_GL_h
nuclear@0 16 #define OVR_CAPI_GL_h
nuclear@0 17
nuclear@0 18 /// @file OVR_CAPI_GL.h
nuclear@0 19 /// OpenGL rendering support.
nuclear@0 20
nuclear@0 21 #include "OVR_CAPI.h"
nuclear@0 22 #if defined(__APPLE__)
nuclear@0 23 #include <OpenGL/gl.h>
nuclear@0 24 #else
nuclear@0 25 #include <GL/gl.h>
nuclear@0 26 #endif
nuclear@0 27
nuclear@0 28
nuclear@0 29 /// Used to configure slave GL rendering (i.e. for devices created externally).
nuclear@0 30 typedef struct OVR_ALIGNAS(8) ovrGLConfigData_s
nuclear@0 31 {
nuclear@0 32 /// General device settings.
nuclear@0 33 ovrRenderAPIConfigHeader Header;
nuclear@0 34
nuclear@0 35 #if defined(OVR_OS_WIN32)
nuclear@0 36 /// The optional window handle. If unset, rendering will use the current window.
nuclear@0 37 HWND Window;
nuclear@0 38 /// The optional device context. If unset, rendering will use a new context.
nuclear@0 39 HDC DC;
nuclear@0 40 #elif defined (OVR_OS_LINUX)
nuclear@0 41 /// Optional display. If unset, will issue glXGetCurrentDisplay when context
nuclear@0 42 /// is current.
nuclear@0 43 struct _XDisplay* Disp;
nuclear@0 44 #endif
nuclear@0 45 } ovrGLConfigData;
nuclear@0 46
nuclear@0 47 /// Contains OpenGL-specific rendering information.
nuclear@0 48 union ovrGLConfig
nuclear@0 49 {
nuclear@0 50 /// General device settings.
nuclear@0 51 ovrRenderAPIConfig Config;
nuclear@0 52 /// OpenGL-specific settings.
nuclear@0 53 ovrGLConfigData OGL;
nuclear@0 54 };
nuclear@0 55
nuclear@0 56 /// Used to pass GL eye texture data to ovrHmd_EndFrame.
nuclear@0 57 typedef struct OVR_ALIGNAS(8) ovrGLTextureData_s
nuclear@0 58 {
nuclear@0 59 /// General device settings.
nuclear@0 60 ovrTextureHeader Header;
nuclear@0 61 /// The OpenGL name for this texture.
nuclear@0 62 GLuint TexId;
nuclear@0 63 } ovrGLTextureData;
nuclear@0 64
nuclear@0 65 static_assert(offsetof(ovrGLTextureData, TexId) == offsetof(ovrTexture, PlatformData), "Mismatch of structs that are presumed binary equivalents.");
nuclear@0 66
nuclear@0 67 /// Contains OpenGL-specific texture information.
nuclear@0 68 typedef union ovrGLTexture_s
nuclear@0 69 {
nuclear@0 70 /// General device settings.
nuclear@0 71 ovrTexture Texture;
nuclear@0 72 /// OpenGL-specific settings.
nuclear@0 73 ovrGLTextureData OGL;
nuclear@0 74 } ovrGLTexture;
nuclear@0 75
nuclear@0 76 #endif // OVR_CAPI_GL_h