mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-25 08:39:39 +00:00
Merge branch 'linux_gl_sys_req' into 'openmw-vr'
call xrGetOpenGLGraphicsRequirementsKHR on linux too See merge request madsbuvi/openmw!15
This commit is contained in:
commit
37585d29bd
1 changed files with 14 additions and 1 deletions
|
@ -470,7 +470,20 @@ namespace MWVR
|
||||||
throw std::logic_error("Enum value not implemented");
|
throw std::logic_error("Enum value not implemented");
|
||||||
}
|
}
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
{ // Create Session
|
{
|
||||||
|
// Get system requirements
|
||||||
|
PFN_xrGetOpenGLGraphicsRequirementsKHR p_getRequirements = nullptr;
|
||||||
|
xrGetInstanceProcAddr(instance, "xrGetOpenGLGraphicsRequirementsKHR", reinterpret_cast<PFN_xrVoidFunction*>(&p_getRequirements));
|
||||||
|
XrGraphicsRequirementsOpenGLKHR requirements{ XR_TYPE_GRAPHICS_REQUIREMENTS_OPENGL_KHR };
|
||||||
|
CHECK_XRCMD(p_getRequirements(instance, systemId, &requirements));
|
||||||
|
|
||||||
|
// TODO: Actually get system version
|
||||||
|
const XrVersion systemApiVersion = XR_MAKE_VERSION(4, 6, 0);
|
||||||
|
if (requirements.minApiVersionSupported > systemApiVersion) {
|
||||||
|
std::cout << "Runtime does not support desired Graphics API and/or version" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create Session
|
||||||
Display* xDisplay = XOpenDisplay(NULL);
|
Display* xDisplay = XOpenDisplay(NULL);
|
||||||
GLXContext glxContext = glXGetCurrentContext();
|
GLXContext glxContext = glXGetCurrentContext();
|
||||||
GLXDrawable glxDrawable = glXGetCurrentDrawable();
|
GLXDrawable glxDrawable = glXGetCurrentDrawable();
|
||||||
|
|
Loading…
Reference in a new issue