-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added custom native handle support to render system. Currently only i…
…mplemented for GL backend on Windows and Linux. - Added "nativeHandle" and "nativeHandleSize" fields to RenderSystemDescriptor struct. - Implemented GetNativeHandle() function in GLRenderSystem. - Updated Test_OpenGL project to test custom WGL context for Win32.
- Loading branch information
1 parent
76ab650
commit 2028ee5
Showing
42 changed files
with
749 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* AndroidNativeHandle.h (OpenGL) | ||
* | ||
* Copyright (c) 2015 Lukas Hermanns. All rights reserved. | ||
* Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). | ||
*/ | ||
|
||
#ifndef LLGL_OPENGL_ANDROID_NATIVE_HANDLE_H | ||
#define LLGL_OPENGL_ANDROID_NATIVE_HANDLE_H | ||
|
||
|
||
#include <EGL/egl.h> | ||
|
||
|
||
namespace LLGL | ||
{ | ||
|
||
namespace OpenGL | ||
{ | ||
|
||
|
||
/** | ||
\brief Android native handle structure for the OpenGL render system. | ||
\see RenderSystem::GetNativeHandle | ||
\see RenderSystemDescriptor::nativeHandle | ||
*/ | ||
struct RenderSystemNativeHandle | ||
{ | ||
EGLContext context; | ||
}; | ||
|
||
|
||
} // /namespace OpenGL | ||
|
||
} // /namespace LLGL | ||
|
||
|
||
#endif | ||
|
||
|
||
|
||
// ================================================================================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* IOSNativeHandle.h (OpenGL) | ||
* | ||
* Copyright (c) 2015 Lukas Hermanns. All rights reserved. | ||
* Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). | ||
*/ | ||
|
||
#ifndef LLGL_OPENGL_IOS_NATIVE_HANDLE_H | ||
#define LLGL_OPENGL_IOS_NATIVE_HANDLE_H | ||
|
||
|
||
#include <OpenGLES/EAGL.h> | ||
|
||
|
||
namespace LLGL | ||
{ | ||
|
||
namespace OpenGL | ||
{ | ||
|
||
|
||
/** | ||
\brief iOS native handle structure for the OpenGL render system. | ||
\see RenderSystem::GetNativeHandle | ||
\see RenderSystemDescriptor::nativeHandle | ||
*/ | ||
struct RenderSystemNativeHandle | ||
{ | ||
EAGLContext* context; | ||
}; | ||
|
||
|
||
} // /namespace OpenGL | ||
|
||
} // /namespace LLGL | ||
|
||
|
||
#endif | ||
|
||
|
||
|
||
// ================================================================================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* LinuxNativeHandle.h (OpenGL) | ||
* | ||
* Copyright (c) 2015 Lukas Hermanns. All rights reserved. | ||
* Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). | ||
*/ | ||
|
||
#ifndef LLGL_OPENGL_LINUX_NATIVE_HANDLE_H | ||
#define LLGL_OPENGL_LINUX_NATIVE_HANDLE_H | ||
|
||
|
||
#include <GL/glx.h> | ||
|
||
|
||
namespace LLGL | ||
{ | ||
|
||
namespace OpenGL | ||
{ | ||
|
||
|
||
/** | ||
\brief GNU/Linux native handle structure for the OpenGL render system. | ||
\see RenderSystem::GetNativeHandle | ||
\see RenderSystemDescriptor::nativeHandle | ||
*/ | ||
struct RenderSystemNativeHandle | ||
{ | ||
GLXContext context; | ||
}; | ||
|
||
|
||
} // /namespace OpenGL | ||
|
||
} // /namespace LLGL | ||
|
||
|
||
#endif | ||
|
||
|
||
|
||
// ================================================================================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* MacOSNativeHandle.h (OpenGL) | ||
* | ||
* Copyright (c) 2015 Lukas Hermanns. All rights reserved. | ||
* Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). | ||
*/ | ||
|
||
#ifndef LLGL_OPENGL_MACOS_NATIVE_HANDLE_H | ||
#define LLGL_OPENGL_MACOS_NATIVE_HANDLE_H | ||
|
||
|
||
#include <Cocoa/Cocoa.h> | ||
|
||
|
||
namespace LLGL | ||
{ | ||
|
||
namespace OpenGL | ||
{ | ||
|
||
|
||
/** | ||
\brief macOS native handle structure for the OpenGL render system. | ||
\see RenderSystem::GetNativeHandle | ||
\see RenderSystemDescriptor::nativeHandle | ||
*/ | ||
struct RenderSystemNativeHandle | ||
{ | ||
NSOpenGLContext* context; | ||
}; | ||
|
||
|
||
} // /namespace OpenGL | ||
|
||
} // /namespace LLGL | ||
|
||
|
||
#endif | ||
|
||
|
||
|
||
// ================================================================================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* NativeHandle.h (OpenGL) | ||
* | ||
* Copyright (c) 2015 Lukas Hermanns. All rights reserved. | ||
* Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). | ||
*/ | ||
|
||
#ifndef LLGL_OPENGL_NATIVE_HANDLE_H | ||
#define LLGL_OPENGL_NATIVE_HANDLE_H | ||
|
||
|
||
#include <LLGL/Platform/Platform.h> | ||
|
||
#if defined(LLGL_OS_WIN32) | ||
# include <LLGL/Backend/OpenGL/Win32/Win32NativeHandle.h> | ||
#elif defined(LLGL_OS_MACOS) | ||
# include <LLGL/Backend/OpenGL/MacOS/MacOSNativeHandle.h> | ||
#elif defined(LLGL_OS_LINUX) | ||
# include <LLGL/Backend/OpenGL/Linux/LinuxNativeHandle.h> | ||
#elif defined(LLGL_OS_IOS) | ||
# include <LLGL/Backend/OpenGL/IOS/IOSNativeHandle.h> | ||
#elif defined(LLGL_OS_ANDROID) | ||
# include <LLGL/Backend/OpenGL/Android/AndroidNativeHandle.h> | ||
#endif | ||
|
||
|
||
#endif | ||
|
||
|
||
|
||
// ================================================================================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Win32NativeHandle.h (OpenGL) | ||
* | ||
* Copyright (c) 2015 Lukas Hermanns. All rights reserved. | ||
* Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt). | ||
*/ | ||
|
||
#ifndef LLGL_OPENGL_WIN32_NATIVE_HANDLE_H | ||
#define LLGL_OPENGL_WIN32_NATIVE_HANDLE_H | ||
|
||
|
||
#include <Windows.h> | ||
#include <GL/gl.h> | ||
#include <GL/wglext.h> | ||
|
||
|
||
namespace LLGL | ||
{ | ||
|
||
namespace OpenGL | ||
{ | ||
|
||
|
||
/** | ||
\brief Windows native handle structure for the OpenGL render system. | ||
\see RenderSystem::GetNativeHandle | ||
\see RenderSystemDescriptor::nativeHandle | ||
*/ | ||
struct RenderSystemNativeHandle | ||
{ | ||
HGLRC context; | ||
}; | ||
|
||
|
||
} // /namespace OpenGL | ||
|
||
} // /namespace LLGL | ||
|
||
|
||
#endif | ||
|
||
|
||
|
||
// ================================================================================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.