D3DXMACRO structure

Describes preprocessor definitions used by an effect object.

Syntax

typedef struct D3DXMACRO {
  LPCSTR Name;
  LPCSTR Definition;
} D3DXMACRO, *LPD3DXMACRO;

Members

Name

Type: LPCSTR

Preprocessor name.

Definition

Type: LPCSTR

Definition name.

Remarks

To use D3DXMACROs in more than one line, prefix each new line character with a backslash (like a #define in the C language). For example:

sample=
macro.Name = "DO_CODE_BLOCK";
macro.Definition =
    "/* here is a block of code */\\\n"
    "{ do something ... }\\\n";

Notice the 3 backslash characters at the end of the line. The first two are required to output a single '\', followed by the newline character "\n". Optionally, you may also want to terminate your lines using "\\\r\n".

Requirements

Requirement Value
Header
D3dx9shader.h

See also

Effect Structures

D3DXCreateEffectFromFile