ovr_sdk

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