From b4d11e2eb5680a8f31d8207ac1c7ec23ff271e06 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Tue, 31 Mar 2015 15:18:59 -0700 Subject: [PATCH] Add the needed global variable exported to enable the nvidia gpu on optimus platform (laptops with intel integrated) also log the opengl version and gpu and driver used --- interface/src/Application.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index eb427737e1..83e26719db 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -136,6 +136,13 @@ #include "ui/StandAloneJSConsole.h" #include "ui/Stats.h" +// ON WIndows PC, NVidia Optimus laptop, we want to enable NVIDIA GPU +#if defined(Q_OS_WIN) +extern "C" { + _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; +} +#endif + using namespace std; // Starfield information @@ -646,6 +653,11 @@ void Application::initializeGL() { } #endif + qDebug() << "GL Version: " << QString((const char*) glGetString(GL_VERSION)); + qDebug() << "GL Shader Language Version: " << QString((const char*) glGetString(GL_SHADING_LANGUAGE_VERSION)); + qDebug() << "GL Vendor: " << QString((const char*) glGetString(GL_VENDOR)); + qDebug() << "GL Renderer: " << QString((const char*) glGetString(GL_RENDERER)); + #ifdef WIN32 GLenum err = glewInit(); if (GLEW_OK != err) {