Changeset View
Changeset View
Standalone View
Standalone View
source/ps/GameSetup/GameSetup.cpp
Show First 20 Lines • Show All 966 Lines • ▼ Show 20 Lines | void InitGraphics(const CmdLineArgs& args, int flags, const std::vector<CStr>& installedMods) | ||||
if(setup_vmode) | if(setup_vmode) | ||||
{ | { | ||||
InitSDL(); | InitSDL(); | ||||
if (!g_VideoMode.InitSDL()) | if (!g_VideoMode.InitSDL()) | ||||
throw PSERROR_System_VmodeFailed(); // abort startup | throw PSERROR_System_VmodeFailed(); // abort startup | ||||
} | } | ||||
RunHardwareDetection(); | |||||
const int quality = SANE_TEX_QUALITY_DEFAULT; // TODO: set value from config file | const int quality = SANE_TEX_QUALITY_DEFAULT; // TODO: set value from config file | ||||
SetTextureQuality(quality); | SetTextureQuality(quality); | ||||
ogl_WarnIfError(); | ogl_WarnIfError(); | ||||
// Optionally start profiler GPU timings automatically | // Optionally start profiler GPU timings automatically | ||||
// (By default it's only enabled by a hotkey, for performance/compatibility) | // (By default it's only enabled by a hotkey, for performance/compatibility) | ||||
bool profilerGPUEnable = false; | bool profilerGPUEnable = false; | ||||
CFG_GET_VAL("profiler2.autoenable", profilerGPUEnable); | CFG_GET_VAL("profiler2.autoenable", profilerGPUEnable); | ||||
if (profilerGPUEnable) | if (profilerGPUEnable) | ||||
g_Profiler2.EnableGPU(); | g_Profiler2.EnableGPU(); | ||||
if(!g_Quickstart) | if(!g_Quickstart) | ||||
{ | { | ||||
WriteSystemInfo(); | WriteSystemInfo(); | ||||
// note: no longer vfs_display here. it's dog-slow due to unbuffered | // note: no longer vfs_display here. it's dog-slow due to unbuffered | ||||
// file output and very rarely needed. | // file output and very rarely needed. | ||||
} | } | ||||
// Must be called after WriteSystemInfo() because WriteSystemInfo() runs the sound detection code. | |||||
RunHardwareDetection(); | |||||
if(g_DisableAudio) | if(g_DisableAudio) | ||||
ISoundManager::SetEnabled(false); | ISoundManager::SetEnabled(false); | ||||
g_GUI = new CGUIManager(); | g_GUI = new CGUIManager(); | ||||
// (must come after SetVideoMode, since it calls ogl_Init) | // (must come after SetVideoMode, since it calls ogl_Init) | ||||
if (ogl_HaveExtensions(0, "GL_ARB_vertex_program", "GL_ARB_fragment_program", NULL) != 0 // ARB | if (ogl_HaveExtensions(0, "GL_ARB_vertex_program", "GL_ARB_fragment_program", NULL) != 0 // ARB | ||||
&& ogl_HaveExtensions(0, "GL_ARB_vertex_shader", "GL_ARB_fragment_shader", NULL) != 0) // GLSL | && ogl_HaveExtensions(0, "GL_ARB_vertex_shader", "GL_ARB_fragment_shader", NULL) != 0) // GLSL | ||||
▲ Show 20 Lines • Show All 635 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator