Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions
HWDetect.cpp File Reference
#include "precompiled.h"
#include "scripting/ScriptingHost.h"
#include "scriptinterface/ScriptInterface.h"
#include "lib/ogl.h"
#include "lib/svn_revision.h"
#include "lib/timer.h"
#include "lib/utf8.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/UserReport.h"
#include "ps/VideoMode.h"
#include "ps/GameSetup/Config.h"

Go to the source code of this file.

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, CScriptValRooted settings)
 
static bool IsOverridden (const char *setting)
 
void SetDisableAudio (void *cbdata, bool disabled)
 
void SetDisableS3TC (void *cbdata, bool disabled)
 
void SetDisableShadows (void *cbdata, bool disabled)
 
void SetDisableShadowPCF (void *cbdata, bool disabled)
 
void SetDisableAllWater (void *cbdata, bool disabled)
 
void SetDisableFancyWater (void *cbdata, bool disabled)
 
void SetDisableFBOWater (void *cbdata, bool disabled)
 
void SetRenderPath (void *cbdata, 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.get(), "GL_" #id, errstr); \
else \
scriptInterface.SetProperty(settings.get(), "GL_" #id, f); \
} while (false)
bool ogl_SquelchError(GLenum err_to_ignore)
ignore and reset the specified OpenGL error.
Definition: ogl.cpp:430
#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.get(), "GL_" #id "[0]", errstr); \
scriptInterface.SetProperty(settings.get(), "GL_" #id "[1]", errstr); \
} else { \
scriptInterface.SetProperty(settings.get(), "GL_" #id "[0]", f[0]); \
scriptInterface.SetProperty(settings.get(), "GL_" #id "[1]", f[1]); \
} \
} while (false)
bool ogl_SquelchError(GLenum err_to_ignore)
ignore and reset the specified OpenGL error.
Definition: ogl.cpp:430
#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.get(), "GL_FRAGMENT_PROGRAM_ARB.GL_" #id, errstr); \
else \
scriptInterface.SetProperty(settings.get(), "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:430
#define INTEGER (   id)
Value:
do { \
GLint i = -1; \
glGetIntegerv(GL_##id, &i); \
if (ogl_SquelchError(GL_INVALID_ENUM)) \
scriptInterface.SetProperty(settings.get(), "GL_" #id, errstr); \
else \
scriptInterface.SetProperty(settings.get(), "GL_" #id, i); \
} while (false)
bool ogl_SquelchError(GLenum err_to_ignore)
ignore and reset the specified OpenGL error.
Definition: ogl.cpp:430
#define INTEGER2 (   id)
Value:
do { \
GLint i[2] = { -1, -1 }; \
glGetIntegerv(GL_##id, i); \
if (ogl_SquelchError(GL_INVALID_ENUM)) { \
scriptInterface.SetProperty(settings.get(), "GL_" #id "[0]", errstr); \
scriptInterface.SetProperty(settings.get(), "GL_" #id "[1]", errstr); \
} else { \
scriptInterface.SetProperty(settings.get(), "GL_" #id "[0]", i[0]); \
scriptInterface.SetProperty(settings.get(), "GL_" #id "[1]", i[1]); \
} \
} while (false)
bool ogl_SquelchError(GLenum err_to_ignore)
ignore and reset the specified OpenGL error.
Definition: ogl.cpp:430
#define QUERY (   target,
  pname 
)
Value:
do { \
GLint i = -1; \
pglGetQueryivARB(GL_##target, GL_##pname, &i); \
if (ogl_SquelchError(GL_INVALID_ENUM)) \
scriptInterface.SetProperty(settings.get(), "GL_" #target ".GL_" #pname, errstr); \
else \
scriptInterface.SetProperty(settings.get(), "GL_" #target ".GL_" #pname, i); \
} while (false)
bool ogl_SquelchError(GLenum err_to_ignore)
ignore and reset the specified OpenGL error.
Definition: ogl.cpp:430
#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.get(), "GL_" #id, std::string(c)); \
} while (false)
bool ogl_SquelchError(GLenum err_to_ignore)
ignore and reset the specified OpenGL error.
Definition: ogl.cpp:430
#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.get(), "GL_VERTEX_PROGRAM_ARB.GL_" #id, errstr); \
else \
scriptInterface.SetProperty(settings.get(), "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:430

Function Documentation

static bool IsOverridden ( const char *  setting)
static

Definition at line 95 of file HWDetect.cpp.

static void ReportGLLimits ( ScriptInterface scriptInterface,
CScriptValRooted  settings 
)
static

Definition at line 310 of file HWDetect.cpp.

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.

Definition at line 165 of file HWDetect.cpp.

void SetDisableAllWater ( void *  cbdata,
bool  disabled 
)

Definition at line 124 of file HWDetect.cpp.

void SetDisableAudio ( void *  cbdata,
bool  disabled 
)

Definition at line 101 of file HWDetect.cpp.

void SetDisableFancyWater ( void *  cbdata,
bool  disabled 
)

Definition at line 141 of file HWDetect.cpp.

void SetDisableFBOWater ( void *  cbdata,
bool  disabled 
)

Definition at line 152 of file HWDetect.cpp.

void SetDisableS3TC ( void *  cbdata,
bool  disabled 
)

Definition at line 106 of file HWDetect.cpp.

void SetDisableShadowPCF ( void *  cbdata,
bool  disabled 
)

Definition at line 118 of file HWDetect.cpp.

void SetDisableShadows ( void *  cbdata,
bool  disabled 
)

Definition at line 112 of file HWDetect.cpp.

void SetRenderPath ( void *  cbdata,
std::string  renderpath 
)

Definition at line 160 of file HWDetect.cpp.