Pyrogenesis  trunk
Macros | Functions
HWDetect.cpp File Reference
#include "precompiled.h"
#include "scriptinterface/ScriptInterface.h"
#include "lib/ogl.h"
#include "lib/svn_revision.h"
#include "lib/timer.h"
#include "lib/utf8.h"
#include "lib/external_libraries/libsdl.h"
#include "lib/res/graphics/ogl_tex.h"
#include "lib/posix/posix_utsname.h"
#include "lib/sysdep/cpu.h"
#include "lib/sysdep/gfx.h"
#include "lib/sysdep/numa.h"
#include "lib/sysdep/os_cpu.h"
#include "lib/sysdep/snd.h"
#include "ps/CLogger.h"
#include "ps/ConfigDB.h"
#include "ps/Filesystem.h"
#include "ps/Profile.h"
#include "ps/UserReport.h"
#include "ps/VideoMode.h"
#include "ps/GameSetup/Config.h"
Include dependency graph for HWDetect.cpp:

Macros

#define INTEGER(id)
 
#define INTEGER2(id)
 
#define FLOAT(id)
 
#define FLOAT2(id)
 
#define STRING(id)
 
#define QUERY(target, pname)
 
#define VERTEXPROGRAM(id)
 
#define FRAGMENTPROGRAM(id)
 
#define BOOL(id)   INTEGER(id)
 

Functions

static void ReportGLLimits (ScriptInterface &scriptInterface, JS::HandleValue settings)
 
static bool IsOverridden (const char *setting)
 
void SetDisableAudio (ScriptInterface::CxPrivate *pCxPrivate, bool disabled)
 
void SetDisableS3TC (ScriptInterface::CxPrivate *pCxPrivate, bool disabled)
 
void SetDisableShadows (ScriptInterface::CxPrivate *pCxPrivate, bool disabled)
 
void SetDisableShadowPCF (ScriptInterface::CxPrivate *pCxPrivate, bool disabled)
 
void SetDisableAllWater (ScriptInterface::CxPrivate *pCxPrivate, bool disabled)
 
void SetDisableFancyWater (ScriptInterface::CxPrivate *pCxPrivate, bool disabled)
 
void SetEnableGLSL (ScriptInterface::CxPrivate *pCxPrivate, bool enabled)
 
void SetEnablePostProc (ScriptInterface::CxPrivate *pCxPrivate, bool enabled)
 
void SetEnableSmoothLOS (ScriptInterface::CxPrivate *pCxPrivate, bool enabled)
 
void SetRenderPath (ScriptInterface::CxPrivate *pCxPrivate, const std::string &renderpath)
 
void RunHardwareDetection ()
 Runs hardware-detection script to adjust default config settings and/or emit warnings depending on the user's system configuration. More...
 

Macro Definition Documentation

#define BOOL (   id)    INTEGER(id)
#define FLOAT (   id)
Value:
do { \
GLfloat f = std::numeric_limits<GLfloat>::quiet_NaN(); \
glGetFloatv(GL_##id, &f); \
if (ogl_SquelchError(GL_INVALID_ENUM)) \
scriptInterface.SetProperty(settings, "GL_" #id, errstr); \
else \
scriptInterface.SetProperty(settings, "GL_" #id, f); \
} while (false)
bool ogl_SquelchError(GLenum err_to_ignore)
ignore and reset the specified OpenGL error.
Definition: ogl.cpp:427
#define FLOAT2 (   id)
Value:
do { \
GLfloat f[2] = { std::numeric_limits<GLfloat>::quiet_NaN(), std::numeric_limits<GLfloat>::quiet_NaN() }; \
glGetFloatv(GL_##id, f); \
if (ogl_SquelchError(GL_INVALID_ENUM)) { \
scriptInterface.SetProperty(settings, "GL_" #id "[0]", errstr); \
scriptInterface.SetProperty(settings, "GL_" #id "[1]", errstr); \
} else { \
scriptInterface.SetProperty(settings, "GL_" #id "[0]", f[0]); \
scriptInterface.SetProperty(settings, "GL_" #id "[1]", f[1]); \
} \
} while (false)
bool ogl_SquelchError(GLenum err_to_ignore)
ignore and reset the specified OpenGL error.
Definition: ogl.cpp:427
#define FRAGMENTPROGRAM (   id)
Value:
do { \
GLint i = -1; \
pglGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_##id, &i); \
if (ogl_SquelchError(GL_INVALID_ENUM)) \
scriptInterface.SetProperty(settings, "GL_FRAGMENT_PROGRAM_ARB.GL_" #id, errstr); \
else \
scriptInterface.SetProperty(settings, "GL_FRAGMENT_PROGRAM_ARB.GL_" #id, i); \
} while (false)
bool ogl_SquelchError(GLenum err_to_ignore)
ignore and reset the specified OpenGL error.
Definition: ogl.cpp:427
#define INTEGER (   id)
Value:
do { \
GLint i = -1; \
glGetIntegerv(GL_##id, &i); \
if (ogl_SquelchError(GL_INVALID_ENUM)) \
scriptInterface.SetProperty(settings, "GL_" #id, errstr); \
else \
scriptInterface.SetProperty(settings, "GL_" #id, i); \
} while (false)
bool ogl_SquelchError(GLenum err_to_ignore)
ignore and reset the specified OpenGL error.
Definition: ogl.cpp:427
#define INTEGER2 (   id)
Value:
do { \
GLint i[2] = { -1, -1 }; \
glGetIntegerv(GL_##id, i); \
if (ogl_SquelchError(GL_INVALID_ENUM)) { \
scriptInterface.SetProperty(settings, "GL_" #id "[0]", errstr); \
scriptInterface.SetProperty(settings, "GL_" #id "[1]", errstr); \
} else { \
scriptInterface.SetProperty(settings, "GL_" #id "[0]", i[0]); \
scriptInterface.SetProperty(settings, "GL_" #id "[1]", i[1]); \
} \
} while (false)
bool ogl_SquelchError(GLenum err_to_ignore)
ignore and reset the specified OpenGL error.
Definition: ogl.cpp:427
#define QUERY (   target,
  pname 
)
Value:
do { \
GLint i = -1; \
pglGetQueryivARB(GL_##target, GL_##pname, &i); \
if (ogl_SquelchError(GL_INVALID_ENUM)) \
scriptInterface.SetProperty(settings, "GL_" #target ".GL_" #pname, errstr); \
else \
scriptInterface.SetProperty(settings, "GL_" #target ".GL_" #pname, i); \
} while (false)
bool ogl_SquelchError(GLenum err_to_ignore)
ignore and reset the specified OpenGL error.
Definition: ogl.cpp:427
#define STRING (   id)
Value:
do { \
const char* c = (const char*)glGetString(GL_##id); \
if (!c) c = ""; \
if (ogl_SquelchError(GL_INVALID_ENUM)) c = errstr; \
scriptInterface.SetProperty(settings, "GL_" #id, std::string(c)); \
} while (false)
bool ogl_SquelchError(GLenum err_to_ignore)
ignore and reset the specified OpenGL error.
Definition: ogl.cpp:427
#define VERTEXPROGRAM (   id)
Value:
do { \
GLint i = -1; \
pglGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_##id, &i); \
if (ogl_SquelchError(GL_INVALID_ENUM)) \
scriptInterface.SetProperty(settings, "GL_VERTEX_PROGRAM_ARB.GL_" #id, errstr); \
else \
scriptInterface.SetProperty(settings, "GL_VERTEX_PROGRAM_ARB.GL_" #id, i); \
} while (false)
bool ogl_SquelchError(GLenum err_to_ignore)
ignore and reset the specified OpenGL error.
Definition: ogl.cpp:427

Function Documentation

static bool IsOverridden ( const char *  setting)
static
static void ReportGLLimits ( ScriptInterface scriptInterface,
JS::HandleValue  settings 
)
static
void RunHardwareDetection ( )

Runs hardware-detection script to adjust default config settings and/or emit warnings depending on the user's system configuration.

This must only be called after ogl_Init.

void SetDisableAllWater ( ScriptInterface::CxPrivate pCxPrivate,
bool  disabled 
)
void SetDisableAudio ( ScriptInterface::CxPrivate pCxPrivate,
bool  disabled 
)
void SetDisableFancyWater ( ScriptInterface::CxPrivate pCxPrivate,
bool  disabled 
)
void SetDisableS3TC ( ScriptInterface::CxPrivate pCxPrivate,
bool  disabled 
)
void SetDisableShadowPCF ( ScriptInterface::CxPrivate pCxPrivate,
bool  disabled 
)
void SetDisableShadows ( ScriptInterface::CxPrivate pCxPrivate,
bool  disabled 
)
void SetEnableGLSL ( ScriptInterface::CxPrivate pCxPrivate,
bool  enabled 
)
void SetEnablePostProc ( ScriptInterface::CxPrivate pCxPrivate,
bool  enabled 
)
void SetEnableSmoothLOS ( ScriptInterface::CxPrivate pCxPrivate,
bool  enabled 
)
void SetRenderPath ( ScriptInterface::CxPrivate pCxPrivate,
const std::string &  renderpath 
)