summaryrefslogtreecommitdiffstats
path: root/LibOVR/Src/OVR_CAPI_GL.h
diff options
context:
space:
mode:
Diffstat (limited to 'LibOVR/Src/OVR_CAPI_GL.h')
-rw-r--r--LibOVR/Src/OVR_CAPI_GL.h63
1 files changed, 33 insertions, 30 deletions
diff --git a/LibOVR/Src/OVR_CAPI_GL.h b/LibOVR/Src/OVR_CAPI_GL.h
index ceabb74..2aa846f 100644
--- a/LibOVR/Src/OVR_CAPI_GL.h
+++ b/LibOVR/Src/OVR_CAPI_GL.h
@@ -5,7 +5,7 @@ Content : GL specific structures used by the CAPI interface.
Created : November 7, 2013
Authors : Lee Cooper
-Copyright : Copyright 2013 Oculus VR, Inc. All Rights reserved.
+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
@@ -15,59 +15,62 @@ otherwise accompanies this software in either electronic or hard copy form.
#ifndef OVR_CAPI_GL_h
#define OVR_CAPI_GL_h
-#include "OVR_CAPI.h"
-
-//-----------------------------------------------------------------------------------
-// ***** GL Specific
+/// @file OVR_CAPI_GL.h
+/// OpenGL rendering support.
-#if defined(OVR_OS_WIN32)
- #include <Windows.h>
- #include <GL/gl.h>
- #include <GL/glext.h>
- #include <GL/wglext.h>
-#elif defined(OVR_OS_MAC)
- #include <OpenGL/gl3.h>
- #include <OpenGL/gl3ext.h>
- #include <OpenGL/OpenGL.h>
+#include "OVR_CAPI.h"
+#if defined(__APPLE__)
+ #include <OpenGL/gl.h>
#else
#include <GL/gl.h>
- #include <GL/glext.h>
- #include <GL/glx.h>
#endif
-// Used to configure slave GL rendering (i.e. for devices created externally).
-typedef struct ovrGLConfigData_s
+/// Used to configure slave GL rendering (i.e. for devices created externally).
+typedef struct OVR_ALIGNAS(8) ovrGLConfigData_s
{
- // General device settings.
+ /// General device settings.
ovrRenderAPIConfigHeader Header;
#if defined(OVR_OS_WIN32)
- HWND Window;
-#elif defined(OVR_OS_LINUX)
- Display* Disp;
- Window Win;
+ /// The optional window handle. If unset, rendering will use the current window.
+ HWND Window;
+ /// The optional device context. If unset, rendering will use a new context.
+ HDC DC;
+#elif defined (OVR_OS_LINUX)
+ /// Optional display. If unset, will issue glXGetCurrentDisplay when context
+ /// is current.
+ struct _XDisplay* Disp;
#endif
} ovrGLConfigData;
+/// Contains OpenGL-specific rendering information.
union ovrGLConfig
{
+ /// General device settings.
ovrRenderAPIConfig Config;
- ovrGLConfigData OGL;
+ /// OpenGL-specific settings.
+ ovrGLConfigData OGL;
};
-// Used to pass GL eye texture data to ovrHmd_EndFrame.
-typedef struct ovrGLTextureData_s
+/// Used to pass GL eye texture data to ovrHmd_EndFrame.
+typedef struct OVR_ALIGNAS(8) ovrGLTextureData_s
{
- // General device settings.
- ovrTextureHeader Header;
+ /// General device settings.
+ ovrTextureHeader Header;
+ /// The OpenGL name for this texture.
GLuint TexId;
} ovrGLTextureData;
+static_assert(offsetof(ovrGLTextureData, TexId) == offsetof(ovrTexture, PlatformData), "Mismatch of structs that are presumed binary equivalents.");
+
+/// Contains OpenGL-specific texture information.
typedef union ovrGLTexture_s
{
- ovrTexture Texture;
- ovrGLTextureData OGL;
+ /// General device settings.
+ ovrTexture Texture;
+ /// OpenGL-specific settings.
+ ovrGLTextureData OGL;
} ovrGLTexture;
#endif // OVR_CAPI_GL_h