![]() | By Sebastien St-Laurent |
![]() | ![]() | ![]() | ![]() | ![]() |
Page 6 ...etric information is passed to the graphics hardware through the use of a rendering API such as Direct3D. Once this information is received by the hardware, it invokes the vertex shader for every vertex in your mesh. Figure 1.1 includes the functional diagram for a vertex shader 2.0 implementation a... | Page 3 ...d in functionality and performance, even shattering Moores law with respect to technological advancement rate. With the introduction of the DirectX 9.0 SDK and the latest generations of graphics hardware such as the GeForce FX series from NVIDIA and Radeon 9800 series from ATI Technologies, came Ver... | Page 51 // Compute the normalized light direction vector and use it to determine | Page 202 nrm Normalizes a four-component vector. Equivalent toinput/length(input). 3 Arithmetic | Page 129 ...ss of the effect framework as it is used to contain and execute the content of an effect .le. The class itself inherits from the ID3DXBaseEffect class but adds a few functions used to control the execution of speci.c effects. Although I will cover individual functions in detail later, the functions... |
For many of the Microsoft DirectX Component Object Model (COM) interfaces, macros are defined for each method. The macros simplify the use of the methods in your application. You can find definitions of these macros in the same header file as the interface declaration. The macros are designed to be used by both C and C++ applications. To use the C++ macros, you must define _cplusplus. Otherwise, the C macros will be used. The macro syntax is the same for both languages, but the header files include separate sets of macro definitions that expand to the appropriate calling convention.
For example, the following code fragment from the d3d.h header file shows the definitions of the C and C++ macros for the GetAdapterIdentifier method:
...
#define IDirect3D9_GetAdapterIdentifier(p,a,b,c)
(p)->lpVtbl->GetAdapterIdentifier(p,a,b,c)
...
#else
...
#define
IDirect3D9_GetAdapterIdentifier(p,a,b,c)
(p)->GetAdapterIdentifier(a,b,c)
...
#endifTo use one of these macros, you must first obtain a pointer to the associated interface. The first parameter of the macro must be set to that pointer. The remaining parameters map to the method's parameters. The macro's return value is the HRESULT value that is returned by the method. The following code fragment uses a macro to call the GetAdapterIdentifier method. Note that pD3D is a pointer to an IDirect3D9 interface.
hr = IDirect3D9_GetAdapterIdentifier(pD3D,
Adapter,
dwFlags,
pIdentifier);