Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/lib/sysdep/gfx.cpp
Show All 33 Lines | |||||
# include "lib/sysdep/os/win/wgfx.h" | # include "lib/sysdep/os/win/wgfx.h" | ||||
#endif | #endif | ||||
namespace gfx { | namespace gfx { | ||||
std::wstring CardName() | std::wstring CardName() | ||||
{ | { | ||||
// GL_VENDOR+GL_RENDERER are good enough here, so we don't use wgfx_CardName, | // GL_VENDOR+GL_RENDERER are good enough here, so we don't use WMI to detect the cards. | ||||
// plus that can cause crashes with Nvidia Optimus and some netbooks | // On top of that WMI can cause crashes with Nvidia Optimus and some netbooks | ||||
// see http://trac.wildfiregames.com/ticket/1952 | // see http://trac.wildfiregames.com/ticket/1952 | ||||
// http://trac.wildfiregames.com/ticket/1575 | // http://trac.wildfiregames.com/ticket/1575 | ||||
wchar_t cardName[128]; | wchar_t cardName[128]; | ||||
const char* vendor = (const char*)glGetString(GL_VENDOR); | const char* vendor = (const char*)glGetString(GL_VENDOR); | ||||
const char* renderer = (const char*)glGetString(GL_RENDERER); | const char* renderer = (const char*)glGetString(GL_RENDERER); | ||||
// (happens if called before ogl_Init or between glBegin and glEnd.) | // (happens if called before ogl_Init or between glBegin and glEnd.) | ||||
if(!vendor || !renderer) | if(!vendor || !renderer) | ||||
return L""; | return L""; | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator