15#define TRITON_PI 3.14159265
16#define TRITON_TWOPI (TRITON_PI * 2.0)
17#define TRITON_SQRT2 1.414213562373095
19#define TRITON_PIF 3.14159265f
20#define TRITON_TWOPIF (TRITON_PIF * 2.0f)
21#define TRITON_SQRT2F 1.414213562373095f
23#define RADIANS(x) ( (x) * (TRITON_PI / 180.0) )
24#define DEGREES(x) ( (x) * (180.0 / TRITON_PI ) )
26#define TRITON_MIN(a,b) (((a) < (b)) ? (a) : (b))
28struct ID3D11Texture2D;
29struct ID3D11ShaderResourceView;
30struct ID3D11UnorderedAccessView;
32struct IDirect3DDevice9;
42#pragma warning (disable: 4302 4311 4312)
71 static void TRITONAPI
SetDebugMsgCB(
void (*debug_msg_cb)(
const char * ));
75 static void TRITONAPI
DebugMsg(
const char *debugMessage);
82 static bool TRITONAPI
PrintGLErrors(
const char *file,
int line, Stream* stream = 0);
100#elif _MSC_VER >= 1500
102#elif _MSC_VER >= 1400
114#if ( __WORDSIZE == 64 )
115 path +=
"linux/x64/";
117 path +=
"linux/x86/";
131 static void TRITONAPI Sprintf(
char *
string,
size_t sizeInBytes,
const char *format,
float val);
132 static void TRITONAPI Sprintf(
char *
string,
size_t sizeInBytes,
const char *format,
double val);
133 static void TRITONAPI Sprintf(
char *
string,
size_t sizeInBytes,
const char *format,
int val);
150 static struct _D3DXMACRO * TRITONAPI
GetDX9Macros(IDirect3DDevice9 *device,
bool hdr,
bool breakingWaves);
172typedef struct DX11Texture_S {
173 ID3D11Texture2D *tex2D;
174 ID3D11Texture2D *staging;
175 ID3D11ShaderResourceView *srv;
176 ID3D11UnorderedAccessView *uav;
Memory allocation interface for SilverLining.
int ShaderHandle
A renderer-agnostic handle for a shader.
Definition: TritonCommon.h:54
void * BufferHandle
A renderer-agnostic handle for a buffer.
Definition: TritonCommon.h:60
void * DecalHandle
A renderer-agnostic handle for a decal.
Definition: TritonCommon.h:58
int TextureHandle
A renderer-agnostic handle for a texture.
Definition: TritonCommon.h:56
Triton's public interface for specifying the environmental conditions and camera properties.
Definition: Environment.h:214
A collection of static utility methods used by Triton.
Definition: TritonCommon.h:65
static TRITON_STRING TRITONAPI GetWaterShaderFileName(const Environment *env, bool tessendorf, bool fragment, bool patch)
Returns the filename for the main water shaders, which may be overridden via config.
static struct _D3DXMACRO *TRITONAPI GetDX9Macros(IDirect3DDevice9 *device, bool hdr, bool breakingWaves)
Returns HLSL preprocessor defines for DirectX9, indicating the shader models avaialble to our shaders...
static TRITON_STRING TRITONAPI GetGodRayShaderFileName(const Environment *env, bool fragment)
Returns the filename for the god ray shaders, which may be overridden via config.
static TRITON_STRING TRITONAPI GetDLLExtension()
Retrieves the DLL extension.
Definition: TritonCommon.h:138
static TRITON_STRING TRITONAPI GetDecalShaderFileName(const Environment *env, bool fragment)
Returns the filename for the volumetric deferred decal shaders, which may be overridden via config.
static TRITON_STRING TRITONAPI GetUserShaderFileName()
Returns the filename for the user-defined fragment shader functions (OpenGL only; see the Resources/u...
static TRITON_STRING TRITONAPI GetParticleShaderFileName(const Environment *env, bool fragment)
Returns the filename for the particle shaders, which may be overridden via config.
static TRITON_STRING TRITONAPI GetUserVertShaderFileName()
Returns the filename for the user-defined vertex shader functions (OpenGL only; see the Resources/use...
static void TRITONAPI ClearGLErrors(Stream *stream=0)
Clears any existing OpenGL error codes so we may test for new ones.
static void TRITONAPI DebugMsg(const char *debugMessage)
Prints out an error message to the debugger's output window only if the setting enable-debug-messages...
static TRITON_STRING TRITONAPI GetDLLPath()
Returns the resources subdirectory where our FFT implementation DLL's live for this specific build's ...
Definition: TritonCommon.h:86
static TRITON_STRING TRITONAPI GetDLLSuffix()
Retrieves the suffix on the FFT implementation DLL's for this specific build flavor's runtime library...
static bool TRITONAPI PrintGLErrors(const char *file, int line, Stream *stream=0)
Prints out (and clears) any existing GL errors using Utils::DebugMsg.
static void TRITONAPI SetDebugMsgCB(void(*debug_msg_cb)(const char *))
Allows the client to plug in a routine which will be called to print/log DebugMsg() calls when "enabl...