mirror of
https://github.com/Bloodysharp/Cheat-ImGui-Menu-Design.git
synced 2024-12-22 16:07:23 +08:00
Add files via upload
This commit is contained in:
parent
162c404695
commit
ce7204ef51
6996
SDK/Include/D2D1.h
Normal file
6996
SDK/Include/D2D1.h
Normal file
File diff suppressed because it is too large
Load Diff
948
SDK/Include/D2D1Helper.h
Normal file
948
SDK/Include/D2D1Helper.h
Normal file
@ -0,0 +1,948 @@
|
||||
|
||||
/*=========================================================================*\
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
File: D2D1helper.h
|
||||
|
||||
Module Name: D2D
|
||||
|
||||
Description: Helper files over the D2D interfaces and APIs.
|
||||
|
||||
\*=========================================================================*/
|
||||
#pragma once
|
||||
|
||||
#ifndef _D2D1_HELPER_H_
|
||||
#define _D2D1_HELPER_H_
|
||||
|
||||
#ifndef _D2D1_H_
|
||||
#include <d2d1.h>
|
||||
#endif // #ifndef _D2D1_H_
|
||||
|
||||
#ifndef D2D_USE_C_DEFINITIONS
|
||||
|
||||
namespace D2D1
|
||||
{
|
||||
//
|
||||
// Forward declared IdentityMatrix function to allow matrix class to use
|
||||
// these constructors.
|
||||
//
|
||||
D2D1FORCEINLINE
|
||||
D2D1_MATRIX_3X2_F
|
||||
IdentityMatrix();
|
||||
|
||||
//
|
||||
// The default trait type for objects in D2D is float.
|
||||
//
|
||||
template<typename Type>
|
||||
struct TypeTraits
|
||||
{
|
||||
typedef D2D1_POINT_2F Point;
|
||||
typedef D2D1_SIZE_F Size;
|
||||
typedef D2D1_RECT_F Rect;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct TypeTraits<UINT32>
|
||||
{
|
||||
typedef D2D1_POINT_2U Point;
|
||||
typedef D2D1_SIZE_U Size;
|
||||
typedef D2D1_RECT_U Rect;
|
||||
};
|
||||
|
||||
static inline
|
||||
FLOAT FloatMax()
|
||||
{
|
||||
#ifdef FLT_MAX
|
||||
return FLT_MAX;
|
||||
#else
|
||||
return 3.402823466e+38F;
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Construction helpers
|
||||
//
|
||||
template<typename Type>
|
||||
D2D1FORCEINLINE
|
||||
typename TypeTraits<Type>::Point
|
||||
Point2(
|
||||
Type x,
|
||||
Type y
|
||||
)
|
||||
{
|
||||
typename TypeTraits<Type>::Point point = { x, y };
|
||||
|
||||
return point;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_POINT_2F
|
||||
Point2F(
|
||||
FLOAT x = 0.f,
|
||||
FLOAT y = 0.f
|
||||
)
|
||||
{
|
||||
return Point2<FLOAT>(x, y);
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_POINT_2U
|
||||
Point2U(
|
||||
UINT32 x = 0,
|
||||
UINT32 y = 0
|
||||
)
|
||||
{
|
||||
return Point2<UINT32>(x, y);
|
||||
}
|
||||
|
||||
template<typename Type>
|
||||
D2D1FORCEINLINE
|
||||
typename TypeTraits<Type>::Size
|
||||
Size(
|
||||
Type width,
|
||||
Type height
|
||||
)
|
||||
{
|
||||
typename TypeTraits<Type>::Size size = { width, height };
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_SIZE_F
|
||||
SizeF(
|
||||
FLOAT width = 0.f,
|
||||
FLOAT height = 0.f
|
||||
)
|
||||
{
|
||||
return Size<FLOAT>(width, height);
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_SIZE_U
|
||||
SizeU(
|
||||
UINT32 width = 0,
|
||||
UINT32 height = 0
|
||||
)
|
||||
{
|
||||
return Size<UINT32>(width, height);
|
||||
}
|
||||
|
||||
template<typename Type>
|
||||
D2D1FORCEINLINE
|
||||
typename TypeTraits<Type>::Rect
|
||||
Rect(
|
||||
Type left,
|
||||
Type top,
|
||||
Type right,
|
||||
Type bottom
|
||||
)
|
||||
{
|
||||
typename TypeTraits<Type>::Rect rect = { left, top, right, bottom };
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_RECT_F
|
||||
RectF(
|
||||
FLOAT left = 0.f,
|
||||
FLOAT top = 0.f,
|
||||
FLOAT right = 0.f,
|
||||
FLOAT bottom = 0.f
|
||||
)
|
||||
{
|
||||
return Rect<FLOAT>(left, top, right, bottom);
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_RECT_U
|
||||
RectU(
|
||||
UINT32 left = 0,
|
||||
UINT32 top = 0,
|
||||
UINT32 right = 0,
|
||||
UINT32 bottom = 0
|
||||
)
|
||||
{
|
||||
return Rect<UINT32>(left, top, right, bottom);
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_RECT_F
|
||||
InfiniteRect()
|
||||
{
|
||||
D2D1_RECT_F rect = { -FloatMax(), -FloatMax(), FloatMax(), FloatMax() };
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_ARC_SEGMENT
|
||||
ArcSegment(
|
||||
__in CONST D2D1_POINT_2F &point,
|
||||
__in CONST D2D1_SIZE_F &size,
|
||||
__in FLOAT rotationAngle,
|
||||
__in D2D1_SWEEP_DIRECTION sweepDirection,
|
||||
__in D2D1_ARC_SIZE arcSize
|
||||
)
|
||||
{
|
||||
D2D1_ARC_SEGMENT arcSegment = { point, size, rotationAngle, sweepDirection, arcSize };
|
||||
|
||||
return arcSegment;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_BEZIER_SEGMENT
|
||||
BezierSegment(
|
||||
__in CONST D2D1_POINT_2F &point1,
|
||||
__in CONST D2D1_POINT_2F &point2,
|
||||
__in CONST D2D1_POINT_2F &point3
|
||||
)
|
||||
{
|
||||
D2D1_BEZIER_SEGMENT bezierSegment = { point1, point2, point3 };
|
||||
|
||||
return bezierSegment;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_ELLIPSE
|
||||
Ellipse(
|
||||
__in CONST D2D1_POINT_2F ¢er,
|
||||
FLOAT radiusX,
|
||||
FLOAT radiusY
|
||||
)
|
||||
{
|
||||
D2D1_ELLIPSE ellipse;
|
||||
|
||||
ellipse.point = center;
|
||||
ellipse.radiusX = radiusX;
|
||||
ellipse.radiusY = radiusY;
|
||||
|
||||
return ellipse;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_ROUNDED_RECT
|
||||
RoundedRect(
|
||||
__in CONST D2D1_RECT_F &rect,
|
||||
FLOAT radiusX,
|
||||
FLOAT radiusY
|
||||
)
|
||||
{
|
||||
D2D1_ROUNDED_RECT roundedRect;
|
||||
|
||||
roundedRect.rect = rect;
|
||||
roundedRect.radiusX = radiusX;
|
||||
roundedRect.radiusY = radiusY;
|
||||
|
||||
return roundedRect;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_BRUSH_PROPERTIES
|
||||
BrushProperties(
|
||||
__in FLOAT opacity = 1.0,
|
||||
__in CONST D2D1_MATRIX_3X2_F &transform = D2D1::IdentityMatrix()
|
||||
)
|
||||
{
|
||||
D2D1_BRUSH_PROPERTIES brushProperties;
|
||||
|
||||
brushProperties.opacity = opacity;
|
||||
brushProperties.transform = transform;
|
||||
|
||||
return brushProperties;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_GRADIENT_STOP
|
||||
GradientStop(
|
||||
FLOAT position,
|
||||
__in CONST D2D1_COLOR_F &color
|
||||
)
|
||||
{
|
||||
D2D1_GRADIENT_STOP gradientStop = { position, color };
|
||||
|
||||
return gradientStop;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_QUADRATIC_BEZIER_SEGMENT
|
||||
QuadraticBezierSegment(
|
||||
__in CONST D2D1_POINT_2F &point1,
|
||||
__in CONST D2D1_POINT_2F &point2
|
||||
)
|
||||
{
|
||||
D2D1_QUADRATIC_BEZIER_SEGMENT quadraticBezier = { point1, point2 };
|
||||
|
||||
return quadraticBezier;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_STROKE_STYLE_PROPERTIES
|
||||
StrokeStyleProperties(
|
||||
D2D1_CAP_STYLE startCap = D2D1_CAP_STYLE_FLAT,
|
||||
D2D1_CAP_STYLE endCap = D2D1_CAP_STYLE_FLAT,
|
||||
D2D1_CAP_STYLE dashCap = D2D1_CAP_STYLE_FLAT,
|
||||
D2D1_LINE_JOIN lineJoin = D2D1_LINE_JOIN_MITER,
|
||||
FLOAT miterLimit = 10.0f,
|
||||
D2D1_DASH_STYLE dashStyle = D2D1_DASH_STYLE_SOLID,
|
||||
FLOAT dashOffset = 0.0f
|
||||
)
|
||||
{
|
||||
D2D1_STROKE_STYLE_PROPERTIES strokeStyleProperties;
|
||||
|
||||
strokeStyleProperties.startCap = startCap;
|
||||
strokeStyleProperties.endCap = endCap;
|
||||
strokeStyleProperties.dashCap = dashCap;
|
||||
strokeStyleProperties.lineJoin = lineJoin;
|
||||
strokeStyleProperties.miterLimit = miterLimit;
|
||||
strokeStyleProperties.dashStyle = dashStyle;
|
||||
strokeStyleProperties.dashOffset = dashOffset;
|
||||
|
||||
return strokeStyleProperties;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_BITMAP_BRUSH_PROPERTIES
|
||||
BitmapBrushProperties(
|
||||
D2D1_EXTEND_MODE extendModeX = D2D1_EXTEND_MODE_CLAMP,
|
||||
D2D1_EXTEND_MODE extendModeY = D2D1_EXTEND_MODE_CLAMP,
|
||||
D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR
|
||||
)
|
||||
{
|
||||
D2D1_BITMAP_BRUSH_PROPERTIES bitmapBrushProperties;
|
||||
|
||||
bitmapBrushProperties.extendModeX = extendModeX;
|
||||
bitmapBrushProperties.extendModeY = extendModeY;
|
||||
bitmapBrushProperties.interpolationMode = interpolationMode;
|
||||
|
||||
return bitmapBrushProperties;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES
|
||||
LinearGradientBrushProperties(
|
||||
__in CONST D2D1_POINT_2F &startPoint,
|
||||
__in CONST D2D1_POINT_2F &endPoint
|
||||
)
|
||||
{
|
||||
D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES linearGradientBrushProperties;
|
||||
|
||||
linearGradientBrushProperties.startPoint = startPoint;
|
||||
linearGradientBrushProperties.endPoint = endPoint;
|
||||
|
||||
return linearGradientBrushProperties;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES
|
||||
RadialGradientBrushProperties(
|
||||
__in CONST D2D1_POINT_2F ¢er,
|
||||
__in CONST D2D1_POINT_2F &gradientOriginOffset,
|
||||
FLOAT radiusX,
|
||||
FLOAT radiusY
|
||||
)
|
||||
{
|
||||
D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES radialGradientBrushProperties;
|
||||
|
||||
radialGradientBrushProperties.center = center;
|
||||
radialGradientBrushProperties.gradientOriginOffset = gradientOriginOffset;
|
||||
radialGradientBrushProperties.radiusX = radiusX;
|
||||
radialGradientBrushProperties.radiusY = radiusY;
|
||||
|
||||
return radialGradientBrushProperties;
|
||||
}
|
||||
|
||||
//
|
||||
// PixelFormat
|
||||
//
|
||||
D2D1FORCEINLINE
|
||||
D2D1_PIXEL_FORMAT
|
||||
PixelFormat(
|
||||
__in DXGI_FORMAT dxgiFormat = DXGI_FORMAT_UNKNOWN,
|
||||
__in D2D1_ALPHA_MODE alphaMode = D2D1_ALPHA_MODE_UNKNOWN
|
||||
)
|
||||
{
|
||||
D2D1_PIXEL_FORMAT pixelFormat;
|
||||
|
||||
pixelFormat.format = dxgiFormat;
|
||||
pixelFormat.alphaMode = alphaMode;
|
||||
|
||||
return pixelFormat;
|
||||
}
|
||||
|
||||
//
|
||||
// Bitmaps
|
||||
//
|
||||
D2D1FORCEINLINE
|
||||
D2D1_BITMAP_PROPERTIES
|
||||
BitmapProperties(
|
||||
CONST D2D1_PIXEL_FORMAT &pixelFormat = D2D1::PixelFormat(),
|
||||
FLOAT dpiX = 96.0f,
|
||||
FLOAT dpiY = 96.0f
|
||||
)
|
||||
{
|
||||
D2D1_BITMAP_PROPERTIES bitmapProperties;
|
||||
|
||||
bitmapProperties.pixelFormat = pixelFormat;
|
||||
bitmapProperties.dpiX = dpiX;
|
||||
bitmapProperties.dpiY = dpiY;
|
||||
|
||||
return bitmapProperties;
|
||||
}
|
||||
|
||||
//
|
||||
// Render Targets
|
||||
//
|
||||
D2D1FORCEINLINE
|
||||
D2D1_RENDER_TARGET_PROPERTIES
|
||||
RenderTargetProperties(
|
||||
D2D1_RENDER_TARGET_TYPE type = D2D1_RENDER_TARGET_TYPE_DEFAULT,
|
||||
__in CONST D2D1_PIXEL_FORMAT &pixelFormat = D2D1::PixelFormat(),
|
||||
FLOAT dpiX = 0.0,
|
||||
FLOAT dpiY = 0.0,
|
||||
D2D1_RENDER_TARGET_USAGE usage = D2D1_RENDER_TARGET_USAGE_NONE,
|
||||
D2D1_FEATURE_LEVEL minLevel = D2D1_FEATURE_LEVEL_DEFAULT
|
||||
)
|
||||
{
|
||||
D2D1_RENDER_TARGET_PROPERTIES renderTargetProperties;
|
||||
|
||||
renderTargetProperties.type = type;
|
||||
renderTargetProperties.pixelFormat = pixelFormat;
|
||||
renderTargetProperties.dpiX = dpiX;
|
||||
renderTargetProperties.dpiY = dpiY;
|
||||
renderTargetProperties.usage = usage;
|
||||
renderTargetProperties.minLevel = minLevel;
|
||||
|
||||
return renderTargetProperties;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_HWND_RENDER_TARGET_PROPERTIES
|
||||
HwndRenderTargetProperties(
|
||||
__in HWND hwnd,
|
||||
__in D2D1_SIZE_U pixelSize = D2D1::Size(static_cast<UINT>(0), static_cast<UINT>(0)),
|
||||
__in D2D1_PRESENT_OPTIONS presentOptions = D2D1_PRESENT_OPTIONS_NONE
|
||||
)
|
||||
{
|
||||
D2D1_HWND_RENDER_TARGET_PROPERTIES hwndRenderTargetProperties;
|
||||
|
||||
hwndRenderTargetProperties.hwnd = hwnd;
|
||||
hwndRenderTargetProperties.pixelSize = pixelSize;
|
||||
hwndRenderTargetProperties.presentOptions = presentOptions;
|
||||
|
||||
return hwndRenderTargetProperties;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_LAYER_PARAMETERS
|
||||
LayerParameters(
|
||||
__in CONST D2D1_RECT_F &contentBounds = D2D1::InfiniteRect(),
|
||||
__in_opt ID2D1Geometry *geometricMask = NULL,
|
||||
D2D1_ANTIALIAS_MODE maskAntialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
|
||||
D2D1_MATRIX_3X2_F maskTransform = D2D1::IdentityMatrix(),
|
||||
FLOAT opacity = 1.0,
|
||||
__in_opt ID2D1Brush *opacityBrush = NULL,
|
||||
D2D1_LAYER_OPTIONS layerOptions = D2D1_LAYER_OPTIONS_NONE
|
||||
)
|
||||
{
|
||||
D2D1_LAYER_PARAMETERS layerParameters = { 0 };
|
||||
|
||||
layerParameters.contentBounds = contentBounds;
|
||||
layerParameters.geometricMask = geometricMask;
|
||||
layerParameters.maskAntialiasMode = maskAntialiasMode;
|
||||
layerParameters.maskTransform = maskTransform;
|
||||
layerParameters.opacity = opacity;
|
||||
layerParameters.opacityBrush = opacityBrush;
|
||||
layerParameters.layerOptions = layerOptions;
|
||||
|
||||
return layerParameters;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_DRAWING_STATE_DESCRIPTION
|
||||
DrawingStateDescription(
|
||||
D2D1_ANTIALIAS_MODE antialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE,
|
||||
D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode = D2D1_TEXT_ANTIALIAS_MODE_DEFAULT,
|
||||
D2D1_TAG tag1 = 0,
|
||||
D2D1_TAG tag2 = 0,
|
||||
__in const D2D1_MATRIX_3X2_F &transform = D2D1::IdentityMatrix()
|
||||
)
|
||||
{
|
||||
D2D1_DRAWING_STATE_DESCRIPTION drawingStateDescription;
|
||||
|
||||
drawingStateDescription.antialiasMode = antialiasMode;
|
||||
drawingStateDescription.textAntialiasMode = textAntialiasMode;
|
||||
drawingStateDescription.tag1 = tag1;
|
||||
drawingStateDescription.tag2 = tag2;
|
||||
drawingStateDescription.transform = transform;
|
||||
|
||||
return drawingStateDescription;
|
||||
}
|
||||
|
||||
//
|
||||
// Colors, this enum defines a set of predefined colors.
|
||||
//
|
||||
class ColorF : public D2D1_COLOR_F
|
||||
{
|
||||
public:
|
||||
|
||||
enum Enum
|
||||
{
|
||||
AliceBlue = 0xF0F8FF,
|
||||
AntiqueWhite = 0xFAEBD7,
|
||||
Aqua = 0x00FFFF,
|
||||
Aquamarine = 0x7FFFD4,
|
||||
Azure = 0xF0FFFF,
|
||||
Beige = 0xF5F5DC,
|
||||
Bisque = 0xFFE4C4,
|
||||
Black = 0x000000,
|
||||
BlanchedAlmond = 0xFFEBCD,
|
||||
Blue = 0x0000FF,
|
||||
BlueViolet = 0x8A2BE2,
|
||||
Brown = 0xA52A2A,
|
||||
BurlyWood = 0xDEB887,
|
||||
CadetBlue = 0x5F9EA0,
|
||||
Chartreuse = 0x7FFF00,
|
||||
Chocolate = 0xD2691E,
|
||||
Coral = 0xFF7F50,
|
||||
CornflowerBlue = 0x6495ED,
|
||||
Cornsilk = 0xFFF8DC,
|
||||
Crimson = 0xDC143C,
|
||||
Cyan = 0x00FFFF,
|
||||
DarkBlue = 0x00008B,
|
||||
DarkCyan = 0x008B8B,
|
||||
DarkGoldenrod = 0xB8860B,
|
||||
DarkGray = 0xA9A9A9,
|
||||
DarkGreen = 0x006400,
|
||||
DarkKhaki = 0xBDB76B,
|
||||
DarkMagenta = 0x8B008B,
|
||||
DarkOliveGreen = 0x556B2F,
|
||||
DarkOrange = 0xFF8C00,
|
||||
DarkOrchid = 0x9932CC,
|
||||
DarkRed = 0x8B0000,
|
||||
DarkSalmon = 0xE9967A,
|
||||
DarkSeaGreen = 0x8FBC8F,
|
||||
DarkSlateBlue = 0x483D8B,
|
||||
DarkSlateGray = 0x2F4F4F,
|
||||
DarkTurquoise = 0x00CED1,
|
||||
DarkViolet = 0x9400D3,
|
||||
DeepPink = 0xFF1493,
|
||||
DeepSkyBlue = 0x00BFFF,
|
||||
DimGray = 0x696969,
|
||||
DodgerBlue = 0x1E90FF,
|
||||
Firebrick = 0xB22222,
|
||||
FloralWhite = 0xFFFAF0,
|
||||
ForestGreen = 0x228B22,
|
||||
Fuchsia = 0xFF00FF,
|
||||
Gainsboro = 0xDCDCDC,
|
||||
GhostWhite = 0xF8F8FF,
|
||||
Gold = 0xFFD700,
|
||||
Goldenrod = 0xDAA520,
|
||||
Gray = 0x808080,
|
||||
Green = 0x008000,
|
||||
GreenYellow = 0xADFF2F,
|
||||
Honeydew = 0xF0FFF0,
|
||||
HotPink = 0xFF69B4,
|
||||
IndianRed = 0xCD5C5C,
|
||||
Indigo = 0x4B0082,
|
||||
Ivory = 0xFFFFF0,
|
||||
Khaki = 0xF0E68C,
|
||||
Lavender = 0xE6E6FA,
|
||||
LavenderBlush = 0xFFF0F5,
|
||||
LawnGreen = 0x7CFC00,
|
||||
LemonChiffon = 0xFFFACD,
|
||||
LightBlue = 0xADD8E6,
|
||||
LightCoral = 0xF08080,
|
||||
LightCyan = 0xE0FFFF,
|
||||
LightGoldenrodYellow = 0xFAFAD2,
|
||||
LightGreen = 0x90EE90,
|
||||
LightGray = 0xD3D3D3,
|
||||
LightPink = 0xFFB6C1,
|
||||
LightSalmon = 0xFFA07A,
|
||||
LightSeaGreen = 0x20B2AA,
|
||||
LightSkyBlue = 0x87CEFA,
|
||||
LightSlateGray = 0x778899,
|
||||
LightSteelBlue = 0xB0C4DE,
|
||||
LightYellow = 0xFFFFE0,
|
||||
Lime = 0x00FF00,
|
||||
LimeGreen = 0x32CD32,
|
||||
Linen = 0xFAF0E6,
|
||||
Magenta = 0xFF00FF,
|
||||
Maroon = 0x800000,
|
||||
MediumAquamarine = 0x66CDAA,
|
||||
MediumBlue = 0x0000CD,
|
||||
MediumOrchid = 0xBA55D3,
|
||||
MediumPurple = 0x9370DB,
|
||||
MediumSeaGreen = 0x3CB371,
|
||||
MediumSlateBlue = 0x7B68EE,
|
||||
MediumSpringGreen = 0x00FA9A,
|
||||
MediumTurquoise = 0x48D1CC,
|
||||
MediumVioletRed = 0xC71585,
|
||||
MidnightBlue = 0x191970,
|
||||
MintCream = 0xF5FFFA,
|
||||
MistyRose = 0xFFE4E1,
|
||||
Moccasin = 0xFFE4B5,
|
||||
NavajoWhite = 0xFFDEAD,
|
||||
Navy = 0x000080,
|
||||
OldLace = 0xFDF5E6,
|
||||
Olive = 0x808000,
|
||||
OliveDrab = 0x6B8E23,
|
||||
Orange = 0xFFA500,
|
||||
OrangeRed = 0xFF4500,
|
||||
Orchid = 0xDA70D6,
|
||||
PaleGoldenrod = 0xEEE8AA,
|
||||
PaleGreen = 0x98FB98,
|
||||
PaleTurquoise = 0xAFEEEE,
|
||||
PaleVioletRed = 0xDB7093,
|
||||
PapayaWhip = 0xFFEFD5,
|
||||
PeachPuff = 0xFFDAB9,
|
||||
Peru = 0xCD853F,
|
||||
Pink = 0xFFC0CB,
|
||||
Plum = 0xDDA0DD,
|
||||
PowderBlue = 0xB0E0E6,
|
||||
Purple = 0x800080,
|
||||
Red = 0xFF0000,
|
||||
RosyBrown = 0xBC8F8F,
|
||||
RoyalBlue = 0x4169E1,
|
||||
SaddleBrown = 0x8B4513,
|
||||
Salmon = 0xFA8072,
|
||||
SandyBrown = 0xF4A460,
|
||||
SeaGreen = 0x2E8B57,
|
||||
SeaShell = 0xFFF5EE,
|
||||
Sienna = 0xA0522D,
|
||||
Silver = 0xC0C0C0,
|
||||
SkyBlue = 0x87CEEB,
|
||||
SlateBlue = 0x6A5ACD,
|
||||
SlateGray = 0x708090,
|
||||
Snow = 0xFFFAFA,
|
||||
SpringGreen = 0x00FF7F,
|
||||
SteelBlue = 0x4682B4,
|
||||
Tan = 0xD2B48C,
|
||||
Teal = 0x008080,
|
||||
Thistle = 0xD8BFD8,
|
||||
Tomato = 0xFF6347,
|
||||
Turquoise = 0x40E0D0,
|
||||
Violet = 0xEE82EE,
|
||||
Wheat = 0xF5DEB3,
|
||||
White = 0xFFFFFF,
|
||||
WhiteSmoke = 0xF5F5F5,
|
||||
Yellow = 0xFFFF00,
|
||||
YellowGreen = 0x9ACD32,
|
||||
};
|
||||
|
||||
//
|
||||
// Construct a color, note that the alpha value from the "rgb" component
|
||||
// is never used.
|
||||
//
|
||||
D2D1FORCEINLINE
|
||||
ColorF(
|
||||
UINT32 rgb,
|
||||
FLOAT a = 1.0
|
||||
)
|
||||
{
|
||||
Init(rgb, a);
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
ColorF(
|
||||
Enum knownColor,
|
||||
FLOAT a = 1.0
|
||||
)
|
||||
{
|
||||
Init(knownColor, a);
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
ColorF(
|
||||
FLOAT r,
|
||||
FLOAT g,
|
||||
FLOAT b,
|
||||
FLOAT a = 1.0
|
||||
)
|
||||
{
|
||||
this->r = r;
|
||||
this->g = g;
|
||||
this->b = b;
|
||||
this->a = a;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
D2D1FORCEINLINE
|
||||
void
|
||||
Init(
|
||||
UINT32 rgb,
|
||||
FLOAT a
|
||||
)
|
||||
{
|
||||
this->r = static_cast<FLOAT>((rgb & sc_redMask) >> sc_redShift) / 255.f;
|
||||
this->g = static_cast<FLOAT>((rgb & sc_greenMask) >> sc_greenShift) / 255.f;
|
||||
this->b = static_cast<FLOAT>((rgb & sc_blueMask) >> sc_blueShift) / 255.f;
|
||||
this->a = a;
|
||||
}
|
||||
|
||||
static const UINT32 sc_redShift = 16;
|
||||
static const UINT32 sc_greenShift = 8;
|
||||
static const UINT32 sc_blueShift = 0;
|
||||
|
||||
static const UINT32 sc_redMask = 0xff << sc_redShift;
|
||||
static const UINT32 sc_greenMask = 0xff << sc_greenShift;
|
||||
static const UINT32 sc_blueMask = 0xff << sc_blueShift;
|
||||
};
|
||||
|
||||
class Matrix3x2F : public D2D1_MATRIX_3X2_F
|
||||
{
|
||||
public:
|
||||
|
||||
D2D1FORCEINLINE
|
||||
Matrix3x2F(
|
||||
FLOAT _11,
|
||||
FLOAT _12,
|
||||
FLOAT _21,
|
||||
FLOAT _22,
|
||||
FLOAT _31,
|
||||
FLOAT _32
|
||||
)
|
||||
{
|
||||
this->_11 = _11;
|
||||
this->_12 = _12;
|
||||
this->_21 = _21;
|
||||
this->_22 = _22;
|
||||
this->_31 = _31;
|
||||
this->_32 = _32;
|
||||
}
|
||||
|
||||
//
|
||||
// Creates an identity matrix
|
||||
//
|
||||
D2D1FORCEINLINE
|
||||
Matrix3x2F(
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// Named quasi-constructors
|
||||
//
|
||||
static D2D1FORCEINLINE
|
||||
Matrix3x2F
|
||||
Identity()
|
||||
{
|
||||
Matrix3x2F identity;
|
||||
|
||||
identity._11 = 1.f;
|
||||
identity._12 = 0.f;
|
||||
identity._21 = 0.f;
|
||||
identity._22 = 1.f;
|
||||
identity._31 = 0.f;
|
||||
identity._32 = 0.f;
|
||||
|
||||
return identity;
|
||||
}
|
||||
|
||||
static D2D1FORCEINLINE
|
||||
Matrix3x2F
|
||||
Translation(
|
||||
D2D1_SIZE_F size
|
||||
)
|
||||
{
|
||||
Matrix3x2F translation;
|
||||
|
||||
translation._11 = 1.0; translation._12 = 0.0;
|
||||
translation._21 = 0.0; translation._22 = 1.0;
|
||||
translation._31 = size.width; translation._32 = size.height;
|
||||
|
||||
return translation;
|
||||
}
|
||||
|
||||
static D2D1FORCEINLINE
|
||||
Matrix3x2F
|
||||
Translation(
|
||||
FLOAT x,
|
||||
FLOAT y
|
||||
)
|
||||
{
|
||||
return Translation(SizeF(x, y));
|
||||
}
|
||||
|
||||
|
||||
static D2D1FORCEINLINE
|
||||
Matrix3x2F
|
||||
Scale(
|
||||
D2D1_SIZE_F size,
|
||||
D2D1_POINT_2F center = D2D1::Point2F()
|
||||
)
|
||||
{
|
||||
Matrix3x2F scale;
|
||||
|
||||
scale._11 = size.width; scale._12 = 0.0;
|
||||
scale._21 = 0.0; scale._22 = size.height;
|
||||
scale._31 = center.x - size.width * center.x;
|
||||
scale._32 = center.y - size.height * center.y;
|
||||
|
||||
return scale;
|
||||
}
|
||||
|
||||
static D2D1FORCEINLINE
|
||||
Matrix3x2F
|
||||
Scale(
|
||||
FLOAT x,
|
||||
FLOAT y,
|
||||
D2D1_POINT_2F center = D2D1::Point2F()
|
||||
)
|
||||
{
|
||||
return Scale(SizeF(x, y), center);
|
||||
}
|
||||
|
||||
static D2D1FORCEINLINE
|
||||
Matrix3x2F
|
||||
Rotation(
|
||||
FLOAT angle,
|
||||
D2D1_POINT_2F center = D2D1::Point2F()
|
||||
)
|
||||
{
|
||||
Matrix3x2F rotation;
|
||||
|
||||
D2D1MakeRotateMatrix(angle, center, &rotation);
|
||||
|
||||
return rotation;
|
||||
}
|
||||
|
||||
static D2D1FORCEINLINE
|
||||
Matrix3x2F
|
||||
Skew(
|
||||
FLOAT angleX,
|
||||
FLOAT angleY,
|
||||
D2D1_POINT_2F center = D2D1::Point2F()
|
||||
)
|
||||
{
|
||||
Matrix3x2F skew;
|
||||
|
||||
D2D1MakeSkewMatrix(angleX, angleY, center, &skew);
|
||||
|
||||
return skew;
|
||||
}
|
||||
|
||||
//
|
||||
// Functions for convertion from the base D2D1_MATRIX_3X2_F to this type
|
||||
// without making a copy
|
||||
//
|
||||
static inline const Matrix3x2F* ReinterpretBaseType(const D2D1_MATRIX_3X2_F *pMatrix)
|
||||
{
|
||||
return static_cast<const Matrix3x2F *>(pMatrix);
|
||||
}
|
||||
|
||||
static inline Matrix3x2F* ReinterpretBaseType(D2D1_MATRIX_3X2_F *pMatrix)
|
||||
{
|
||||
return static_cast<Matrix3x2F *>(pMatrix);
|
||||
}
|
||||
|
||||
inline
|
||||
FLOAT
|
||||
Determinant() const
|
||||
{
|
||||
return (_11 * _22) - (_12 * _21);
|
||||
}
|
||||
|
||||
inline
|
||||
bool
|
||||
IsInvertible() const
|
||||
{
|
||||
return !!D2D1IsMatrixInvertible(this);
|
||||
}
|
||||
|
||||
inline
|
||||
bool
|
||||
Invert()
|
||||
{
|
||||
return !!D2D1InvertMatrix(this);
|
||||
}
|
||||
|
||||
inline
|
||||
bool
|
||||
IsIdentity() const
|
||||
{
|
||||
return _11 == 1.f && _12 == 0.f
|
||||
&& _21 == 0.f && _22 == 1.f
|
||||
&& _31 == 0.f && _32 == 0.f;
|
||||
}
|
||||
|
||||
inline
|
||||
void SetProduct(
|
||||
const Matrix3x2F &a,
|
||||
const Matrix3x2F &b
|
||||
)
|
||||
{
|
||||
_11 = a._11 * b._11 + a._12 * b._21;
|
||||
_12 = a._11 * b._12 + a._12 * b._22;
|
||||
_21 = a._21 * b._11 + a._22 * b._21;
|
||||
_22 = a._21 * b._12 + a._22 * b._22;
|
||||
_31 = a._31 * b._11 + a._32 * b._21 + b._31;
|
||||
_32 = a._31 * b._12 + a._32 * b._22 + b._32;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
Matrix3x2F
|
||||
operator*(
|
||||
const Matrix3x2F &matrix
|
||||
) const
|
||||
{
|
||||
Matrix3x2F result;
|
||||
|
||||
result.SetProduct(*this, matrix);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_POINT_2F
|
||||
TransformPoint(
|
||||
D2D1_POINT_2F point
|
||||
) const
|
||||
{
|
||||
D2D1_POINT_2F result =
|
||||
{
|
||||
point.x * _11 + point.y * _21 + _31,
|
||||
point.x * _12 + point.y * _22 + _32
|
||||
};
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_POINT_2F
|
||||
operator*(
|
||||
const D2D1_POINT_2F &point,
|
||||
const D2D1_MATRIX_3X2_F &matrix
|
||||
)
|
||||
{
|
||||
return Matrix3x2F::ReinterpretBaseType(&matrix)->TransformPoint(point);
|
||||
}
|
||||
|
||||
D2D1_MATRIX_3X2_F
|
||||
IdentityMatrix()
|
||||
{
|
||||
return Matrix3x2F::Identity();
|
||||
}
|
||||
|
||||
} // namespace D2D1
|
||||
|
||||
D2D1FORCEINLINE
|
||||
D2D1_MATRIX_3X2_F
|
||||
operator*(
|
||||
const D2D1_MATRIX_3X2_F &matrix1,
|
||||
const D2D1_MATRIX_3X2_F &matrix2
|
||||
)
|
||||
{
|
||||
return
|
||||
(*D2D1::Matrix3x2F::ReinterpretBaseType(&matrix1)) *
|
||||
(*D2D1::Matrix3x2F::ReinterpretBaseType(&matrix2));
|
||||
}
|
||||
|
||||
#endif // #ifndef D2D_USE_C_DEFINITIONS
|
||||
|
||||
#endif // #ifndef _D2D1_HELPER_H_
|
||||
|
145
SDK/Include/D2DBaseTypes.h
Normal file
145
SDK/Include/D2DBaseTypes.h
Normal file
@ -0,0 +1,145 @@
|
||||
//---------------------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// This file is automatically generated. Please do not edit it directly.
|
||||
//
|
||||
// File name: D2DBaseTypes.h
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma once
|
||||
|
||||
|
||||
#ifndef _D2DBASETYPES_INCLUDED
|
||||
#define _D2DBASETYPES_INCLUDED
|
||||
|
||||
#ifndef COM_NO_WINDOWS_H
|
||||
#include <windows.h>
|
||||
#endif // #ifndef COM_NO_WINDOWS_H
|
||||
|
||||
#ifndef D3DCOLORVALUE_DEFINED
|
||||
|
||||
//+-----------------------------------------------------------------------------
|
||||
//
|
||||
// Struct:
|
||||
// D3DCOLORVALUE
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
typedef struct D3DCOLORVALUE
|
||||
{
|
||||
FLOAT r;
|
||||
FLOAT g;
|
||||
FLOAT b;
|
||||
FLOAT a;
|
||||
|
||||
} D3DCOLORVALUE;
|
||||
|
||||
#define D3DCOLORVALUE_DEFINED
|
||||
#endif
|
||||
|
||||
|
||||
//+-----------------------------------------------------------------------------
|
||||
//
|
||||
// Struct:
|
||||
// D2D_POINT_2U
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
typedef struct D2D_POINT_2U
|
||||
{
|
||||
UINT32 x;
|
||||
UINT32 y;
|
||||
|
||||
} D2D_POINT_2U;
|
||||
|
||||
|
||||
//+-----------------------------------------------------------------------------
|
||||
//
|
||||
// Struct:
|
||||
// D2D_POINT_2F
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
typedef struct D2D_POINT_2F
|
||||
{
|
||||
FLOAT x;
|
||||
FLOAT y;
|
||||
|
||||
} D2D_POINT_2F;
|
||||
|
||||
|
||||
//+-----------------------------------------------------------------------------
|
||||
//
|
||||
// Struct:
|
||||
// D2D_RECT_F
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
typedef struct D2D_RECT_F
|
||||
{
|
||||
FLOAT left;
|
||||
FLOAT top;
|
||||
FLOAT right;
|
||||
FLOAT bottom;
|
||||
|
||||
} D2D_RECT_F;
|
||||
|
||||
|
||||
//+-----------------------------------------------------------------------------
|
||||
//
|
||||
// Struct:
|
||||
// D2D_RECT_U
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
typedef struct D2D_RECT_U
|
||||
{
|
||||
UINT32 left;
|
||||
UINT32 top;
|
||||
UINT32 right;
|
||||
UINT32 bottom;
|
||||
|
||||
} D2D_RECT_U;
|
||||
|
||||
|
||||
//+-----------------------------------------------------------------------------
|
||||
//
|
||||
// Struct:
|
||||
// D2D_SIZE_F
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
typedef struct D2D_SIZE_F
|
||||
{
|
||||
FLOAT width;
|
||||
FLOAT height;
|
||||
|
||||
} D2D_SIZE_F;
|
||||
|
||||
|
||||
//+-----------------------------------------------------------------------------
|
||||
//
|
||||
// Struct:
|
||||
// D2D_SIZE_U
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
typedef struct D2D_SIZE_U
|
||||
{
|
||||
UINT32 width;
|
||||
UINT32 height;
|
||||
|
||||
} D2D_SIZE_U;
|
||||
|
||||
typedef D3DCOLORVALUE D2D_COLOR_F;
|
||||
|
||||
//+-----------------------------------------------------------------------------
|
||||
//
|
||||
// Struct:
|
||||
// D2D_MATRIX_3X2_F
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
typedef struct D2D_MATRIX_3X2_F
|
||||
{
|
||||
FLOAT _11;
|
||||
FLOAT _12;
|
||||
FLOAT _21;
|
||||
FLOAT _22;
|
||||
FLOAT _31;
|
||||
FLOAT _32;
|
||||
|
||||
} D2D_MATRIX_3X2_F;
|
||||
|
||||
#endif // #ifndef _D2DBASETYPES_INCLUDED
|
206
SDK/Include/D2Derr.h
Normal file
206
SDK/Include/D2Derr.h
Normal file
@ -0,0 +1,206 @@
|
||||
/*=========================================================================*\
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
\*=========================================================================*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/*=========================================================================*\
|
||||
D2D Status Codes
|
||||
\*=========================================================================*/
|
||||
|
||||
#define FACILITY_D2D 0x899
|
||||
|
||||
#define MAKE_D2DHR( sev, code )\
|
||||
MAKE_HRESULT( sev, FACILITY_D2D, (code) )
|
||||
|
||||
#define MAKE_D2DHR_ERR( code )\
|
||||
MAKE_D2DHR( 1, code )
|
||||
|
||||
|
||||
//+----------------------------------------------------------------------------
|
||||
//
|
||||
// D2D error codes
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Error codes shared with WINCODECS
|
||||
//
|
||||
|
||||
//
|
||||
// The pixel format is not supported.
|
||||
//
|
||||
#define D2DERR_UNSUPPORTED_PIXEL_FORMAT WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT
|
||||
|
||||
//
|
||||
// Error codes that were already returned in prior versions and were part of the
|
||||
// MIL facility.
|
||||
|
||||
//
|
||||
// Error codes mapped from WIN32 where there isn't already another HRESULT based
|
||||
// define
|
||||
//
|
||||
|
||||
//
|
||||
// The supplied buffer was too small to accomodate the data.
|
||||
//
|
||||
#define D2DERR_INSUFFICIENT_BUFFER HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
|
||||
|
||||
|
||||
//
|
||||
// D2D specific codes
|
||||
//
|
||||
|
||||
//
|
||||
// The object was not in the correct state to process the method.
|
||||
//
|
||||
#define D2DERR_WRONG_STATE MAKE_D2DHR_ERR(0x001)
|
||||
|
||||
//
|
||||
// The object has not yet been initialized.
|
||||
//
|
||||
#define D2DERR_NOT_INITIALIZED MAKE_D2DHR_ERR(0x002)
|
||||
|
||||
//
|
||||
// The requested opertion is not supported.
|
||||
//
|
||||
#define D2DERR_UNSUPPORTED_OPERATION MAKE_D2DHR_ERR(0x003)
|
||||
|
||||
//
|
||||
// The geomery scanner failed to process the data.
|
||||
//
|
||||
#define D2DERR_SCANNER_FAILED MAKE_D2DHR_ERR(0x004)
|
||||
|
||||
//
|
||||
// D2D could not access the screen.
|
||||
//
|
||||
#define D2DERR_SCREEN_ACCESS_DENIED MAKE_D2DHR_ERR(0x005)
|
||||
|
||||
//
|
||||
// A valid display state could not be determined.
|
||||
//
|
||||
#define D2DERR_DISPLAY_STATE_INVALID MAKE_D2DHR_ERR(0x006)
|
||||
|
||||
//
|
||||
// The supplied vector is vero.
|
||||
//
|
||||
#define D2DERR_ZERO_VECTOR MAKE_D2DHR_ERR(0x007)
|
||||
|
||||
//
|
||||
// An internal error (D2D bug) occurred. On checked builds, we would assert.
|
||||
//
|
||||
// The application should close this instance of D2D and should consider
|
||||
// restarting its process.
|
||||
//
|
||||
#define D2DERR_INTERNAL_ERROR MAKE_D2DHR_ERR(0x008)
|
||||
|
||||
//
|
||||
// The display format we need to render is not supported by the
|
||||
// hardware device.
|
||||
//
|
||||
#define D2DERR_DISPLAY_FORMAT_NOT_SUPPORTED MAKE_D2DHR_ERR(0x009)
|
||||
|
||||
//
|
||||
// A call to this method is invalid.
|
||||
//
|
||||
#define D2DERR_INVALID_CALL MAKE_D2DHR_ERR(0x00A)
|
||||
|
||||
//
|
||||
// No HW rendering device is available for this operation.
|
||||
//
|
||||
#define D2DERR_NO_HARDWARE_DEVICE MAKE_D2DHR_ERR(0x00B)
|
||||
|
||||
//
|
||||
// There has been a presentation error that may be recoverable. The caller
|
||||
// needs to recreate, rerender the entire frame, and reattempt present.
|
||||
//
|
||||
#define D2DERR_RECREATE_TARGET MAKE_D2DHR_ERR(0x00C)
|
||||
|
||||
//
|
||||
// Shader construction failed because it was too complex.
|
||||
//
|
||||
#define D2DERR_TOO_MANY_SHADER_ELEMENTS MAKE_D2DHR_ERR(0x00D)
|
||||
|
||||
//
|
||||
// Shader compilation failed.
|
||||
//
|
||||
#define D2DERR_SHADER_COMPILE_FAILED MAKE_D2DHR_ERR(0x00E)
|
||||
|
||||
//
|
||||
// Requested DX surface size exceeded maximum texture size.
|
||||
//
|
||||
#define D2DERR_MAX_TEXTURE_SIZE_EXCEEDED MAKE_D2DHR_ERR(0x00F)
|
||||
|
||||
//
|
||||
// The requested D2D version is not supported.
|
||||
//
|
||||
#define D2DERR_UNSUPPORTED_VERSION MAKE_D2DHR_ERR(0x010)
|
||||
|
||||
//
|
||||
// Invalid number.
|
||||
//
|
||||
#define D2DERR_BAD_NUMBER MAKE_D2DHR_ERR(0x0011)
|
||||
|
||||
//
|
||||
// Objects used together must be created from the same factory instance.
|
||||
//
|
||||
#define D2DERR_WRONG_FACTORY MAKE_D2DHR_ERR(0x012)
|
||||
|
||||
//
|
||||
// A layer resource can only be in use once at any point in time.
|
||||
//
|
||||
#define D2DERR_LAYER_ALREADY_IN_USE MAKE_D2DHR_ERR(0x013)
|
||||
|
||||
//
|
||||
// The pop call did not match the corresponding push call
|
||||
//
|
||||
#define D2DERR_POP_CALL_DID_NOT_MATCH_PUSH MAKE_D2DHR_ERR(0x014)
|
||||
|
||||
//
|
||||
// The resource was realized on the wrong render target
|
||||
//
|
||||
#define D2DERR_WRONG_RESOURCE_DOMAIN MAKE_D2DHR_ERR(0x015)
|
||||
|
||||
//
|
||||
// The push and pop calls were unbalanced
|
||||
//
|
||||
#define D2DERR_PUSH_POP_UNBALANCED MAKE_D2DHR_ERR(0x016)
|
||||
|
||||
//
|
||||
// Attempt to copy from a render target while a layer or clip rect is applied
|
||||
//
|
||||
#define D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT MAKE_D2DHR_ERR(0x017)
|
||||
|
||||
//
|
||||
// The brush types are incompatible for the call.
|
||||
//
|
||||
#define D2DERR_INCOMPATIBLE_BRUSH_TYPES MAKE_D2DHR_ERR(0x018)
|
||||
|
||||
//
|
||||
// An unknown win32 failure occurred.
|
||||
//
|
||||
#define D2DERR_WIN32_ERROR MAKE_D2DHR_ERR(0x019)
|
||||
|
||||
//
|
||||
// The render target is not compatible with GDI
|
||||
//
|
||||
#define D2DERR_TARGET_NOT_GDI_COMPATIBLE MAKE_D2DHR_ERR(0x01A)
|
||||
|
||||
//
|
||||
// A text client drawing effect object is of the wrong type
|
||||
//
|
||||
#define D2DERR_TEXT_EFFECT_IS_WRONG_TYPE MAKE_D2DHR_ERR(0x01B)
|
||||
|
||||
//
|
||||
// The application is holding a reference to the IDWriteTextRenderer interface
|
||||
// after the corresponding DrawText or DrawTextLayout call has returned. The
|
||||
// IDWriteTextRenderer instance will be zombied.
|
||||
//
|
||||
#define D2DERR_TEXT_RENDERER_NOT_RELEASED MAKE_D2DHR_ERR(0x01C)
|
||||
|
||||
//
|
||||
// The requested size is larger than the guaranteed supported texture size.
|
||||
//
|
||||
#define D2DERR_EXCEEDS_MAX_BITMAP_SIZE MAKE_D2DHR_ERR(0x01D)
|
6723
SDK/Include/D3D10.h
Normal file
6723
SDK/Include/D3D10.h
Normal file
File diff suppressed because it is too large
Load Diff
1775
SDK/Include/D3D10_1.h
Normal file
1775
SDK/Include/D3D10_1.h
Normal file
File diff suppressed because it is too large
Load Diff
301
SDK/Include/D3D10_1shader.h
Normal file
301
SDK/Include/D3D10_1shader.h
Normal file
@ -0,0 +1,301 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// File: D3D10_1Shader.h
|
||||
// Content: D3D10.1 Shader Types and APIs
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __D3D10_1SHADER_H__
|
||||
#define __D3D10_1SHADER_H__
|
||||
|
||||
#include "d3d10shader.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Shader debugging structures
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum _D3D10_SHADER_DEBUG_REGTYPE
|
||||
{
|
||||
D3D10_SHADER_DEBUG_REG_INPUT,
|
||||
D3D10_SHADER_DEBUG_REG_OUTPUT,
|
||||
D3D10_SHADER_DEBUG_REG_CBUFFER,
|
||||
D3D10_SHADER_DEBUG_REG_TBUFFER,
|
||||
D3D10_SHADER_DEBUG_REG_TEMP,
|
||||
D3D10_SHADER_DEBUG_REG_TEMPARRAY,
|
||||
D3D10_SHADER_DEBUG_REG_TEXTURE,
|
||||
D3D10_SHADER_DEBUG_REG_SAMPLER,
|
||||
D3D10_SHADER_DEBUG_REG_IMMEDIATECBUFFER,
|
||||
D3D10_SHADER_DEBUG_REG_LITERAL,
|
||||
D3D10_SHADER_DEBUG_REG_UNUSED,
|
||||
D3D11_SHADER_DEBUG_REG_INTERFACE_POINTERS,
|
||||
D3D11_SHADER_DEBUG_REG_UAV,
|
||||
D3D10_SHADER_DEBUG_REG_FORCE_DWORD = 0x7fffffff,
|
||||
} D3D10_SHADER_DEBUG_REGTYPE;
|
||||
|
||||
typedef enum _D3D10_SHADER_DEBUG_SCOPETYPE
|
||||
{
|
||||
D3D10_SHADER_DEBUG_SCOPE_GLOBAL,
|
||||
D3D10_SHADER_DEBUG_SCOPE_BLOCK,
|
||||
D3D10_SHADER_DEBUG_SCOPE_FORLOOP,
|
||||
D3D10_SHADER_DEBUG_SCOPE_STRUCT,
|
||||
D3D10_SHADER_DEBUG_SCOPE_FUNC_PARAMS,
|
||||
D3D10_SHADER_DEBUG_SCOPE_STATEBLOCK,
|
||||
D3D10_SHADER_DEBUG_SCOPE_NAMESPACE,
|
||||
D3D10_SHADER_DEBUG_SCOPE_ANNOTATION,
|
||||
D3D10_SHADER_DEBUG_SCOPE_FORCE_DWORD = 0x7fffffff,
|
||||
} D3D10_SHADER_DEBUG_SCOPETYPE;
|
||||
|
||||
typedef enum _D3D10_SHADER_DEBUG_VARTYPE
|
||||
{
|
||||
D3D10_SHADER_DEBUG_VAR_VARIABLE,
|
||||
D3D10_SHADER_DEBUG_VAR_FUNCTION,
|
||||
D3D10_SHADER_DEBUG_VAR_FORCE_DWORD = 0x7fffffff,
|
||||
} D3D10_SHADER_DEBUG_VARTYPE;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// These are the serialized structures that get written to the file
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct _D3D10_SHADER_DEBUG_TOKEN_INFO
|
||||
{
|
||||
UINT File; // offset into file list
|
||||
UINT Line; // line #
|
||||
UINT Column; // column #
|
||||
|
||||
UINT TokenLength;
|
||||
UINT TokenId; // offset to LPCSTR of length TokenLength in string datastore
|
||||
} D3D10_SHADER_DEBUG_TOKEN_INFO;
|
||||
|
||||
// Variable list
|
||||
typedef struct _D3D10_SHADER_DEBUG_VAR_INFO
|
||||
{
|
||||
// Index into token list for declaring identifier
|
||||
UINT TokenId;
|
||||
D3D10_SHADER_VARIABLE_TYPE Type;
|
||||
// register and component for this variable, only valid/necessary for arrays
|
||||
UINT Register;
|
||||
UINT Component;
|
||||
// gives the original variable that declared this variable
|
||||
UINT ScopeVar;
|
||||
// this variable's offset in its ScopeVar
|
||||
UINT ScopeVarOffset;
|
||||
} D3D10_SHADER_DEBUG_VAR_INFO;
|
||||
|
||||
typedef struct _D3D10_SHADER_DEBUG_INPUT_INFO
|
||||
{
|
||||
// index into array of variables of variable to initialize
|
||||
UINT Var;
|
||||
// input, cbuffer, tbuffer
|
||||
D3D10_SHADER_DEBUG_REGTYPE InitialRegisterSet;
|
||||
// set to cbuffer or tbuffer slot, geometry shader input primitive #,
|
||||
// identifying register for indexable temp, or -1
|
||||
UINT InitialBank;
|
||||
// -1 if temp, otherwise gives register in register set
|
||||
UINT InitialRegister;
|
||||
// -1 if temp, otherwise gives component
|
||||
UINT InitialComponent;
|
||||
// initial value if literal
|
||||
UINT InitialValue;
|
||||
} D3D10_SHADER_DEBUG_INPUT_INFO;
|
||||
|
||||
typedef struct _D3D10_SHADER_DEBUG_SCOPEVAR_INFO
|
||||
{
|
||||
// Index into variable token
|
||||
UINT TokenId;
|
||||
|
||||
D3D10_SHADER_DEBUG_VARTYPE VarType; // variable or function (different namespaces)
|
||||
D3D10_SHADER_VARIABLE_CLASS Class;
|
||||
UINT Rows; // number of rows (matrices)
|
||||
UINT Columns; // number of columns (vectors and matrices)
|
||||
|
||||
// In an array of structures, one struct member scope is provided, and
|
||||
// you'll have to add the array stride times the index to the variable
|
||||
// index you find, then find that variable in this structure's list of
|
||||
// variables.
|
||||
|
||||
// gives a scope to look up struct members. -1 if not a struct
|
||||
UINT StructMemberScope;
|
||||
|
||||
// number of array indices
|
||||
UINT uArrayIndices; // a[3][2][1] has 3 indices
|
||||
// maximum array index for each index
|
||||
// offset to UINT[uArrayIndices] in UINT datastore
|
||||
UINT ArrayElements; // a[3][2][1] has {3, 2, 1}
|
||||
// how many variables each array index moves
|
||||
// offset to UINT[uArrayIndices] in UINT datastore
|
||||
UINT ArrayStrides; // a[3][2][1] has {2, 1, 1}
|
||||
|
||||
UINT uVariables;
|
||||
// index of the first variable, later variables are offsets from this one
|
||||
UINT uFirstVariable;
|
||||
} D3D10_SHADER_DEBUG_SCOPEVAR_INFO;
|
||||
|
||||
// scope data, this maps variable names to debug variables (useful for the watch window)
|
||||
typedef struct _D3D10_SHADER_DEBUG_SCOPE_INFO
|
||||
{
|
||||
D3D10_SHADER_DEBUG_SCOPETYPE ScopeType;
|
||||
UINT Name; // offset to name of scope in strings list
|
||||
UINT uNameLen; // length of name string
|
||||
UINT uVariables;
|
||||
UINT VariableData; // Offset to UINT[uVariables] indexing the Scope Variable list
|
||||
} D3D10_SHADER_DEBUG_SCOPE_INFO;
|
||||
|
||||
// instruction outputs
|
||||
typedef struct _D3D10_SHADER_DEBUG_OUTPUTVAR
|
||||
{
|
||||
// index variable being written to, if -1 it's not going to a variable
|
||||
UINT Var;
|
||||
// range data that the compiler expects to be true
|
||||
UINT uValueMin, uValueMax;
|
||||
INT iValueMin, iValueMax;
|
||||
FLOAT fValueMin, fValueMax;
|
||||
|
||||
BOOL bNaNPossible, bInfPossible;
|
||||
} D3D10_SHADER_DEBUG_OUTPUTVAR;
|
||||
|
||||
typedef struct _D3D10_SHADER_DEBUG_OUTPUTREG_INFO
|
||||
{
|
||||
// Only temp, indexable temp, and output are valid here
|
||||
D3D10_SHADER_DEBUG_REGTYPE OutputRegisterSet;
|
||||
// -1 means no output
|
||||
UINT OutputReg;
|
||||
// if a temp array, identifier for which one
|
||||
UINT TempArrayReg;
|
||||
// -1 means masked out
|
||||
UINT OutputComponents[4];
|
||||
D3D10_SHADER_DEBUG_OUTPUTVAR OutputVars[4];
|
||||
// when indexing the output, get the value of this register, then add
|
||||
// that to uOutputReg. If uIndexReg is -1, then there is no index.
|
||||
// find the variable whose register is the sum (by looking in the ScopeVar)
|
||||
// and component matches, then set it. This should only happen for indexable
|
||||
// temps and outputs.
|
||||
UINT IndexReg;
|
||||
UINT IndexComp;
|
||||
} D3D10_SHADER_DEBUG_OUTPUTREG_INFO;
|
||||
|
||||
// per instruction data
|
||||
typedef struct _D3D10_SHADER_DEBUG_INST_INFO
|
||||
{
|
||||
UINT Id; // Which instruction this is in the bytecode
|
||||
UINT Opcode; // instruction type
|
||||
|
||||
// 0, 1, or 2
|
||||
UINT uOutputs;
|
||||
|
||||
// up to two outputs per instruction
|
||||
D3D10_SHADER_DEBUG_OUTPUTREG_INFO pOutputs[2];
|
||||
|
||||
// index into the list of tokens for this instruction's token
|
||||
UINT TokenId;
|
||||
|
||||
// how many function calls deep this instruction is
|
||||
UINT NestingLevel;
|
||||
|
||||
// list of scopes from outer-most to inner-most
|
||||
// Number of scopes
|
||||
UINT Scopes;
|
||||
UINT ScopeInfo; // Offset to UINT[uScopes] specifying indices of the ScopeInfo Array
|
||||
|
||||
// list of variables accessed by this instruction
|
||||
// Number of variables
|
||||
UINT AccessedVars;
|
||||
UINT AccessedVarsInfo; // Offset to UINT[AccessedVars] specifying indices of the ScopeVariableInfo Array
|
||||
} D3D10_SHADER_DEBUG_INST_INFO;
|
||||
|
||||
typedef struct _D3D10_SHADER_DEBUG_FILE_INFO
|
||||
{
|
||||
UINT FileName; // Offset to LPCSTR for file name
|
||||
UINT FileNameLen; // Length of file name
|
||||
UINT FileData; // Offset to LPCSTR of length FileLen
|
||||
UINT FileLen; // Length of file
|
||||
} D3D10_SHADER_DEBUG_FILE_INFO;
|
||||
|
||||
typedef struct _D3D10_SHADER_DEBUG_INFO
|
||||
{
|
||||
UINT Size; // sizeof(D3D10_SHADER_DEBUG_INFO)
|
||||
UINT Creator; // Offset to LPCSTR for compiler version
|
||||
UINT EntrypointName; // Offset to LPCSTR for Entry point name
|
||||
UINT ShaderTarget; // Offset to LPCSTR for shader target
|
||||
UINT CompileFlags; // flags used to compile
|
||||
UINT Files; // number of included files
|
||||
UINT FileInfo; // Offset to D3D10_SHADER_DEBUG_FILE_INFO[Files]
|
||||
UINT Instructions; // number of instructions
|
||||
UINT InstructionInfo; // Offset to D3D10_SHADER_DEBUG_INST_INFO[Instructions]
|
||||
UINT Variables; // number of variables
|
||||
UINT VariableInfo; // Offset to D3D10_SHADER_DEBUG_VAR_INFO[Variables]
|
||||
UINT InputVariables; // number of variables to initialize before running
|
||||
UINT InputVariableInfo; // Offset to D3D10_SHADER_DEBUG_INPUT_INFO[InputVariables]
|
||||
UINT Tokens; // number of tokens to initialize
|
||||
UINT TokenInfo; // Offset to D3D10_SHADER_DEBUG_TOKEN_INFO[Tokens]
|
||||
UINT Scopes; // number of scopes
|
||||
UINT ScopeInfo; // Offset to D3D10_SHADER_DEBUG_SCOPE_INFO[Scopes]
|
||||
UINT ScopeVariables; // number of variables declared
|
||||
UINT ScopeVariableInfo; // Offset to D3D10_SHADER_DEBUG_SCOPEVAR_INFO[Scopes]
|
||||
UINT UintOffset; // Offset to the UINT datastore, all UINT offsets are from this offset
|
||||
UINT StringOffset; // Offset to the string datastore, all string offsets are from this offset
|
||||
} D3D10_SHADER_DEBUG_INFO;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ID3D10ShaderReflection1:
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Interface definitions
|
||||
//
|
||||
|
||||
typedef interface ID3D10ShaderReflection1 ID3D10ShaderReflection1;
|
||||
typedef interface ID3D10ShaderReflection1 *LPD3D10SHADERREFLECTION1;
|
||||
|
||||
// {C3457783-A846-47CE-9520-CEA6F66E7447}
|
||||
DEFINE_GUID(IID_ID3D10ShaderReflection1,
|
||||
0xc3457783, 0xa846, 0x47ce, 0x95, 0x20, 0xce, 0xa6, 0xf6, 0x6e, 0x74, 0x47);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D10ShaderReflection1
|
||||
|
||||
DECLARE_INTERFACE_(ID3D10ShaderReflection1, IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE;
|
||||
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDescByName)(THIS_ LPCSTR Name, D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD(GetMovInstructionCount)(THIS_ UINT* pCount) PURE;
|
||||
STDMETHOD(GetMovcInstructionCount)(THIS_ UINT* pCount) PURE;
|
||||
STDMETHOD(GetConversionInstructionCount)(THIS_ UINT* pCount) PURE;
|
||||
STDMETHOD(GetBitwiseInstructionCount)(THIS_ UINT* pCount) PURE;
|
||||
|
||||
STDMETHOD(GetGSInputPrimitive)(THIS_ D3D10_PRIMITIVE* pPrim) PURE;
|
||||
STDMETHOD(IsLevel9Shader)(THIS_ BOOL* pbLevel9Shader) PURE;
|
||||
STDMETHOD(IsSampleFrequencyShader)(THIS_ BOOL* pbSampleFrequency) PURE;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// APIs //////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3D10_1SHADER_H__
|
||||
|
1455
SDK/Include/D3D10effect.h
Normal file
1455
SDK/Include/D3D10effect.h
Normal file
File diff suppressed because it is too large
Load Diff
534
SDK/Include/D3D10shader.h
Normal file
534
SDK/Include/D3D10shader.h
Normal file
@ -0,0 +1,534 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// File: D3D10Shader.h
|
||||
// Content: D3D10 Shader Types and APIs
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __D3D10SHADER_H__
|
||||
#define __D3D10SHADER_H__
|
||||
|
||||
#include "d3d10.h"
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// D3D10_TX_VERSION:
|
||||
// --------------
|
||||
// Version token used to create a procedural texture filler in effects
|
||||
// Used by D3D10Fill[]TX functions
|
||||
//---------------------------------------------------------------------------
|
||||
#define D3D10_TX_VERSION(_Major,_Minor) (('T' << 24) | ('X' << 16) | ((_Major) << 8) | (_Minor))
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3D10SHADER flags:
|
||||
// -----------------
|
||||
// D3D10_SHADER_DEBUG
|
||||
// Insert debug file/line/type/symbol information.
|
||||
//
|
||||
// D3D10_SHADER_SKIP_VALIDATION
|
||||
// Do not validate the generated code against known capabilities and
|
||||
// constraints. This option is only recommended when compiling shaders
|
||||
// you KNOW will work. (ie. have compiled before without this option.)
|
||||
// Shaders are always validated by D3D before they are set to the device.
|
||||
//
|
||||
// D3D10_SHADER_SKIP_OPTIMIZATION
|
||||
// Instructs the compiler to skip optimization steps during code generation.
|
||||
// Unless you are trying to isolate a problem in your code using this option
|
||||
// is not recommended.
|
||||
//
|
||||
// D3D10_SHADER_PACK_MATRIX_ROW_MAJOR
|
||||
// Unless explicitly specified, matrices will be packed in row-major order
|
||||
// on input and output from the shader.
|
||||
//
|
||||
// D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR
|
||||
// Unless explicitly specified, matrices will be packed in column-major
|
||||
// order on input and output from the shader. This is generally more
|
||||
// efficient, since it allows vector-matrix multiplication to be performed
|
||||
// using a series of dot-products.
|
||||
//
|
||||
// D3D10_SHADER_PARTIAL_PRECISION
|
||||
// Force all computations in resulting shader to occur at partial precision.
|
||||
// This may result in faster evaluation of shaders on some hardware.
|
||||
//
|
||||
// D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT
|
||||
// Force compiler to compile against the next highest available software
|
||||
// target for vertex shaders. This flag also turns optimizations off,
|
||||
// and debugging on.
|
||||
//
|
||||
// D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT
|
||||
// Force compiler to compile against the next highest available software
|
||||
// target for pixel shaders. This flag also turns optimizations off,
|
||||
// and debugging on.
|
||||
//
|
||||
// D3D10_SHADER_NO_PRESHADER
|
||||
// Disables Preshaders. Using this flag will cause the compiler to not
|
||||
// pull out static expression for evaluation on the host cpu
|
||||
//
|
||||
// D3D10_SHADER_AVOID_FLOW_CONTROL
|
||||
// Hint compiler to avoid flow-control constructs where possible.
|
||||
//
|
||||
// D3D10_SHADER_PREFER_FLOW_CONTROL
|
||||
// Hint compiler to prefer flow-control constructs where possible.
|
||||
//
|
||||
// D3D10_SHADER_ENABLE_STRICTNESS
|
||||
// By default, the HLSL/Effect compilers are not strict on deprecated syntax.
|
||||
// Specifying this flag enables the strict mode. Deprecated syntax may be
|
||||
// removed in a future release, and enabling syntax is a good way to make sure
|
||||
// your shaders comply to the latest spec.
|
||||
//
|
||||
// D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY
|
||||
// This enables older shaders to compile to 4_0 targets.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define D3D10_SHADER_DEBUG (1 << 0)
|
||||
#define D3D10_SHADER_SKIP_VALIDATION (1 << 1)
|
||||
#define D3D10_SHADER_SKIP_OPTIMIZATION (1 << 2)
|
||||
#define D3D10_SHADER_PACK_MATRIX_ROW_MAJOR (1 << 3)
|
||||
#define D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR (1 << 4)
|
||||
#define D3D10_SHADER_PARTIAL_PRECISION (1 << 5)
|
||||
#define D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT (1 << 6)
|
||||
#define D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT (1 << 7)
|
||||
#define D3D10_SHADER_NO_PRESHADER (1 << 8)
|
||||
#define D3D10_SHADER_AVOID_FLOW_CONTROL (1 << 9)
|
||||
#define D3D10_SHADER_PREFER_FLOW_CONTROL (1 << 10)
|
||||
#define D3D10_SHADER_ENABLE_STRICTNESS (1 << 11)
|
||||
#define D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12)
|
||||
#define D3D10_SHADER_IEEE_STRICTNESS (1 << 13)
|
||||
#define D3D10_SHADER_WARNINGS_ARE_ERRORS (1 << 18)
|
||||
|
||||
|
||||
// optimization level flags
|
||||
#define D3D10_SHADER_OPTIMIZATION_LEVEL0 (1 << 14)
|
||||
#define D3D10_SHADER_OPTIMIZATION_LEVEL1 0
|
||||
#define D3D10_SHADER_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15))
|
||||
#define D3D10_SHADER_OPTIMIZATION_LEVEL3 (1 << 15)
|
||||
|
||||
|
||||
|
||||
|
||||
typedef D3D_SHADER_MACRO D3D10_SHADER_MACRO;
|
||||
typedef D3D10_SHADER_MACRO* LPD3D10_SHADER_MACRO;
|
||||
|
||||
|
||||
typedef D3D_SHADER_VARIABLE_CLASS D3D10_SHADER_VARIABLE_CLASS;
|
||||
typedef D3D10_SHADER_VARIABLE_CLASS* LPD3D10_SHADER_VARIABLE_CLASS;
|
||||
|
||||
typedef D3D_SHADER_VARIABLE_FLAGS D3D10_SHADER_VARIABLE_FLAGS;
|
||||
typedef D3D10_SHADER_VARIABLE_FLAGS* LPD3D10_SHADER_VARIABLE_FLAGS;
|
||||
|
||||
typedef D3D_SHADER_VARIABLE_TYPE D3D10_SHADER_VARIABLE_TYPE;
|
||||
typedef D3D10_SHADER_VARIABLE_TYPE* LPD3D10_SHADER_VARIABLE_TYPE;
|
||||
|
||||
typedef D3D_SHADER_INPUT_FLAGS D3D10_SHADER_INPUT_FLAGS;
|
||||
typedef D3D10_SHADER_INPUT_FLAGS* LPD3D10_SHADER_INPUT_FLAGS;
|
||||
|
||||
typedef D3D_SHADER_INPUT_TYPE D3D10_SHADER_INPUT_TYPE;
|
||||
typedef D3D10_SHADER_INPUT_TYPE* LPD3D10_SHADER_INPUT_TYPE;
|
||||
|
||||
typedef D3D_SHADER_CBUFFER_FLAGS D3D10_SHADER_CBUFFER_FLAGS;
|
||||
typedef D3D10_SHADER_CBUFFER_FLAGS* LPD3D10_SHADER_CBUFFER_FLAGS;
|
||||
|
||||
typedef D3D_CBUFFER_TYPE D3D10_CBUFFER_TYPE;
|
||||
typedef D3D10_CBUFFER_TYPE* LPD3D10_CBUFFER_TYPE;
|
||||
|
||||
typedef D3D_NAME D3D10_NAME;
|
||||
|
||||
typedef D3D_RESOURCE_RETURN_TYPE D3D10_RESOURCE_RETURN_TYPE;
|
||||
|
||||
typedef D3D_REGISTER_COMPONENT_TYPE D3D10_REGISTER_COMPONENT_TYPE;
|
||||
|
||||
typedef D3D_INCLUDE_TYPE D3D10_INCLUDE_TYPE;
|
||||
|
||||
// ID3D10Include has been made version-neutral and moved to d3dcommon.h.
|
||||
typedef interface ID3DInclude ID3D10Include;
|
||||
typedef interface ID3DInclude* LPD3D10INCLUDE;
|
||||
#define IID_ID3D10Include IID_ID3DInclude
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ID3D10ShaderReflection:
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//
|
||||
// Structure definitions
|
||||
//
|
||||
|
||||
typedef struct _D3D10_SHADER_DESC
|
||||
{
|
||||
UINT Version; // Shader version
|
||||
LPCSTR Creator; // Creator string
|
||||
UINT Flags; // Shader compilation/parse flags
|
||||
|
||||
UINT ConstantBuffers; // Number of constant buffers
|
||||
UINT BoundResources; // Number of bound resources
|
||||
UINT InputParameters; // Number of parameters in the input signature
|
||||
UINT OutputParameters; // Number of parameters in the output signature
|
||||
|
||||
UINT InstructionCount; // Number of emitted instructions
|
||||
UINT TempRegisterCount; // Number of temporary registers used
|
||||
UINT TempArrayCount; // Number of temporary arrays used
|
||||
UINT DefCount; // Number of constant defines
|
||||
UINT DclCount; // Number of declarations (input + output)
|
||||
UINT TextureNormalInstructions; // Number of non-categorized texture instructions
|
||||
UINT TextureLoadInstructions; // Number of texture load instructions
|
||||
UINT TextureCompInstructions; // Number of texture comparison instructions
|
||||
UINT TextureBiasInstructions; // Number of texture bias instructions
|
||||
UINT TextureGradientInstructions; // Number of texture gradient instructions
|
||||
UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
|
||||
UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
|
||||
UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
|
||||
UINT StaticFlowControlCount; // Number of static flow control instructions used
|
||||
UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
|
||||
UINT MacroInstructionCount; // Number of macro instructions used
|
||||
UINT ArrayInstructionCount; // Number of array instructions used
|
||||
UINT CutInstructionCount; // Number of cut instructions used
|
||||
UINT EmitInstructionCount; // Number of emit instructions used
|
||||
D3D10_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology
|
||||
UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count
|
||||
} D3D10_SHADER_DESC;
|
||||
|
||||
typedef struct _D3D10_SHADER_BUFFER_DESC
|
||||
{
|
||||
LPCSTR Name; // Name of the constant buffer
|
||||
D3D10_CBUFFER_TYPE Type; // Indicates that this is a CBuffer or TBuffer
|
||||
UINT Variables; // Number of member variables
|
||||
UINT Size; // Size of CB (in bytes)
|
||||
UINT uFlags; // Buffer description flags
|
||||
} D3D10_SHADER_BUFFER_DESC;
|
||||
|
||||
typedef struct _D3D10_SHADER_VARIABLE_DESC
|
||||
{
|
||||
LPCSTR Name; // Name of the variable
|
||||
UINT StartOffset; // Offset in constant buffer's backing store
|
||||
UINT Size; // Size of variable (in bytes)
|
||||
UINT uFlags; // Variable flags
|
||||
LPVOID DefaultValue; // Raw pointer to default value
|
||||
} D3D10_SHADER_VARIABLE_DESC;
|
||||
|
||||
typedef struct _D3D10_SHADER_TYPE_DESC
|
||||
{
|
||||
D3D10_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)
|
||||
D3D10_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)
|
||||
UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
|
||||
UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
|
||||
UINT Elements; // Number of elements (0 if not an array)
|
||||
UINT Members; // Number of members (0 if not a structure)
|
||||
UINT Offset; // Offset from the start of structure (0 if not a structure member)
|
||||
} D3D10_SHADER_TYPE_DESC;
|
||||
|
||||
typedef struct _D3D10_SHADER_INPUT_BIND_DESC
|
||||
{
|
||||
LPCSTR Name; // Name of the resource
|
||||
D3D10_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)
|
||||
UINT BindPoint; // Starting bind point
|
||||
UINT BindCount; // Number of contiguous bind points (for arrays)
|
||||
|
||||
UINT uFlags; // Input binding flags
|
||||
D3D10_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)
|
||||
D3D10_SRV_DIMENSION Dimension; // Dimension (if texture)
|
||||
UINT NumSamples; // Number of samples (0 if not MS texture)
|
||||
} D3D10_SHADER_INPUT_BIND_DESC;
|
||||
|
||||
typedef struct _D3D10_SIGNATURE_PARAMETER_DESC
|
||||
{
|
||||
LPCSTR SemanticName; // Name of the semantic
|
||||
UINT SemanticIndex; // Index of the semantic
|
||||
UINT Register; // Number of member variables
|
||||
D3D10_NAME SystemValueType;// A predefined system value, or D3D10_NAME_UNDEFINED if not applicable
|
||||
D3D10_REGISTER_COMPONENT_TYPE ComponentType;// Scalar type (e.g. uint, float, etc.)
|
||||
BYTE Mask; // Mask to indicate which components of the register
|
||||
// are used (combination of D3D10_COMPONENT_MASK values)
|
||||
BYTE ReadWriteMask; // Mask to indicate whether a given component is
|
||||
// never written (if this is an output signature) or
|
||||
// always read (if this is an input signature).
|
||||
// (combination of D3D10_COMPONENT_MASK values)
|
||||
|
||||
} D3D10_SIGNATURE_PARAMETER_DESC;
|
||||
|
||||
|
||||
//
|
||||
// Interface definitions
|
||||
//
|
||||
|
||||
typedef interface ID3D10ShaderReflectionType ID3D10ShaderReflectionType;
|
||||
typedef interface ID3D10ShaderReflectionType *LPD3D10SHADERREFLECTIONTYPE;
|
||||
|
||||
// {C530AD7D-9B16-4395-A979-BA2ECFF83ADD}
|
||||
DEFINE_GUID(IID_ID3D10ShaderReflectionType,
|
||||
0xc530ad7d, 0x9b16, 0x4395, 0xa9, 0x79, 0xba, 0x2e, 0xcf, 0xf8, 0x3a, 0xdd);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D10ShaderReflectionType
|
||||
|
||||
DECLARE_INTERFACE(ID3D10ShaderReflectionType)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_TYPE_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D10ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ UINT Index) PURE;
|
||||
STDMETHOD_(ID3D10ShaderReflectionType*, GetMemberTypeByName)(THIS_ LPCSTR Name) PURE;
|
||||
STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ UINT Index) PURE;
|
||||
};
|
||||
|
||||
typedef interface ID3D10ShaderReflectionVariable ID3D10ShaderReflectionVariable;
|
||||
typedef interface ID3D10ShaderReflectionVariable *LPD3D10SHADERREFLECTIONVARIABLE;
|
||||
|
||||
// {1BF63C95-2650-405d-99C1-3636BD1DA0A1}
|
||||
DEFINE_GUID(IID_ID3D10ShaderReflectionVariable,
|
||||
0x1bf63c95, 0x2650, 0x405d, 0x99, 0xc1, 0x36, 0x36, 0xbd, 0x1d, 0xa0, 0xa1);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D10ShaderReflectionVariable
|
||||
|
||||
DECLARE_INTERFACE(ID3D10ShaderReflectionVariable)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_VARIABLE_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D10ShaderReflectionType*, GetType)(THIS) PURE;
|
||||
};
|
||||
|
||||
typedef interface ID3D10ShaderReflectionConstantBuffer ID3D10ShaderReflectionConstantBuffer;
|
||||
typedef interface ID3D10ShaderReflectionConstantBuffer *LPD3D10SHADERREFLECTIONCONSTANTBUFFER;
|
||||
|
||||
// {66C66A94-DDDD-4b62-A66A-F0DA33C2B4D0}
|
||||
DEFINE_GUID(IID_ID3D10ShaderReflectionConstantBuffer,
|
||||
0x66c66a94, 0xdddd, 0x4b62, 0xa6, 0x6a, 0xf0, 0xda, 0x33, 0xc2, 0xb4, 0xd0);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D10ShaderReflectionConstantBuffer
|
||||
|
||||
DECLARE_INTERFACE(ID3D10ShaderReflectionConstantBuffer)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_BUFFER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByIndex)(THIS_ UINT Index) PURE;
|
||||
STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE;
|
||||
};
|
||||
|
||||
typedef interface ID3D10ShaderReflection ID3D10ShaderReflection;
|
||||
typedef interface ID3D10ShaderReflection *LPD3D10SHADERREFLECTION;
|
||||
|
||||
// {D40E20B6-F8F7-42ad-AB20-4BAF8F15DFAA}
|
||||
DEFINE_GUID(IID_ID3D10ShaderReflection,
|
||||
0xd40e20b6, 0xf8f7, 0x42ad, 0xab, 0x20, 0x4b, 0xaf, 0x8f, 0x15, 0xdf, 0xaa);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D10ShaderReflection
|
||||
|
||||
DECLARE_INTERFACE_(ID3D10ShaderReflection, IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE;
|
||||
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// APIs //////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3D10CompileShader:
|
||||
// ------------------
|
||||
// Compiles a shader.
|
||||
//
|
||||
// Parameters:
|
||||
// pSrcFile
|
||||
// Source file name.
|
||||
// hSrcModule
|
||||
// Module handle. if NULL, current module will be used.
|
||||
// pSrcResource
|
||||
// Resource name in module.
|
||||
// pSrcData
|
||||
// Pointer to source code.
|
||||
// SrcDataLen
|
||||
// Size of source code, in bytes.
|
||||
// pDefines
|
||||
// Optional NULL-terminated array of preprocessor macro definitions.
|
||||
// pInclude
|
||||
// Optional interface pointer to use for handling #include directives.
|
||||
// If this parameter is NULL, #includes will be honored when compiling
|
||||
// from file, and will error when compiling from resource or memory.
|
||||
// pFunctionName
|
||||
// Name of the entrypoint function where execution should begin.
|
||||
// pProfile
|
||||
// Instruction set to be used when generating code. The D3D10 entry
|
||||
// point currently supports only "vs_4_0", "ps_4_0", and "gs_4_0".
|
||||
// Flags
|
||||
// See D3D10_SHADER_xxx flags.
|
||||
// ppShader
|
||||
// Returns a buffer containing the created shader. This buffer contains
|
||||
// the compiled shader code, as well as any embedded debug and symbol
|
||||
// table info. (See D3D10GetShaderConstantTable)
|
||||
// ppErrorMsgs
|
||||
// Returns a buffer containing a listing of errors and warnings that were
|
||||
// encountered during the compile. If you are running in a debugger,
|
||||
// these are the same messages you will see in your debug output.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI D3D10CompileShader(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
|
||||
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3D10DisassembleShader:
|
||||
// ----------------------
|
||||
// Takes a binary shader, and returns a buffer containing text assembly.
|
||||
//
|
||||
// Parameters:
|
||||
// pShader
|
||||
// Pointer to the shader byte code.
|
||||
// BytecodeLength
|
||||
// Size of the shader byte code in bytes.
|
||||
// EnableColorCode
|
||||
// Emit HTML tags for color coding the output?
|
||||
// pComments
|
||||
// Pointer to a comment string to include at the top of the shader.
|
||||
// ppDisassembly
|
||||
// Returns a buffer containing the disassembled shader.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI D3D10DisassembleShader(CONST void *pShader, SIZE_T BytecodeLength, BOOL EnableColorCode, LPCSTR pComments, ID3D10Blob** ppDisassembly);
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3D10GetPixelShaderProfile/D3D10GetVertexShaderProfile/D3D10GetGeometryShaderProfile:
|
||||
// -----------------------------------------------------
|
||||
// Returns the name of the HLSL profile best suited to a given device.
|
||||
//
|
||||
// Parameters:
|
||||
// pDevice
|
||||
// Pointer to the device in question
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
LPCSTR WINAPI D3D10GetPixelShaderProfile(ID3D10Device *pDevice);
|
||||
|
||||
LPCSTR WINAPI D3D10GetVertexShaderProfile(ID3D10Device *pDevice);
|
||||
|
||||
LPCSTR WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *pDevice);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3D10ReflectShader:
|
||||
// ------------------
|
||||
// Creates a shader reflection object that can be used to retrieve information
|
||||
// about a compiled shader
|
||||
//
|
||||
// Parameters:
|
||||
// pShaderBytecode
|
||||
// Pointer to a compiled shader (same pointer that is passed into
|
||||
// ID3D10Device::CreateShader)
|
||||
// BytecodeLength
|
||||
// Length of the shader bytecode buffer
|
||||
// ppReflector
|
||||
// [out] Returns a ID3D10ShaderReflection object that can be used to
|
||||
// retrieve shader resource and constant buffer information
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI D3D10ReflectShader(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10ShaderReflection **ppReflector);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3D10PreprocessShader
|
||||
// ---------------------
|
||||
// Creates a shader reflection object that can be used to retrieve information
|
||||
// about a compiled shader
|
||||
//
|
||||
// Parameters:
|
||||
// pSrcData
|
||||
// Pointer to source code
|
||||
// SrcDataLen
|
||||
// Size of source code, in bytes
|
||||
// pFileName
|
||||
// Source file name (used for error output)
|
||||
// pDefines
|
||||
// Optional NULL-terminated array of preprocessor macro definitions.
|
||||
// pInclude
|
||||
// Optional interface pointer to use for handling #include directives.
|
||||
// If this parameter is NULL, #includes will be honored when assembling
|
||||
// from file, and will error when assembling from resource or memory.
|
||||
// ppShaderText
|
||||
// Returns a buffer containing a single large string that represents
|
||||
// the resulting formatted token stream
|
||||
// ppErrorMsgs
|
||||
// Returns a buffer containing a listing of errors and warnings that were
|
||||
// encountered during assembly. If you are running in a debugger,
|
||||
// these are the same messages you will see in your debug output.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI D3D10PreprocessShader(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Shader blob manipulation routines
|
||||
// ---------------------------------
|
||||
//
|
||||
// void *pShaderBytecode - a buffer containing the result of an HLSL
|
||||
// compilation. Typically this opaque buffer contains several
|
||||
// discrete sections including the shader executable code, the input
|
||||
// signature, and the output signature. This can typically be retrieved
|
||||
// by calling ID3D10Blob::GetBufferPointer() on the returned blob
|
||||
// from HLSL's compile APIs.
|
||||
//
|
||||
// UINT BytecodeLength - the length of pShaderBytecode. This can
|
||||
// typically be retrieved by calling ID3D10Blob::GetBufferSize()
|
||||
// on the returned blob from HLSL's compile APIs.
|
||||
//
|
||||
// ID3D10Blob **ppSignatureBlob(s) - a newly created buffer that
|
||||
// contains only the signature portions of the original bytecode.
|
||||
// This is a copy; the original bytecode is not modified. You may
|
||||
// specify NULL for this parameter to have the bytecode validated
|
||||
// for the presence of the corresponding signatures without actually
|
||||
// copying them and creating a new blob.
|
||||
//
|
||||
// Returns E_INVALIDARG if any required parameters are NULL
|
||||
// Returns E_FAIL is the bytecode is corrupt or missing signatures
|
||||
// Returns S_OK on success
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
HRESULT WINAPI D3D10GetInputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);
|
||||
HRESULT WINAPI D3D10GetOutputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);
|
||||
HRESULT WINAPI D3D10GetInputAndOutputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3D10GetShaderDebugInfo:
|
||||
// -----------------------
|
||||
// Gets shader debug info. Debug info is generated by D3D10CompileShader and is
|
||||
// embedded in the body of the shader.
|
||||
//
|
||||
// Parameters:
|
||||
// pShaderBytecode
|
||||
// Pointer to the function bytecode
|
||||
// BytecodeLength
|
||||
// Length of the shader bytecode buffer
|
||||
// ppDebugInfo
|
||||
// Buffer used to return debug info. For information about the layout
|
||||
// of this buffer, see definition of D3D10_SHADER_DEBUG_INFO above.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI D3D10GetShaderDebugInfo(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob** ppDebugInfo);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3D10SHADER_H__
|
||||
|
10227
SDK/Include/D3D11.h
Normal file
10227
SDK/Include/D3D11.h
Normal file
File diff suppressed because it is too large
Load Diff
1669
SDK/Include/D3D11SDKLayers.h
Normal file
1669
SDK/Include/D3D11SDKLayers.h
Normal file
File diff suppressed because it is too large
Load Diff
296
SDK/Include/D3D11Shader.h
Normal file
296
SDK/Include/D3D11Shader.h
Normal file
@ -0,0 +1,296 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// File: D3D11Shader.h
|
||||
// Content: D3D11 Shader Types and APIs
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __D3D11SHADER_H__
|
||||
#define __D3D11SHADER_H__
|
||||
|
||||
#include "d3dcommon.h"
|
||||
|
||||
|
||||
typedef enum D3D11_SHADER_VERSION_TYPE
|
||||
{
|
||||
D3D11_SHVER_PIXEL_SHADER = 0,
|
||||
D3D11_SHVER_VERTEX_SHADER = 1,
|
||||
D3D11_SHVER_GEOMETRY_SHADER = 2,
|
||||
|
||||
// D3D11 Shaders
|
||||
D3D11_SHVER_HULL_SHADER = 3,
|
||||
D3D11_SHVER_DOMAIN_SHADER = 4,
|
||||
D3D11_SHVER_COMPUTE_SHADER = 5,
|
||||
} D3D11_SHADER_VERSION_TYPE;
|
||||
|
||||
#define D3D11_SHVER_GET_TYPE(_Version) \
|
||||
(((_Version) >> 16) & 0xffff)
|
||||
#define D3D11_SHVER_GET_MAJOR(_Version) \
|
||||
(((_Version) >> 4) & 0xf)
|
||||
#define D3D11_SHVER_GET_MINOR(_Version) \
|
||||
(((_Version) >> 0) & 0xf)
|
||||
|
||||
typedef D3D_RESOURCE_RETURN_TYPE D3D11_RESOURCE_RETURN_TYPE;
|
||||
|
||||
typedef D3D_CBUFFER_TYPE D3D11_CBUFFER_TYPE;
|
||||
|
||||
|
||||
typedef struct _D3D11_SIGNATURE_PARAMETER_DESC
|
||||
{
|
||||
LPCSTR SemanticName; // Name of the semantic
|
||||
UINT SemanticIndex; // Index of the semantic
|
||||
UINT Register; // Number of member variables
|
||||
D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable
|
||||
D3D_REGISTER_COMPONENT_TYPE ComponentType;// Scalar type (e.g. uint, float, etc.)
|
||||
BYTE Mask; // Mask to indicate which components of the register
|
||||
// are used (combination of D3D10_COMPONENT_MASK values)
|
||||
BYTE ReadWriteMask; // Mask to indicate whether a given component is
|
||||
// never written (if this is an output signature) or
|
||||
// always read (if this is an input signature).
|
||||
// (combination of D3D10_COMPONENT_MASK values)
|
||||
UINT Stream; // Stream index
|
||||
} D3D11_SIGNATURE_PARAMETER_DESC;
|
||||
|
||||
typedef struct _D3D11_SHADER_BUFFER_DESC
|
||||
{
|
||||
LPCSTR Name; // Name of the constant buffer
|
||||
D3D_CBUFFER_TYPE Type; // Indicates type of buffer content
|
||||
UINT Variables; // Number of member variables
|
||||
UINT Size; // Size of CB (in bytes)
|
||||
UINT uFlags; // Buffer description flags
|
||||
} D3D11_SHADER_BUFFER_DESC;
|
||||
|
||||
typedef struct _D3D11_SHADER_VARIABLE_DESC
|
||||
{
|
||||
LPCSTR Name; // Name of the variable
|
||||
UINT StartOffset; // Offset in constant buffer's backing store
|
||||
UINT Size; // Size of variable (in bytes)
|
||||
UINT uFlags; // Variable flags
|
||||
LPVOID DefaultValue; // Raw pointer to default value
|
||||
UINT StartTexture; // First texture index (or -1 if no textures used)
|
||||
UINT TextureSize; // Number of texture slots possibly used.
|
||||
UINT StartSampler; // First sampler index (or -1 if no textures used)
|
||||
UINT SamplerSize; // Number of sampler slots possibly used.
|
||||
} D3D11_SHADER_VARIABLE_DESC;
|
||||
|
||||
typedef struct _D3D11_SHADER_TYPE_DESC
|
||||
{
|
||||
D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)
|
||||
D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)
|
||||
UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
|
||||
UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
|
||||
UINT Elements; // Number of elements (0 if not an array)
|
||||
UINT Members; // Number of members (0 if not a structure)
|
||||
UINT Offset; // Offset from the start of structure (0 if not a structure member)
|
||||
LPCSTR Name; // Name of type, can be NULL
|
||||
} D3D11_SHADER_TYPE_DESC;
|
||||
|
||||
typedef D3D_TESSELLATOR_DOMAIN D3D11_TESSELLATOR_DOMAIN;
|
||||
|
||||
typedef D3D_TESSELLATOR_PARTITIONING D3D11_TESSELLATOR_PARTITIONING;
|
||||
|
||||
typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D11_TESSELLATOR_OUTPUT_PRIMITIVE;
|
||||
|
||||
typedef struct _D3D11_SHADER_DESC
|
||||
{
|
||||
UINT Version; // Shader version
|
||||
LPCSTR Creator; // Creator string
|
||||
UINT Flags; // Shader compilation/parse flags
|
||||
|
||||
UINT ConstantBuffers; // Number of constant buffers
|
||||
UINT BoundResources; // Number of bound resources
|
||||
UINT InputParameters; // Number of parameters in the input signature
|
||||
UINT OutputParameters; // Number of parameters in the output signature
|
||||
|
||||
UINT InstructionCount; // Number of emitted instructions
|
||||
UINT TempRegisterCount; // Number of temporary registers used
|
||||
UINT TempArrayCount; // Number of temporary arrays used
|
||||
UINT DefCount; // Number of constant defines
|
||||
UINT DclCount; // Number of declarations (input + output)
|
||||
UINT TextureNormalInstructions; // Number of non-categorized texture instructions
|
||||
UINT TextureLoadInstructions; // Number of texture load instructions
|
||||
UINT TextureCompInstructions; // Number of texture comparison instructions
|
||||
UINT TextureBiasInstructions; // Number of texture bias instructions
|
||||
UINT TextureGradientInstructions; // Number of texture gradient instructions
|
||||
UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
|
||||
UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
|
||||
UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
|
||||
UINT StaticFlowControlCount; // Number of static flow control instructions used
|
||||
UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
|
||||
UINT MacroInstructionCount; // Number of macro instructions used
|
||||
UINT ArrayInstructionCount; // Number of array instructions used
|
||||
UINT CutInstructionCount; // Number of cut instructions used
|
||||
UINT EmitInstructionCount; // Number of emit instructions used
|
||||
D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology
|
||||
UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count
|
||||
D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive
|
||||
UINT PatchConstantParameters; // Number of parameters in the patch constant signature
|
||||
UINT cGSInstanceCount; // Number of Geometry shader instances
|
||||
UINT cControlPoints; // Number of control points in the HS->DS stage
|
||||
D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator
|
||||
D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator
|
||||
D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline)
|
||||
// instruction counts
|
||||
UINT cBarrierInstructions; // Number of barrier instructions in a compute shader
|
||||
UINT cInterlockedInstructions; // Number of interlocked instructions
|
||||
UINT cTextureStoreInstructions; // Number of texture writes
|
||||
} D3D11_SHADER_DESC;
|
||||
|
||||
typedef struct _D3D11_SHADER_INPUT_BIND_DESC
|
||||
{
|
||||
LPCSTR Name; // Name of the resource
|
||||
D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)
|
||||
UINT BindPoint; // Starting bind point
|
||||
UINT BindCount; // Number of contiguous bind points (for arrays)
|
||||
|
||||
UINT uFlags; // Input binding flags
|
||||
D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)
|
||||
D3D_SRV_DIMENSION Dimension; // Dimension (if texture)
|
||||
UINT NumSamples; // Number of samples (0 if not MS texture)
|
||||
} D3D11_SHADER_INPUT_BIND_DESC;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Interfaces ////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef interface ID3D11ShaderReflectionType ID3D11ShaderReflectionType;
|
||||
typedef interface ID3D11ShaderReflectionType *LPD3D11SHADERREFLECTIONTYPE;
|
||||
|
||||
typedef interface ID3D11ShaderReflectionVariable ID3D11ShaderReflectionVariable;
|
||||
typedef interface ID3D11ShaderReflectionVariable *LPD3D11SHADERREFLECTIONVARIABLE;
|
||||
|
||||
typedef interface ID3D11ShaderReflectionConstantBuffer ID3D11ShaderReflectionConstantBuffer;
|
||||
typedef interface ID3D11ShaderReflectionConstantBuffer *LPD3D11SHADERREFLECTIONCONSTANTBUFFER;
|
||||
|
||||
typedef interface ID3D11ShaderReflection ID3D11ShaderReflection;
|
||||
typedef interface ID3D11ShaderReflection *LPD3D11SHADERREFLECTION;
|
||||
|
||||
// {6E6FFA6A-9BAE-4613-A51E-91652D508C21}
|
||||
DEFINE_GUID(IID_ID3D11ShaderReflectionType,
|
||||
0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11ShaderReflectionType
|
||||
|
||||
DECLARE_INTERFACE(ID3D11ShaderReflectionType)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ __out D3D11_SHADER_TYPE_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ __in UINT Index) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByName)(THIS_ __in LPCSTR Name) PURE;
|
||||
STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ __in UINT Index) PURE;
|
||||
|
||||
STDMETHOD(IsEqual)(THIS_ __in ID3D11ShaderReflectionType* pType) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionType*, GetSubType)(THIS) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionType*, GetBaseClass)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionType*, GetInterfaceByIndex)(THIS_ __in UINT uIndex) PURE;
|
||||
STDMETHOD(IsOfType)(THIS_ __in ID3D11ShaderReflectionType* pType) PURE;
|
||||
STDMETHOD(ImplementsInterface)(THIS_ __in ID3D11ShaderReflectionType* pBase) PURE;
|
||||
};
|
||||
|
||||
// {51F23923-F3E5-4BD1-91CB-606177D8DB4C}
|
||||
DEFINE_GUID(IID_ID3D11ShaderReflectionVariable,
|
||||
0x51f23923, 0xf3e5, 0x4bd1, 0x91, 0xcb, 0x60, 0x61, 0x77, 0xd8, 0xdb, 0x4c);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11ShaderReflectionVariable
|
||||
|
||||
DECLARE_INTERFACE(ID3D11ShaderReflectionVariable)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ __out D3D11_SHADER_VARIABLE_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D11ShaderReflectionType*, GetType)(THIS) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE;
|
||||
|
||||
STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ __in UINT uArrayIndex) PURE;
|
||||
};
|
||||
|
||||
// {EB62D63D-93DD-4318-8AE8-C6F83AD371B8}
|
||||
DEFINE_GUID(IID_ID3D11ShaderReflectionConstantBuffer,
|
||||
0xeb62d63d, 0x93dd, 0x4318, 0x8a, 0xe8, 0xc6, 0xf8, 0x3a, 0xd3, 0x71, 0xb8);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11ShaderReflectionConstantBuffer
|
||||
|
||||
DECLARE_INTERFACE(ID3D11ShaderReflectionConstantBuffer)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_BUFFER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByIndex)(THIS_ __in UINT Index) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ __in LPCSTR Name) PURE;
|
||||
};
|
||||
|
||||
// The ID3D11ShaderReflection IID may change from SDK version to SDK version
|
||||
// if the reflection API changes. This prevents new code with the new API
|
||||
// from working with an old binary. Recompiling with the new header
|
||||
// will pick up the new IID.
|
||||
|
||||
// 0a233719-3960-4578-9d7c-203b8b1d9cc1
|
||||
DEFINE_GUID(IID_ID3D11ShaderReflection,
|
||||
0x0a233719, 0x3960, 0x4578, 0x9d, 0x7c, 0x20, 0x3b, 0x8b, 0x1d, 0x9c, 0xc1);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D11ShaderReflection
|
||||
|
||||
DECLARE_INTERFACE_(ID3D11ShaderReflection, IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ __in REFIID iid,
|
||||
__out LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
STDMETHOD(GetDesc)(THIS_ __out D3D11_SHADER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ __in UINT Index) PURE;
|
||||
STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ __in LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDesc)(THIS_ __in UINT ResourceIndex,
|
||||
__out D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD(GetInputParameterDesc)(THIS_ __in UINT ParameterIndex,
|
||||
__out D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
STDMETHOD(GetOutputParameterDesc)(THIS_ __in UINT ParameterIndex,
|
||||
__out D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
STDMETHOD(GetPatchConstantParameterDesc)(THIS_ __in UINT ParameterIndex,
|
||||
__out D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ __in LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDescByName)(THIS_ __in LPCSTR Name,
|
||||
__out D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
|
||||
|
||||
STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
|
||||
STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;
|
||||
|
||||
STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
|
||||
STDMETHOD(GetMinFeatureLevel)(THIS_ __out enum D3D_FEATURE_LEVEL* pLevel) PURE;
|
||||
|
||||
STDMETHOD_(UINT, GetThreadGroupSize)(THIS_
|
||||
__out_opt UINT* pSizeX,
|
||||
__out_opt UINT* pSizeY,
|
||||
__out_opt UINT* pSizeZ) PURE;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// APIs //////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3D11SHADER_H__
|
||||
|
409
SDK/Include/D3DCSX.h
Normal file
409
SDK/Include/D3DCSX.h
Normal file
@ -0,0 +1,409 @@
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// File: D3DX11GPGPU.h
|
||||
// Content: D3DX11 General Purpose GPU computing algorithms
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "d3dx11.h"
|
||||
|
||||
#ifndef __D3DX11GPGPU_H__
|
||||
#define __D3DX11GPGPU_H__
|
||||
|
||||
// Current name of the DLL shipped in the same SDK as this header.
|
||||
|
||||
|
||||
#define D3DCSX_DLL_W L"d3dcsx_43.dll"
|
||||
#define D3DCSX_DLL_A "d3dcsx_43.dll"
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DCSX_DLL D3DCSX_DLL_W
|
||||
#else
|
||||
#define D3DCSX_DLL D3DCSX_DLL_A
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef enum D3DX11_SCAN_DATA_TYPE
|
||||
{
|
||||
D3DX11_SCAN_DATA_TYPE_FLOAT = 1,
|
||||
D3DX11_SCAN_DATA_TYPE_INT,
|
||||
D3DX11_SCAN_DATA_TYPE_UINT,
|
||||
} D3DX11_SCAN_DATA_TYPE;
|
||||
|
||||
typedef enum D3DX11_SCAN_OPCODE
|
||||
{
|
||||
D3DX11_SCAN_OPCODE_ADD = 1,
|
||||
D3DX11_SCAN_OPCODE_MIN,
|
||||
D3DX11_SCAN_OPCODE_MAX,
|
||||
D3DX11_SCAN_OPCODE_MUL,
|
||||
D3DX11_SCAN_OPCODE_AND,
|
||||
D3DX11_SCAN_OPCODE_OR,
|
||||
D3DX11_SCAN_OPCODE_XOR,
|
||||
} D3DX11_SCAN_OPCODE;
|
||||
|
||||
typedef enum D3DX11_SCAN_DIRECTION
|
||||
{
|
||||
D3DX11_SCAN_DIRECTION_FORWARD = 1,
|
||||
D3DX11_SCAN_DIRECTION_BACKWARD,
|
||||
} D3DX11_SCAN_DIRECTION;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DX11Scan:
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// {5089b68f-e71d-4d38-be8e-f363b95a9405}
|
||||
DEFINE_GUID(IID_ID3DX11Scan, 0x5089b68f, 0xe71d, 0x4d38, 0xbe, 0x8e, 0xf3, 0x63, 0xb9, 0x5a, 0x94, 0x05);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DX11Scan
|
||||
|
||||
DECLARE_INTERFACE_(ID3DX11Scan, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DX11Scan
|
||||
|
||||
STDMETHOD(SetScanDirection)(THIS_ D3DX11_SCAN_DIRECTION Direction) PURE;
|
||||
|
||||
//=============================================================================
|
||||
// Performs an unsegmented scan of a sequence in-place or out-of-place
|
||||
// ElementType element type
|
||||
// OpCode binary operation
|
||||
// Direction scan direction
|
||||
// ElementScanSize size of scan, in elements
|
||||
// pSrc input sequence on the device. pSrc==pDst for in-place scans
|
||||
// pDst output sequence on the device
|
||||
//=============================================================================
|
||||
STDMETHOD(Scan)( THIS_
|
||||
D3DX11_SCAN_DATA_TYPE ElementType,
|
||||
D3DX11_SCAN_OPCODE OpCode,
|
||||
UINT ElementScanSize,
|
||||
__in ID3D11UnorderedAccessView* pSrc,
|
||||
__in ID3D11UnorderedAccessView* pDst
|
||||
) PURE;
|
||||
|
||||
//=============================================================================
|
||||
// Performs a multiscan of a sequence in-place or out-of-place
|
||||
// ElementType element type
|
||||
// OpCode binary operation
|
||||
// Direction scan direction
|
||||
// ElementScanSize size of scan, in elements
|
||||
// ElementScanPitch pitch of the next scan, in elements
|
||||
// ScanCount number of scans in a multiscan
|
||||
// pSrc input sequence on the device. pSrc==pDst for in-place scans
|
||||
// pDst output sequence on the device
|
||||
//=============================================================================
|
||||
STDMETHOD(Multiscan)( THIS_
|
||||
D3DX11_SCAN_DATA_TYPE ElementType,
|
||||
D3DX11_SCAN_OPCODE OpCode,
|
||||
UINT ElementScanSize,
|
||||
UINT ElementScanPitch,
|
||||
UINT ScanCount,
|
||||
__in ID3D11UnorderedAccessView* pSrc,
|
||||
__in ID3D11UnorderedAccessView* pDst
|
||||
) PURE;
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Creates a scan context
|
||||
// pDevice the device context
|
||||
// MaxElementScanSize maximum single scan size, in elements (FLOAT, UINT, or INT)
|
||||
// MaxScanCount maximum number of scans in multiscan
|
||||
// ppScanContext new scan context
|
||||
//=============================================================================
|
||||
HRESULT WINAPI D3DX11CreateScan(
|
||||
__in ID3D11DeviceContext* pDeviceContext,
|
||||
UINT MaxElementScanSize,
|
||||
UINT MaxScanCount,
|
||||
__out ID3DX11Scan** ppScan );
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DX11SegmentedScan:
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// {a915128c-d954-4c79-bfe1-64db923194d6}
|
||||
DEFINE_GUID(IID_ID3DX11SegmentedScan, 0xa915128c, 0xd954, 0x4c79, 0xbf, 0xe1, 0x64, 0xdb, 0x92, 0x31, 0x94, 0xd6);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DX11SegmentedScan
|
||||
|
||||
DECLARE_INTERFACE_(ID3DX11SegmentedScan, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DX11SegmentedScan
|
||||
|
||||
STDMETHOD(SetScanDirection)(THIS_ D3DX11_SCAN_DIRECTION Direction) PURE;
|
||||
|
||||
//=============================================================================
|
||||
// Performs a segscan of a sequence in-place or out-of-place
|
||||
// ElementType element type
|
||||
// OpCode binary operation
|
||||
// Direction scan direction
|
||||
// pSrcElementFlags compact array of bits, one per element of pSrc. A set value
|
||||
// indicates the start of a new segment.
|
||||
// ElementScanSize size of scan, in elements
|
||||
// pSrc input sequence on the device. pSrc==pDst for in-place scans
|
||||
// pDst output sequence on the device
|
||||
//=============================================================================
|
||||
STDMETHOD(SegScan)( THIS_
|
||||
D3DX11_SCAN_DATA_TYPE ElementType,
|
||||
D3DX11_SCAN_OPCODE OpCode,
|
||||
UINT ElementScanSize,
|
||||
__in_opt ID3D11UnorderedAccessView* pSrc,
|
||||
__in ID3D11UnorderedAccessView* pSrcElementFlags,
|
||||
__in ID3D11UnorderedAccessView* pDst
|
||||
) PURE;
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Creates a segmented scan context
|
||||
// pDevice the device context
|
||||
// MaxElementScanSize maximum single scan size, in elements (FLOAT, UINT, or INT)
|
||||
// ppScanContext new scan context
|
||||
//=============================================================================
|
||||
HRESULT WINAPI D3DX11CreateSegmentedScan(
|
||||
__in ID3D11DeviceContext* pDeviceContext,
|
||||
UINT MaxElementScanSize,
|
||||
__out ID3DX11SegmentedScan** ppScan );
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS 4
|
||||
#define D3DX11_FFT_MAX_TEMP_BUFFERS 4
|
||||
#define D3DX11_FFT_MAX_DIMENSIONS 32
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DX11FFT:
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// {b3f7a938-4c93-4310-a675-b30d6de50553}
|
||||
DEFINE_GUID(IID_ID3DX11FFT, 0xb3f7a938, 0x4c93, 0x4310, 0xa6, 0x75, 0xb3, 0x0d, 0x6d, 0xe5, 0x05, 0x53);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DX11FFT
|
||||
|
||||
DECLARE_INTERFACE_(ID3DX11FFT, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DX11FFT
|
||||
|
||||
// scale for forward transform (defaults to 1 if set to 0)
|
||||
STDMETHOD(SetForwardScale)(THIS_ FLOAT ForwardScale) PURE;
|
||||
STDMETHOD_(FLOAT, GetForwardScale)(THIS) PURE;
|
||||
|
||||
// scale for inverse transform (defaults to 1/N if set to 0, where N is
|
||||
// the product of the transformed dimension lengths
|
||||
STDMETHOD(SetInverseScale)(THIS_ FLOAT InverseScale) PURE;
|
||||
STDMETHOD_(FLOAT, GetInverseScale)(THIS) PURE;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Attaches buffers to the context and performs any required precomputation.
|
||||
// The buffers must be no smaller than the corresponding buffer sizes returned
|
||||
// by D3DX11CreateFFT*(). Temp buffers may beshared between multiple contexts,
|
||||
// though care should be taken to concurrently execute multiple FFTs which share
|
||||
// temp buffers.
|
||||
//
|
||||
// NumTempBuffers number of buffers in ppTempBuffers
|
||||
// ppTempBuffers temp buffers to attach
|
||||
// NumPrecomputeBuffers number of buffers in ppPrecomputeBufferSizes
|
||||
// ppPrecomputeBufferSizes buffers to hold precomputed data
|
||||
STDMETHOD(AttachBuffersAndPrecompute)( THIS_
|
||||
__in_range(0,D3DX11_FFT_MAX_TEMP_BUFFERS) UINT NumTempBuffers,
|
||||
__in_ecount(NumTempBuffers) ID3D11UnorderedAccessView*const* ppTempBuffers,
|
||||
__in_range(0,D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS) UINT NumPrecomputeBuffers,
|
||||
__in_ecount(NumPrecomputeBuffers) ID3D11UnorderedAccessView*const* ppPrecomputeBufferSizes ) PURE;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Call after buffers have been attached to the context, pInput and *ppOuput can
|
||||
// be one of the temp buffers. If *ppOutput == NULL, then the computation will ping-pong
|
||||
// between temp buffers and the last buffer written to is stored at *ppOutput.
|
||||
// Otherwise, *ppOutput is used as the output buffer (which may incur an extra copy).
|
||||
//
|
||||
// The format of complex data is interleaved components, e.g. (Real0, Imag0),
|
||||
// (Real1, Imag1) ... etc. Data is stored in row major order
|
||||
//
|
||||
// pInputBuffer view onto input buffer
|
||||
// ppOutpuBuffert pointer to view of output buffer
|
||||
STDMETHOD(ForwardTransform)( THIS_
|
||||
__in const ID3D11UnorderedAccessView* pInputBuffer,
|
||||
__inout ID3D11UnorderedAccessView** ppOutputBuffer ) PURE;
|
||||
|
||||
STDMETHOD(InverseTransform)( THIS_
|
||||
__in const ID3D11UnorderedAccessView* pInputBuffer,
|
||||
__inout ID3D11UnorderedAccessView** ppOutputBuffer ) PURE;
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DX11FFT Creation Routines
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef enum D3DX11_FFT_DATA_TYPE
|
||||
{
|
||||
D3DX11_FFT_DATA_TYPE_REAL,
|
||||
D3DX11_FFT_DATA_TYPE_COMPLEX,
|
||||
} D3DX11_FFT_DATA_TYPE;
|
||||
|
||||
typedef enum D3DX11_FFT_DIM_MASK
|
||||
{
|
||||
D3DX11_FFT_DIM_MASK_1D = 0x1,
|
||||
D3DX11_FFT_DIM_MASK_2D = 0x3,
|
||||
D3DX11_FFT_DIM_MASK_3D = 0x7,
|
||||
} D3DX11_FFT_DIM_MASK;
|
||||
|
||||
typedef struct D3DX11_FFT_DESC
|
||||
{
|
||||
UINT NumDimensions; // number of dimensions
|
||||
UINT ElementLengths[D3DX11_FFT_MAX_DIMENSIONS]; // length of each dimension
|
||||
UINT DimensionMask; // a bit set for each dimensions to transform
|
||||
// (see D3DX11_FFT_DIM_MASK for common masks)
|
||||
D3DX11_FFT_DATA_TYPE Type; // type of the elements in spatial domain
|
||||
} D3DX11_FFT_DESC;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// NumTempBufferSizes Number of temporary buffers needed
|
||||
// pTempBufferSizes Minimum sizes (in FLOATs) of temporary buffers
|
||||
// NumPrecomputeBufferSizes Number of precompute buffers needed
|
||||
// pPrecomputeBufferSizes minimum sizes (in FLOATs) for precompute buffers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
typedef struct D3DX11_FFT_BUFFER_INFO
|
||||
{
|
||||
__range(0,D3DX11_FFT_MAX_TEMP_BUFFERS) UINT NumTempBufferSizes;
|
||||
UINT TempBufferFloatSizes[D3DX11_FFT_MAX_TEMP_BUFFERS];
|
||||
__range(0,D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS) UINT NumPrecomputeBufferSizes;
|
||||
UINT PrecomputeBufferFloatSizes[D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS];
|
||||
} D3DX11_FFT_BUFFER_INFO;
|
||||
|
||||
|
||||
typedef enum D3DX11_FFT_CREATE_FLAG
|
||||
{
|
||||
D3DX11_FFT_CREATE_FLAG_NO_PRECOMPUTE_BUFFERS = 0x01L, // do not precompute values and store into buffers
|
||||
} D3DX11_FFT_CREATE_FLAG;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Creates an ID3DX11FFT COM interface object and returns a pointer to it at *ppFFT.
|
||||
// The descriptor describes the shape of the data as well as the scaling factors
|
||||
// that should be used for forward and inverse transforms.
|
||||
// The FFT computation may require temporaries that act as ping-pong buffers
|
||||
// and for other purposes. aTempSizes is a list of the sizes required for
|
||||
// temporaries. Likewise, some data may need to be precomputed and the sizes
|
||||
// of those sizes are returned in aPrecomputedBufferSizes.
|
||||
//
|
||||
// To perform a computation, follow these steps:
|
||||
// 1) Create the FFT context object
|
||||
// 2) Precompute (and Attach temp working buffers of at least the required size)
|
||||
// 3) Call Compute() on some input data
|
||||
//
|
||||
// Compute() may be called repeatedly with different inputs and transform
|
||||
// directions. When finished with the FFT work, release the FFT interface()
|
||||
//
|
||||
// Device Direct3DDeviceContext to use in
|
||||
// pDesc Descriptor for FFT transform in
|
||||
// Count the number of 1D FFTs to perform in
|
||||
// Flags See D3DX11_FFT_CREATE_FLAG in
|
||||
// pBufferInfo Pointer to BUFFER_INFO struct, filled by funciton out
|
||||
// ppFFT Pointer to returned context pointer out
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI D3DX11CreateFFT(
|
||||
ID3D11DeviceContext* pDeviceContext,
|
||||
__in const D3DX11_FFT_DESC* pDesc,
|
||||
UINT Flags,
|
||||
__out D3DX11_FFT_BUFFER_INFO* pBufferInfo,
|
||||
__out ID3DX11FFT** ppFFT
|
||||
);
|
||||
|
||||
HRESULT WINAPI D3DX11CreateFFT1DReal(
|
||||
ID3D11DeviceContext* pDeviceContext,
|
||||
UINT X,
|
||||
UINT Flags,
|
||||
__out D3DX11_FFT_BUFFER_INFO* pBufferInfo,
|
||||
__out ID3DX11FFT** ppFFT
|
||||
);
|
||||
HRESULT WINAPI D3DX11CreateFFT1DComplex(
|
||||
ID3D11DeviceContext* pDeviceContext,
|
||||
UINT X,
|
||||
UINT Flags,
|
||||
__out D3DX11_FFT_BUFFER_INFO* pBufferInfo,
|
||||
__out ID3DX11FFT** ppFFT
|
||||
);
|
||||
HRESULT WINAPI D3DX11CreateFFT2DReal(
|
||||
ID3D11DeviceContext* pDeviceContext,
|
||||
UINT X,
|
||||
UINT Y,
|
||||
UINT Flags,
|
||||
__out D3DX11_FFT_BUFFER_INFO* pBufferInfo,
|
||||
__out ID3DX11FFT** ppFFT
|
||||
);
|
||||
HRESULT WINAPI D3DX11CreateFFT2DComplex(
|
||||
ID3D11DeviceContext* pDeviceContext,
|
||||
UINT X,
|
||||
UINT Y,
|
||||
UINT Flags,
|
||||
__out D3DX11_FFT_BUFFER_INFO* pBufferInfo,
|
||||
__out ID3DX11FFT** ppFFT
|
||||
);
|
||||
HRESULT WINAPI D3DX11CreateFFT3DReal(
|
||||
ID3D11DeviceContext* pDeviceContext,
|
||||
UINT X,
|
||||
UINT Y,
|
||||
UINT Z,
|
||||
UINT Flags,
|
||||
__out D3DX11_FFT_BUFFER_INFO* pBufferInfo,
|
||||
__out ID3DX11FFT** ppFFT
|
||||
);
|
||||
HRESULT WINAPI D3DX11CreateFFT3DComplex(
|
||||
ID3D11DeviceContext* pDeviceContext,
|
||||
UINT X,
|
||||
UINT Y,
|
||||
UINT Z,
|
||||
UINT Flags,
|
||||
__out D3DX11_FFT_BUFFER_INFO* pBufferInfo,
|
||||
__out ID3DX11FFT** ppFFT
|
||||
);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3DX11GPGPU_H__
|
||||
|
||||
|
72
SDK/Include/D3DX10.h
Normal file
72
SDK/Include/D3DX10.h
Normal file
@ -0,0 +1,72 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||
//
|
||||
// File: d3dx10.h
|
||||
// Content: D3DX10 utility library
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __D3DX10_INTERNAL__
|
||||
#error Incorrect D3DX10 header used
|
||||
#endif
|
||||
|
||||
#ifndef __D3DX10_H__
|
||||
#define __D3DX10_H__
|
||||
|
||||
|
||||
// Defines
|
||||
#include <limits.h>
|
||||
#include <float.h>
|
||||
|
||||
#define D3DX10_DEFAULT ((UINT) -1)
|
||||
#define D3DX10_FROM_FILE ((UINT) -3)
|
||||
#define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3)
|
||||
|
||||
#ifndef D3DX10INLINE
|
||||
#ifdef _MSC_VER
|
||||
#if (_MSC_VER >= 1200)
|
||||
#define D3DX10INLINE __forceinline
|
||||
#else
|
||||
#define D3DX10INLINE __inline
|
||||
#endif
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
#define D3DX10INLINE inline
|
||||
#else
|
||||
#define D3DX10INLINE
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// Includes
|
||||
#include "d3d10.h"
|
||||
#include "d3dx10.h"
|
||||
#include "d3dx10math.h"
|
||||
#include "d3dx10core.h"
|
||||
#include "d3dx10tex.h"
|
||||
#include "d3dx10mesh.h"
|
||||
#include "d3dx10async.h"
|
||||
|
||||
|
||||
// Errors
|
||||
#define _FACDD 0x876
|
||||
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
|
||||
|
||||
enum _D3DX10_ERR {
|
||||
D3DX10_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900),
|
||||
D3DX10_ERR_INVALID_MESH = MAKE_DDHRESULT(2901),
|
||||
D3DX10_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902),
|
||||
D3DX10_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903),
|
||||
D3DX10_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904),
|
||||
D3DX10_ERR_INVALID_DATA = MAKE_DDHRESULT(2905),
|
||||
D3DX10_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906),
|
||||
D3DX10_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907),
|
||||
D3DX10_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908),
|
||||
};
|
||||
|
||||
|
||||
#endif //__D3DX10_H__
|
||||
|
444
SDK/Include/D3DX10core.h
Normal file
444
SDK/Include/D3DX10core.h
Normal file
@ -0,0 +1,444 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||
//
|
||||
// File: d3dx10core.h
|
||||
// Content: D3DX10 core types and functions
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "d3dx10.h"
|
||||
|
||||
#ifndef __D3DX10CORE_H__
|
||||
#define __D3DX10CORE_H__
|
||||
|
||||
// Current name of the DLL shipped in the same SDK as this header.
|
||||
|
||||
|
||||
#define D3DX10_DLL_W L"d3dx10_43.dll"
|
||||
#define D3DX10_DLL_A "d3dx10_43.dll"
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10_DLL D3DX10_DLL_W
|
||||
#else
|
||||
#define D3DX10_DLL D3DX10_DLL_A
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// D3DX10_SDK_VERSION:
|
||||
// -----------------
|
||||
// This identifier is passed to D3DX10CheckVersion in order to ensure that an
|
||||
// application was built against the correct header files and lib files.
|
||||
// This number is incremented whenever a header (or other) change would
|
||||
// require applications to be rebuilt. If the version doesn't match,
|
||||
// D3DX10CreateVersion will return FALSE. (The number itself has no meaning.)
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#define D3DX10_SDK_VERSION 43
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// D3DX10CreateDevice
|
||||
// D3DX10CreateDeviceAndSwapChain
|
||||
// D3DX10GetFeatureLevel1
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *pAdapter,
|
||||
D3D10_DRIVER_TYPE DriverType,
|
||||
HMODULE Software,
|
||||
UINT Flags,
|
||||
ID3D10Device **ppDevice);
|
||||
|
||||
HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *pAdapter,
|
||||
D3D10_DRIVER_TYPE DriverType,
|
||||
HMODULE Software,
|
||||
UINT Flags,
|
||||
DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
|
||||
IDXGISwapChain **ppSwapChain,
|
||||
ID3D10Device **ppDevice);
|
||||
|
||||
typedef interface ID3D10Device1 ID3D10Device1;
|
||||
HRESULT WINAPI D3DX10GetFeatureLevel1(ID3D10Device *pDevice, ID3D10Device1 **ppDevice1);
|
||||
|
||||
|
||||
#ifdef D3D_DIAG_DLL
|
||||
BOOL WINAPI D3DX10DebugMute(BOOL Mute);
|
||||
#endif
|
||||
HRESULT WINAPI D3DX10CheckVersion(UINT D3DSdkVersion, UINT D3DX10SdkVersion);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// D3DX10_SPRITE flags:
|
||||
// -----------------
|
||||
// D3DX10_SPRITE_SAVE_STATE
|
||||
// Specifies device state should be saved and restored in Begin/End.
|
||||
// D3DX10SPRITE_SORT_TEXTURE
|
||||
// Sprites are sorted by texture prior to drawing. This is recommended when
|
||||
// drawing non-overlapping sprites of uniform depth. For example, drawing
|
||||
// screen-aligned text with ID3DX10Font.
|
||||
// D3DX10SPRITE_SORT_DEPTH_FRONT_TO_BACK
|
||||
// Sprites are sorted by depth front-to-back prior to drawing. This is
|
||||
// recommended when drawing opaque sprites of varying depths.
|
||||
// D3DX10SPRITE_SORT_DEPTH_BACK_TO_FRONT
|
||||
// Sprites are sorted by depth back-to-front prior to drawing. This is
|
||||
// recommended when drawing transparent sprites of varying depths.
|
||||
// D3DX10SPRITE_ADDREF_TEXTURES
|
||||
// AddRef/Release all textures passed in to DrawSpritesBuffered
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef enum _D3DX10_SPRITE_FLAG
|
||||
{
|
||||
D3DX10_SPRITE_SORT_TEXTURE = 0x01,
|
||||
D3DX10_SPRITE_SORT_DEPTH_BACK_TO_FRONT = 0x02,
|
||||
D3DX10_SPRITE_SORT_DEPTH_FRONT_TO_BACK = 0x04,
|
||||
D3DX10_SPRITE_SAVE_STATE = 0x08,
|
||||
D3DX10_SPRITE_ADDREF_TEXTURES = 0x10,
|
||||
} D3DX10_SPRITE_FLAG;
|
||||
|
||||
typedef struct _D3DX10_SPRITE
|
||||
{
|
||||
D3DXMATRIX matWorld;
|
||||
|
||||
D3DXVECTOR2 TexCoord;
|
||||
D3DXVECTOR2 TexSize;
|
||||
|
||||
D3DXCOLOR ColorModulate;
|
||||
|
||||
ID3D10ShaderResourceView *pTexture;
|
||||
UINT TextureIndex;
|
||||
} D3DX10_SPRITE;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DX10Sprite:
|
||||
// ------------
|
||||
// This object intends to provide an easy way to drawing sprites using D3D.
|
||||
//
|
||||
// Begin -
|
||||
// Prepares device for drawing sprites.
|
||||
//
|
||||
// Draw -
|
||||
// Draws a sprite
|
||||
//
|
||||
// Flush -
|
||||
// Forces all batched sprites to submitted to the device.
|
||||
//
|
||||
// End -
|
||||
// Restores device state to how it was when Begin was called.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef interface ID3DX10Sprite ID3DX10Sprite;
|
||||
typedef interface ID3DX10Sprite *LPD3DX10SPRITE;
|
||||
|
||||
|
||||
// {BA0B762D-8D28-43ec-B9DC-2F84443B0614}
|
||||
DEFINE_GUID(IID_ID3DX10Sprite,
|
||||
0xba0b762d, 0x8d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14);
|
||||
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DX10Sprite
|
||||
|
||||
DECLARE_INTERFACE_(ID3DX10Sprite, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DX10Sprite
|
||||
STDMETHOD(Begin)(THIS_ UINT flags) PURE;
|
||||
|
||||
STDMETHOD(DrawSpritesBuffered)(THIS_ D3DX10_SPRITE *pSprites, UINT cSprites) PURE;
|
||||
STDMETHOD(Flush)(THIS) PURE;
|
||||
|
||||
STDMETHOD(DrawSpritesImmediate)(THIS_ D3DX10_SPRITE *pSprites, UINT cSprites, UINT cbSprite, UINT flags) PURE;
|
||||
STDMETHOD(End)(THIS) PURE;
|
||||
|
||||
STDMETHOD(GetViewTransform)(THIS_ D3DXMATRIX *pViewTransform) PURE;
|
||||
STDMETHOD(SetViewTransform)(THIS_ D3DXMATRIX *pViewTransform) PURE;
|
||||
STDMETHOD(GetProjectionTransform)(THIS_ D3DXMATRIX *pProjectionTransform) PURE;
|
||||
STDMETHOD(SetProjectionTransform)(THIS_ D3DXMATRIX *pProjectionTransform) PURE;
|
||||
|
||||
STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE;
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateSprite(
|
||||
ID3D10Device* pDevice,
|
||||
UINT cDeviceBufferSize,
|
||||
LPD3DX10SPRITE* ppSprite);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DX10ThreadPump:
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DX10DataLoader
|
||||
|
||||
DECLARE_INTERFACE(ID3DX10DataLoader)
|
||||
{
|
||||
STDMETHOD(Load)(THIS) PURE;
|
||||
STDMETHOD(Decompress)(THIS_ void **ppData, SIZE_T *pcBytes) PURE;
|
||||
STDMETHOD(Destroy)(THIS) PURE;
|
||||
};
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DX10DataProcessor
|
||||
|
||||
DECLARE_INTERFACE(ID3DX10DataProcessor)
|
||||
{
|
||||
STDMETHOD(Process)(THIS_ void *pData, SIZE_T cBytes) PURE;
|
||||
STDMETHOD(CreateDeviceObject)(THIS_ void **ppDataObject) PURE;
|
||||
STDMETHOD(Destroy)(THIS) PURE;
|
||||
};
|
||||
|
||||
// {C93FECFA-6967-478a-ABBC-402D90621FCB}
|
||||
DEFINE_GUID(IID_ID3DX10ThreadPump,
|
||||
0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DX10ThreadPump
|
||||
|
||||
DECLARE_INTERFACE_(ID3DX10ThreadPump, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DX10ThreadPump
|
||||
STDMETHOD(AddWorkItem)(THIS_ ID3DX10DataLoader *pDataLoader, ID3DX10DataProcessor *pDataProcessor, HRESULT *pHResult, void **ppDeviceObject) PURE;
|
||||
STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE;
|
||||
|
||||
STDMETHOD(WaitForAllItems)(THIS) PURE;
|
||||
STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT iWorkItemCount);
|
||||
|
||||
STDMETHOD(PurgeAllItems)(THIS) PURE;
|
||||
STDMETHOD(GetQueueStatus)(THIS_ UINT *pIoQueue, UINT *pProcessQueue, UINT *pDeviceQueue) PURE;
|
||||
|
||||
};
|
||||
|
||||
HRESULT WINAPI D3DX10CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX10ThreadPump **ppThreadPump);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DX10Font:
|
||||
// ----------
|
||||
// Font objects contain the textures and resources needed to render a specific
|
||||
// font on a specific device.
|
||||
//
|
||||
// GetGlyphData -
|
||||
// Returns glyph cache data, for a given glyph.
|
||||
//
|
||||
// PreloadCharacters/PreloadGlyphs/PreloadText -
|
||||
// Preloads glyphs into the glyph cache textures.
|
||||
//
|
||||
// DrawText -
|
||||
// Draws formatted text on a D3D device. Some parameters are
|
||||
// surprisingly similar to those of GDI's DrawText function. See GDI
|
||||
// documentation for a detailed description of these parameters.
|
||||
// If pSprite is NULL, an internal sprite object will be used.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct _D3DX10_FONT_DESCA
|
||||
{
|
||||
INT Height;
|
||||
UINT Width;
|
||||
UINT Weight;
|
||||
UINT MipLevels;
|
||||
BOOL Italic;
|
||||
BYTE CharSet;
|
||||
BYTE OutputPrecision;
|
||||
BYTE Quality;
|
||||
BYTE PitchAndFamily;
|
||||
CHAR FaceName[LF_FACESIZE];
|
||||
|
||||
} D3DX10_FONT_DESCA, *LPD3DX10_FONT_DESCA;
|
||||
|
||||
typedef struct _D3DX10_FONT_DESCW
|
||||
{
|
||||
INT Height;
|
||||
UINT Width;
|
||||
UINT Weight;
|
||||
UINT MipLevels;
|
||||
BOOL Italic;
|
||||
BYTE CharSet;
|
||||
BYTE OutputPrecision;
|
||||
BYTE Quality;
|
||||
BYTE PitchAndFamily;
|
||||
WCHAR FaceName[LF_FACESIZE];
|
||||
|
||||
} D3DX10_FONT_DESCW, *LPD3DX10_FONT_DESCW;
|
||||
|
||||
#ifdef UNICODE
|
||||
typedef D3DX10_FONT_DESCW D3DX10_FONT_DESC;
|
||||
typedef LPD3DX10_FONT_DESCW LPD3DX10_FONT_DESC;
|
||||
#else
|
||||
typedef D3DX10_FONT_DESCA D3DX10_FONT_DESC;
|
||||
typedef LPD3DX10_FONT_DESCA LPD3DX10_FONT_DESC;
|
||||
#endif
|
||||
|
||||
|
||||
typedef interface ID3DX10Font ID3DX10Font;
|
||||
typedef interface ID3DX10Font *LPD3DX10FONT;
|
||||
|
||||
|
||||
// {D79DBB70-5F21-4d36-BBC2-FF525C213CDC}
|
||||
DEFINE_GUID(IID_ID3DX10Font,
|
||||
0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc);
|
||||
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DX10Font
|
||||
|
||||
DECLARE_INTERFACE_(ID3DX10Font, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DX10Font
|
||||
STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE;
|
||||
STDMETHOD(GetDescA)(THIS_ D3DX10_FONT_DESCA *pDesc) PURE;
|
||||
STDMETHOD(GetDescW)(THIS_ D3DX10_FONT_DESCW *pDesc) PURE;
|
||||
STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *pTextMetrics) PURE;
|
||||
STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *pTextMetrics) PURE;
|
||||
|
||||
STDMETHOD_(HDC, GetDC)(THIS) PURE;
|
||||
STDMETHOD(GetGlyphData)(THIS_ UINT Glyph, ID3D10ShaderResourceView** ppTexture, RECT *pBlackBox, POINT *pCellInc) PURE;
|
||||
|
||||
STDMETHOD(PreloadCharacters)(THIS_ UINT First, UINT Last) PURE;
|
||||
STDMETHOD(PreloadGlyphs)(THIS_ UINT First, UINT Last) PURE;
|
||||
STDMETHOD(PreloadTextA)(THIS_ LPCSTR pString, INT Count) PURE;
|
||||
STDMETHOD(PreloadTextW)(THIS_ LPCWSTR pString, INT Count) PURE;
|
||||
|
||||
STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DX10SPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, UINT Format, D3DXCOLOR Color) PURE;
|
||||
STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DX10SPRITE pSprite, LPCWSTR pString, INT Count, LPRECT pRect, UINT Format, D3DXCOLOR Color) PURE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
#ifdef UNICODE
|
||||
HRESULT WINAPI_INLINE GetDesc(D3DX10_FONT_DESCW *pDesc) { return GetDescW(pDesc); }
|
||||
HRESULT WINAPI_INLINE PreloadText(LPCWSTR pString, INT Count) { return PreloadTextW(pString, Count); }
|
||||
#else
|
||||
HRESULT WINAPI_INLINE GetDesc(D3DX10_FONT_DESCA *pDesc) { return GetDescA(pDesc); }
|
||||
HRESULT WINAPI_INLINE PreloadText(LPCSTR pString, INT Count) { return PreloadTextA(pString, Count); }
|
||||
#endif
|
||||
#endif //__cplusplus
|
||||
};
|
||||
|
||||
#ifndef GetTextMetrics
|
||||
#ifdef UNICODE
|
||||
#define GetTextMetrics GetTextMetricsW
|
||||
#else
|
||||
#define GetTextMetrics GetTextMetricsA
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef DrawText
|
||||
#ifdef UNICODE
|
||||
#define DrawText DrawTextW
|
||||
#else
|
||||
#define DrawText DrawTextA
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateFontA(
|
||||
ID3D10Device* pDevice,
|
||||
INT Height,
|
||||
UINT Width,
|
||||
UINT Weight,
|
||||
UINT MipLevels,
|
||||
BOOL Italic,
|
||||
UINT CharSet,
|
||||
UINT OutputPrecision,
|
||||
UINT Quality,
|
||||
UINT PitchAndFamily,
|
||||
LPCSTR pFaceName,
|
||||
LPD3DX10FONT* ppFont);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateFontW(
|
||||
ID3D10Device* pDevice,
|
||||
INT Height,
|
||||
UINT Width,
|
||||
UINT Weight,
|
||||
UINT MipLevels,
|
||||
BOOL Italic,
|
||||
UINT CharSet,
|
||||
UINT OutputPrecision,
|
||||
UINT Quality,
|
||||
UINT PitchAndFamily,
|
||||
LPCWSTR pFaceName,
|
||||
LPD3DX10FONT* ppFont);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10CreateFont D3DX10CreateFontW
|
||||
#else
|
||||
#define D3DX10CreateFont D3DX10CreateFontA
|
||||
#endif
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateFontIndirectA(
|
||||
ID3D10Device* pDevice,
|
||||
CONST D3DX10_FONT_DESCA* pDesc,
|
||||
LPD3DX10FONT* ppFont);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateFontIndirectW(
|
||||
ID3D10Device* pDevice,
|
||||
CONST D3DX10_FONT_DESCW* pDesc,
|
||||
LPD3DX10FONT* ppFont);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10CreateFontIndirect D3DX10CreateFontIndirectW
|
||||
#else
|
||||
#define D3DX10CreateFontIndirect D3DX10CreateFontIndirectA
|
||||
#endif
|
||||
|
||||
HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *pDevice);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define _FACD3D 0x876
|
||||
#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code )
|
||||
#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code )
|
||||
|
||||
#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156)
|
||||
#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540)
|
||||
|
||||
#endif //__D3DX10CORE_H__
|
||||
|
1866
SDK/Include/D3DX10math.h
Normal file
1866
SDK/Include/D3DX10math.h
Normal file
File diff suppressed because it is too large
Load Diff
2228
SDK/Include/D3DX10math.inl
Normal file
2228
SDK/Include/D3DX10math.inl
Normal file
File diff suppressed because it is too large
Load Diff
286
SDK/Include/D3DX10mesh.h
Normal file
286
SDK/Include/D3DX10mesh.h
Normal file
@ -0,0 +1,286 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||
//
|
||||
// File: d3dx10mesh.h
|
||||
// Content: D3DX10 mesh types and functions
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "d3dx10.h"
|
||||
|
||||
#ifndef __D3DX10MESH_H__
|
||||
#define __D3DX10MESH_H__
|
||||
|
||||
// {7ED943DD-52E8-40b5-A8D8-76685C406330}
|
||||
DEFINE_GUID(IID_ID3DX10BaseMesh,
|
||||
0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30);
|
||||
|
||||
// {04B0D117-1041-46b1-AA8A-3952848BA22E}
|
||||
DEFINE_GUID(IID_ID3DX10MeshBuffer,
|
||||
0x4b0d117, 0x1041, 0x46b1, 0xaa, 0x8a, 0x39, 0x52, 0x84, 0x8b, 0xa2, 0x2e);
|
||||
|
||||
// {4020E5C2-1403-4929-883F-E2E849FAC195}
|
||||
DEFINE_GUID(IID_ID3DX10Mesh,
|
||||
0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95);
|
||||
|
||||
// {8875769A-D579-4088-AAEB-534D1AD84E96}
|
||||
DEFINE_GUID(IID_ID3DX10PMesh,
|
||||
0x8875769a, 0xd579, 0x4088, 0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96);
|
||||
|
||||
// {667EA4C7-F1CD-4386-B523-7C0290B83CC5}
|
||||
DEFINE_GUID(IID_ID3DX10SPMesh,
|
||||
0x667ea4c7, 0xf1cd, 0x4386, 0xb5, 0x23, 0x7c, 0x2, 0x90, 0xb8, 0x3c, 0xc5);
|
||||
|
||||
// {3CE6CC22-DBF2-44f4-894D-F9C34A337139}
|
||||
DEFINE_GUID(IID_ID3DX10PatchMesh,
|
||||
0x3ce6cc22, 0xdbf2, 0x44f4, 0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39);
|
||||
|
||||
|
||||
// Mesh options - lower 3 bytes only, upper byte used by _D3DX10MESHOPT option flags
|
||||
enum _D3DX10_MESH {
|
||||
D3DX10_MESH_32_BIT = 0x001, // If set, then use 32 bit indices, if not set use 16 bit indices.
|
||||
D3DX10_MESH_GS_ADJACENCY = 0x004, // If set, mesh contains GS adjacency info. Not valid on input.
|
||||
|
||||
};
|
||||
|
||||
typedef struct _D3DX10_ATTRIBUTE_RANGE
|
||||
{
|
||||
UINT AttribId;
|
||||
UINT FaceStart;
|
||||
UINT FaceCount;
|
||||
UINT VertexStart;
|
||||
UINT VertexCount;
|
||||
} D3DX10_ATTRIBUTE_RANGE;
|
||||
|
||||
typedef D3DX10_ATTRIBUTE_RANGE* LPD3DX10_ATTRIBUTE_RANGE;
|
||||
|
||||
typedef enum _D3DX10_MESH_DISCARD_FLAGS
|
||||
{
|
||||
D3DX10_MESH_DISCARD_ATTRIBUTE_BUFFER = 0x01,
|
||||
D3DX10_MESH_DISCARD_ATTRIBUTE_TABLE = 0x02,
|
||||
D3DX10_MESH_DISCARD_POINTREPS = 0x04,
|
||||
D3DX10_MESH_DISCARD_ADJACENCY = 0x08,
|
||||
D3DX10_MESH_DISCARD_DEVICE_BUFFERS = 0x10,
|
||||
|
||||
} D3DX10_MESH_DISCARD_FLAGS;
|
||||
|
||||
typedef struct _D3DX10_WELD_EPSILONS
|
||||
{
|
||||
FLOAT Position; // NOTE: This does NOT replace the epsilon in GenerateAdjacency
|
||||
// in general, it should be the same value or greater than the one passed to GeneratedAdjacency
|
||||
FLOAT BlendWeights;
|
||||
FLOAT Normal;
|
||||
FLOAT PSize;
|
||||
FLOAT Specular;
|
||||
FLOAT Diffuse;
|
||||
FLOAT Texcoord[8];
|
||||
FLOAT Tangent;
|
||||
FLOAT Binormal;
|
||||
FLOAT TessFactor;
|
||||
} D3DX10_WELD_EPSILONS;
|
||||
|
||||
typedef D3DX10_WELD_EPSILONS* LPD3DX10_WELD_EPSILONS;
|
||||
|
||||
typedef struct _D3DX10_INTERSECT_INFO
|
||||
{
|
||||
UINT FaceIndex; // index of face intersected
|
||||
FLOAT U; // Barycentric Hit Coordinates
|
||||
FLOAT V; // Barycentric Hit Coordinates
|
||||
FLOAT Dist; // Ray-Intersection Parameter Distance
|
||||
} D3DX10_INTERSECT_INFO, *LPD3DX10_INTERSECT_INFO;
|
||||
|
||||
// ID3DX10MeshBuffer is used by D3DX10Mesh vertex and index buffers
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DX10MeshBuffer
|
||||
|
||||
DECLARE_INTERFACE_(ID3DX10MeshBuffer, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DX10MeshBuffer
|
||||
STDMETHOD(Map)(THIS_ void **ppData, SIZE_T *pSize) PURE;
|
||||
STDMETHOD(Unmap)(THIS) PURE;
|
||||
STDMETHOD_(SIZE_T, GetSize)(THIS) PURE;
|
||||
};
|
||||
|
||||
// D3DX10 Mesh interfaces
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DX10Mesh
|
||||
|
||||
DECLARE_INTERFACE_(ID3DX10Mesh, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DX10Mesh
|
||||
STDMETHOD_(UINT, GetFaceCount)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetVertexCount)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetVertexBufferCount)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetFlags)(THIS) PURE;
|
||||
STDMETHOD(GetVertexDescription)(THIS_ CONST D3D10_INPUT_ELEMENT_DESC **ppDesc, UINT *pDeclCount) PURE;
|
||||
|
||||
STDMETHOD(SetVertexData)(THIS_ UINT iBuffer, CONST void *pData) PURE;
|
||||
STDMETHOD(GetVertexBuffer)(THIS_ UINT iBuffer, ID3DX10MeshBuffer **ppVertexBuffer) PURE;
|
||||
|
||||
STDMETHOD(SetIndexData)(THIS_ CONST void *pData, UINT cIndices) PURE;
|
||||
STDMETHOD(GetIndexBuffer)(THIS_ ID3DX10MeshBuffer **ppIndexBuffer) PURE;
|
||||
|
||||
STDMETHOD(SetAttributeData)(THIS_ CONST UINT *pData) PURE;
|
||||
STDMETHOD(GetAttributeBuffer)(THIS_ ID3DX10MeshBuffer **ppAttributeBuffer) PURE;
|
||||
|
||||
STDMETHOD(SetAttributeTable)(THIS_ CONST D3DX10_ATTRIBUTE_RANGE *pAttribTable, UINT cAttribTableSize) PURE;
|
||||
STDMETHOD(GetAttributeTable)(THIS_ D3DX10_ATTRIBUTE_RANGE *pAttribTable, UINT *pAttribTableSize) PURE;
|
||||
|
||||
STDMETHOD(GenerateAdjacencyAndPointReps)(THIS_ FLOAT Epsilon) PURE;
|
||||
STDMETHOD(GenerateGSAdjacency)(THIS) PURE;
|
||||
|
||||
STDMETHOD(SetAdjacencyData)(THIS_ CONST UINT *pAdjacency) PURE;
|
||||
STDMETHOD(GetAdjacencyBuffer)(THIS_ ID3DX10MeshBuffer **ppAdjacency) PURE;
|
||||
|
||||
STDMETHOD(SetPointRepData)(THIS_ CONST UINT *pPointReps) PURE;
|
||||
STDMETHOD(GetPointRepBuffer)(THIS_ ID3DX10MeshBuffer **ppPointReps) PURE;
|
||||
|
||||
STDMETHOD(Discard)(THIS_ D3DX10_MESH_DISCARD_FLAGS dwDiscard) PURE;
|
||||
STDMETHOD(CloneMesh)(THIS_ UINT Flags, LPCSTR pPosSemantic, CONST D3D10_INPUT_ELEMENT_DESC *pDesc, UINT DeclCount, ID3DX10Mesh** ppCloneMesh) PURE;
|
||||
|
||||
STDMETHOD(Optimize)(THIS_ UINT Flags, UINT * pFaceRemap, LPD3D10BLOB *ppVertexRemap) PURE;
|
||||
STDMETHOD(GenerateAttributeBufferFromTable)(THIS) PURE;
|
||||
|
||||
STDMETHOD(Intersect)(THIS_ D3DXVECTOR3 *pRayPos, D3DXVECTOR3 *pRayDir,
|
||||
UINT *pHitCount, UINT *pFaceIndex, float *pU, float *pV, float *pDist, ID3D10Blob **ppAllHits);
|
||||
STDMETHOD(IntersectSubset)(THIS_ UINT AttribId, D3DXVECTOR3 *pRayPos, D3DXVECTOR3 *pRayDir,
|
||||
UINT *pHitCount, UINT *pFaceIndex, float *pU, float *pV, float *pDist, ID3D10Blob **ppAllHits);
|
||||
|
||||
// ID3DX10Mesh - Device functions
|
||||
STDMETHOD(CommitToDevice)(THIS) PURE;
|
||||
STDMETHOD(DrawSubset)(THIS_ UINT AttribId) PURE;
|
||||
STDMETHOD(DrawSubsetInstanced)(THIS_ UINT AttribId, UINT InstanceCount, UINT StartInstanceLocation) PURE;
|
||||
|
||||
STDMETHOD(GetDeviceVertexBuffer)(THIS_ UINT iBuffer, ID3D10Buffer **ppVertexBuffer) PURE;
|
||||
STDMETHOD(GetDeviceIndexBuffer)(THIS_ ID3D10Buffer **ppIndexBuffer) PURE;
|
||||
};
|
||||
|
||||
|
||||
// Flat API
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateMesh(
|
||||
ID3D10Device *pDevice,
|
||||
CONST D3D10_INPUT_ELEMENT_DESC *pDeclaration,
|
||||
UINT DeclCount,
|
||||
LPCSTR pPositionSemantic,
|
||||
UINT VertexCount,
|
||||
UINT FaceCount,
|
||||
UINT Options,
|
||||
ID3DX10Mesh **ppMesh);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
// ID3DX10Mesh::Optimize options - upper byte only, lower 3 bytes used from _D3DX10MESH option flags
|
||||
enum _D3DX10_MESHOPT {
|
||||
D3DX10_MESHOPT_COMPACT = 0x01000000,
|
||||
D3DX10_MESHOPT_ATTR_SORT = 0x02000000,
|
||||
D3DX10_MESHOPT_VERTEX_CACHE = 0x04000000,
|
||||
D3DX10_MESHOPT_STRIP_REORDER = 0x08000000,
|
||||
D3DX10_MESHOPT_IGNORE_VERTS = 0x10000000, // optimize faces only, don't touch vertices
|
||||
D3DX10_MESHOPT_DO_NOT_SPLIT = 0x20000000, // do not split vertices shared between attribute groups when attribute sorting
|
||||
D3DX10_MESHOPT_DEVICE_INDEPENDENT = 0x00400000, // Only affects VCache. uses a static known good cache size for all cards
|
||||
|
||||
// D3DX10_MESHOPT_SHAREVB has been removed, please use D3DX10MESH_VB_SHARE instead
|
||||
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXSkinInfo
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// {420BD604-1C76-4a34-A466-E45D0658A32C}
|
||||
DEFINE_GUID(IID_ID3DX10SkinInfo,
|
||||
0x420bd604, 0x1c76, 0x4a34, 0xa4, 0x66, 0xe4, 0x5d, 0x6, 0x58, 0xa3, 0x2c);
|
||||
|
||||
// scaling modes for ID3DX10SkinInfo::Compact() & ID3DX10SkinInfo::UpdateMesh()
|
||||
#define D3DX10_SKININFO_NO_SCALING 0
|
||||
#define D3DX10_SKININFO_SCALE_TO_1 1
|
||||
#define D3DX10_SKININFO_SCALE_TO_TOTAL 2
|
||||
|
||||
typedef struct _D3DX10_SKINNING_CHANNEL
|
||||
{
|
||||
UINT SrcOffset;
|
||||
UINT DestOffset;
|
||||
BOOL IsNormal;
|
||||
} D3DX10_SKINNING_CHANNEL;
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DX10SkinInfo
|
||||
|
||||
typedef struct ID3DX10SkinInfo *LPD3DX10SKININFO;
|
||||
|
||||
DECLARE_INTERFACE_(ID3DX10SkinInfo, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
STDMETHOD_(UINT , GetNumVertices)(THIS) PURE;
|
||||
STDMETHOD_(UINT , GetNumBones)(THIS) PURE;
|
||||
STDMETHOD_(UINT , GetMaxBoneInfluences)(THIS) PURE;
|
||||
|
||||
STDMETHOD(AddVertices)(THIS_ UINT Count) PURE;
|
||||
STDMETHOD(RemapVertices)(THIS_ UINT NewVertexCount, UINT *pVertexRemap) PURE;
|
||||
|
||||
STDMETHOD(AddBones)(THIS_ UINT Count) PURE;
|
||||
STDMETHOD(RemoveBone)(THIS_ UINT Index) PURE;
|
||||
STDMETHOD(RemapBones)(THIS_ UINT NewBoneCount, UINT *pBoneRemap) PURE;
|
||||
|
||||
STDMETHOD(AddBoneInfluences)(THIS_ UINT BoneIndex, UINT InfluenceCount, UINT *pIndices, float *pWeights) PURE;
|
||||
STDMETHOD(ClearBoneInfluences)(THIS_ UINT BoneIndex) PURE;
|
||||
STDMETHOD_(UINT , GetBoneInfluenceCount)(THIS_ UINT BoneIndex) PURE;
|
||||
STDMETHOD(GetBoneInfluences)(THIS_ UINT BoneIndex, UINT Offset, UINT Count, UINT *pDestIndices, float *pDestWeights) PURE;
|
||||
STDMETHOD(FindBoneInfluenceIndex)(THIS_ UINT BoneIndex, UINT VertexIndex, UINT *pInfluenceIndex) PURE;
|
||||
STDMETHOD(SetBoneInfluence)(THIS_ UINT BoneIndex, UINT InfluenceIndex, float Weight) PURE;
|
||||
STDMETHOD(GetBoneInfluence)(THIS_ UINT BoneIndex, UINT InfluenceIndex, float *pWeight) PURE;
|
||||
|
||||
STDMETHOD(Compact)(THIS_ UINT MaxPerVertexInfluences, UINT ScaleMode, float MinWeight) PURE;
|
||||
STDMETHOD(DoSoftwareSkinning)(UINT StartVertex, UINT VertexCount, void *pSrcVertices, UINT SrcStride, void *pDestVertices, UINT DestStride, D3DXMATRIX *pBoneMatrices, D3DXMATRIX *pInverseTransposeBoneMatrices, D3DX10_SKINNING_CHANNEL *pChannelDescs, UINT NumChannels) PURE;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateSkinInfo(LPD3DX10SKININFO* ppSkinInfo);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
typedef struct _D3DX10_ATTRIBUTE_WEIGHTS
|
||||
{
|
||||
FLOAT Position;
|
||||
FLOAT Boundary;
|
||||
FLOAT Normal;
|
||||
FLOAT Diffuse;
|
||||
FLOAT Specular;
|
||||
FLOAT Texcoord[8];
|
||||
FLOAT Tangent;
|
||||
FLOAT Binormal;
|
||||
} D3DX10_ATTRIBUTE_WEIGHTS, *LPD3DX10_ATTRIBUTE_WEIGHTS;
|
||||
|
||||
#endif //__D3DX10MESH_H__
|
||||
|
||||
|
766
SDK/Include/D3DX10tex.h
Normal file
766
SDK/Include/D3DX10tex.h
Normal file
@ -0,0 +1,766 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||
//
|
||||
// File: d3dx10tex.h
|
||||
// Content: D3DX10 texturing APIs
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "d3dx10.h"
|
||||
|
||||
#ifndef __D3DX10TEX_H__
|
||||
#define __D3DX10TEX_H__
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10_FILTER flags:
|
||||
// ------------------
|
||||
//
|
||||
// A valid filter must contain one of these values:
|
||||
//
|
||||
// D3DX10_FILTER_NONE
|
||||
// No scaling or filtering will take place. Pixels outside the bounds
|
||||
// of the source image are assumed to be transparent black.
|
||||
// D3DX10_FILTER_POINT
|
||||
// Each destination pixel is computed by sampling the nearest pixel
|
||||
// from the source image.
|
||||
// D3DX10_FILTER_LINEAR
|
||||
// Each destination pixel is computed by linearly interpolating between
|
||||
// the nearest pixels in the source image. This filter works best
|
||||
// when the scale on each axis is less than 2.
|
||||
// D3DX10_FILTER_TRIANGLE
|
||||
// Every pixel in the source image contributes equally to the
|
||||
// destination image. This is the slowest of all the filters.
|
||||
// D3DX10_FILTER_BOX
|
||||
// Each pixel is computed by averaging a 2x2(x2) box pixels from
|
||||
// the source image. Only works when the dimensions of the
|
||||
// destination are half those of the source. (as with mip maps)
|
||||
//
|
||||
// And can be OR'd with any of these optional flags:
|
||||
//
|
||||
// D3DX10_FILTER_MIRROR_U
|
||||
// Indicates that pixels off the edge of the texture on the U-axis
|
||||
// should be mirrored, not wraped.
|
||||
// D3DX10_FILTER_MIRROR_V
|
||||
// Indicates that pixels off the edge of the texture on the V-axis
|
||||
// should be mirrored, not wraped.
|
||||
// D3DX10_FILTER_MIRROR_W
|
||||
// Indicates that pixels off the edge of the texture on the W-axis
|
||||
// should be mirrored, not wraped.
|
||||
// D3DX10_FILTER_MIRROR
|
||||
// Same as specifying D3DX10_FILTER_MIRROR_U | D3DX10_FILTER_MIRROR_V |
|
||||
// D3DX10_FILTER_MIRROR_V
|
||||
// D3DX10_FILTER_DITHER
|
||||
// Dithers the resulting image using a 4x4 order dither pattern.
|
||||
// D3DX10_FILTER_SRGB_IN
|
||||
// Denotes that the input data is in sRGB (gamma 2.2) colorspace.
|
||||
// D3DX10_FILTER_SRGB_OUT
|
||||
// Denotes that the output data is in sRGB (gamma 2.2) colorspace.
|
||||
// D3DX10_FILTER_SRGB
|
||||
// Same as specifying D3DX10_FILTER_SRGB_IN | D3DX10_FILTER_SRGB_OUT
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3DX10_FILTER_FLAG
|
||||
{
|
||||
D3DX10_FILTER_NONE = (1 << 0),
|
||||
D3DX10_FILTER_POINT = (2 << 0),
|
||||
D3DX10_FILTER_LINEAR = (3 << 0),
|
||||
D3DX10_FILTER_TRIANGLE = (4 << 0),
|
||||
D3DX10_FILTER_BOX = (5 << 0),
|
||||
|
||||
D3DX10_FILTER_MIRROR_U = (1 << 16),
|
||||
D3DX10_FILTER_MIRROR_V = (2 << 16),
|
||||
D3DX10_FILTER_MIRROR_W = (4 << 16),
|
||||
D3DX10_FILTER_MIRROR = (7 << 16),
|
||||
|
||||
D3DX10_FILTER_DITHER = (1 << 19),
|
||||
D3DX10_FILTER_DITHER_DIFFUSION= (2 << 19),
|
||||
|
||||
D3DX10_FILTER_SRGB_IN = (1 << 21),
|
||||
D3DX10_FILTER_SRGB_OUT = (2 << 21),
|
||||
D3DX10_FILTER_SRGB = (3 << 21),
|
||||
} D3DX10_FILTER_FLAG;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10_NORMALMAP flags:
|
||||
// ---------------------
|
||||
// These flags are used to control how D3DX10ComputeNormalMap generates normal
|
||||
// maps. Any number of these flags may be OR'd together in any combination.
|
||||
//
|
||||
// D3DX10_NORMALMAP_MIRROR_U
|
||||
// Indicates that pixels off the edge of the texture on the U-axis
|
||||
// should be mirrored, not wraped.
|
||||
// D3DX10_NORMALMAP_MIRROR_V
|
||||
// Indicates that pixels off the edge of the texture on the V-axis
|
||||
// should be mirrored, not wraped.
|
||||
// D3DX10_NORMALMAP_MIRROR
|
||||
// Same as specifying D3DX10_NORMALMAP_MIRROR_U | D3DX10_NORMALMAP_MIRROR_V
|
||||
// D3DX10_NORMALMAP_INVERTSIGN
|
||||
// Inverts the direction of each normal
|
||||
// D3DX10_NORMALMAP_COMPUTE_OCCLUSION
|
||||
// Compute the per pixel Occlusion term and encodes it into the alpha.
|
||||
// An Alpha of 1 means that the pixel is not obscured in anyway, and
|
||||
// an alpha of 0 would mean that the pixel is completly obscured.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3DX10_NORMALMAP_FLAG
|
||||
{
|
||||
D3DX10_NORMALMAP_MIRROR_U = (1 << 16),
|
||||
D3DX10_NORMALMAP_MIRROR_V = (2 << 16),
|
||||
D3DX10_NORMALMAP_MIRROR = (3 << 16),
|
||||
D3DX10_NORMALMAP_INVERTSIGN = (8 << 16),
|
||||
D3DX10_NORMALMAP_COMPUTE_OCCLUSION = (16 << 16),
|
||||
} D3DX10_NORMALMAP_FLAG;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10_CHANNEL flags:
|
||||
// -------------------
|
||||
// These flags are used by functions which operate on or more channels
|
||||
// in a texture.
|
||||
//
|
||||
// D3DX10_CHANNEL_RED
|
||||
// Indicates the red channel should be used
|
||||
// D3DX10_CHANNEL_BLUE
|
||||
// Indicates the blue channel should be used
|
||||
// D3DX10_CHANNEL_GREEN
|
||||
// Indicates the green channel should be used
|
||||
// D3DX10_CHANNEL_ALPHA
|
||||
// Indicates the alpha channel should be used
|
||||
// D3DX10_CHANNEL_LUMINANCE
|
||||
// Indicates the luminaces of the red green and blue channels should be
|
||||
// used.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3DX10_CHANNEL_FLAG
|
||||
{
|
||||
D3DX10_CHANNEL_RED = (1 << 0),
|
||||
D3DX10_CHANNEL_BLUE = (1 << 1),
|
||||
D3DX10_CHANNEL_GREEN = (1 << 2),
|
||||
D3DX10_CHANNEL_ALPHA = (1 << 3),
|
||||
D3DX10_CHANNEL_LUMINANCE = (1 << 4),
|
||||
} D3DX10_CHANNEL_FLAG;
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10_IMAGE_FILE_FORMAT:
|
||||
// ---------------------
|
||||
// This enum is used to describe supported image file formats.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3DX10_IMAGE_FILE_FORMAT
|
||||
{
|
||||
D3DX10_IFF_BMP = 0,
|
||||
D3DX10_IFF_JPG = 1,
|
||||
D3DX10_IFF_PNG = 3,
|
||||
D3DX10_IFF_DDS = 4,
|
||||
D3DX10_IFF_TIFF = 10,
|
||||
D3DX10_IFF_GIF = 11,
|
||||
D3DX10_IFF_WMP = 12,
|
||||
D3DX10_IFF_FORCE_DWORD = 0x7fffffff
|
||||
|
||||
} D3DX10_IMAGE_FILE_FORMAT;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10_SAVE_TEXTURE_FLAG:
|
||||
// ---------------------
|
||||
// This enum is used to support texture saving options.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3DX10_SAVE_TEXTURE_FLAG
|
||||
{
|
||||
D3DX10_STF_USEINPUTBLOB = 0x0001,
|
||||
} D3DX10_SAVE_TEXTURE_FLAG;
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10_IMAGE_INFO:
|
||||
// ---------------
|
||||
// This structure is used to return a rough description of what the
|
||||
// the original contents of an image file looked like.
|
||||
//
|
||||
// Width
|
||||
// Width of original image in pixels
|
||||
// Height
|
||||
// Height of original image in pixels
|
||||
// Depth
|
||||
// Depth of original image in pixels
|
||||
// ArraySize
|
||||
// Array size in textures
|
||||
// MipLevels
|
||||
// Number of mip levels in original image
|
||||
// MiscFlags
|
||||
// Miscellaneous flags
|
||||
// Format
|
||||
// D3D format which most closely describes the data in original image
|
||||
// ResourceDimension
|
||||
// D3D10_RESOURCE_DIMENSION representing the dimension of texture stored in the file.
|
||||
// D3D10_RESOURCE_DIMENSION_TEXTURE1D, 2D, 3D
|
||||
// ImageFileFormat
|
||||
// D3DX10_IMAGE_FILE_FORMAT representing the format of the image file.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef struct D3DX10_IMAGE_INFO
|
||||
{
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
UINT Depth;
|
||||
UINT ArraySize;
|
||||
UINT MipLevels;
|
||||
UINT MiscFlags;
|
||||
DXGI_FORMAT Format;
|
||||
D3D10_RESOURCE_DIMENSION ResourceDimension;
|
||||
D3DX10_IMAGE_FILE_FORMAT ImageFileFormat;
|
||||
} D3DX10_IMAGE_INFO;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Image File APIs ///////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10_IMAGE_LOAD_INFO:
|
||||
// ---------------
|
||||
// This structure can be optionally passed in to texture loader APIs to
|
||||
// control how textures get loaded. Pass in D3DX10_DEFAULT for any of these
|
||||
// to have D3DX automatically pick defaults based on the source file.
|
||||
//
|
||||
// Width
|
||||
// Rescale texture to Width texels wide
|
||||
// Height
|
||||
// Rescale texture to Height texels high
|
||||
// Depth
|
||||
// Rescale texture to Depth texels deep
|
||||
// FirstMipLevel
|
||||
// First mip level to load
|
||||
// MipLevels
|
||||
// Number of mip levels to load after the first level
|
||||
// Usage
|
||||
// D3D10_USAGE flag for the new texture
|
||||
// BindFlags
|
||||
// D3D10 Bind flags for the new texture
|
||||
// CpuAccessFlags
|
||||
// D3D10 CPU Access flags for the new texture
|
||||
// MiscFlags
|
||||
// Reserved. Must be 0
|
||||
// Format
|
||||
// Resample texture to the specified format
|
||||
// Filter
|
||||
// Filter the texture using the specified filter (only when resampling)
|
||||
// MipFilter
|
||||
// Filter the texture mip levels using the specified filter (only if
|
||||
// generating mips)
|
||||
// pSrcInfo
|
||||
// (optional) pointer to a D3DX10_IMAGE_INFO structure that will get
|
||||
// populated with source image information
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
||||
typedef struct D3DX10_IMAGE_LOAD_INFO
|
||||
{
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
UINT Depth;
|
||||
UINT FirstMipLevel;
|
||||
UINT MipLevels;
|
||||
D3D10_USAGE Usage;
|
||||
UINT BindFlags;
|
||||
UINT CpuAccessFlags;
|
||||
UINT MiscFlags;
|
||||
DXGI_FORMAT Format;
|
||||
UINT Filter;
|
||||
UINT MipFilter;
|
||||
D3DX10_IMAGE_INFO* pSrcInfo;
|
||||
|
||||
#ifdef __cplusplus
|
||||
D3DX10_IMAGE_LOAD_INFO()
|
||||
{
|
||||
Width = D3DX10_DEFAULT;
|
||||
Height = D3DX10_DEFAULT;
|
||||
Depth = D3DX10_DEFAULT;
|
||||
FirstMipLevel = D3DX10_DEFAULT;
|
||||
MipLevels = D3DX10_DEFAULT;
|
||||
Usage = (D3D10_USAGE) D3DX10_DEFAULT;
|
||||
BindFlags = D3DX10_DEFAULT;
|
||||
CpuAccessFlags = D3DX10_DEFAULT;
|
||||
MiscFlags = D3DX10_DEFAULT;
|
||||
Format = DXGI_FORMAT_FROM_FILE;
|
||||
Filter = D3DX10_DEFAULT;
|
||||
MipFilter = D3DX10_DEFAULT;
|
||||
pSrcInfo = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
} D3DX10_IMAGE_LOAD_INFO;
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
// GetImageInfoFromFile/Resource/Memory:
|
||||
// ------------------------------
|
||||
// Fills in a D3DX10_IMAGE_INFO struct with information about an image file.
|
||||
//
|
||||
// Parameters:
|
||||
// pSrcFile
|
||||
// File name of the source image.
|
||||
// pSrcModule
|
||||
// Module where resource is located, or NULL for module associated
|
||||
// with image the os used to create the current process.
|
||||
// pSrcResource
|
||||
// Resource name.
|
||||
// pSrcData
|
||||
// Pointer to file in memory.
|
||||
// SrcDataSize
|
||||
// Size in bytes of file in memory.
|
||||
// pPump
|
||||
// Optional pointer to a thread pump object to use.
|
||||
// pSrcInfo
|
||||
// Pointer to a D3DX10_IMAGE_INFO structure to be filled in with the
|
||||
// description of the data in the source image file.
|
||||
// pHResult
|
||||
// Pointer to a memory location to receive the return value upon completion.
|
||||
// Maybe NULL if not needed.
|
||||
// If pPump != NULL, pHResult must be a valid memory location until the
|
||||
// the asynchronous execution completes.
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10GetImageInfoFromFileA(
|
||||
LPCSTR pSrcFile,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
D3DX10_IMAGE_INFO* pSrcInfo,
|
||||
HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10GetImageInfoFromFileW(
|
||||
LPCWSTR pSrcFile,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
D3DX10_IMAGE_INFO* pSrcInfo,
|
||||
HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10GetImageInfoFromFile D3DX10GetImageInfoFromFileW
|
||||
#else
|
||||
#define D3DX10GetImageInfoFromFile D3DX10GetImageInfoFromFileA
|
||||
#endif
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10GetImageInfoFromResourceA(
|
||||
HMODULE hSrcModule,
|
||||
LPCSTR pSrcResource,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
D3DX10_IMAGE_INFO* pSrcInfo,
|
||||
HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10GetImageInfoFromResourceW(
|
||||
HMODULE hSrcModule,
|
||||
LPCWSTR pSrcResource,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
D3DX10_IMAGE_INFO* pSrcInfo,
|
||||
HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10GetImageInfoFromResource D3DX10GetImageInfoFromResourceW
|
||||
#else
|
||||
#define D3DX10GetImageInfoFromResource D3DX10GetImageInfoFromResourceA
|
||||
#endif
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10GetImageInfoFromMemory(
|
||||
LPCVOID pSrcData,
|
||||
SIZE_T SrcDataSize,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
D3DX10_IMAGE_INFO* pSrcInfo,
|
||||
HRESULT* pHResult);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Create/Save Texture APIs //////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10CreateTextureFromFile/Resource/Memory:
|
||||
// D3DX10CreateShaderResourceViewFromFile/Resource/Memory:
|
||||
// -----------------------------------
|
||||
// Create a texture object from a file or resource.
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
// pDevice
|
||||
// The D3D device with which the texture is going to be used.
|
||||
// pSrcFile
|
||||
// File name.
|
||||
// hSrcModule
|
||||
// Module handle. if NULL, current module will be used.
|
||||
// pSrcResource
|
||||
// Resource name in module
|
||||
// pvSrcData
|
||||
// Pointer to file in memory.
|
||||
// SrcDataSize
|
||||
// Size in bytes of file in memory.
|
||||
// pLoadInfo
|
||||
// Optional pointer to a D3DX10_IMAGE_LOAD_INFO structure that
|
||||
// contains additional loader parameters.
|
||||
// pPump
|
||||
// Optional pointer to a thread pump object to use.
|
||||
// ppTexture
|
||||
// [out] Created texture object.
|
||||
// ppShaderResourceView
|
||||
// [out] Shader resource view object created.
|
||||
// pHResult
|
||||
// Pointer to a memory location to receive the return value upon completion.
|
||||
// Maybe NULL if not needed.
|
||||
// If pPump != NULL, pHResult must be a valid memory location until the
|
||||
// the asynchronous execution completes.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// FromFile
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateShaderResourceViewFromFileA(
|
||||
ID3D10Device* pDevice,
|
||||
LPCSTR pSrcFile,
|
||||
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
ID3D10ShaderResourceView** ppShaderResourceView,
|
||||
HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateShaderResourceViewFromFileW(
|
||||
ID3D10Device* pDevice,
|
||||
LPCWSTR pSrcFile,
|
||||
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
ID3D10ShaderResourceView** ppShaderResourceView,
|
||||
HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10CreateShaderResourceViewFromFile D3DX10CreateShaderResourceViewFromFileW
|
||||
#else
|
||||
#define D3DX10CreateShaderResourceViewFromFile D3DX10CreateShaderResourceViewFromFileA
|
||||
#endif
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateTextureFromFileA(
|
||||
ID3D10Device* pDevice,
|
||||
LPCSTR pSrcFile,
|
||||
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
ID3D10Resource** ppTexture,
|
||||
HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateTextureFromFileW(
|
||||
ID3D10Device* pDevice,
|
||||
LPCWSTR pSrcFile,
|
||||
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
ID3D10Resource** ppTexture,
|
||||
HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10CreateTextureFromFile D3DX10CreateTextureFromFileW
|
||||
#else
|
||||
#define D3DX10CreateTextureFromFile D3DX10CreateTextureFromFileA
|
||||
#endif
|
||||
|
||||
|
||||
// FromResource (resources in dll/exes)
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateShaderResourceViewFromResourceA(
|
||||
ID3D10Device* pDevice,
|
||||
HMODULE hSrcModule,
|
||||
LPCSTR pSrcResource,
|
||||
D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
ID3D10ShaderResourceView** ppShaderResourceView,
|
||||
HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateShaderResourceViewFromResourceW(
|
||||
ID3D10Device* pDevice,
|
||||
HMODULE hSrcModule,
|
||||
LPCWSTR pSrcResource,
|
||||
D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
ID3D10ShaderResourceView** ppShaderResourceView,
|
||||
HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10CreateShaderResourceViewFromResource D3DX10CreateShaderResourceViewFromResourceW
|
||||
#else
|
||||
#define D3DX10CreateShaderResourceViewFromResource D3DX10CreateShaderResourceViewFromResourceA
|
||||
#endif
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateTextureFromResourceA(
|
||||
ID3D10Device* pDevice,
|
||||
HMODULE hSrcModule,
|
||||
LPCSTR pSrcResource,
|
||||
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
ID3D10Resource** ppTexture,
|
||||
HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateTextureFromResourceW(
|
||||
ID3D10Device* pDevice,
|
||||
HMODULE hSrcModule,
|
||||
LPCWSTR pSrcResource,
|
||||
D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
ID3D10Resource** ppTexture,
|
||||
HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10CreateTextureFromResource D3DX10CreateTextureFromResourceW
|
||||
#else
|
||||
#define D3DX10CreateTextureFromResource D3DX10CreateTextureFromResourceA
|
||||
#endif
|
||||
|
||||
|
||||
// FromFileInMemory
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateShaderResourceViewFromMemory(
|
||||
ID3D10Device* pDevice,
|
||||
LPCVOID pSrcData,
|
||||
SIZE_T SrcDataSize,
|
||||
D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
ID3D10ShaderResourceView** ppShaderResourceView,
|
||||
HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10CreateTextureFromMemory(
|
||||
ID3D10Device* pDevice,
|
||||
LPCVOID pSrcData,
|
||||
SIZE_T SrcDataSize,
|
||||
D3DX10_IMAGE_LOAD_INFO* pLoadInfo,
|
||||
ID3DX10ThreadPump* pPump,
|
||||
ID3D10Resource** ppTexture,
|
||||
HRESULT* pHResult);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Misc Texture APIs /////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10_TEXTURE_LOAD_INFO:
|
||||
// ------------------------
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef struct _D3DX10_TEXTURE_LOAD_INFO
|
||||
{
|
||||
D3D10_BOX *pSrcBox;
|
||||
D3D10_BOX *pDstBox;
|
||||
UINT SrcFirstMip;
|
||||
UINT DstFirstMip;
|
||||
UINT NumMips;
|
||||
UINT SrcFirstElement;
|
||||
UINT DstFirstElement;
|
||||
UINT NumElements;
|
||||
UINT Filter;
|
||||
UINT MipFilter;
|
||||
|
||||
#ifdef __cplusplus
|
||||
_D3DX10_TEXTURE_LOAD_INFO()
|
||||
{
|
||||
pSrcBox = NULL;
|
||||
pDstBox = NULL;
|
||||
SrcFirstMip = 0;
|
||||
DstFirstMip = 0;
|
||||
NumMips = D3DX10_DEFAULT;
|
||||
SrcFirstElement = 0;
|
||||
DstFirstElement = 0;
|
||||
NumElements = D3DX10_DEFAULT;
|
||||
Filter = D3DX10_DEFAULT;
|
||||
MipFilter = D3DX10_DEFAULT;
|
||||
}
|
||||
#endif
|
||||
|
||||
} D3DX10_TEXTURE_LOAD_INFO;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10LoadTextureFromTexture:
|
||||
// ----------------------------
|
||||
// Load a texture from a texture.
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10LoadTextureFromTexture(
|
||||
ID3D10Resource *pSrcTexture,
|
||||
D3DX10_TEXTURE_LOAD_INFO *pLoadInfo,
|
||||
ID3D10Resource *pDstTexture);
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10FilterTexture:
|
||||
// ------------------
|
||||
// Filters mipmaps levels of a texture.
|
||||
//
|
||||
// Parameters:
|
||||
// pBaseTexture
|
||||
// The texture object to be filtered
|
||||
// SrcLevel
|
||||
// The level whose image is used to generate the subsequent levels.
|
||||
// MipFilter
|
||||
// D3DX10_FILTER flags controlling how each miplevel is filtered.
|
||||
// Or D3DX10_DEFAULT for D3DX10_FILTER_BOX,
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10FilterTexture(
|
||||
ID3D10Resource *pTexture,
|
||||
UINT SrcLevel,
|
||||
UINT MipFilter);
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10SaveTextureToFile:
|
||||
// ----------------------
|
||||
// Save a texture to a file.
|
||||
//
|
||||
// Parameters:
|
||||
// pDestFile
|
||||
// File name of the destination file
|
||||
// DestFormat
|
||||
// D3DX10_IMAGE_FILE_FORMAT specifying file format to use when saving.
|
||||
// pSrcTexture
|
||||
// Source texture, containing the image to be saved
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10SaveTextureToFileA(
|
||||
ID3D10Resource *pSrcTexture,
|
||||
D3DX10_IMAGE_FILE_FORMAT DestFormat,
|
||||
LPCSTR pDestFile);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10SaveTextureToFileW(
|
||||
ID3D10Resource *pSrcTexture,
|
||||
D3DX10_IMAGE_FILE_FORMAT DestFormat,
|
||||
LPCWSTR pDestFile);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10SaveTextureToFile D3DX10SaveTextureToFileW
|
||||
#else
|
||||
#define D3DX10SaveTextureToFile D3DX10SaveTextureToFileA
|
||||
#endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10SaveTextureToMemory:
|
||||
// ----------------------
|
||||
// Save a texture to a blob.
|
||||
//
|
||||
// Parameters:
|
||||
// pSrcTexture
|
||||
// Source texture, containing the image to be saved
|
||||
// DestFormat
|
||||
// D3DX10_IMAGE_FILE_FORMAT specifying file format to use when saving.
|
||||
// ppDestBuf
|
||||
// address of a d3dxbuffer pointer to return the image data
|
||||
// Flags
|
||||
// optional flags
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10SaveTextureToMemory(
|
||||
ID3D10Resource* pSrcTexture,
|
||||
D3DX10_IMAGE_FILE_FORMAT DestFormat,
|
||||
LPD3D10BLOB* ppDestBuf,
|
||||
UINT Flags);
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10ComputeNormalMap:
|
||||
// ---------------------
|
||||
// Converts a height map into a normal map. The (x,y,z) components of each
|
||||
// normal are mapped to the (r,g,b) channels of the output texture.
|
||||
//
|
||||
// Parameters
|
||||
// pSrcTexture
|
||||
// Pointer to the source heightmap texture
|
||||
// Flags
|
||||
// D3DX10_NORMALMAP flags
|
||||
// Channel
|
||||
// D3DX10_CHANNEL specifying source of height information
|
||||
// Amplitude
|
||||
// The constant value which the height information is multiplied by.
|
||||
// pDestTexture
|
||||
// Pointer to the destination texture
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10ComputeNormalMap(
|
||||
ID3D10Texture2D *pSrcTexture,
|
||||
UINT Flags,
|
||||
UINT Channel,
|
||||
FLOAT Amplitude,
|
||||
ID3D10Texture2D *pDestTexture);
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10SHProjectCubeMap:
|
||||
// ----------------------
|
||||
// Projects a function represented in a cube map into spherical harmonics.
|
||||
//
|
||||
// Parameters:
|
||||
// Order
|
||||
// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
|
||||
// pCubeMap
|
||||
// CubeMap that is going to be projected into spherical harmonics
|
||||
// pROut
|
||||
// Output SH vector for Red.
|
||||
// pGOut
|
||||
// Output SH vector for Green
|
||||
// pBOut
|
||||
// Output SH vector for Blue
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX10SHProjectCubeMap(
|
||||
__in_range(2,6) UINT Order,
|
||||
ID3D10Texture2D *pCubeMap,
|
||||
__out_ecount(Order*Order) FLOAT *pROut,
|
||||
__out_ecount_opt(Order*Order) FLOAT *pGOut,
|
||||
__out_ecount_opt(Order*Order) FLOAT *pBOut);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3DX10TEX_H__
|
||||
|
74
SDK/Include/D3DX11.h
Normal file
74
SDK/Include/D3DX11.h
Normal file
@ -0,0 +1,74 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||
//
|
||||
// File: d3dx11.h
|
||||
// Content: D3DX11 utility library
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __D3DX11_INTERNAL__
|
||||
#error Incorrect D3DX11 header used
|
||||
#endif
|
||||
|
||||
#ifndef __D3DX11_H__
|
||||
#define __D3DX11_H__
|
||||
|
||||
|
||||
// Defines
|
||||
#include <limits.h>
|
||||
#include <float.h>
|
||||
|
||||
#ifdef ALLOW_THROWING_NEW
|
||||
#include <new>
|
||||
#endif
|
||||
|
||||
#define D3DX11_DEFAULT ((UINT) -1)
|
||||
#define D3DX11_FROM_FILE ((UINT) -3)
|
||||
#define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3)
|
||||
|
||||
#ifndef D3DX11INLINE
|
||||
#ifdef _MSC_VER
|
||||
#if (_MSC_VER >= 1200)
|
||||
#define D3DX11INLINE __forceinline
|
||||
#else
|
||||
#define D3DX11INLINE __inline
|
||||
#endif
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
#define D3DX11INLINE inline
|
||||
#else
|
||||
#define D3DX11INLINE
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// Includes
|
||||
#include "d3d11.h"
|
||||
#include "d3dx11.h"
|
||||
#include "d3dx11core.h"
|
||||
#include "d3dx11tex.h"
|
||||
#include "d3dx11async.h"
|
||||
|
||||
|
||||
// Errors
|
||||
#define _FACDD 0x876
|
||||
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
|
||||
|
||||
enum _D3DX11_ERR {
|
||||
D3DX11_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900),
|
||||
D3DX11_ERR_INVALID_MESH = MAKE_DDHRESULT(2901),
|
||||
D3DX11_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902),
|
||||
D3DX11_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903),
|
||||
D3DX11_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904),
|
||||
D3DX11_ERR_INVALID_DATA = MAKE_DDHRESULT(2905),
|
||||
D3DX11_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906),
|
||||
D3DX11_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907),
|
||||
D3DX11_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908),
|
||||
};
|
||||
|
||||
|
||||
#endif //__D3DX11_H__
|
||||
|
164
SDK/Include/D3DX11async.h
Normal file
164
SDK/Include/D3DX11async.h
Normal file
@ -0,0 +1,164 @@
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// File: D3DX11Async.h
|
||||
// Content: D3DX11 Asynchronous Shader loaders / compilers
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __D3DX11ASYNC_H__
|
||||
#define __D3DX11ASYNC_H__
|
||||
|
||||
#include "d3dx11.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11Compile:
|
||||
// ------------------
|
||||
// Compiles an effect or shader.
|
||||
//
|
||||
// Parameters:
|
||||
// pSrcFile
|
||||
// Source file name.
|
||||
// hSrcModule
|
||||
// Module handle. if NULL, current module will be used.
|
||||
// pSrcResource
|
||||
// Resource name in module.
|
||||
// pSrcData
|
||||
// Pointer to source code.
|
||||
// SrcDataLen
|
||||
// Size of source code, in bytes.
|
||||
// pDefines
|
||||
// Optional NULL-terminated array of preprocessor macro definitions.
|
||||
// pInclude
|
||||
// Optional interface pointer to use for handling #include directives.
|
||||
// If this parameter is NULL, #includes will be honored when compiling
|
||||
// from file, and will error when compiling from resource or memory.
|
||||
// pFunctionName
|
||||
// Name of the entrypoint function where execution should begin.
|
||||
// pProfile
|
||||
// Instruction set to be used when generating code. Currently supported
|
||||
// profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "vs_3_0",
|
||||
// "vs_3_sw", "vs_4_0", "vs_4_1",
|
||||
// "ps_2_0", "ps_2_a", "ps_2_b", "ps_2_sw", "ps_3_0",
|
||||
// "ps_3_sw", "ps_4_0", "ps_4_1",
|
||||
// "gs_4_0", "gs_4_1",
|
||||
// "tx_1_0",
|
||||
// "fx_4_0", "fx_4_1"
|
||||
// Note that this entrypoint does not compile fx_2_0 targets, for that
|
||||
// you need to use the D3DX9 function.
|
||||
// Flags1
|
||||
// See D3D10_SHADER_xxx flags.
|
||||
// Flags2
|
||||
// See D3D10_EFFECT_xxx flags.
|
||||
// ppShader
|
||||
// Returns a buffer containing the created shader. This buffer contains
|
||||
// the compiled shader code, as well as any embedded debug and symbol
|
||||
// table info. (See D3D10GetShaderConstantTable)
|
||||
// ppErrorMsgs
|
||||
// Returns a buffer containing a listing of errors and warnings that were
|
||||
// encountered during the compile. If you are running in a debugger,
|
||||
// these are the same messages you will see in your debug output.
|
||||
// pHResult
|
||||
// Pointer to a memory location to receive the return value upon completion.
|
||||
// Maybe NULL if not needed.
|
||||
// If pPump != NULL, pHResult must be a valid memory location until the
|
||||
// the asynchronous execution completes.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI D3DX11CompileFromFileA(LPCSTR pSrcFile,CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
|
||||
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX11CompileFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
|
||||
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX11CompileFromFile D3DX11CompileFromFileW
|
||||
#else
|
||||
#define D3DX11CompileFromFile D3DX11CompileFromFileA
|
||||
#endif
|
||||
|
||||
HRESULT WINAPI D3DX11CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX11CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX11CompileFromResource D3DX11CompileFromResourceW
|
||||
#else
|
||||
#define D3DX11CompileFromResource D3DX11CompileFromResourceA
|
||||
#endif
|
||||
|
||||
HRESULT WINAPI D3DX11CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
|
||||
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX11PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX11PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX11PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX11PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX11PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX11PreprocessShaderFromFile D3DX11PreprocessShaderFromFileW
|
||||
#define D3DX11PreprocessShaderFromResource D3DX11PreprocessShaderFromResourceW
|
||||
#else
|
||||
#define D3DX11PreprocessShaderFromFile D3DX11PreprocessShaderFromFileA
|
||||
#define D3DX11PreprocessShaderFromResource D3DX11PreprocessShaderFromResourceA
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Async processors
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI D3DX11CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
|
||||
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2,
|
||||
ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX11DataProcessor **ppProcessor);
|
||||
|
||||
HRESULT WINAPI D3DX11CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
|
||||
ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX11DataProcessor **ppProcessor);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11 Asynchronous texture I/O (advanced mode)
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI D3DX11CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX11DataLoader **ppDataLoader);
|
||||
HRESULT WINAPI D3DX11CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX11DataLoader **ppDataLoader);
|
||||
HRESULT WINAPI D3DX11CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX11DataLoader **ppDataLoader);
|
||||
HRESULT WINAPI D3DX11CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX11DataLoader **ppDataLoader);
|
||||
HRESULT WINAPI D3DX11CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX11DataLoader **ppDataLoader);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderW
|
||||
#define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderW
|
||||
#else
|
||||
#define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderA
|
||||
#define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderA
|
||||
#endif
|
||||
|
||||
HRESULT WINAPI D3DX11CreateAsyncTextureProcessor(ID3D11Device *pDevice, D3DX11_IMAGE_LOAD_INFO *pLoadInfo, ID3DX11DataProcessor **ppDataProcessor);
|
||||
HRESULT WINAPI D3DX11CreateAsyncTextureInfoProcessor(D3DX11_IMAGE_INFO *pImageInfo, ID3DX11DataProcessor **ppDataProcessor);
|
||||
HRESULT WINAPI D3DX11CreateAsyncShaderResourceViewProcessor(ID3D11Device *pDevice, D3DX11_IMAGE_LOAD_INFO *pLoadInfo, ID3DX11DataProcessor **ppDataProcessor);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3DX11ASYNC_H__
|
||||
|
||||
|
128
SDK/Include/D3DX11core.h
Normal file
128
SDK/Include/D3DX11core.h
Normal file
@ -0,0 +1,128 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||
//
|
||||
// File: d3dx11core.h
|
||||
// Content: D3DX11 core types and functions
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "d3dx11.h"
|
||||
|
||||
#ifndef __D3DX11CORE_H__
|
||||
#define __D3DX11CORE_H__
|
||||
|
||||
// Current name of the DLL shipped in the same SDK as this header.
|
||||
|
||||
|
||||
#define D3DX11_DLL_W L"d3dx11_43.dll"
|
||||
#define D3DX11_DLL_A "d3dx11_43.dll"
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX11_DLL D3DX11_DLL_W
|
||||
#else
|
||||
#define D3DX11_DLL D3DX11_DLL_A
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// D3DX11_SDK_VERSION:
|
||||
// -----------------
|
||||
// This identifier is passed to D3DX11CheckVersion in order to ensure that an
|
||||
// application was built against the correct header files and lib files.
|
||||
// This number is incremented whenever a header (or other) change would
|
||||
// require applications to be rebuilt. If the version doesn't match,
|
||||
// D3DX11CreateVersion will return FALSE. (The number itself has no meaning.)
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#define D3DX11_SDK_VERSION 43
|
||||
|
||||
|
||||
#ifdef D3D_DIAG_DLL
|
||||
BOOL WINAPI D3DX11DebugMute(BOOL Mute);
|
||||
#endif
|
||||
HRESULT WINAPI D3DX11CheckVersion(UINT D3DSdkVersion, UINT D3DX11SdkVersion);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DX11ThreadPump:
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DX11DataLoader
|
||||
|
||||
DECLARE_INTERFACE(ID3DX11DataLoader)
|
||||
{
|
||||
STDMETHOD(Load)(THIS) PURE;
|
||||
STDMETHOD(Decompress)(THIS_ void **ppData, SIZE_T *pcBytes) PURE;
|
||||
STDMETHOD(Destroy)(THIS) PURE;
|
||||
};
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DX11DataProcessor
|
||||
|
||||
DECLARE_INTERFACE(ID3DX11DataProcessor)
|
||||
{
|
||||
STDMETHOD(Process)(THIS_ void *pData, SIZE_T cBytes) PURE;
|
||||
STDMETHOD(CreateDeviceObject)(THIS_ void **ppDataObject) PURE;
|
||||
STDMETHOD(Destroy)(THIS) PURE;
|
||||
};
|
||||
|
||||
// {C93FECFA-6967-478a-ABBC-402D90621FCB}
|
||||
DEFINE_GUID(IID_ID3DX11ThreadPump,
|
||||
0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DX11ThreadPump
|
||||
|
||||
DECLARE_INTERFACE_(ID3DX11ThreadPump, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DX11ThreadPump
|
||||
STDMETHOD(AddWorkItem)(THIS_ ID3DX11DataLoader *pDataLoader, ID3DX11DataProcessor *pDataProcessor, HRESULT *pHResult, void **ppDeviceObject) PURE;
|
||||
STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE;
|
||||
|
||||
STDMETHOD(WaitForAllItems)(THIS) PURE;
|
||||
STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT iWorkItemCount);
|
||||
|
||||
STDMETHOD(PurgeAllItems)(THIS) PURE;
|
||||
STDMETHOD(GetQueueStatus)(THIS_ UINT *pIoQueue, UINT *pProcessQueue, UINT *pDeviceQueue) PURE;
|
||||
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
HRESULT WINAPI D3DX11CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX11ThreadPump **ppThreadPump);
|
||||
|
||||
HRESULT WINAPI D3DX11UnsetAllDeviceObjects(ID3D11DeviceContext *pContext);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define _FACD3D 0x876
|
||||
#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code )
|
||||
#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code )
|
||||
|
||||
#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156)
|
||||
#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540)
|
||||
|
||||
#endif //__D3DX11CORE_H__
|
||||
|
772
SDK/Include/D3DX11tex.h
Normal file
772
SDK/Include/D3DX11tex.h
Normal file
@ -0,0 +1,772 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||
//
|
||||
// File: d3dx11tex.h
|
||||
// Content: D3DX11 texturing APIs
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "d3dx11.h"
|
||||
|
||||
#ifndef __D3DX11TEX_H__
|
||||
#define __D3DX11TEX_H__
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11_FILTER flags:
|
||||
// ------------------
|
||||
//
|
||||
// A valid filter must contain one of these values:
|
||||
//
|
||||
// D3DX11_FILTER_NONE
|
||||
// No scaling or filtering will take place. Pixels outside the bounds
|
||||
// of the source image are assumed to be transparent black.
|
||||
// D3DX11_FILTER_POINT
|
||||
// Each destination pixel is computed by sampling the nearest pixel
|
||||
// from the source image.
|
||||
// D3DX11_FILTER_LINEAR
|
||||
// Each destination pixel is computed by linearly interpolating between
|
||||
// the nearest pixels in the source image. This filter works best
|
||||
// when the scale on each axis is less than 2.
|
||||
// D3DX11_FILTER_TRIANGLE
|
||||
// Every pixel in the source image contributes equally to the
|
||||
// destination image. This is the slowest of all the filters.
|
||||
// D3DX11_FILTER_BOX
|
||||
// Each pixel is computed by averaging a 2x2(x2) box pixels from
|
||||
// the source image. Only works when the dimensions of the
|
||||
// destination are half those of the source. (as with mip maps)
|
||||
//
|
||||
// And can be OR'd with any of these optional flags:
|
||||
//
|
||||
// D3DX11_FILTER_MIRROR_U
|
||||
// Indicates that pixels off the edge of the texture on the U-axis
|
||||
// should be mirrored, not wraped.
|
||||
// D3DX11_FILTER_MIRROR_V
|
||||
// Indicates that pixels off the edge of the texture on the V-axis
|
||||
// should be mirrored, not wraped.
|
||||
// D3DX11_FILTER_MIRROR_W
|
||||
// Indicates that pixels off the edge of the texture on the W-axis
|
||||
// should be mirrored, not wraped.
|
||||
// D3DX11_FILTER_MIRROR
|
||||
// Same as specifying D3DX11_FILTER_MIRROR_U | D3DX11_FILTER_MIRROR_V |
|
||||
// D3DX11_FILTER_MIRROR_V
|
||||
// D3DX11_FILTER_DITHER
|
||||
// Dithers the resulting image using a 4x4 order dither pattern.
|
||||
// D3DX11_FILTER_SRGB_IN
|
||||
// Denotes that the input data is in sRGB (gamma 2.2) colorspace.
|
||||
// D3DX11_FILTER_SRGB_OUT
|
||||
// Denotes that the output data is in sRGB (gamma 2.2) colorspace.
|
||||
// D3DX11_FILTER_SRGB
|
||||
// Same as specifying D3DX11_FILTER_SRGB_IN | D3DX11_FILTER_SRGB_OUT
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3DX11_FILTER_FLAG
|
||||
{
|
||||
D3DX11_FILTER_NONE = (1 << 0),
|
||||
D3DX11_FILTER_POINT = (2 << 0),
|
||||
D3DX11_FILTER_LINEAR = (3 << 0),
|
||||
D3DX11_FILTER_TRIANGLE = (4 << 0),
|
||||
D3DX11_FILTER_BOX = (5 << 0),
|
||||
|
||||
D3DX11_FILTER_MIRROR_U = (1 << 16),
|
||||
D3DX11_FILTER_MIRROR_V = (2 << 16),
|
||||
D3DX11_FILTER_MIRROR_W = (4 << 16),
|
||||
D3DX11_FILTER_MIRROR = (7 << 16),
|
||||
|
||||
D3DX11_FILTER_DITHER = (1 << 19),
|
||||
D3DX11_FILTER_DITHER_DIFFUSION= (2 << 19),
|
||||
|
||||
D3DX11_FILTER_SRGB_IN = (1 << 21),
|
||||
D3DX11_FILTER_SRGB_OUT = (2 << 21),
|
||||
D3DX11_FILTER_SRGB = (3 << 21),
|
||||
} D3DX11_FILTER_FLAG;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11_NORMALMAP flags:
|
||||
// ---------------------
|
||||
// These flags are used to control how D3DX11ComputeNormalMap generates normal
|
||||
// maps. Any number of these flags may be OR'd together in any combination.
|
||||
//
|
||||
// D3DX11_NORMALMAP_MIRROR_U
|
||||
// Indicates that pixels off the edge of the texture on the U-axis
|
||||
// should be mirrored, not wraped.
|
||||
// D3DX11_NORMALMAP_MIRROR_V
|
||||
// Indicates that pixels off the edge of the texture on the V-axis
|
||||
// should be mirrored, not wraped.
|
||||
// D3DX11_NORMALMAP_MIRROR
|
||||
// Same as specifying D3DX11_NORMALMAP_MIRROR_U | D3DX11_NORMALMAP_MIRROR_V
|
||||
// D3DX11_NORMALMAP_INVERTSIGN
|
||||
// Inverts the direction of each normal
|
||||
// D3DX11_NORMALMAP_COMPUTE_OCCLUSION
|
||||
// Compute the per pixel Occlusion term and encodes it into the alpha.
|
||||
// An Alpha of 1 means that the pixel is not obscured in anyway, and
|
||||
// an alpha of 0 would mean that the pixel is completly obscured.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3DX11_NORMALMAP_FLAG
|
||||
{
|
||||
D3DX11_NORMALMAP_MIRROR_U = (1 << 16),
|
||||
D3DX11_NORMALMAP_MIRROR_V = (2 << 16),
|
||||
D3DX11_NORMALMAP_MIRROR = (3 << 16),
|
||||
D3DX11_NORMALMAP_INVERTSIGN = (8 << 16),
|
||||
D3DX11_NORMALMAP_COMPUTE_OCCLUSION = (16 << 16),
|
||||
} D3DX11_NORMALMAP_FLAG;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11_CHANNEL flags:
|
||||
// -------------------
|
||||
// These flags are used by functions which operate on or more channels
|
||||
// in a texture.
|
||||
//
|
||||
// D3DX11_CHANNEL_RED
|
||||
// Indicates the red channel should be used
|
||||
// D3DX11_CHANNEL_BLUE
|
||||
// Indicates the blue channel should be used
|
||||
// D3DX11_CHANNEL_GREEN
|
||||
// Indicates the green channel should be used
|
||||
// D3DX11_CHANNEL_ALPHA
|
||||
// Indicates the alpha channel should be used
|
||||
// D3DX11_CHANNEL_LUMINANCE
|
||||
// Indicates the luminaces of the red green and blue channels should be
|
||||
// used.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3DX11_CHANNEL_FLAG
|
||||
{
|
||||
D3DX11_CHANNEL_RED = (1 << 0),
|
||||
D3DX11_CHANNEL_BLUE = (1 << 1),
|
||||
D3DX11_CHANNEL_GREEN = (1 << 2),
|
||||
D3DX11_CHANNEL_ALPHA = (1 << 3),
|
||||
D3DX11_CHANNEL_LUMINANCE = (1 << 4),
|
||||
} D3DX11_CHANNEL_FLAG;
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11_IMAGE_FILE_FORMAT:
|
||||
// ---------------------
|
||||
// This enum is used to describe supported image file formats.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3DX11_IMAGE_FILE_FORMAT
|
||||
{
|
||||
D3DX11_IFF_BMP = 0,
|
||||
D3DX11_IFF_JPG = 1,
|
||||
D3DX11_IFF_PNG = 3,
|
||||
D3DX11_IFF_DDS = 4,
|
||||
D3DX11_IFF_TIFF = 10,
|
||||
D3DX11_IFF_GIF = 11,
|
||||
D3DX11_IFF_WMP = 12,
|
||||
D3DX11_IFF_FORCE_DWORD = 0x7fffffff
|
||||
|
||||
} D3DX11_IMAGE_FILE_FORMAT;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11_SAVE_TEXTURE_FLAG:
|
||||
// ---------------------
|
||||
// This enum is used to support texture saving options.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3DX11_SAVE_TEXTURE_FLAG
|
||||
{
|
||||
D3DX11_STF_USEINPUTBLOB = 0x0001,
|
||||
} D3DX11_SAVE_TEXTURE_FLAG;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11_IMAGE_INFO:
|
||||
// ---------------
|
||||
// This structure is used to return a rough description of what the
|
||||
// the original contents of an image file looked like.
|
||||
//
|
||||
// Width
|
||||
// Width of original image in pixels
|
||||
// Height
|
||||
// Height of original image in pixels
|
||||
// Depth
|
||||
// Depth of original image in pixels
|
||||
// ArraySize
|
||||
// Array size in textures
|
||||
// MipLevels
|
||||
// Number of mip levels in original image
|
||||
// MiscFlags
|
||||
// Miscellaneous flags
|
||||
// Format
|
||||
// D3D format which most closely describes the data in original image
|
||||
// ResourceDimension
|
||||
// D3D11_RESOURCE_DIMENSION representing the dimension of texture stored in the file.
|
||||
// D3D11_RESOURCE_DIMENSION_TEXTURE1D, 2D, 3D
|
||||
// ImageFileFormat
|
||||
// D3DX11_IMAGE_FILE_FORMAT representing the format of the image file.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef struct D3DX11_IMAGE_INFO
|
||||
{
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
UINT Depth;
|
||||
UINT ArraySize;
|
||||
UINT MipLevels;
|
||||
UINT MiscFlags;
|
||||
DXGI_FORMAT Format;
|
||||
D3D11_RESOURCE_DIMENSION ResourceDimension;
|
||||
D3DX11_IMAGE_FILE_FORMAT ImageFileFormat;
|
||||
} D3DX11_IMAGE_INFO;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Image File APIs ///////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11_IMAGE_LOAD_INFO:
|
||||
// ---------------
|
||||
// This structure can be optionally passed in to texture loader APIs to
|
||||
// control how textures get loaded. Pass in D3DX11_DEFAULT for any of these
|
||||
// to have D3DX automatically pick defaults based on the source file.
|
||||
//
|
||||
// Width
|
||||
// Rescale texture to Width texels wide
|
||||
// Height
|
||||
// Rescale texture to Height texels high
|
||||
// Depth
|
||||
// Rescale texture to Depth texels deep
|
||||
// FirstMipLevel
|
||||
// First mip level to load
|
||||
// MipLevels
|
||||
// Number of mip levels to load after the first level
|
||||
// Usage
|
||||
// D3D11_USAGE flag for the new texture
|
||||
// BindFlags
|
||||
// D3D11 Bind flags for the new texture
|
||||
// CpuAccessFlags
|
||||
// D3D11 CPU Access flags for the new texture
|
||||
// MiscFlags
|
||||
// Reserved. Must be 0
|
||||
// Format
|
||||
// Resample texture to the specified format
|
||||
// Filter
|
||||
// Filter the texture using the specified filter (only when resampling)
|
||||
// MipFilter
|
||||
// Filter the texture mip levels using the specified filter (only if
|
||||
// generating mips)
|
||||
// pSrcInfo
|
||||
// (optional) pointer to a D3DX11_IMAGE_INFO structure that will get
|
||||
// populated with source image information
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
||||
typedef struct D3DX11_IMAGE_LOAD_INFO
|
||||
{
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
UINT Depth;
|
||||
UINT FirstMipLevel;
|
||||
UINT MipLevels;
|
||||
D3D11_USAGE Usage;
|
||||
UINT BindFlags;
|
||||
UINT CpuAccessFlags;
|
||||
UINT MiscFlags;
|
||||
DXGI_FORMAT Format;
|
||||
UINT Filter;
|
||||
UINT MipFilter;
|
||||
D3DX11_IMAGE_INFO* pSrcInfo;
|
||||
|
||||
#ifdef __cplusplus
|
||||
D3DX11_IMAGE_LOAD_INFO()
|
||||
{
|
||||
Width = D3DX11_DEFAULT;
|
||||
Height = D3DX11_DEFAULT;
|
||||
Depth = D3DX11_DEFAULT;
|
||||
FirstMipLevel = D3DX11_DEFAULT;
|
||||
MipLevels = D3DX11_DEFAULT;
|
||||
Usage = (D3D11_USAGE) D3DX11_DEFAULT;
|
||||
BindFlags = D3DX11_DEFAULT;
|
||||
CpuAccessFlags = D3DX11_DEFAULT;
|
||||
MiscFlags = D3DX11_DEFAULT;
|
||||
Format = DXGI_FORMAT_FROM_FILE;
|
||||
Filter = D3DX11_DEFAULT;
|
||||
MipFilter = D3DX11_DEFAULT;
|
||||
pSrcInfo = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
} D3DX11_IMAGE_LOAD_INFO;
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
// GetImageInfoFromFile/Resource/Memory:
|
||||
// ------------------------------
|
||||
// Fills in a D3DX11_IMAGE_INFO struct with information about an image file.
|
||||
//
|
||||
// Parameters:
|
||||
// pSrcFile
|
||||
// File name of the source image.
|
||||
// pSrcModule
|
||||
// Module where resource is located, or NULL for module associated
|
||||
// with image the os used to create the current process.
|
||||
// pSrcResource
|
||||
// Resource name.
|
||||
// pSrcData
|
||||
// Pointer to file in memory.
|
||||
// SrcDataSize
|
||||
// Size in bytes of file in memory.
|
||||
// pPump
|
||||
// Optional pointer to a thread pump object to use.
|
||||
// pSrcInfo
|
||||
// Pointer to a D3DX11_IMAGE_INFO structure to be filled in with the
|
||||
// description of the data in the source image file.
|
||||
// pHResult
|
||||
// Pointer to a memory location to receive the return value upon completion.
|
||||
// Maybe NULL if not needed.
|
||||
// If pPump != NULL, pHResult must be a valid memory location until the
|
||||
// the asynchronous execution completes.
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11GetImageInfoFromFileA(
|
||||
LPCSTR pSrcFile,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
D3DX11_IMAGE_INFO* pSrcInfo,
|
||||
HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11GetImageInfoFromFileW(
|
||||
LPCWSTR pSrcFile,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
D3DX11_IMAGE_INFO* pSrcInfo,
|
||||
HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX11GetImageInfoFromFile D3DX11GetImageInfoFromFileW
|
||||
#else
|
||||
#define D3DX11GetImageInfoFromFile D3DX11GetImageInfoFromFileA
|
||||
#endif
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11GetImageInfoFromResourceA(
|
||||
HMODULE hSrcModule,
|
||||
LPCSTR pSrcResource,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
D3DX11_IMAGE_INFO* pSrcInfo,
|
||||
HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11GetImageInfoFromResourceW(
|
||||
HMODULE hSrcModule,
|
||||
LPCWSTR pSrcResource,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
D3DX11_IMAGE_INFO* pSrcInfo,
|
||||
HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX11GetImageInfoFromResource D3DX11GetImageInfoFromResourceW
|
||||
#else
|
||||
#define D3DX11GetImageInfoFromResource D3DX11GetImageInfoFromResourceA
|
||||
#endif
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11GetImageInfoFromMemory(
|
||||
LPCVOID pSrcData,
|
||||
SIZE_T SrcDataSize,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
D3DX11_IMAGE_INFO* pSrcInfo,
|
||||
HRESULT* pHResult);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Create/Save Texture APIs //////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11CreateTextureFromFile/Resource/Memory:
|
||||
// D3DX11CreateShaderResourceViewFromFile/Resource/Memory:
|
||||
// -----------------------------------
|
||||
// Create a texture object from a file or resource.
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
// pDevice
|
||||
// The D3D device with which the texture is going to be used.
|
||||
// pSrcFile
|
||||
// File name.
|
||||
// hSrcModule
|
||||
// Module handle. if NULL, current module will be used.
|
||||
// pSrcResource
|
||||
// Resource name in module
|
||||
// pvSrcData
|
||||
// Pointer to file in memory.
|
||||
// SrcDataSize
|
||||
// Size in bytes of file in memory.
|
||||
// pLoadInfo
|
||||
// Optional pointer to a D3DX11_IMAGE_LOAD_INFO structure that
|
||||
// contains additional loader parameters.
|
||||
// pPump
|
||||
// Optional pointer to a thread pump object to use.
|
||||
// ppTexture
|
||||
// [out] Created texture object.
|
||||
// ppShaderResourceView
|
||||
// [out] Shader resource view object created.
|
||||
// pHResult
|
||||
// Pointer to a memory location to receive the return value upon completion.
|
||||
// Maybe NULL if not needed.
|
||||
// If pPump != NULL, pHResult must be a valid memory location until the
|
||||
// the asynchronous execution completes.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// FromFile
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11CreateShaderResourceViewFromFileA(
|
||||
ID3D11Device* pDevice,
|
||||
LPCSTR pSrcFile,
|
||||
D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
ID3D11ShaderResourceView** ppShaderResourceView,
|
||||
HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11CreateShaderResourceViewFromFileW(
|
||||
ID3D11Device* pDevice,
|
||||
LPCWSTR pSrcFile,
|
||||
D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
ID3D11ShaderResourceView** ppShaderResourceView,
|
||||
HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX11CreateShaderResourceViewFromFile D3DX11CreateShaderResourceViewFromFileW
|
||||
#else
|
||||
#define D3DX11CreateShaderResourceViewFromFile D3DX11CreateShaderResourceViewFromFileA
|
||||
#endif
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11CreateTextureFromFileA(
|
||||
ID3D11Device* pDevice,
|
||||
LPCSTR pSrcFile,
|
||||
D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
ID3D11Resource** ppTexture,
|
||||
HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11CreateTextureFromFileW(
|
||||
ID3D11Device* pDevice,
|
||||
LPCWSTR pSrcFile,
|
||||
D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
ID3D11Resource** ppTexture,
|
||||
HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX11CreateTextureFromFile D3DX11CreateTextureFromFileW
|
||||
#else
|
||||
#define D3DX11CreateTextureFromFile D3DX11CreateTextureFromFileA
|
||||
#endif
|
||||
|
||||
|
||||
// FromResource (resources in dll/exes)
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11CreateShaderResourceViewFromResourceA(
|
||||
ID3D11Device* pDevice,
|
||||
HMODULE hSrcModule,
|
||||
LPCSTR pSrcResource,
|
||||
D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
ID3D11ShaderResourceView** ppShaderResourceView,
|
||||
HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11CreateShaderResourceViewFromResourceW(
|
||||
ID3D11Device* pDevice,
|
||||
HMODULE hSrcModule,
|
||||
LPCWSTR pSrcResource,
|
||||
D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
ID3D11ShaderResourceView** ppShaderResourceView,
|
||||
HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX11CreateShaderResourceViewFromResource D3DX11CreateShaderResourceViewFromResourceW
|
||||
#else
|
||||
#define D3DX11CreateShaderResourceViewFromResource D3DX11CreateShaderResourceViewFromResourceA
|
||||
#endif
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11CreateTextureFromResourceA(
|
||||
ID3D11Device* pDevice,
|
||||
HMODULE hSrcModule,
|
||||
LPCSTR pSrcResource,
|
||||
D3DX11_IMAGE_LOAD_INFO *pLoadInfo,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
ID3D11Resource** ppTexture,
|
||||
HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11CreateTextureFromResourceW(
|
||||
ID3D11Device* pDevice,
|
||||
HMODULE hSrcModule,
|
||||
LPCWSTR pSrcResource,
|
||||
D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
ID3D11Resource** ppTexture,
|
||||
HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX11CreateTextureFromResource D3DX11CreateTextureFromResourceW
|
||||
#else
|
||||
#define D3DX11CreateTextureFromResource D3DX11CreateTextureFromResourceA
|
||||
#endif
|
||||
|
||||
|
||||
// FromFileInMemory
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11CreateShaderResourceViewFromMemory(
|
||||
ID3D11Device* pDevice,
|
||||
LPCVOID pSrcData,
|
||||
SIZE_T SrcDataSize,
|
||||
D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
ID3D11ShaderResourceView** ppShaderResourceView,
|
||||
HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11CreateTextureFromMemory(
|
||||
ID3D11Device* pDevice,
|
||||
LPCVOID pSrcData,
|
||||
SIZE_T SrcDataSize,
|
||||
D3DX11_IMAGE_LOAD_INFO* pLoadInfo,
|
||||
ID3DX11ThreadPump* pPump,
|
||||
ID3D11Resource** ppTexture,
|
||||
HRESULT* pHResult);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Misc Texture APIs /////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11_TEXTURE_LOAD_INFO:
|
||||
// ------------------------
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef struct _D3DX11_TEXTURE_LOAD_INFO
|
||||
{
|
||||
D3D11_BOX *pSrcBox;
|
||||
D3D11_BOX *pDstBox;
|
||||
UINT SrcFirstMip;
|
||||
UINT DstFirstMip;
|
||||
UINT NumMips;
|
||||
UINT SrcFirstElement;
|
||||
UINT DstFirstElement;
|
||||
UINT NumElements;
|
||||
UINT Filter;
|
||||
UINT MipFilter;
|
||||
|
||||
#ifdef __cplusplus
|
||||
_D3DX11_TEXTURE_LOAD_INFO()
|
||||
{
|
||||
pSrcBox = NULL;
|
||||
pDstBox = NULL;
|
||||
SrcFirstMip = 0;
|
||||
DstFirstMip = 0;
|
||||
NumMips = D3DX11_DEFAULT;
|
||||
SrcFirstElement = 0;
|
||||
DstFirstElement = 0;
|
||||
NumElements = D3DX11_DEFAULT;
|
||||
Filter = D3DX11_DEFAULT;
|
||||
MipFilter = D3DX11_DEFAULT;
|
||||
}
|
||||
#endif
|
||||
|
||||
} D3DX11_TEXTURE_LOAD_INFO;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11LoadTextureFromTexture:
|
||||
// ----------------------------
|
||||
// Load a texture from a texture.
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11LoadTextureFromTexture(
|
||||
ID3D11DeviceContext *pContext,
|
||||
ID3D11Resource *pSrcTexture,
|
||||
D3DX11_TEXTURE_LOAD_INFO *pLoadInfo,
|
||||
ID3D11Resource *pDstTexture);
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11FilterTexture:
|
||||
// ------------------
|
||||
// Filters mipmaps levels of a texture.
|
||||
//
|
||||
// Parameters:
|
||||
// pBaseTexture
|
||||
// The texture object to be filtered
|
||||
// SrcLevel
|
||||
// The level whose image is used to generate the subsequent levels.
|
||||
// MipFilter
|
||||
// D3DX11_FILTER flags controlling how each miplevel is filtered.
|
||||
// Or D3DX11_DEFAULT for D3DX11_FILTER_BOX,
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11FilterTexture(
|
||||
ID3D11DeviceContext *pContext,
|
||||
ID3D11Resource *pTexture,
|
||||
UINT SrcLevel,
|
||||
UINT MipFilter);
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11SaveTextureToFile:
|
||||
// ----------------------
|
||||
// Save a texture to a file.
|
||||
//
|
||||
// Parameters:
|
||||
// pDestFile
|
||||
// File name of the destination file
|
||||
// DestFormat
|
||||
// D3DX11_IMAGE_FILE_FORMAT specifying file format to use when saving.
|
||||
// pSrcTexture
|
||||
// Source texture, containing the image to be saved
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11SaveTextureToFileA(
|
||||
ID3D11DeviceContext *pContext,
|
||||
ID3D11Resource *pSrcTexture,
|
||||
D3DX11_IMAGE_FILE_FORMAT DestFormat,
|
||||
LPCSTR pDestFile);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11SaveTextureToFileW(
|
||||
ID3D11DeviceContext *pContext,
|
||||
ID3D11Resource *pSrcTexture,
|
||||
D3DX11_IMAGE_FILE_FORMAT DestFormat,
|
||||
LPCWSTR pDestFile);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX11SaveTextureToFile D3DX11SaveTextureToFileW
|
||||
#else
|
||||
#define D3DX11SaveTextureToFile D3DX11SaveTextureToFileA
|
||||
#endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11SaveTextureToMemory:
|
||||
// ----------------------
|
||||
// Save a texture to a blob.
|
||||
//
|
||||
// Parameters:
|
||||
// pSrcTexture
|
||||
// Source texture, containing the image to be saved
|
||||
// DestFormat
|
||||
// D3DX11_IMAGE_FILE_FORMAT specifying file format to use when saving.
|
||||
// ppDestBuf
|
||||
// address of a d3dxbuffer pointer to return the image data
|
||||
// Flags
|
||||
// optional flags
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11SaveTextureToMemory(
|
||||
ID3D11DeviceContext *pContext,
|
||||
ID3D11Resource* pSrcTexture,
|
||||
D3DX11_IMAGE_FILE_FORMAT DestFormat,
|
||||
ID3D10Blob** ppDestBuf,
|
||||
UINT Flags);
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11ComputeNormalMap:
|
||||
// ---------------------
|
||||
// Converts a height map into a normal map. The (x,y,z) components of each
|
||||
// normal are mapped to the (r,g,b) channels of the output texture.
|
||||
//
|
||||
// Parameters
|
||||
// pSrcTexture
|
||||
// Pointer to the source heightmap texture
|
||||
// Flags
|
||||
// D3DX11_NORMALMAP flags
|
||||
// Channel
|
||||
// D3DX11_CHANNEL specifying source of height information
|
||||
// Amplitude
|
||||
// The constant value which the height information is multiplied by.
|
||||
// pDestTexture
|
||||
// Pointer to the destination texture
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11ComputeNormalMap(
|
||||
ID3D11DeviceContext *pContext,
|
||||
ID3D11Texture2D *pSrcTexture,
|
||||
UINT Flags,
|
||||
UINT Channel,
|
||||
FLOAT Amplitude,
|
||||
ID3D11Texture2D *pDestTexture);
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX11SHProjectCubeMap:
|
||||
// ----------------------
|
||||
// Projects a function represented in a cube map into spherical harmonics.
|
||||
//
|
||||
// Parameters:
|
||||
// Order
|
||||
// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1
|
||||
// pCubeMap
|
||||
// CubeMap that is going to be projected into spherical harmonics
|
||||
// pROut
|
||||
// Output SH vector for Red.
|
||||
// pGOut
|
||||
// Output SH vector for Green
|
||||
// pBOut
|
||||
// Output SH vector for Blue
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DX11SHProjectCubeMap(
|
||||
ID3D11DeviceContext *pContext,
|
||||
__in_range(2,6) UINT Order,
|
||||
ID3D11Texture2D *pCubeMap,
|
||||
__out_ecount(Order*Order) FLOAT *pROut,
|
||||
__out_ecount_opt(Order*Order) FLOAT *pGOut,
|
||||
__out_ecount_opt(Order*Order) FLOAT *pBOut);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3DX11TEX_H__
|
||||
|
800
SDK/Include/D3DX_DXGIFormatConvert.inl
Normal file
800
SDK/Include/D3DX_DXGIFormatConvert.inl
Normal file
@ -0,0 +1,800 @@
|
||||
//=============================================================================
|
||||
// D3D11 HLSL Routines for Manual Pack/Unpack of 32-bit DXGI_FORMAT_*
|
||||
//=============================================================================
|
||||
//
|
||||
// This file contains format conversion routines for use in the
|
||||
// Compute Shader or Pixel Shader on D3D11 Hardware.
|
||||
//
|
||||
// Skip to the end of this comment to see a summary of the routines
|
||||
// provided. The rest of the text below explains why they are needed
|
||||
// and how to use them.
|
||||
//
|
||||
// The scenario where these can be useful is if your application
|
||||
// needs to simultaneously both read and write texture - i.e. in-place
|
||||
// image editing.
|
||||
//
|
||||
// D3D11's Unordered Access View (UAV) of a Texture1D/2D/3D resource
|
||||
// allows random access reads and writes to memory from a Compute Shader
|
||||
// or Pixel Shader. However, the only texture format that supports this
|
||||
// is DXGI_FORMAT_R32_UINT. e.g. Other more interesting formats like
|
||||
// DXGI_FORMAT_R8G8B8A8_UNORM do not support simultaneous read and
|
||||
// write. You can use such formats for random access writing only
|
||||
// using a UAV, or reading only using a Shader Resource View (SRV).
|
||||
// But for simultaneous read+write, the format conversion hardware is
|
||||
// not available.
|
||||
//
|
||||
// There is a workaround to this limitation, involving casting the texture
|
||||
// to R32_UINT when creating a UAV, as long as the original format of the
|
||||
// resource supports it (most 32 bit per element formats). This allows
|
||||
// simultaneous read+write as long as the shader does manual format
|
||||
// unpacking on read and packing on write.
|
||||
//
|
||||
// The benefit is that later on, other views such as RenderTarget Views
|
||||
// or ShaderResource Views on the same texture can be used with the
|
||||
// proper format (e.g. DXGI_FORMAT_R16G16_FLOAT) so the hardware can
|
||||
// do the usual automatic format unpack/pack and do texture filtering etc.
|
||||
// where there are no hardware limitations.
|
||||
//
|
||||
// The sequence of actions for an application is the following:
|
||||
//
|
||||
// Suppose you want to make a texture than you can use a Pixel Shader
|
||||
// or Compute Shader to perform in-place editing, and that the format
|
||||
// you want the data to be stored in happens to be a descendent
|
||||
// of of one of these formats:
|
||||
//
|
||||
// DXGI_FORMAT_R10G10B10A2_TYPELESS
|
||||
// DXGI_FORMAT_R8G8B8A8_TYPELESS
|
||||
// DXGI_FORMAT_B8G8R8A8_TYPELESS
|
||||
// DXGI_FORMAT_B8G8R8X8_TYPELESS
|
||||
// DXGI_FORMAT_R16G16_TYPELESS
|
||||
//
|
||||
// e.g. DXGI_FORMAT_R10G10B10A2_UNORM is a descendent of
|
||||
// DXGI_FORMAT_R10G10B10A2_TYPELESS, so it supports the
|
||||
// usage pattern described here.
|
||||
//
|
||||
// (Formats descending from DXGI_FORMAT_R32_TYPELESS, such as
|
||||
// DXGI_FORMAT_R32_FLOAT, are trivially supported without
|
||||
// needing any of the format conversion help provided here.)
|
||||
//
|
||||
// Steps:
|
||||
//
|
||||
// (1) Create a texture with the appropriate _TYPELESS format above
|
||||
// along with the needed bind flags, such as
|
||||
// D3D11_BIND_UNORDERED_ACCESS | D3D11_BIND_SHADER_RESOURCE.
|
||||
//
|
||||
// (2) For in-place image editing, create a UAV with the format
|
||||
// DXGI_FORMAT_R32_UINT. D3D normally doesn't allow casting
|
||||
// between different format "families", but the API makes
|
||||
// an exception here.
|
||||
//
|
||||
// (3) In the Compute Shader or Pixel Shader, use the appropriate
|
||||
// format pack/unpack routines provided in this file.
|
||||
// For example if the DXGI_FORMAT_R32_UINT UAV really holds
|
||||
// DXGI_FORMAT_R10G10B10A2_UNORM data, then, after reading a
|
||||
// uint from the UAV into the shader, unpack by calling:
|
||||
//
|
||||
// XMFLOAT4 D3DX_R10G10B10A2_UNORM_to_FLOAT4(UINT packedInput)
|
||||
//
|
||||
// Then to write to the UAV in the same shader, call the following
|
||||
// to pack shader data into a uint that can be written out:
|
||||
//
|
||||
// UINT D3DX_FLOAT4_to_R10G10B10A2_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
|
||||
//
|
||||
// (4) Other views, such as SRVs, can be created with the desired format;
|
||||
// e.g. DXGI_FORMAT_R10G10B10A2_UNORM if the resource was created as
|
||||
// DXGI_FORMAT_R10G10B10A2_TYPELESS. When that view is accessed by a
|
||||
// shader, the hardware can do automatic type conversion as usual.
|
||||
//
|
||||
// Note, again, that if the shader only needs to write to a UAV, or read
|
||||
// as an SRV, then none of this is needed - fully typed UAV or SRVs can
|
||||
// be used. Only if simultaneous reading and writing to a UAV of a texture
|
||||
// is needed are the format conversion routines provided here potentially
|
||||
// useful.
|
||||
//
|
||||
// The following is the list of format conversion routines included in this
|
||||
// file, categorized by the DXGI_FORMAT they unpack/pack. Each of the
|
||||
// formats supported descends from one of the TYPELESS formats listed
|
||||
// above, and supports casting to DXGI_FORMAT_R32_UINT as a UAV.
|
||||
//
|
||||
// DXGI_FORMAT_R10G10B10A2_UNORM:
|
||||
//
|
||||
// XMFLOAT4 D3DX_R10G10B10A2_UNORM_to_FLOAT4(UINT packedInput)
|
||||
// UINT D3DX_FLOAT4_to_R10G10B10A2_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
|
||||
//
|
||||
// DXGI_FORMAT_R10G10B10A2_UINT:
|
||||
//
|
||||
// XMUINT4 D3DX_R10G10B10A2_UINT_to_UINT4(UINT packedInput)
|
||||
// UINT D3DX_UINT4_to_R10G10B10A2_UINT(XMUINT4 unpackedInput)
|
||||
//
|
||||
// DXGI_FORMAT_R8G8B8A8_UNORM:
|
||||
//
|
||||
// XMFLOAT4 D3DX_R8G8B8A8_UNORM_to_FLOAT4(UINT packedInput)
|
||||
// UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
|
||||
//
|
||||
// DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
|
||||
//
|
||||
// XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput) *
|
||||
// XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput)
|
||||
// UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput)
|
||||
//
|
||||
// * The "_inexact" function above uses shader instructions that don't
|
||||
// have high enough precision to give the exact answer, albeit close.
|
||||
// The alternative function uses a lookup table stored in the shader
|
||||
// to give an exact SRGB->float conversion.
|
||||
//
|
||||
// DXGI_FORMAT_R8G8B8A8_UINT:
|
||||
//
|
||||
// XMUINT4 D3DX_R8G8B8A8_UINT_to_UINT4(UINT packedInput)
|
||||
// XMUINT D3DX_UINT4_to_R8G8B8A8_UINT(XMUINT4 unpackedInput)
|
||||
//
|
||||
// DXGI_FORMAT_R8G8B8A8_SNORM:
|
||||
//
|
||||
// XMFLOAT4 D3DX_R8G8B8A8_SNORM_to_FLOAT4(UINT packedInput)
|
||||
// UINT D3DX_FLOAT4_to_R8G8B8A8_SNORM(hlsl_precise XMFLOAT4 unpackedInput)
|
||||
//
|
||||
// DXGI_FORMAT_R8G8B8A8_SINT:
|
||||
//
|
||||
// XMINT4 D3DX_R8G8B8A8_SINT_to_INT4(UINT packedInput)
|
||||
// UINT D3DX_INT4_to_R8G8B8A8_SINT(XMINT4 unpackedInput)
|
||||
//
|
||||
// DXGI_FORMAT_B8G8R8A8_UNORM:
|
||||
//
|
||||
// XMFLOAT4 D3DX_B8G8R8A8_UNORM_to_FLOAT4(UINT packedInput)
|
||||
// UINT D3DX_FLOAT4_to_B8G8R8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
|
||||
//
|
||||
// DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
|
||||
//
|
||||
// XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput) *
|
||||
// XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput)
|
||||
// UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput)
|
||||
//
|
||||
// * The "_inexact" function above uses shader instructions that don't
|
||||
// have high enough precision to give the exact answer, albeit close.
|
||||
// The alternative function uses a lookup table stored in the shader
|
||||
// to give an exact SRGB->float conversion.
|
||||
//
|
||||
// DXGI_FORMAT_B8G8R8X8_UNORM:
|
||||
//
|
||||
// XMFLOAT3 D3DX_B8G8R8X8_UNORM_to_FLOAT3(UINT packedInput)
|
||||
// UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM(hlsl_precise XMFLOAT3 unpackedInput)
|
||||
//
|
||||
// DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
|
||||
//
|
||||
// XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3_inexact(UINT packedInput) *
|
||||
// XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3(UINT packedInput)
|
||||
// UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM_SRGB(hlsl_precise XMFLOAT3 unpackedInput)
|
||||
//
|
||||
// * The "_inexact" function above uses shader instructions that don't
|
||||
// have high enough precision to give the exact answer, albeit close.
|
||||
// The alternative function uses a lookup table stored in the shader
|
||||
// to give an exact SRGB->float conversion.
|
||||
//
|
||||
// DXGI_FORMAT_R16G16_FLOAT:
|
||||
//
|
||||
// XMFLOAT2 D3DX_R16G16_FLOAT_to_FLOAT2(UINT packedInput)
|
||||
// UINT D3DX_FLOAT2_to_R16G16_FLOAT(hlsl_precise XMFLOAT2 unpackedInput)
|
||||
//
|
||||
// DXGI_FORMAT_R16G16_UNORM:
|
||||
//
|
||||
// XMFLOAT2 D3DX_R16G16_UNORM_to_FLOAT2(UINT packedInput)
|
||||
// UINT D3DX_FLOAT2_to_R16G16_UNORM(hlsl_precise FLOAT2 unpackedInput)
|
||||
//
|
||||
// DXGI_FORMAT_R16G16_UINT:
|
||||
//
|
||||
// XMUINT2 D3DX_R16G16_UINT_to_UINT2(UINT packedInput)
|
||||
// UINT D3DX_UINT2_to_R16G16_UINT(XMUINT2 unpackedInput)
|
||||
//
|
||||
// DXGI_FORMAT_R16G16_SNORM:
|
||||
//
|
||||
// XMFLOAT2 D3DX_R16G16_SNORM_to_FLOAT2(UINT packedInput)
|
||||
// UINT D3DX_FLOAT2_to_R16G16_SNORM(hlsl_precise XMFLOAT2 unpackedInput)
|
||||
//
|
||||
// DXGI_FORMAT_R16G16_SINT:
|
||||
//
|
||||
// XMINT2 D3DX_R16G16_SINT_to_INT2(UINT packedInput)
|
||||
// UINT D3DX_INT2_to_R16G16_SINT(XMINT2 unpackedInput)
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef __D3DX_DXGI_FORMAT_CONVERT_INL___
|
||||
#define __D3DX_DXGI_FORMAT_CONVERT_INL___
|
||||
|
||||
#if HLSL_VERSION > 0
|
||||
|
||||
#define D3DX11INLINE
|
||||
|
||||
typedef int INT;
|
||||
typedef uint UINT;
|
||||
|
||||
typedef float2 XMFLOAT2;
|
||||
typedef float3 XMFLOAT3;
|
||||
typedef float4 XMFLOAT4;
|
||||
typedef int2 XMINT2;
|
||||
typedef int4 XMINT4;
|
||||
typedef uint2 XMUINT2;
|
||||
typedef uint4 XMUINT4;
|
||||
|
||||
#define hlsl_precise precise
|
||||
|
||||
#define D3DX_Saturate_FLOAT(_V) saturate(_V)
|
||||
#define D3DX_IsNan(_V) isnan(_V)
|
||||
#define D3DX_Truncate_FLOAT(_V) trunc(_V)
|
||||
|
||||
#else // HLSL_VERSION > 0
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error C++ compilation required
|
||||
#endif
|
||||
|
||||
#include <float.h>
|
||||
#include <xnamath.h>
|
||||
|
||||
#define hlsl_precise
|
||||
|
||||
D3DX11INLINE FLOAT D3DX_Saturate_FLOAT(FLOAT _V)
|
||||
{
|
||||
return min(max(_V, 0), 1);
|
||||
}
|
||||
D3DX11INLINE bool D3DX_IsNan(FLOAT _V)
|
||||
{
|
||||
return _V != _V;
|
||||
}
|
||||
D3DX11INLINE FLOAT D3DX_Truncate_FLOAT(FLOAT _V)
|
||||
{
|
||||
return _V >= 0 ? floor(_V) : ceil(_V);
|
||||
}
|
||||
|
||||
// 2D Vector; 32 bit signed integer components
|
||||
typedef struct _XMINT2
|
||||
{
|
||||
INT x;
|
||||
INT y;
|
||||
} XMINT2;
|
||||
|
||||
// 2D Vector; 32 bit unsigned integer components
|
||||
typedef struct _XMUINT2
|
||||
{
|
||||
UINT x;
|
||||
UINT y;
|
||||
} XMUINT2;
|
||||
|
||||
// 4D Vector; 32 bit signed integer components
|
||||
typedef struct _XMINT4
|
||||
{
|
||||
INT x;
|
||||
INT y;
|
||||
INT z;
|
||||
INT w;
|
||||
} XMINT4;
|
||||
|
||||
// 4D Vector; 32 bit unsigned integer components
|
||||
typedef struct _XMUINT4
|
||||
{
|
||||
UINT x;
|
||||
UINT y;
|
||||
UINT z;
|
||||
UINT w;
|
||||
} XMUINT4;
|
||||
|
||||
#endif // HLSL_VERSION > 0
|
||||
|
||||
//=============================================================================
|
||||
// SRGB Helper Functions Called By Conversions Further Below.
|
||||
//=============================================================================
|
||||
// SRGB_to_FLOAT_inexact is imprecise due to precision of pow implementations.
|
||||
// If exact SRGB->float conversion is needed, a table lookup is provided
|
||||
// further below.
|
||||
D3DX11INLINE FLOAT D3DX_SRGB_to_FLOAT_inexact(hlsl_precise FLOAT val)
|
||||
{
|
||||
if( val < 0.04045f )
|
||||
val /= 12.92f;
|
||||
else
|
||||
val = pow((val + 0.055f)/1.055f,2.4f);
|
||||
return val;
|
||||
}
|
||||
|
||||
static const UINT D3DX_SRGBTable[] =
|
||||
{
|
||||
0x00000000,0x399f22b4,0x3a1f22b4,0x3a6eb40e,0x3a9f22b4,0x3ac6eb61,0x3aeeb40e,0x3b0b3e5d,
|
||||
0x3b1f22b4,0x3b33070b,0x3b46eb61,0x3b5b518d,0x3b70f18d,0x3b83e1c6,0x3b8fe616,0x3b9c87fd,
|
||||
0x3ba9c9b7,0x3bb7ad6f,0x3bc63549,0x3bd56361,0x3be539c1,0x3bf5ba70,0x3c0373b5,0x3c0c6152,
|
||||
0x3c15a703,0x3c1f45be,0x3c293e6b,0x3c3391f7,0x3c3e4149,0x3c494d43,0x3c54b6c7,0x3c607eb1,
|
||||
0x3c6ca5df,0x3c792d22,0x3c830aa8,0x3c89af9f,0x3c9085db,0x3c978dc5,0x3c9ec7c2,0x3ca63433,
|
||||
0x3cadd37d,0x3cb5a601,0x3cbdac20,0x3cc5e639,0x3cce54ab,0x3cd6f7d5,0x3cdfd010,0x3ce8ddb9,
|
||||
0x3cf2212c,0x3cfb9ac1,0x3d02a569,0x3d0798dc,0x3d0ca7e6,0x3d11d2af,0x3d171963,0x3d1c7c2e,
|
||||
0x3d21fb3c,0x3d2796b2,0x3d2d4ebb,0x3d332380,0x3d39152b,0x3d3f23e3,0x3d454fd1,0x3d4b991c,
|
||||
0x3d51ffef,0x3d58846a,0x3d5f26b7,0x3d65e6fe,0x3d6cc564,0x3d73c20f,0x3d7add29,0x3d810b67,
|
||||
0x3d84b795,0x3d887330,0x3d8c3e4a,0x3d9018f6,0x3d940345,0x3d97fd4a,0x3d9c0716,0x3da020bb,
|
||||
0x3da44a4b,0x3da883d7,0x3daccd70,0x3db12728,0x3db59112,0x3dba0b3b,0x3dbe95b5,0x3dc33092,
|
||||
0x3dc7dbe2,0x3dcc97b6,0x3dd1641f,0x3dd6412c,0x3ddb2eef,0x3de02d77,0x3de53cd5,0x3dea5d19,
|
||||
0x3def8e52,0x3df4d091,0x3dfa23e8,0x3dff8861,0x3e027f07,0x3e054280,0x3e080ea3,0x3e0ae378,
|
||||
0x3e0dc105,0x3e10a754,0x3e13966b,0x3e168e52,0x3e198f10,0x3e1c98ad,0x3e1fab30,0x3e22c6a3,
|
||||
0x3e25eb09,0x3e29186c,0x3e2c4ed0,0x3e2f8e41,0x3e32d6c4,0x3e362861,0x3e39831e,0x3e3ce703,
|
||||
0x3e405416,0x3e43ca5f,0x3e4749e4,0x3e4ad2ae,0x3e4e64c2,0x3e520027,0x3e55a4e6,0x3e595303,
|
||||
0x3e5d0a8b,0x3e60cb7c,0x3e6495e0,0x3e6869bf,0x3e6c4720,0x3e702e0c,0x3e741e84,0x3e781890,
|
||||
0x3e7c1c38,0x3e8014c2,0x3e82203c,0x3e84308d,0x3e8645ba,0x3e885fc5,0x3e8a7eb2,0x3e8ca283,
|
||||
0x3e8ecb3d,0x3e90f8e1,0x3e932b74,0x3e9562f8,0x3e979f71,0x3e99e0e2,0x3e9c274e,0x3e9e72b7,
|
||||
0x3ea0c322,0x3ea31892,0x3ea57308,0x3ea7d289,0x3eaa3718,0x3eaca0b7,0x3eaf0f69,0x3eb18333,
|
||||
0x3eb3fc18,0x3eb67a18,0x3eb8fd37,0x3ebb8579,0x3ebe12e1,0x3ec0a571,0x3ec33d2d,0x3ec5da17,
|
||||
0x3ec87c33,0x3ecb2383,0x3ecdd00b,0x3ed081cd,0x3ed338cc,0x3ed5f50b,0x3ed8b68d,0x3edb7d54,
|
||||
0x3ede4965,0x3ee11ac1,0x3ee3f16b,0x3ee6cd67,0x3ee9aeb6,0x3eec955d,0x3eef815d,0x3ef272ba,
|
||||
0x3ef56976,0x3ef86594,0x3efb6717,0x3efe6e02,0x3f00bd2d,0x3f02460e,0x3f03d1a7,0x3f055ff9,
|
||||
0x3f06f106,0x3f0884cf,0x3f0a1b56,0x3f0bb49b,0x3f0d50a0,0x3f0eef67,0x3f1090f1,0x3f12353e,
|
||||
0x3f13dc51,0x3f15862b,0x3f1732cd,0x3f18e239,0x3f1a946f,0x3f1c4971,0x3f1e0141,0x3f1fbbdf,
|
||||
0x3f21794e,0x3f23398e,0x3f24fca0,0x3f26c286,0x3f288b41,0x3f2a56d3,0x3f2c253d,0x3f2df680,
|
||||
0x3f2fca9e,0x3f31a197,0x3f337b6c,0x3f355820,0x3f3737b3,0x3f391a26,0x3f3aff7c,0x3f3ce7b5,
|
||||
0x3f3ed2d2,0x3f40c0d4,0x3f42b1be,0x3f44a590,0x3f469c4b,0x3f4895f1,0x3f4a9282,0x3f4c9201,
|
||||
0x3f4e946e,0x3f5099cb,0x3f52a218,0x3f54ad57,0x3f56bb8a,0x3f58ccb0,0x3f5ae0cd,0x3f5cf7e0,
|
||||
0x3f5f11ec,0x3f612eee,0x3f634eef,0x3f6571e9,0x3f6797e3,0x3f69c0d6,0x3f6beccd,0x3f6e1bbf,
|
||||
0x3f704db8,0x3f7282af,0x3f74baae,0x3f76f5ae,0x3f7933b9,0x3f7b74c6,0x3f7db8e0,0x3f800000
|
||||
};
|
||||
|
||||
D3DX11INLINE FLOAT D3DX_SRGB_to_FLOAT(UINT val)
|
||||
{
|
||||
#if HLSL_VERSION > 0
|
||||
return asfloat(D3DX_SRGBTable[val]);
|
||||
#else
|
||||
return *(FLOAT*)&D3DX_SRGBTable[val];
|
||||
#endif
|
||||
}
|
||||
|
||||
D3DX11INLINE FLOAT D3DX_FLOAT_to_SRGB(hlsl_precise FLOAT val)
|
||||
{
|
||||
if( val < 0.0031308f )
|
||||
val *= 12.92f;
|
||||
else
|
||||
val = 1.055f * pow(val,1.0f/2.4f) - 0.055f;
|
||||
return val;
|
||||
}
|
||||
|
||||
D3DX11INLINE FLOAT D3DX_SaturateSigned_FLOAT(FLOAT _V)
|
||||
{
|
||||
if (D3DX_IsNan(_V))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return min(max(_V, -1), 1);
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_FLOAT_to_UINT(FLOAT _V,
|
||||
FLOAT _Scale)
|
||||
{
|
||||
return (UINT)floor(_V * _Scale + 0.5f);
|
||||
}
|
||||
|
||||
D3DX11INLINE FLOAT D3DX_INT_to_FLOAT(INT _V,
|
||||
FLOAT _Scale)
|
||||
{
|
||||
FLOAT Scaled = (FLOAT)_V / _Scale;
|
||||
// The integer is a two's-complement signed
|
||||
// number so the negative range is slightly
|
||||
// larger than the positive range, meaning
|
||||
// the scaled value can be slight less than -1.
|
||||
// Clamp to keep the float range [-1, 1].
|
||||
return max(Scaled, -1.0f);
|
||||
}
|
||||
|
||||
D3DX11INLINE INT D3DX_FLOAT_to_INT(FLOAT _V,
|
||||
FLOAT _Scale)
|
||||
{
|
||||
return (INT)D3DX_Truncate_FLOAT(_V * _Scale + (_V >= 0 ? 0.5f : -0.5f));
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Conversion routines
|
||||
//=============================================================================
|
||||
//-----------------------------------------------------------------------------
|
||||
// R10B10G10A2_UNORM <-> FLOAT4
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMFLOAT4 D3DX_R10G10B10A2_UNORM_to_FLOAT4(UINT packedInput)
|
||||
{
|
||||
hlsl_precise XMFLOAT4 unpackedOutput;
|
||||
unpackedOutput.x = (FLOAT) (packedInput & 0x000003ff) / 1023;
|
||||
unpackedOutput.y = (FLOAT)(((packedInput>>10) & 0x000003ff)) / 1023;
|
||||
unpackedOutput.z = (FLOAT)(((packedInput>>20) & 0x000003ff)) / 1023;
|
||||
unpackedOutput.w = (FLOAT)(((packedInput>>30) & 0x00000003)) / 3;
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_FLOAT4_to_R10G10B10A2_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 1023)) |
|
||||
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 1023)<<10) |
|
||||
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 1023)<<20) |
|
||||
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.w), 3)<<30) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// R10B10G10A2_UINT <-> UINT4
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMUINT4 D3DX_R10G10B10A2_UINT_to_UINT4(UINT packedInput)
|
||||
{
|
||||
XMUINT4 unpackedOutput;
|
||||
unpackedOutput.x = packedInput & 0x000003ff;
|
||||
unpackedOutput.y = (packedInput>>10) & 0x000003ff;
|
||||
unpackedOutput.z = (packedInput>>20) & 0x000003ff;
|
||||
unpackedOutput.w = (packedInput>>30) & 0x00000003;
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_UINT4_to_R10G10B10A2_UINT(XMUINT4 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
unpackedInput.x = min(unpackedInput.x, 0x000003ff);
|
||||
unpackedInput.y = min(unpackedInput.y, 0x000003ff);
|
||||
unpackedInput.z = min(unpackedInput.z, 0x000003ff);
|
||||
unpackedInput.w = min(unpackedInput.w, 0x00000003);
|
||||
packedOutput = ( (unpackedInput.x) |
|
||||
((unpackedInput.y)<<10) |
|
||||
((unpackedInput.z)<<20) |
|
||||
((unpackedInput.w)<<30) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// R8G8B8A8_UNORM <-> FLOAT4
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_UNORM_to_FLOAT4(UINT packedInput)
|
||||
{
|
||||
hlsl_precise XMFLOAT4 unpackedOutput;
|
||||
unpackedOutput.x = (FLOAT) (packedInput & 0x000000ff) / 255;
|
||||
unpackedOutput.y = (FLOAT)(((packedInput>> 8) & 0x000000ff)) / 255;
|
||||
unpackedOutput.z = (FLOAT)(((packedInput>>16) & 0x000000ff)) / 255;
|
||||
unpackedOutput.w = (FLOAT) (packedInput>>24) / 255;
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 255)) |
|
||||
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 255)<< 8) |
|
||||
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 255)<<16) |
|
||||
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.w), 255)<<24) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// R8G8B8A8_UNORM_SRGB <-> FLOAT4
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput)
|
||||
{
|
||||
hlsl_precise XMFLOAT4 unpackedOutput;
|
||||
unpackedOutput.x = D3DX_SRGB_to_FLOAT_inexact(((FLOAT) (packedInput & 0x000000ff) )/255);
|
||||
unpackedOutput.y = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>> 8) & 0x000000ff)))/255);
|
||||
unpackedOutput.z = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>>16) & 0x000000ff)))/255);
|
||||
unpackedOutput.w = (FLOAT)(packedInput>>24) / 255;
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput)
|
||||
{
|
||||
hlsl_precise XMFLOAT4 unpackedOutput;
|
||||
unpackedOutput.x = D3DX_SRGB_to_FLOAT( (packedInput & 0x000000ff) );
|
||||
unpackedOutput.y = D3DX_SRGB_to_FLOAT((((packedInput>> 8) & 0x000000ff)));
|
||||
unpackedOutput.z = D3DX_SRGB_to_FLOAT((((packedInput>>16) & 0x000000ff)));
|
||||
unpackedOutput.w = (FLOAT)(packedInput>>24) / 255;
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_FLOAT4_to_R8G8B8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
unpackedInput.x = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.x));
|
||||
unpackedInput.y = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.y));
|
||||
unpackedInput.z = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.z));
|
||||
unpackedInput.w = D3DX_Saturate_FLOAT(unpackedInput.w);
|
||||
packedOutput = ( (D3DX_FLOAT_to_UINT(unpackedInput.x, 255)) |
|
||||
(D3DX_FLOAT_to_UINT(unpackedInput.y, 255)<< 8) |
|
||||
(D3DX_FLOAT_to_UINT(unpackedInput.z, 255)<<16) |
|
||||
(D3DX_FLOAT_to_UINT(unpackedInput.w, 255)<<24) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// R8G8B8A8_UINT <-> UINT4
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMUINT4 D3DX_R8G8B8A8_UINT_to_UINT4(UINT packedInput)
|
||||
{
|
||||
XMUINT4 unpackedOutput;
|
||||
unpackedOutput.x = packedInput & 0x000000ff;
|
||||
unpackedOutput.y = (packedInput>> 8) & 0x000000ff;
|
||||
unpackedOutput.z = (packedInput>>16) & 0x000000ff;
|
||||
unpackedOutput.w = packedInput>>24;
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_UINT4_to_R8G8B8A8_UINT(XMUINT4 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
unpackedInput.x = min(unpackedInput.x, 0x000000ff);
|
||||
unpackedInput.y = min(unpackedInput.y, 0x000000ff);
|
||||
unpackedInput.z = min(unpackedInput.z, 0x000000ff);
|
||||
unpackedInput.w = min(unpackedInput.w, 0x000000ff);
|
||||
packedOutput = ( unpackedInput.x |
|
||||
(unpackedInput.y<< 8) |
|
||||
(unpackedInput.z<<16) |
|
||||
(unpackedInput.w<<24) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// R8G8B8A8_SNORM <-> FLOAT4
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMFLOAT4 D3DX_R8G8B8A8_SNORM_to_FLOAT4(UINT packedInput)
|
||||
{
|
||||
hlsl_precise XMFLOAT4 unpackedOutput;
|
||||
XMINT4 signExtendedBits;
|
||||
signExtendedBits.x = (INT)(packedInput << 24) >> 24;
|
||||
signExtendedBits.y = (INT)((packedInput << 16) & 0xff000000) >> 24;
|
||||
signExtendedBits.z = (INT)((packedInput << 8) & 0xff000000) >> 24;
|
||||
signExtendedBits.w = (INT)(packedInput & 0xff000000) >> 24;
|
||||
unpackedOutput.x = D3DX_INT_to_FLOAT(signExtendedBits.x, 127);
|
||||
unpackedOutput.y = D3DX_INT_to_FLOAT(signExtendedBits.y, 127);
|
||||
unpackedOutput.z = D3DX_INT_to_FLOAT(signExtendedBits.z, 127);
|
||||
unpackedOutput.w = D3DX_INT_to_FLOAT(signExtendedBits.w, 127);
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_FLOAT4_to_R8G8B8A8_SNORM(hlsl_precise XMFLOAT4 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
packedOutput = ( (D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.x), 127) & 0x000000ff) |
|
||||
((D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.y), 127) & 0x000000ff)<< 8) |
|
||||
((D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.z), 127) & 0x000000ff)<<16) |
|
||||
((D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.w), 127)) <<24) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// R8G8B8A8_SINT <-> INT4
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMINT4 D3DX_R8G8B8A8_SINT_to_INT4(UINT packedInput)
|
||||
{
|
||||
XMINT4 unpackedOutput;
|
||||
unpackedOutput.x = (INT)(packedInput << 24) >> 24;
|
||||
unpackedOutput.y = (INT)((packedInput << 16) & 0xff000000) >> 24;
|
||||
unpackedOutput.z = (INT)((packedInput << 8) & 0xff000000) >> 24;
|
||||
unpackedOutput.w = (INT)(packedInput & 0xff000000) >> 24;
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_INT4_to_R8G8B8A8_SINT(XMINT4 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
unpackedInput.x = max(min(unpackedInput.x,127),-128);
|
||||
unpackedInput.y = max(min(unpackedInput.y,127),-128);
|
||||
unpackedInput.z = max(min(unpackedInput.z,127),-128);
|
||||
unpackedInput.w = max(min(unpackedInput.w,127),-128);
|
||||
packedOutput = ( (unpackedInput.x & 0x000000ff) |
|
||||
((unpackedInput.y & 0x000000ff)<< 8) |
|
||||
((unpackedInput.z & 0x000000ff)<<16) |
|
||||
(unpackedInput.w <<24) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// B8G8R8A8_UNORM <-> FLOAT4
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMFLOAT4 D3DX_B8G8R8A8_UNORM_to_FLOAT4(UINT packedInput)
|
||||
{
|
||||
hlsl_precise XMFLOAT4 unpackedOutput;
|
||||
unpackedOutput.z = (FLOAT) (packedInput & 0x000000ff) / 255;
|
||||
unpackedOutput.y = (FLOAT)(((packedInput>> 8) & 0x000000ff)) / 255;
|
||||
unpackedOutput.x = (FLOAT)(((packedInput>>16) & 0x000000ff)) / 255;
|
||||
unpackedOutput.w = (FLOAT) (packedInput>>24) / 255;
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_FLOAT4_to_B8G8R8A8_UNORM(hlsl_precise XMFLOAT4 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 255)) |
|
||||
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 255)<< 8) |
|
||||
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 255)<<16) |
|
||||
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.w), 255)<<24) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// B8G8R8A8_UNORM_SRGB <-> FLOAT4
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4_inexact(UINT packedInput)
|
||||
{
|
||||
hlsl_precise XMFLOAT4 unpackedOutput;
|
||||
unpackedOutput.z = D3DX_SRGB_to_FLOAT_inexact(((FLOAT) (packedInput & 0x000000ff) )/255);
|
||||
unpackedOutput.y = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>> 8) & 0x000000ff)))/255);
|
||||
unpackedOutput.x = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>>16) & 0x000000ff)))/255);
|
||||
unpackedOutput.w = (FLOAT)(packedInput>>24) / 255;
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE XMFLOAT4 D3DX_B8G8R8A8_UNORM_SRGB_to_FLOAT4(UINT packedInput)
|
||||
{
|
||||
hlsl_precise XMFLOAT4 unpackedOutput;
|
||||
unpackedOutput.z = D3DX_SRGB_to_FLOAT( (packedInput & 0x000000ff) );
|
||||
unpackedOutput.y = D3DX_SRGB_to_FLOAT((((packedInput>> 8) & 0x000000ff)));
|
||||
unpackedOutput.x = D3DX_SRGB_to_FLOAT((((packedInput>>16) & 0x000000ff)));
|
||||
unpackedOutput.w = (FLOAT)(packedInput>>24) / 255;
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_FLOAT4_to_B8G8R8A8_UNORM_SRGB(hlsl_precise XMFLOAT4 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
unpackedInput.z = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.z));
|
||||
unpackedInput.y = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.y));
|
||||
unpackedInput.x = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.x));
|
||||
unpackedInput.w = D3DX_Saturate_FLOAT(unpackedInput.w);
|
||||
packedOutput = ( (D3DX_FLOAT_to_UINT(unpackedInput.z, 255)) |
|
||||
(D3DX_FLOAT_to_UINT(unpackedInput.y, 255)<< 8) |
|
||||
(D3DX_FLOAT_to_UINT(unpackedInput.x, 255)<<16) |
|
||||
(D3DX_FLOAT_to_UINT(unpackedInput.w, 255)<<24) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// B8G8R8X8_UNORM <-> FLOAT3
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMFLOAT3 D3DX_B8G8R8X8_UNORM_to_FLOAT3(UINT packedInput)
|
||||
{
|
||||
hlsl_precise XMFLOAT3 unpackedOutput;
|
||||
unpackedOutput.z = (FLOAT) (packedInput & 0x000000ff) / 255;
|
||||
unpackedOutput.y = (FLOAT)(((packedInput>> 8) & 0x000000ff)) / 255;
|
||||
unpackedOutput.x = (FLOAT)(((packedInput>>16) & 0x000000ff)) / 255;
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM(hlsl_precise XMFLOAT3 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.z), 255)) |
|
||||
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 255)<< 8) |
|
||||
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 255)<<16) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// B8G8R8X8_UNORM_SRGB <-> FLOAT3
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3_inexact(UINT packedInput)
|
||||
{
|
||||
hlsl_precise XMFLOAT3 unpackedOutput;
|
||||
unpackedOutput.z = D3DX_SRGB_to_FLOAT_inexact(((FLOAT) (packedInput & 0x000000ff) )/255);
|
||||
unpackedOutput.y = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>> 8) & 0x000000ff)))/255);
|
||||
unpackedOutput.x = D3DX_SRGB_to_FLOAT_inexact(((FLOAT)(((packedInput>>16) & 0x000000ff)))/255);
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE XMFLOAT3 D3DX_B8G8R8X8_UNORM_SRGB_to_FLOAT3(UINT packedInput)
|
||||
{
|
||||
hlsl_precise XMFLOAT3 unpackedOutput;
|
||||
unpackedOutput.z = D3DX_SRGB_to_FLOAT( (packedInput & 0x000000ff) );
|
||||
unpackedOutput.y = D3DX_SRGB_to_FLOAT((((packedInput>> 8) & 0x000000ff)));
|
||||
unpackedOutput.x = D3DX_SRGB_to_FLOAT((((packedInput>>16) & 0x000000ff)));
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_FLOAT3_to_B8G8R8X8_UNORM_SRGB(hlsl_precise XMFLOAT3 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
unpackedInput.z = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.z));
|
||||
unpackedInput.y = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.y));
|
||||
unpackedInput.x = D3DX_FLOAT_to_SRGB(D3DX_Saturate_FLOAT(unpackedInput.x));
|
||||
packedOutput = ( (D3DX_FLOAT_to_UINT(unpackedInput.z, 255)) |
|
||||
(D3DX_FLOAT_to_UINT(unpackedInput.y, 255)<< 8) |
|
||||
(D3DX_FLOAT_to_UINT(unpackedInput.x, 255)<<16) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// R16G16_FLOAT <-> FLOAT2
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if HLSL_VERSION > 0
|
||||
|
||||
D3DX11INLINE XMFLOAT2 D3DX_R16G16_FLOAT_to_FLOAT2(UINT packedInput)
|
||||
{
|
||||
hlsl_precise XMFLOAT2 unpackedOutput;
|
||||
unpackedOutput.x = f16tof32(packedInput&0x0000ffff);
|
||||
unpackedOutput.y = f16tof32(packedInput>>16);
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_FLOAT2_to_R16G16_FLOAT(hlsl_precise XMFLOAT2 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
packedOutput = asuint(f32tof16(unpackedInput.x)) |
|
||||
(asuint(f32tof16(unpackedInput.y)) << 16);
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
#endif // HLSL_VERSION > 0
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// R16G16_UNORM <-> FLOAT2
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMFLOAT2 D3DX_R16G16_UNORM_to_FLOAT2(UINT packedInput)
|
||||
{
|
||||
hlsl_precise XMFLOAT2 unpackedOutput;
|
||||
unpackedOutput.x = (FLOAT) (packedInput & 0x0000ffff) / 65535;
|
||||
unpackedOutput.y = (FLOAT) (packedInput>>16) / 65535;
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_FLOAT2_to_R16G16_UNORM(hlsl_precise XMFLOAT2 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
packedOutput = ( (D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.x), 65535)) |
|
||||
(D3DX_FLOAT_to_UINT(D3DX_Saturate_FLOAT(unpackedInput.y), 65535)<< 16) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// R16G16_UINT <-> UINT2
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMUINT2 D3DX_R16G16_UINT_to_UINT2(UINT packedInput)
|
||||
{
|
||||
XMUINT2 unpackedOutput;
|
||||
unpackedOutput.x = packedInput & 0x0000ffff;
|
||||
unpackedOutput.y = packedInput>>16;
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_UINT2_to_R16G16_UINT(XMUINT2 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
unpackedInput.x = min(unpackedInput.x,0x0000ffff);
|
||||
unpackedInput.y = min(unpackedInput.y,0x0000ffff);
|
||||
packedOutput = ( unpackedInput.x |
|
||||
(unpackedInput.y<<16) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// R16G16_SNORM <-> FLOAT2
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMFLOAT2 D3DX_R16G16_SNORM_to_FLOAT2(UINT packedInput)
|
||||
{
|
||||
hlsl_precise XMFLOAT2 unpackedOutput;
|
||||
XMINT2 signExtendedBits;
|
||||
signExtendedBits.x = (INT)(packedInput << 16) >> 16;
|
||||
signExtendedBits.y = (INT)(packedInput & 0xffff0000) >> 16;
|
||||
unpackedOutput.x = D3DX_INT_to_FLOAT(signExtendedBits.x, 32767);
|
||||
unpackedOutput.y = D3DX_INT_to_FLOAT(signExtendedBits.y, 32767);
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_FLOAT2_to_R16G16_SNORM(hlsl_precise XMFLOAT2 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
packedOutput = ( (D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.x), 32767) & 0x0000ffff) |
|
||||
(D3DX_FLOAT_to_INT(D3DX_SaturateSigned_FLOAT(unpackedInput.y), 32767) <<16) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// R16G16_SINT <-> INT2
|
||||
//-----------------------------------------------------------------------------
|
||||
D3DX11INLINE XMINT2 D3DX_R16G16_SINT_to_INT2(UINT packedInput)
|
||||
{
|
||||
XMINT2 unpackedOutput;
|
||||
unpackedOutput.x = (INT)(packedInput << 16) >> 16;
|
||||
unpackedOutput.y = (INT)(packedInput & 0xffff0000) >> 16;
|
||||
return unpackedOutput;
|
||||
}
|
||||
|
||||
D3DX11INLINE UINT D3DX_INT2_to_R16G16_SINT(XMINT2 unpackedInput)
|
||||
{
|
||||
UINT packedOutput;
|
||||
unpackedInput.x = max(min(unpackedInput.x,32767),-32768);
|
||||
unpackedInput.y = max(min(unpackedInput.y,32767),-32768);
|
||||
packedOutput = ( (unpackedInput.x & 0x0000ffff) |
|
||||
(unpackedInput.y <<16) );
|
||||
return packedOutput;
|
||||
}
|
||||
|
||||
#endif // __D3DX_DXGI_FORMAT_CONVERT_INL___
|
787
SDK/Include/D3Dcommon.h
Normal file
787
SDK/Include/D3Dcommon.h
Normal file
@ -0,0 +1,787 @@
|
||||
|
||||
|
||||
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 7.00.0555 */
|
||||
/* @@MIDL_FILE_HEADING( ) */
|
||||
|
||||
#pragma warning( disable: 4049 ) /* more than 64k source lines */
|
||||
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCSAL_H_VERSION__
|
||||
#define __REQUIRED_RPCSAL_H_VERSION__ 100
|
||||
#endif
|
||||
|
||||
#include "rpc.h"
|
||||
#include "rpcndr.h"
|
||||
|
||||
#ifndef __RPCNDR_H_VERSION__
|
||||
#error this stub requires an updated version of <rpcndr.h>
|
||||
#endif // __RPCNDR_H_VERSION__
|
||||
|
||||
#ifndef COM_NO_WINDOWS_H
|
||||
#include "windows.h"
|
||||
#include "ole2.h"
|
||||
#endif /*COM_NO_WINDOWS_H*/
|
||||
|
||||
#ifndef __d3dcommon_h__
|
||||
#define __d3dcommon_h__
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
#ifndef __ID3D10Blob_FWD_DEFINED__
|
||||
#define __ID3D10Blob_FWD_DEFINED__
|
||||
typedef interface ID3D10Blob ID3D10Blob;
|
||||
#endif /* __ID3D10Blob_FWD_DEFINED__ */
|
||||
|
||||
|
||||
/* header files for imported files */
|
||||
#include "oaidl.h"
|
||||
#include "ocidl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
|
||||
/* interface __MIDL_itf_d3dcommon_0000_0000 */
|
||||
/* [local] */
|
||||
|
||||
typedef
|
||||
enum D3D_DRIVER_TYPE
|
||||
{ D3D_DRIVER_TYPE_UNKNOWN = 0,
|
||||
D3D_DRIVER_TYPE_HARDWARE = ( D3D_DRIVER_TYPE_UNKNOWN + 1 ) ,
|
||||
D3D_DRIVER_TYPE_REFERENCE = ( D3D_DRIVER_TYPE_HARDWARE + 1 ) ,
|
||||
D3D_DRIVER_TYPE_NULL = ( D3D_DRIVER_TYPE_REFERENCE + 1 ) ,
|
||||
D3D_DRIVER_TYPE_SOFTWARE = ( D3D_DRIVER_TYPE_NULL + 1 ) ,
|
||||
D3D_DRIVER_TYPE_WARP = ( D3D_DRIVER_TYPE_SOFTWARE + 1 )
|
||||
} D3D_DRIVER_TYPE;
|
||||
|
||||
typedef
|
||||
enum D3D_FEATURE_LEVEL
|
||||
{ D3D_FEATURE_LEVEL_9_1 = 0x9100,
|
||||
D3D_FEATURE_LEVEL_9_2 = 0x9200,
|
||||
D3D_FEATURE_LEVEL_9_3 = 0x9300,
|
||||
D3D_FEATURE_LEVEL_10_0 = 0xa000,
|
||||
D3D_FEATURE_LEVEL_10_1 = 0xa100,
|
||||
D3D_FEATURE_LEVEL_11_0 = 0xb000
|
||||
} D3D_FEATURE_LEVEL;
|
||||
|
||||
typedef
|
||||
enum D3D_PRIMITIVE_TOPOLOGY
|
||||
{ D3D_PRIMITIVE_TOPOLOGY_UNDEFINED = 0,
|
||||
D3D_PRIMITIVE_TOPOLOGY_POINTLIST = 1,
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINELIST = 2,
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5,
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13,
|
||||
D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33,
|
||||
D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = 34,
|
||||
D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = 35,
|
||||
D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = 36,
|
||||
D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = 37,
|
||||
D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = 38,
|
||||
D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = 39,
|
||||
D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = 40,
|
||||
D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = 41,
|
||||
D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = 42,
|
||||
D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = 43,
|
||||
D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = 44,
|
||||
D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = 45,
|
||||
D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = 46,
|
||||
D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = 47,
|
||||
D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = 48,
|
||||
D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = 49,
|
||||
D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = 50,
|
||||
D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = 51,
|
||||
D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = 52,
|
||||
D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = 53,
|
||||
D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = 54,
|
||||
D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = 55,
|
||||
D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = 56,
|
||||
D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = 57,
|
||||
D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = 58,
|
||||
D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = 59,
|
||||
D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = 60,
|
||||
D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = 61,
|
||||
D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = 62,
|
||||
D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = 63,
|
||||
D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = 64,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ,
|
||||
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST,
|
||||
D3D11_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST
|
||||
} D3D_PRIMITIVE_TOPOLOGY;
|
||||
|
||||
typedef
|
||||
enum D3D_PRIMITIVE
|
||||
{ D3D_PRIMITIVE_UNDEFINED = 0,
|
||||
D3D_PRIMITIVE_POINT = 1,
|
||||
D3D_PRIMITIVE_LINE = 2,
|
||||
D3D_PRIMITIVE_TRIANGLE = 3,
|
||||
D3D_PRIMITIVE_LINE_ADJ = 6,
|
||||
D3D_PRIMITIVE_TRIANGLE_ADJ = 7,
|
||||
D3D_PRIMITIVE_1_CONTROL_POINT_PATCH = 8,
|
||||
D3D_PRIMITIVE_2_CONTROL_POINT_PATCH = 9,
|
||||
D3D_PRIMITIVE_3_CONTROL_POINT_PATCH = 10,
|
||||
D3D_PRIMITIVE_4_CONTROL_POINT_PATCH = 11,
|
||||
D3D_PRIMITIVE_5_CONTROL_POINT_PATCH = 12,
|
||||
D3D_PRIMITIVE_6_CONTROL_POINT_PATCH = 13,
|
||||
D3D_PRIMITIVE_7_CONTROL_POINT_PATCH = 14,
|
||||
D3D_PRIMITIVE_8_CONTROL_POINT_PATCH = 15,
|
||||
D3D_PRIMITIVE_9_CONTROL_POINT_PATCH = 16,
|
||||
D3D_PRIMITIVE_10_CONTROL_POINT_PATCH = 17,
|
||||
D3D_PRIMITIVE_11_CONTROL_POINT_PATCH = 18,
|
||||
D3D_PRIMITIVE_12_CONTROL_POINT_PATCH = 19,
|
||||
D3D_PRIMITIVE_13_CONTROL_POINT_PATCH = 20,
|
||||
D3D_PRIMITIVE_14_CONTROL_POINT_PATCH = 21,
|
||||
D3D_PRIMITIVE_15_CONTROL_POINT_PATCH = 22,
|
||||
D3D_PRIMITIVE_16_CONTROL_POINT_PATCH = 23,
|
||||
D3D_PRIMITIVE_17_CONTROL_POINT_PATCH = 24,
|
||||
D3D_PRIMITIVE_18_CONTROL_POINT_PATCH = 25,
|
||||
D3D_PRIMITIVE_19_CONTROL_POINT_PATCH = 26,
|
||||
D3D_PRIMITIVE_20_CONTROL_POINT_PATCH = 28,
|
||||
D3D_PRIMITIVE_21_CONTROL_POINT_PATCH = 29,
|
||||
D3D_PRIMITIVE_22_CONTROL_POINT_PATCH = 30,
|
||||
D3D_PRIMITIVE_23_CONTROL_POINT_PATCH = 31,
|
||||
D3D_PRIMITIVE_24_CONTROL_POINT_PATCH = 32,
|
||||
D3D_PRIMITIVE_25_CONTROL_POINT_PATCH = 33,
|
||||
D3D_PRIMITIVE_26_CONTROL_POINT_PATCH = 34,
|
||||
D3D_PRIMITIVE_27_CONTROL_POINT_PATCH = 35,
|
||||
D3D_PRIMITIVE_28_CONTROL_POINT_PATCH = 36,
|
||||
D3D_PRIMITIVE_29_CONTROL_POINT_PATCH = 37,
|
||||
D3D_PRIMITIVE_30_CONTROL_POINT_PATCH = 38,
|
||||
D3D_PRIMITIVE_31_CONTROL_POINT_PATCH = 39,
|
||||
D3D_PRIMITIVE_32_CONTROL_POINT_PATCH = 40,
|
||||
D3D10_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED,
|
||||
D3D10_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT,
|
||||
D3D10_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE,
|
||||
D3D10_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE,
|
||||
D3D10_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ,
|
||||
D3D10_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ,
|
||||
D3D11_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED,
|
||||
D3D11_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT,
|
||||
D3D11_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE,
|
||||
D3D11_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE,
|
||||
D3D11_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ,
|
||||
D3D11_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ,
|
||||
D3D11_PRIMITIVE_1_CONTROL_POINT_PATCH = D3D_PRIMITIVE_1_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_2_CONTROL_POINT_PATCH = D3D_PRIMITIVE_2_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_3_CONTROL_POINT_PATCH = D3D_PRIMITIVE_3_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_4_CONTROL_POINT_PATCH = D3D_PRIMITIVE_4_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_5_CONTROL_POINT_PATCH = D3D_PRIMITIVE_5_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_6_CONTROL_POINT_PATCH = D3D_PRIMITIVE_6_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_7_CONTROL_POINT_PATCH = D3D_PRIMITIVE_7_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_8_CONTROL_POINT_PATCH = D3D_PRIMITIVE_8_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_9_CONTROL_POINT_PATCH = D3D_PRIMITIVE_9_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_10_CONTROL_POINT_PATCH = D3D_PRIMITIVE_10_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_11_CONTROL_POINT_PATCH = D3D_PRIMITIVE_11_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_12_CONTROL_POINT_PATCH = D3D_PRIMITIVE_12_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_13_CONTROL_POINT_PATCH = D3D_PRIMITIVE_13_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_14_CONTROL_POINT_PATCH = D3D_PRIMITIVE_14_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_15_CONTROL_POINT_PATCH = D3D_PRIMITIVE_15_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_16_CONTROL_POINT_PATCH = D3D_PRIMITIVE_16_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_17_CONTROL_POINT_PATCH = D3D_PRIMITIVE_17_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_18_CONTROL_POINT_PATCH = D3D_PRIMITIVE_18_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_19_CONTROL_POINT_PATCH = D3D_PRIMITIVE_19_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_20_CONTROL_POINT_PATCH = D3D_PRIMITIVE_20_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_21_CONTROL_POINT_PATCH = D3D_PRIMITIVE_21_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_22_CONTROL_POINT_PATCH = D3D_PRIMITIVE_22_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_23_CONTROL_POINT_PATCH = D3D_PRIMITIVE_23_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_24_CONTROL_POINT_PATCH = D3D_PRIMITIVE_24_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_25_CONTROL_POINT_PATCH = D3D_PRIMITIVE_25_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_26_CONTROL_POINT_PATCH = D3D_PRIMITIVE_26_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_27_CONTROL_POINT_PATCH = D3D_PRIMITIVE_27_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_28_CONTROL_POINT_PATCH = D3D_PRIMITIVE_28_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_29_CONTROL_POINT_PATCH = D3D_PRIMITIVE_29_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_30_CONTROL_POINT_PATCH = D3D_PRIMITIVE_30_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_31_CONTROL_POINT_PATCH = D3D_PRIMITIVE_31_CONTROL_POINT_PATCH,
|
||||
D3D11_PRIMITIVE_32_CONTROL_POINT_PATCH = D3D_PRIMITIVE_32_CONTROL_POINT_PATCH
|
||||
} D3D_PRIMITIVE;
|
||||
|
||||
typedef
|
||||
enum D3D_SRV_DIMENSION
|
||||
{ D3D_SRV_DIMENSION_UNKNOWN = 0,
|
||||
D3D_SRV_DIMENSION_BUFFER = 1,
|
||||
D3D_SRV_DIMENSION_TEXTURE1D = 2,
|
||||
D3D_SRV_DIMENSION_TEXTURE1DARRAY = 3,
|
||||
D3D_SRV_DIMENSION_TEXTURE2D = 4,
|
||||
D3D_SRV_DIMENSION_TEXTURE2DARRAY = 5,
|
||||
D3D_SRV_DIMENSION_TEXTURE2DMS = 6,
|
||||
D3D_SRV_DIMENSION_TEXTURE2DMSARRAY = 7,
|
||||
D3D_SRV_DIMENSION_TEXTURE3D = 8,
|
||||
D3D_SRV_DIMENSION_TEXTURECUBE = 9,
|
||||
D3D_SRV_DIMENSION_TEXTURECUBEARRAY = 10,
|
||||
D3D_SRV_DIMENSION_BUFFEREX = 11,
|
||||
D3D10_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN,
|
||||
D3D10_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER,
|
||||
D3D10_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D,
|
||||
D3D10_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY,
|
||||
D3D10_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D,
|
||||
D3D10_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY,
|
||||
D3D10_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS,
|
||||
D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY,
|
||||
D3D10_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D,
|
||||
D3D10_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE,
|
||||
D3D10_1_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN,
|
||||
D3D10_1_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE,
|
||||
D3D10_1_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY,
|
||||
D3D11_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN,
|
||||
D3D11_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER,
|
||||
D3D11_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D,
|
||||
D3D11_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY,
|
||||
D3D11_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D,
|
||||
D3D11_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY,
|
||||
D3D11_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS,
|
||||
D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY,
|
||||
D3D11_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D,
|
||||
D3D11_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE,
|
||||
D3D11_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY,
|
||||
D3D11_SRV_DIMENSION_BUFFEREX = D3D_SRV_DIMENSION_BUFFEREX
|
||||
} D3D_SRV_DIMENSION;
|
||||
|
||||
typedef struct _D3D_SHADER_MACRO
|
||||
{
|
||||
LPCSTR Name;
|
||||
LPCSTR Definition;
|
||||
} D3D_SHADER_MACRO;
|
||||
|
||||
typedef struct _D3D_SHADER_MACRO *LPD3D_SHADER_MACRO;
|
||||
|
||||
DEFINE_GUID(IID_ID3D10Blob, 0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);
|
||||
|
||||
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_c_ifspec;
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_s_ifspec;
|
||||
|
||||
#ifndef __ID3D10Blob_INTERFACE_DEFINED__
|
||||
#define __ID3D10Blob_INTERFACE_DEFINED__
|
||||
|
||||
/* interface ID3D10Blob */
|
||||
/* [unique][local][object][uuid] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_ID3D10Blob;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("8BA5FB08-5195-40e2-AC58-0D989C3A0102")
|
||||
ID3D10Blob : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual LPVOID STDMETHODCALLTYPE GetBufferPointer( void) = 0;
|
||||
|
||||
virtual SIZE_T STDMETHODCALLTYPE GetBufferSize( void) = 0;
|
||||
|
||||
};
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct ID3D10BlobVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
ID3D10Blob * This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [annotation][iid_is][out] */
|
||||
__RPC__deref_out void **ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
ID3D10Blob * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
ID3D10Blob * This);
|
||||
|
||||
LPVOID ( STDMETHODCALLTYPE *GetBufferPointer )(
|
||||
ID3D10Blob * This);
|
||||
|
||||
SIZE_T ( STDMETHODCALLTYPE *GetBufferSize )(
|
||||
ID3D10Blob * This);
|
||||
|
||||
END_INTERFACE
|
||||
} ID3D10BlobVtbl;
|
||||
|
||||
interface ID3D10Blob
|
||||
{
|
||||
CONST_VTBL struct ID3D10BlobVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define ID3D10Blob_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define ID3D10Blob_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define ID3D10Blob_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#define ID3D10Blob_GetBufferPointer(This) \
|
||||
( (This)->lpVtbl -> GetBufferPointer(This) )
|
||||
|
||||
#define ID3D10Blob_GetBufferSize(This) \
|
||||
( (This)->lpVtbl -> GetBufferSize(This) )
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __ID3D10Blob_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
/* interface __MIDL_itf_d3dcommon_0000_0001 */
|
||||
/* [local] */
|
||||
|
||||
typedef interface ID3D10Blob* LPD3D10BLOB;
|
||||
typedef ID3D10Blob ID3DBlob;
|
||||
typedef ID3DBlob* LPD3DBLOB;
|
||||
#define IID_ID3DBlob IID_ID3D10Blob
|
||||
typedef
|
||||
enum _D3D_INCLUDE_TYPE
|
||||
{ D3D_INCLUDE_LOCAL = 0,
|
||||
D3D_INCLUDE_SYSTEM = ( D3D_INCLUDE_LOCAL + 1 ) ,
|
||||
D3D10_INCLUDE_LOCAL = D3D_INCLUDE_LOCAL,
|
||||
D3D10_INCLUDE_SYSTEM = D3D_INCLUDE_SYSTEM,
|
||||
D3D_INCLUDE_FORCE_DWORD = 0x7fffffff
|
||||
} D3D_INCLUDE_TYPE;
|
||||
|
||||
typedef interface ID3DInclude ID3DInclude;
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DInclude
|
||||
DECLARE_INTERFACE(ID3DInclude)
|
||||
{
|
||||
STDMETHOD(Open)(THIS_ D3D_INCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) PURE;
|
||||
STDMETHOD(Close)(THIS_ LPCVOID pData) PURE;
|
||||
};
|
||||
typedef ID3DInclude* LPD3DINCLUDE;
|
||||
typedef
|
||||
enum _D3D_SHADER_VARIABLE_CLASS
|
||||
{ D3D_SVC_SCALAR = 0,
|
||||
D3D_SVC_VECTOR = ( D3D_SVC_SCALAR + 1 ) ,
|
||||
D3D_SVC_MATRIX_ROWS = ( D3D_SVC_VECTOR + 1 ) ,
|
||||
D3D_SVC_MATRIX_COLUMNS = ( D3D_SVC_MATRIX_ROWS + 1 ) ,
|
||||
D3D_SVC_OBJECT = ( D3D_SVC_MATRIX_COLUMNS + 1 ) ,
|
||||
D3D_SVC_STRUCT = ( D3D_SVC_OBJECT + 1 ) ,
|
||||
D3D_SVC_INTERFACE_CLASS = ( D3D_SVC_STRUCT + 1 ) ,
|
||||
D3D_SVC_INTERFACE_POINTER = ( D3D_SVC_INTERFACE_CLASS + 1 ) ,
|
||||
D3D10_SVC_SCALAR = D3D_SVC_SCALAR,
|
||||
D3D10_SVC_VECTOR = D3D_SVC_VECTOR,
|
||||
D3D10_SVC_MATRIX_ROWS = D3D_SVC_MATRIX_ROWS,
|
||||
D3D10_SVC_MATRIX_COLUMNS = D3D_SVC_MATRIX_COLUMNS,
|
||||
D3D10_SVC_OBJECT = D3D_SVC_OBJECT,
|
||||
D3D10_SVC_STRUCT = D3D_SVC_STRUCT,
|
||||
D3D11_SVC_INTERFACE_CLASS = D3D_SVC_INTERFACE_CLASS,
|
||||
D3D11_SVC_INTERFACE_POINTER = D3D_SVC_INTERFACE_POINTER,
|
||||
D3D_SVC_FORCE_DWORD = 0x7fffffff
|
||||
} D3D_SHADER_VARIABLE_CLASS;
|
||||
|
||||
typedef
|
||||
enum _D3D_SHADER_VARIABLE_FLAGS
|
||||
{ D3D_SVF_USERPACKED = 1,
|
||||
D3D_SVF_USED = 2,
|
||||
D3D_SVF_INTERFACE_POINTER = 4,
|
||||
D3D_SVF_INTERFACE_PARAMETER = 8,
|
||||
D3D10_SVF_USERPACKED = D3D_SVF_USERPACKED,
|
||||
D3D10_SVF_USED = D3D_SVF_USED,
|
||||
D3D11_SVF_INTERFACE_POINTER = D3D_SVF_INTERFACE_POINTER,
|
||||
D3D11_SVF_INTERFACE_PARAMETER = D3D_SVF_INTERFACE_PARAMETER,
|
||||
D3D_SVF_FORCE_DWORD = 0x7fffffff
|
||||
} D3D_SHADER_VARIABLE_FLAGS;
|
||||
|
||||
typedef
|
||||
enum _D3D_SHADER_VARIABLE_TYPE
|
||||
{ D3D_SVT_VOID = 0,
|
||||
D3D_SVT_BOOL = 1,
|
||||
D3D_SVT_INT = 2,
|
||||
D3D_SVT_FLOAT = 3,
|
||||
D3D_SVT_STRING = 4,
|
||||
D3D_SVT_TEXTURE = 5,
|
||||
D3D_SVT_TEXTURE1D = 6,
|
||||
D3D_SVT_TEXTURE2D = 7,
|
||||
D3D_SVT_TEXTURE3D = 8,
|
||||
D3D_SVT_TEXTURECUBE = 9,
|
||||
D3D_SVT_SAMPLER = 10,
|
||||
D3D_SVT_SAMPLER1D = 11,
|
||||
D3D_SVT_SAMPLER2D = 12,
|
||||
D3D_SVT_SAMPLER3D = 13,
|
||||
D3D_SVT_SAMPLERCUBE = 14,
|
||||
D3D_SVT_PIXELSHADER = 15,
|
||||
D3D_SVT_VERTEXSHADER = 16,
|
||||
D3D_SVT_PIXELFRAGMENT = 17,
|
||||
D3D_SVT_VERTEXFRAGMENT = 18,
|
||||
D3D_SVT_UINT = 19,
|
||||
D3D_SVT_UINT8 = 20,
|
||||
D3D_SVT_GEOMETRYSHADER = 21,
|
||||
D3D_SVT_RASTERIZER = 22,
|
||||
D3D_SVT_DEPTHSTENCIL = 23,
|
||||
D3D_SVT_BLEND = 24,
|
||||
D3D_SVT_BUFFER = 25,
|
||||
D3D_SVT_CBUFFER = 26,
|
||||
D3D_SVT_TBUFFER = 27,
|
||||
D3D_SVT_TEXTURE1DARRAY = 28,
|
||||
D3D_SVT_TEXTURE2DARRAY = 29,
|
||||
D3D_SVT_RENDERTARGETVIEW = 30,
|
||||
D3D_SVT_DEPTHSTENCILVIEW = 31,
|
||||
D3D_SVT_TEXTURE2DMS = 32,
|
||||
D3D_SVT_TEXTURE2DMSARRAY = 33,
|
||||
D3D_SVT_TEXTURECUBEARRAY = 34,
|
||||
D3D_SVT_HULLSHADER = 35,
|
||||
D3D_SVT_DOMAINSHADER = 36,
|
||||
D3D_SVT_INTERFACE_POINTER = 37,
|
||||
D3D_SVT_COMPUTESHADER = 38,
|
||||
D3D_SVT_DOUBLE = 39,
|
||||
D3D_SVT_RWTEXTURE1D = 40,
|
||||
D3D_SVT_RWTEXTURE1DARRAY = 41,
|
||||
D3D_SVT_RWTEXTURE2D = 42,
|
||||
D3D_SVT_RWTEXTURE2DARRAY = 43,
|
||||
D3D_SVT_RWTEXTURE3D = 44,
|
||||
D3D_SVT_RWBUFFER = 45,
|
||||
D3D_SVT_BYTEADDRESS_BUFFER = 46,
|
||||
D3D_SVT_RWBYTEADDRESS_BUFFER = 47,
|
||||
D3D_SVT_STRUCTURED_BUFFER = 48,
|
||||
D3D_SVT_RWSTRUCTURED_BUFFER = 49,
|
||||
D3D_SVT_APPEND_STRUCTURED_BUFFER = 50,
|
||||
D3D_SVT_CONSUME_STRUCTURED_BUFFER = 51,
|
||||
D3D10_SVT_VOID = D3D_SVT_VOID,
|
||||
D3D10_SVT_BOOL = D3D_SVT_BOOL,
|
||||
D3D10_SVT_INT = D3D_SVT_INT,
|
||||
D3D10_SVT_FLOAT = D3D_SVT_FLOAT,
|
||||
D3D10_SVT_STRING = D3D_SVT_STRING,
|
||||
D3D10_SVT_TEXTURE = D3D_SVT_TEXTURE,
|
||||
D3D10_SVT_TEXTURE1D = D3D_SVT_TEXTURE1D,
|
||||
D3D10_SVT_TEXTURE2D = D3D_SVT_TEXTURE2D,
|
||||
D3D10_SVT_TEXTURE3D = D3D_SVT_TEXTURE3D,
|
||||
D3D10_SVT_TEXTURECUBE = D3D_SVT_TEXTURECUBE,
|
||||
D3D10_SVT_SAMPLER = D3D_SVT_SAMPLER,
|
||||
D3D10_SVT_SAMPLER1D = D3D_SVT_SAMPLER1D,
|
||||
D3D10_SVT_SAMPLER2D = D3D_SVT_SAMPLER2D,
|
||||
D3D10_SVT_SAMPLER3D = D3D_SVT_SAMPLER3D,
|
||||
D3D10_SVT_SAMPLERCUBE = D3D_SVT_SAMPLERCUBE,
|
||||
D3D10_SVT_PIXELSHADER = D3D_SVT_PIXELSHADER,
|
||||
D3D10_SVT_VERTEXSHADER = D3D_SVT_VERTEXSHADER,
|
||||
D3D10_SVT_PIXELFRAGMENT = D3D_SVT_PIXELFRAGMENT,
|
||||
D3D10_SVT_VERTEXFRAGMENT = D3D_SVT_VERTEXFRAGMENT,
|
||||
D3D10_SVT_UINT = D3D_SVT_UINT,
|
||||
D3D10_SVT_UINT8 = D3D_SVT_UINT8,
|
||||
D3D10_SVT_GEOMETRYSHADER = D3D_SVT_GEOMETRYSHADER,
|
||||
D3D10_SVT_RASTERIZER = D3D_SVT_RASTERIZER,
|
||||
D3D10_SVT_DEPTHSTENCIL = D3D_SVT_DEPTHSTENCIL,
|
||||
D3D10_SVT_BLEND = D3D_SVT_BLEND,
|
||||
D3D10_SVT_BUFFER = D3D_SVT_BUFFER,
|
||||
D3D10_SVT_CBUFFER = D3D_SVT_CBUFFER,
|
||||
D3D10_SVT_TBUFFER = D3D_SVT_TBUFFER,
|
||||
D3D10_SVT_TEXTURE1DARRAY = D3D_SVT_TEXTURE1DARRAY,
|
||||
D3D10_SVT_TEXTURE2DARRAY = D3D_SVT_TEXTURE2DARRAY,
|
||||
D3D10_SVT_RENDERTARGETVIEW = D3D_SVT_RENDERTARGETVIEW,
|
||||
D3D10_SVT_DEPTHSTENCILVIEW = D3D_SVT_DEPTHSTENCILVIEW,
|
||||
D3D10_SVT_TEXTURE2DMS = D3D_SVT_TEXTURE2DMS,
|
||||
D3D10_SVT_TEXTURE2DMSARRAY = D3D_SVT_TEXTURE2DMSARRAY,
|
||||
D3D10_SVT_TEXTURECUBEARRAY = D3D_SVT_TEXTURECUBEARRAY,
|
||||
D3D11_SVT_HULLSHADER = D3D_SVT_HULLSHADER,
|
||||
D3D11_SVT_DOMAINSHADER = D3D_SVT_DOMAINSHADER,
|
||||
D3D11_SVT_INTERFACE_POINTER = D3D_SVT_INTERFACE_POINTER,
|
||||
D3D11_SVT_COMPUTESHADER = D3D_SVT_COMPUTESHADER,
|
||||
D3D11_SVT_DOUBLE = D3D_SVT_DOUBLE,
|
||||
D3D11_SVT_RWTEXTURE1D = D3D_SVT_RWTEXTURE1D,
|
||||
D3D11_SVT_RWTEXTURE1DARRAY = D3D_SVT_RWTEXTURE1DARRAY,
|
||||
D3D11_SVT_RWTEXTURE2D = D3D_SVT_RWTEXTURE2D,
|
||||
D3D11_SVT_RWTEXTURE2DARRAY = D3D_SVT_RWTEXTURE2DARRAY,
|
||||
D3D11_SVT_RWTEXTURE3D = D3D_SVT_RWTEXTURE3D,
|
||||
D3D11_SVT_RWBUFFER = D3D_SVT_RWBUFFER,
|
||||
D3D11_SVT_BYTEADDRESS_BUFFER = D3D_SVT_BYTEADDRESS_BUFFER,
|
||||
D3D11_SVT_RWBYTEADDRESS_BUFFER = D3D_SVT_RWBYTEADDRESS_BUFFER,
|
||||
D3D11_SVT_STRUCTURED_BUFFER = D3D_SVT_STRUCTURED_BUFFER,
|
||||
D3D11_SVT_RWSTRUCTURED_BUFFER = D3D_SVT_RWSTRUCTURED_BUFFER,
|
||||
D3D11_SVT_APPEND_STRUCTURED_BUFFER = D3D_SVT_APPEND_STRUCTURED_BUFFER,
|
||||
D3D11_SVT_CONSUME_STRUCTURED_BUFFER = D3D_SVT_CONSUME_STRUCTURED_BUFFER,
|
||||
D3D_SVT_FORCE_DWORD = 0x7fffffff
|
||||
} D3D_SHADER_VARIABLE_TYPE;
|
||||
|
||||
typedef
|
||||
enum _D3D_SHADER_INPUT_FLAGS
|
||||
{ D3D_SIF_USERPACKED = 1,
|
||||
D3D_SIF_COMPARISON_SAMPLER = 2,
|
||||
D3D_SIF_TEXTURE_COMPONENT_0 = 4,
|
||||
D3D_SIF_TEXTURE_COMPONENT_1 = 8,
|
||||
D3D_SIF_TEXTURE_COMPONENTS = 12,
|
||||
D3D10_SIF_USERPACKED = D3D_SIF_USERPACKED,
|
||||
D3D10_SIF_COMPARISON_SAMPLER = D3D_SIF_COMPARISON_SAMPLER,
|
||||
D3D10_SIF_TEXTURE_COMPONENT_0 = D3D_SIF_TEXTURE_COMPONENT_0,
|
||||
D3D10_SIF_TEXTURE_COMPONENT_1 = D3D_SIF_TEXTURE_COMPONENT_1,
|
||||
D3D10_SIF_TEXTURE_COMPONENTS = D3D_SIF_TEXTURE_COMPONENTS,
|
||||
D3D_SIF_FORCE_DWORD = 0x7fffffff
|
||||
} D3D_SHADER_INPUT_FLAGS;
|
||||
|
||||
typedef
|
||||
enum _D3D_SHADER_INPUT_TYPE
|
||||
{ D3D_SIT_CBUFFER = 0,
|
||||
D3D_SIT_TBUFFER = ( D3D_SIT_CBUFFER + 1 ) ,
|
||||
D3D_SIT_TEXTURE = ( D3D_SIT_TBUFFER + 1 ) ,
|
||||
D3D_SIT_SAMPLER = ( D3D_SIT_TEXTURE + 1 ) ,
|
||||
D3D_SIT_UAV_RWTYPED = ( D3D_SIT_SAMPLER + 1 ) ,
|
||||
D3D_SIT_STRUCTURED = ( D3D_SIT_UAV_RWTYPED + 1 ) ,
|
||||
D3D_SIT_UAV_RWSTRUCTURED = ( D3D_SIT_STRUCTURED + 1 ) ,
|
||||
D3D_SIT_BYTEADDRESS = ( D3D_SIT_UAV_RWSTRUCTURED + 1 ) ,
|
||||
D3D_SIT_UAV_RWBYTEADDRESS = ( D3D_SIT_BYTEADDRESS + 1 ) ,
|
||||
D3D_SIT_UAV_APPEND_STRUCTURED = ( D3D_SIT_UAV_RWBYTEADDRESS + 1 ) ,
|
||||
D3D_SIT_UAV_CONSUME_STRUCTURED = ( D3D_SIT_UAV_APPEND_STRUCTURED + 1 ) ,
|
||||
D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = ( D3D_SIT_UAV_CONSUME_STRUCTURED + 1 ) ,
|
||||
D3D10_SIT_CBUFFER = D3D_SIT_CBUFFER,
|
||||
D3D10_SIT_TBUFFER = D3D_SIT_TBUFFER,
|
||||
D3D10_SIT_TEXTURE = D3D_SIT_TEXTURE,
|
||||
D3D10_SIT_SAMPLER = D3D_SIT_SAMPLER,
|
||||
D3D11_SIT_UAV_RWTYPED = D3D_SIT_UAV_RWTYPED,
|
||||
D3D11_SIT_STRUCTURED = D3D_SIT_STRUCTURED,
|
||||
D3D11_SIT_UAV_RWSTRUCTURED = D3D_SIT_UAV_RWSTRUCTURED,
|
||||
D3D11_SIT_BYTEADDRESS = D3D_SIT_BYTEADDRESS,
|
||||
D3D11_SIT_UAV_RWBYTEADDRESS = D3D_SIT_UAV_RWBYTEADDRESS,
|
||||
D3D11_SIT_UAV_APPEND_STRUCTURED = D3D_SIT_UAV_APPEND_STRUCTURED,
|
||||
D3D11_SIT_UAV_CONSUME_STRUCTURED = D3D_SIT_UAV_CONSUME_STRUCTURED,
|
||||
D3D11_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER
|
||||
} D3D_SHADER_INPUT_TYPE;
|
||||
|
||||
typedef
|
||||
enum _D3D_SHADER_CBUFFER_FLAGS
|
||||
{ D3D_CBF_USERPACKED = 1,
|
||||
D3D10_CBF_USERPACKED = D3D_CBF_USERPACKED,
|
||||
D3D_CBF_FORCE_DWORD = 0x7fffffff
|
||||
} D3D_SHADER_CBUFFER_FLAGS;
|
||||
|
||||
typedef
|
||||
enum _D3D_CBUFFER_TYPE
|
||||
{ D3D_CT_CBUFFER = 0,
|
||||
D3D_CT_TBUFFER = ( D3D_CT_CBUFFER + 1 ) ,
|
||||
D3D_CT_INTERFACE_POINTERS = ( D3D_CT_TBUFFER + 1 ) ,
|
||||
D3D_CT_RESOURCE_BIND_INFO = ( D3D_CT_INTERFACE_POINTERS + 1 ) ,
|
||||
D3D10_CT_CBUFFER = D3D_CT_CBUFFER,
|
||||
D3D10_CT_TBUFFER = D3D_CT_TBUFFER,
|
||||
D3D11_CT_CBUFFER = D3D_CT_CBUFFER,
|
||||
D3D11_CT_TBUFFER = D3D_CT_TBUFFER,
|
||||
D3D11_CT_INTERFACE_POINTERS = D3D_CT_INTERFACE_POINTERS,
|
||||
D3D11_CT_RESOURCE_BIND_INFO = D3D_CT_RESOURCE_BIND_INFO
|
||||
} D3D_CBUFFER_TYPE;
|
||||
|
||||
typedef
|
||||
enum D3D_NAME
|
||||
{ D3D_NAME_UNDEFINED = 0,
|
||||
D3D_NAME_POSITION = 1,
|
||||
D3D_NAME_CLIP_DISTANCE = 2,
|
||||
D3D_NAME_CULL_DISTANCE = 3,
|
||||
D3D_NAME_RENDER_TARGET_ARRAY_INDEX = 4,
|
||||
D3D_NAME_VIEWPORT_ARRAY_INDEX = 5,
|
||||
D3D_NAME_VERTEX_ID = 6,
|
||||
D3D_NAME_PRIMITIVE_ID = 7,
|
||||
D3D_NAME_INSTANCE_ID = 8,
|
||||
D3D_NAME_IS_FRONT_FACE = 9,
|
||||
D3D_NAME_SAMPLE_INDEX = 10,
|
||||
D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR = 11,
|
||||
D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = 12,
|
||||
D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR = 13,
|
||||
D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR = 14,
|
||||
D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR = 15,
|
||||
D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR = 16,
|
||||
D3D_NAME_TARGET = 64,
|
||||
D3D_NAME_DEPTH = 65,
|
||||
D3D_NAME_COVERAGE = 66,
|
||||
D3D_NAME_DEPTH_GREATER_EQUAL = 67,
|
||||
D3D_NAME_DEPTH_LESS_EQUAL = 68,
|
||||
D3D10_NAME_UNDEFINED = D3D_NAME_UNDEFINED,
|
||||
D3D10_NAME_POSITION = D3D_NAME_POSITION,
|
||||
D3D10_NAME_CLIP_DISTANCE = D3D_NAME_CLIP_DISTANCE,
|
||||
D3D10_NAME_CULL_DISTANCE = D3D_NAME_CULL_DISTANCE,
|
||||
D3D10_NAME_RENDER_TARGET_ARRAY_INDEX = D3D_NAME_RENDER_TARGET_ARRAY_INDEX,
|
||||
D3D10_NAME_VIEWPORT_ARRAY_INDEX = D3D_NAME_VIEWPORT_ARRAY_INDEX,
|
||||
D3D10_NAME_VERTEX_ID = D3D_NAME_VERTEX_ID,
|
||||
D3D10_NAME_PRIMITIVE_ID = D3D_NAME_PRIMITIVE_ID,
|
||||
D3D10_NAME_INSTANCE_ID = D3D_NAME_INSTANCE_ID,
|
||||
D3D10_NAME_IS_FRONT_FACE = D3D_NAME_IS_FRONT_FACE,
|
||||
D3D10_NAME_SAMPLE_INDEX = D3D_NAME_SAMPLE_INDEX,
|
||||
D3D10_NAME_TARGET = D3D_NAME_TARGET,
|
||||
D3D10_NAME_DEPTH = D3D_NAME_DEPTH,
|
||||
D3D10_NAME_COVERAGE = D3D_NAME_COVERAGE,
|
||||
D3D11_NAME_FINAL_QUAD_EDGE_TESSFACTOR = D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR,
|
||||
D3D11_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR,
|
||||
D3D11_NAME_FINAL_TRI_EDGE_TESSFACTOR = D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR,
|
||||
D3D11_NAME_FINAL_TRI_INSIDE_TESSFACTOR = D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR,
|
||||
D3D11_NAME_FINAL_LINE_DETAIL_TESSFACTOR = D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR,
|
||||
D3D11_NAME_FINAL_LINE_DENSITY_TESSFACTOR = D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR,
|
||||
D3D11_NAME_DEPTH_GREATER_EQUAL = D3D_NAME_DEPTH_GREATER_EQUAL,
|
||||
D3D11_NAME_DEPTH_LESS_EQUAL = D3D_NAME_DEPTH_LESS_EQUAL
|
||||
} D3D_NAME;
|
||||
|
||||
typedef
|
||||
enum D3D_RESOURCE_RETURN_TYPE
|
||||
{ D3D_RETURN_TYPE_UNORM = 1,
|
||||
D3D_RETURN_TYPE_SNORM = 2,
|
||||
D3D_RETURN_TYPE_SINT = 3,
|
||||
D3D_RETURN_TYPE_UINT = 4,
|
||||
D3D_RETURN_TYPE_FLOAT = 5,
|
||||
D3D_RETURN_TYPE_MIXED = 6,
|
||||
D3D_RETURN_TYPE_DOUBLE = 7,
|
||||
D3D_RETURN_TYPE_CONTINUED = 8,
|
||||
D3D10_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM,
|
||||
D3D10_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM,
|
||||
D3D10_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT,
|
||||
D3D10_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT,
|
||||
D3D10_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT,
|
||||
D3D10_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED,
|
||||
D3D11_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM,
|
||||
D3D11_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM,
|
||||
D3D11_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT,
|
||||
D3D11_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT,
|
||||
D3D11_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT,
|
||||
D3D11_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED,
|
||||
D3D11_RETURN_TYPE_DOUBLE = D3D_RETURN_TYPE_DOUBLE,
|
||||
D3D11_RETURN_TYPE_CONTINUED = D3D_RETURN_TYPE_CONTINUED
|
||||
} D3D_RESOURCE_RETURN_TYPE;
|
||||
|
||||
typedef
|
||||
enum D3D_REGISTER_COMPONENT_TYPE
|
||||
{ D3D_REGISTER_COMPONENT_UNKNOWN = 0,
|
||||
D3D_REGISTER_COMPONENT_UINT32 = 1,
|
||||
D3D_REGISTER_COMPONENT_SINT32 = 2,
|
||||
D3D_REGISTER_COMPONENT_FLOAT32 = 3,
|
||||
D3D10_REGISTER_COMPONENT_UNKNOWN = D3D_REGISTER_COMPONENT_UNKNOWN,
|
||||
D3D10_REGISTER_COMPONENT_UINT32 = D3D_REGISTER_COMPONENT_UINT32,
|
||||
D3D10_REGISTER_COMPONENT_SINT32 = D3D_REGISTER_COMPONENT_SINT32,
|
||||
D3D10_REGISTER_COMPONENT_FLOAT32 = D3D_REGISTER_COMPONENT_FLOAT32
|
||||
} D3D_REGISTER_COMPONENT_TYPE;
|
||||
|
||||
typedef
|
||||
enum D3D_TESSELLATOR_DOMAIN
|
||||
{ D3D_TESSELLATOR_DOMAIN_UNDEFINED = 0,
|
||||
D3D_TESSELLATOR_DOMAIN_ISOLINE = 1,
|
||||
D3D_TESSELLATOR_DOMAIN_TRI = 2,
|
||||
D3D_TESSELLATOR_DOMAIN_QUAD = 3,
|
||||
D3D11_TESSELLATOR_DOMAIN_UNDEFINED = D3D_TESSELLATOR_DOMAIN_UNDEFINED,
|
||||
D3D11_TESSELLATOR_DOMAIN_ISOLINE = D3D_TESSELLATOR_DOMAIN_ISOLINE,
|
||||
D3D11_TESSELLATOR_DOMAIN_TRI = D3D_TESSELLATOR_DOMAIN_TRI,
|
||||
D3D11_TESSELLATOR_DOMAIN_QUAD = D3D_TESSELLATOR_DOMAIN_QUAD
|
||||
} D3D_TESSELLATOR_DOMAIN;
|
||||
|
||||
typedef
|
||||
enum D3D_TESSELLATOR_PARTITIONING
|
||||
{ D3D_TESSELLATOR_PARTITIONING_UNDEFINED = 0,
|
||||
D3D_TESSELLATOR_PARTITIONING_INTEGER = 1,
|
||||
D3D_TESSELLATOR_PARTITIONING_POW2 = 2,
|
||||
D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3,
|
||||
D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4,
|
||||
D3D11_TESSELLATOR_PARTITIONING_UNDEFINED = D3D_TESSELLATOR_PARTITIONING_UNDEFINED,
|
||||
D3D11_TESSELLATOR_PARTITIONING_INTEGER = D3D_TESSELLATOR_PARTITIONING_INTEGER,
|
||||
D3D11_TESSELLATOR_PARTITIONING_POW2 = D3D_TESSELLATOR_PARTITIONING_POW2,
|
||||
D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD,
|
||||
D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN
|
||||
} D3D_TESSELLATOR_PARTITIONING;
|
||||
|
||||
typedef
|
||||
enum D3D_TESSELLATOR_OUTPUT_PRIMITIVE
|
||||
{ D3D_TESSELLATOR_OUTPUT_UNDEFINED = 0,
|
||||
D3D_TESSELLATOR_OUTPUT_POINT = 1,
|
||||
D3D_TESSELLATOR_OUTPUT_LINE = 2,
|
||||
D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3,
|
||||
D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4,
|
||||
D3D11_TESSELLATOR_OUTPUT_UNDEFINED = D3D_TESSELLATOR_OUTPUT_UNDEFINED,
|
||||
D3D11_TESSELLATOR_OUTPUT_POINT = D3D_TESSELLATOR_OUTPUT_POINT,
|
||||
D3D11_TESSELLATOR_OUTPUT_LINE = D3D_TESSELLATOR_OUTPUT_LINE,
|
||||
D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW,
|
||||
D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CCW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW
|
||||
} D3D_TESSELLATOR_OUTPUT_PRIMITIVE;
|
||||
|
||||
DEFINE_GUID(WKPDID_D3DDebugObjectName,0x429b8c22,0x9188,0x4b0c,0x87,0x42,0xac,0xb0,0xbf,0x85,0xc2,0x00);
|
||||
|
||||
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_c_ifspec;
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_s_ifspec;
|
||||
|
||||
/* Additional Prototypes for ALL interfaces */
|
||||
|
||||
/* end of Additional Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
397
SDK/Include/D3Dcompiler.h
Normal file
397
SDK/Include/D3Dcompiler.h
Normal file
@ -0,0 +1,397 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// File: D3DCompiler.h
|
||||
// Content: D3D Compilation Types and APIs
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __D3DCOMPILER_H__
|
||||
#define __D3DCOMPILER_H__
|
||||
|
||||
// Current name of the DLL shipped in the same SDK as this header.
|
||||
|
||||
|
||||
#define D3DCOMPILER_DLL_W L"d3dcompiler_43.dll"
|
||||
#define D3DCOMPILER_DLL_A "d3dcompiler_43.dll"
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DCOMPILER_DLL D3DCOMPILER_DLL_W
|
||||
#else
|
||||
#define D3DCOMPILER_DLL D3DCOMPILER_DLL_A
|
||||
#endif
|
||||
|
||||
#include "d3d11shader.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// APIs //////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCOMPILE flags:
|
||||
// -----------------
|
||||
// D3DCOMPILE_DEBUG
|
||||
// Insert debug file/line/type/symbol information.
|
||||
//
|
||||
// D3DCOMPILE_SKIP_VALIDATION
|
||||
// Do not validate the generated code against known capabilities and
|
||||
// constraints. This option is only recommended when compiling shaders
|
||||
// you KNOW will work. (ie. have compiled before without this option.)
|
||||
// Shaders are always validated by D3D before they are set to the device.
|
||||
//
|
||||
// D3DCOMPILE_SKIP_OPTIMIZATION
|
||||
// Instructs the compiler to skip optimization steps during code generation.
|
||||
// Unless you are trying to isolate a problem in your code using this option
|
||||
// is not recommended.
|
||||
//
|
||||
// D3DCOMPILE_PACK_MATRIX_ROW_MAJOR
|
||||
// Unless explicitly specified, matrices will be packed in row-major order
|
||||
// on input and output from the shader.
|
||||
//
|
||||
// D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR
|
||||
// Unless explicitly specified, matrices will be packed in column-major
|
||||
// order on input and output from the shader. This is generally more
|
||||
// efficient, since it allows vector-matrix multiplication to be performed
|
||||
// using a series of dot-products.
|
||||
//
|
||||
// D3DCOMPILE_PARTIAL_PRECISION
|
||||
// Force all computations in resulting shader to occur at partial precision.
|
||||
// This may result in faster evaluation of shaders on some hardware.
|
||||
//
|
||||
// D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT
|
||||
// Force compiler to compile against the next highest available software
|
||||
// target for vertex shaders. This flag also turns optimizations off,
|
||||
// and debugging on.
|
||||
//
|
||||
// D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT
|
||||
// Force compiler to compile against the next highest available software
|
||||
// target for pixel shaders. This flag also turns optimizations off,
|
||||
// and debugging on.
|
||||
//
|
||||
// D3DCOMPILE_NO_PRESHADER
|
||||
// Disables Preshaders. Using this flag will cause the compiler to not
|
||||
// pull out static expression for evaluation on the host cpu
|
||||
//
|
||||
// D3DCOMPILE_AVOID_FLOW_CONTROL
|
||||
// Hint compiler to avoid flow-control constructs where possible.
|
||||
//
|
||||
// D3DCOMPILE_PREFER_FLOW_CONTROL
|
||||
// Hint compiler to prefer flow-control constructs where possible.
|
||||
//
|
||||
// D3DCOMPILE_ENABLE_STRICTNESS
|
||||
// By default, the HLSL/Effect compilers are not strict on deprecated syntax.
|
||||
// Specifying this flag enables the strict mode. Deprecated syntax may be
|
||||
// removed in a future release, and enabling syntax is a good way to make
|
||||
// sure your shaders comply to the latest spec.
|
||||
//
|
||||
// D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY
|
||||
// This enables older shaders to compile to 4_0 targets.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define D3DCOMPILE_DEBUG (1 << 0)
|
||||
#define D3DCOMPILE_SKIP_VALIDATION (1 << 1)
|
||||
#define D3DCOMPILE_SKIP_OPTIMIZATION (1 << 2)
|
||||
#define D3DCOMPILE_PACK_MATRIX_ROW_MAJOR (1 << 3)
|
||||
#define D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR (1 << 4)
|
||||
#define D3DCOMPILE_PARTIAL_PRECISION (1 << 5)
|
||||
#define D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT (1 << 6)
|
||||
#define D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT (1 << 7)
|
||||
#define D3DCOMPILE_NO_PRESHADER (1 << 8)
|
||||
#define D3DCOMPILE_AVOID_FLOW_CONTROL (1 << 9)
|
||||
#define D3DCOMPILE_PREFER_FLOW_CONTROL (1 << 10)
|
||||
#define D3DCOMPILE_ENABLE_STRICTNESS (1 << 11)
|
||||
#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12)
|
||||
#define D3DCOMPILE_IEEE_STRICTNESS (1 << 13)
|
||||
#define D3DCOMPILE_OPTIMIZATION_LEVEL0 (1 << 14)
|
||||
#define D3DCOMPILE_OPTIMIZATION_LEVEL1 0
|
||||
#define D3DCOMPILE_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15))
|
||||
#define D3DCOMPILE_OPTIMIZATION_LEVEL3 (1 << 15)
|
||||
#define D3DCOMPILE_RESERVED16 (1 << 16)
|
||||
#define D3DCOMPILE_RESERVED17 (1 << 17)
|
||||
#define D3DCOMPILE_WARNINGS_ARE_ERRORS (1 << 18)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCOMPILE_EFFECT flags:
|
||||
// -------------------------------------
|
||||
// These flags are passed in when creating an effect, and affect
|
||||
// either compilation behavior or runtime effect behavior
|
||||
//
|
||||
// D3DCOMPILE_EFFECT_CHILD_EFFECT
|
||||
// Compile this .fx file to a child effect. Child effects have no
|
||||
// initializers for any shared values as these are initialied in the
|
||||
// master effect (pool).
|
||||
//
|
||||
// D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS
|
||||
// By default, performance mode is enabled. Performance mode
|
||||
// disallows mutable state objects by preventing non-literal
|
||||
// expressions from appearing in state object definitions.
|
||||
// Specifying this flag will disable the mode and allow for mutable
|
||||
// state objects.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define D3DCOMPILE_EFFECT_CHILD_EFFECT (1 << 0)
|
||||
#define D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS (1 << 1)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCompile:
|
||||
// ----------
|
||||
// Compile source text into bytecode appropriate for the given target.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DCompile(__in_bcount(SrcDataSize) LPCVOID pSrcData,
|
||||
__in SIZE_T SrcDataSize,
|
||||
__in_opt LPCSTR pSourceName,
|
||||
__in_xcount_opt(pDefines->Name != NULL) CONST D3D_SHADER_MACRO* pDefines,
|
||||
__in_opt ID3DInclude* pInclude,
|
||||
__in LPCSTR pEntrypoint,
|
||||
__in LPCSTR pTarget,
|
||||
__in UINT Flags1,
|
||||
__in UINT Flags2,
|
||||
__out ID3DBlob** ppCode,
|
||||
__out_opt ID3DBlob** ppErrorMsgs);
|
||||
|
||||
typedef HRESULT (WINAPI *pD3DCompile)
|
||||
(LPCVOID pSrcData,
|
||||
SIZE_T SrcDataSize,
|
||||
LPCSTR pFileName,
|
||||
CONST D3D_SHADER_MACRO* pDefines,
|
||||
ID3DInclude* pInclude,
|
||||
LPCSTR pEntrypoint,
|
||||
LPCSTR pTarget,
|
||||
UINT Flags1,
|
||||
UINT Flags2,
|
||||
ID3DBlob** ppCode,
|
||||
ID3DBlob** ppErrorMsgs);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DPreprocess:
|
||||
// ----------
|
||||
// Process source text with the compiler's preprocessor and return
|
||||
// the resulting text.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DPreprocess(__in_bcount(SrcDataSize) LPCVOID pSrcData,
|
||||
__in SIZE_T SrcDataSize,
|
||||
__in_opt LPCSTR pSourceName,
|
||||
__in_opt CONST D3D_SHADER_MACRO* pDefines,
|
||||
__in_opt ID3DInclude* pInclude,
|
||||
__out ID3DBlob** ppCodeText,
|
||||
__out_opt ID3DBlob** ppErrorMsgs);
|
||||
|
||||
typedef HRESULT (WINAPI *pD3DPreprocess)
|
||||
(LPCVOID pSrcData,
|
||||
SIZE_T SrcDataSize,
|
||||
LPCSTR pFileName,
|
||||
CONST D3D_SHADER_MACRO* pDefines,
|
||||
ID3DInclude* pInclude,
|
||||
ID3DBlob** ppCodeText,
|
||||
ID3DBlob** ppErrorMsgs);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetDebugInfo:
|
||||
// -----------------------
|
||||
// Gets shader debug info. Debug info is generated by D3DCompile and is
|
||||
// embedded in the body of the shader.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetDebugInfo(__in_bcount(SrcDataSize) LPCVOID pSrcData,
|
||||
__in SIZE_T SrcDataSize,
|
||||
__out ID3DBlob** ppDebugInfo);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DReflect:
|
||||
// ----------
|
||||
// Shader code contains metadata that can be inspected via the
|
||||
// reflection APIs.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DReflect(__in_bcount(SrcDataSize) LPCVOID pSrcData,
|
||||
__in SIZE_T SrcDataSize,
|
||||
__in REFIID pInterface,
|
||||
__out void** ppReflector);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DDisassemble:
|
||||
// ----------------------
|
||||
// Takes a binary shader and returns a buffer containing text assembly.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define D3D_DISASM_ENABLE_COLOR_CODE 0x00000001
|
||||
#define D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS 0x00000002
|
||||
#define D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING 0x00000004
|
||||
#define D3D_DISASM_ENABLE_INSTRUCTION_CYCLE 0x00000008
|
||||
#define D3D_DISASM_DISABLE_DEBUG_INFO 0x00000010
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DDisassemble(__in_bcount(SrcDataSize) LPCVOID pSrcData,
|
||||
__in SIZE_T SrcDataSize,
|
||||
__in UINT Flags,
|
||||
__in_opt LPCSTR szComments,
|
||||
__out ID3DBlob** ppDisassembly);
|
||||
|
||||
typedef HRESULT (WINAPI *pD3DDisassemble)
|
||||
(__in_bcount(SrcDataSize) LPCVOID pSrcData,
|
||||
__in SIZE_T SrcDataSize,
|
||||
__in UINT Flags,
|
||||
__in_opt LPCSTR szComments,
|
||||
__out ID3DBlob** ppDisassembly);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DDisassemble10Effect:
|
||||
// -----------------------
|
||||
// Takes a D3D10 effect interface and returns a
|
||||
// buffer containing text assembly.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DDisassemble10Effect(__in interface ID3D10Effect *pEffect,
|
||||
__in UINT Flags,
|
||||
__out ID3DBlob** ppDisassembly);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetInputSignatureBlob:
|
||||
// -----------------------
|
||||
// Retrieve the input signature from a compilation result.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetInputSignatureBlob(__in_bcount(SrcDataSize) LPCVOID pSrcData,
|
||||
__in SIZE_T SrcDataSize,
|
||||
__out ID3DBlob** ppSignatureBlob);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetOutputSignatureBlob:
|
||||
// -----------------------
|
||||
// Retrieve the output signature from a compilation result.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetOutputSignatureBlob(__in_bcount(SrcDataSize) LPCVOID pSrcData,
|
||||
__in SIZE_T SrcDataSize,
|
||||
__out ID3DBlob** ppSignatureBlob);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetInputAndOutputSignatureBlob:
|
||||
// -----------------------
|
||||
// Retrieve the input and output signatures from a compilation result.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetInputAndOutputSignatureBlob(__in_bcount(SrcDataSize) LPCVOID pSrcData,
|
||||
__in SIZE_T SrcDataSize,
|
||||
__out ID3DBlob** ppSignatureBlob);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DStripShader:
|
||||
// -----------------------
|
||||
// Removes unwanted blobs from a compilation result
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3DCOMPILER_STRIP_FLAGS
|
||||
{
|
||||
D3DCOMPILER_STRIP_REFLECTION_DATA = 1,
|
||||
D3DCOMPILER_STRIP_DEBUG_INFO = 2,
|
||||
D3DCOMPILER_STRIP_TEST_BLOBS = 4,
|
||||
D3DCOMPILER_STRIP_FORCE_DWORD = 0x7fffffff,
|
||||
} D3DCOMPILER_STRIP_FLAGS;
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DStripShader(__in_bcount(BytecodeLength) LPCVOID pShaderBytecode,
|
||||
__in SIZE_T BytecodeLength,
|
||||
__in UINT uStripFlags,
|
||||
__out ID3DBlob** ppStrippedBlob);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetBlobPart:
|
||||
// -----------------------
|
||||
// Extracts information from a compilation result.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3D_BLOB_PART
|
||||
{
|
||||
D3D_BLOB_INPUT_SIGNATURE_BLOB,
|
||||
D3D_BLOB_OUTPUT_SIGNATURE_BLOB,
|
||||
D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB,
|
||||
D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB,
|
||||
D3D_BLOB_ALL_SIGNATURE_BLOB,
|
||||
D3D_BLOB_DEBUG_INFO,
|
||||
D3D_BLOB_LEGACY_SHADER,
|
||||
D3D_BLOB_XNA_PREPASS_SHADER,
|
||||
D3D_BLOB_XNA_SHADER,
|
||||
|
||||
// Test parts are only produced by special compiler versions and so
|
||||
// are usually not present in shaders.
|
||||
D3D_BLOB_TEST_ALTERNATE_SHADER = 0x8000,
|
||||
D3D_BLOB_TEST_COMPILE_DETAILS,
|
||||
D3D_BLOB_TEST_COMPILE_PERF,
|
||||
} D3D_BLOB_PART;
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetBlobPart(__in_bcount(SrcDataSize) LPCVOID pSrcData,
|
||||
__in SIZE_T SrcDataSize,
|
||||
__in D3D_BLOB_PART Part,
|
||||
__in UINT Flags,
|
||||
__out ID3DBlob** ppPart);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCompressShaders:
|
||||
// -----------------------
|
||||
// Compresses a set of shaders into a more compact form.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef struct _D3D_SHADER_DATA
|
||||
{
|
||||
LPCVOID pBytecode;
|
||||
SIZE_T BytecodeLength;
|
||||
} D3D_SHADER_DATA;
|
||||
|
||||
#define D3D_COMPRESS_SHADER_KEEP_ALL_PARTS 0x00000001
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DCompressShaders(__in UINT uNumShaders,
|
||||
__in_ecount(uNumShaders) D3D_SHADER_DATA* pShaderData,
|
||||
__in UINT uFlags,
|
||||
__out ID3DBlob** ppCompressedData);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DDecompressShaders:
|
||||
// -----------------------
|
||||
// Decompresses one or more shaders from a compressed set.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DDecompressShaders(__in_bcount(SrcDataSize) LPCVOID pSrcData,
|
||||
__in SIZE_T SrcDataSize,
|
||||
__in UINT uNumShaders,
|
||||
__in UINT uStartIndex,
|
||||
__in_ecount_opt(uNumShaders) UINT* pIndices,
|
||||
__in UINT uFlags,
|
||||
__out_ecount(uNumShaders) ID3DBlob** ppShaders,
|
||||
__out_opt UINT* pTotalShaders);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCreateBlob:
|
||||
// -----------------------
|
||||
// Create an ID3DBlob instance.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DCreateBlob(__in SIZE_T Size,
|
||||
__out ID3DBlob** ppBlob);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif // #ifndef __D3DCOMPILER_H__
|
4995
SDK/Include/DWrite.h
Normal file
4995
SDK/Include/DWrite.h
Normal file
File diff suppressed because it is too large
Load Diff
2901
SDK/Include/DXGI.h
Normal file
2901
SDK/Include/DXGI.h
Normal file
File diff suppressed because it is too large
Load Diff
112
SDK/Include/DXGIFormat.h
Normal file
112
SDK/Include/DXGIFormat.h
Normal file
@ -0,0 +1,112 @@
|
||||
|
||||
#ifndef __dxgiformat_h__
|
||||
#define __dxgiformat_h__
|
||||
|
||||
#define DXGI_FORMAT_DEFINED 1
|
||||
|
||||
typedef enum DXGI_FORMAT
|
||||
{
|
||||
DXGI_FORMAT_UNKNOWN = 0,
|
||||
DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
|
||||
DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
|
||||
DXGI_FORMAT_R32G32B32A32_UINT = 3,
|
||||
DXGI_FORMAT_R32G32B32A32_SINT = 4,
|
||||
DXGI_FORMAT_R32G32B32_TYPELESS = 5,
|
||||
DXGI_FORMAT_R32G32B32_FLOAT = 6,
|
||||
DXGI_FORMAT_R32G32B32_UINT = 7,
|
||||
DXGI_FORMAT_R32G32B32_SINT = 8,
|
||||
DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
|
||||
DXGI_FORMAT_R16G16B16A16_FLOAT = 10,
|
||||
DXGI_FORMAT_R16G16B16A16_UNORM = 11,
|
||||
DXGI_FORMAT_R16G16B16A16_UINT = 12,
|
||||
DXGI_FORMAT_R16G16B16A16_SNORM = 13,
|
||||
DXGI_FORMAT_R16G16B16A16_SINT = 14,
|
||||
DXGI_FORMAT_R32G32_TYPELESS = 15,
|
||||
DXGI_FORMAT_R32G32_FLOAT = 16,
|
||||
DXGI_FORMAT_R32G32_UINT = 17,
|
||||
DXGI_FORMAT_R32G32_SINT = 18,
|
||||
DXGI_FORMAT_R32G8X24_TYPELESS = 19,
|
||||
DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20,
|
||||
DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21,
|
||||
DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22,
|
||||
DXGI_FORMAT_R10G10B10A2_TYPELESS = 23,
|
||||
DXGI_FORMAT_R10G10B10A2_UNORM = 24,
|
||||
DXGI_FORMAT_R10G10B10A2_UINT = 25,
|
||||
DXGI_FORMAT_R11G11B10_FLOAT = 26,
|
||||
DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM = 28,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
|
||||
DXGI_FORMAT_R8G8B8A8_UINT = 30,
|
||||
DXGI_FORMAT_R8G8B8A8_SNORM = 31,
|
||||
DXGI_FORMAT_R8G8B8A8_SINT = 32,
|
||||
DXGI_FORMAT_R16G16_TYPELESS = 33,
|
||||
DXGI_FORMAT_R16G16_FLOAT = 34,
|
||||
DXGI_FORMAT_R16G16_UNORM = 35,
|
||||
DXGI_FORMAT_R16G16_UINT = 36,
|
||||
DXGI_FORMAT_R16G16_SNORM = 37,
|
||||
DXGI_FORMAT_R16G16_SINT = 38,
|
||||
DXGI_FORMAT_R32_TYPELESS = 39,
|
||||
DXGI_FORMAT_D32_FLOAT = 40,
|
||||
DXGI_FORMAT_R32_FLOAT = 41,
|
||||
DXGI_FORMAT_R32_UINT = 42,
|
||||
DXGI_FORMAT_R32_SINT = 43,
|
||||
DXGI_FORMAT_R24G8_TYPELESS = 44,
|
||||
DXGI_FORMAT_D24_UNORM_S8_UINT = 45,
|
||||
DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46,
|
||||
DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47,
|
||||
DXGI_FORMAT_R8G8_TYPELESS = 48,
|
||||
DXGI_FORMAT_R8G8_UNORM = 49,
|
||||
DXGI_FORMAT_R8G8_UINT = 50,
|
||||
DXGI_FORMAT_R8G8_SNORM = 51,
|
||||
DXGI_FORMAT_R8G8_SINT = 52,
|
||||
DXGI_FORMAT_R16_TYPELESS = 53,
|
||||
DXGI_FORMAT_R16_FLOAT = 54,
|
||||
DXGI_FORMAT_D16_UNORM = 55,
|
||||
DXGI_FORMAT_R16_UNORM = 56,
|
||||
DXGI_FORMAT_R16_UINT = 57,
|
||||
DXGI_FORMAT_R16_SNORM = 58,
|
||||
DXGI_FORMAT_R16_SINT = 59,
|
||||
DXGI_FORMAT_R8_TYPELESS = 60,
|
||||
DXGI_FORMAT_R8_UNORM = 61,
|
||||
DXGI_FORMAT_R8_UINT = 62,
|
||||
DXGI_FORMAT_R8_SNORM = 63,
|
||||
DXGI_FORMAT_R8_SINT = 64,
|
||||
DXGI_FORMAT_A8_UNORM = 65,
|
||||
DXGI_FORMAT_R1_UNORM = 66,
|
||||
DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67,
|
||||
DXGI_FORMAT_R8G8_B8G8_UNORM = 68,
|
||||
DXGI_FORMAT_G8R8_G8B8_UNORM = 69,
|
||||
DXGI_FORMAT_BC1_TYPELESS = 70,
|
||||
DXGI_FORMAT_BC1_UNORM = 71,
|
||||
DXGI_FORMAT_BC1_UNORM_SRGB = 72,
|
||||
DXGI_FORMAT_BC2_TYPELESS = 73,
|
||||
DXGI_FORMAT_BC2_UNORM = 74,
|
||||
DXGI_FORMAT_BC2_UNORM_SRGB = 75,
|
||||
DXGI_FORMAT_BC3_TYPELESS = 76,
|
||||
DXGI_FORMAT_BC3_UNORM = 77,
|
||||
DXGI_FORMAT_BC3_UNORM_SRGB = 78,
|
||||
DXGI_FORMAT_BC4_TYPELESS = 79,
|
||||
DXGI_FORMAT_BC4_UNORM = 80,
|
||||
DXGI_FORMAT_BC4_SNORM = 81,
|
||||
DXGI_FORMAT_BC5_TYPELESS = 82,
|
||||
DXGI_FORMAT_BC5_UNORM = 83,
|
||||
DXGI_FORMAT_BC5_SNORM = 84,
|
||||
DXGI_FORMAT_B5G6R5_UNORM = 85,
|
||||
DXGI_FORMAT_B5G5R5A1_UNORM = 86,
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM = 87,
|
||||
DXGI_FORMAT_B8G8R8X8_UNORM = 88,
|
||||
DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89,
|
||||
DXGI_FORMAT_B8G8R8A8_TYPELESS = 90,
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91,
|
||||
DXGI_FORMAT_B8G8R8X8_TYPELESS = 92,
|
||||
DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93,
|
||||
DXGI_FORMAT_BC6H_TYPELESS = 94,
|
||||
DXGI_FORMAT_BC6H_UF16 = 95,
|
||||
DXGI_FORMAT_BC6H_SF16 = 96,
|
||||
DXGI_FORMAT_BC7_TYPELESS = 97,
|
||||
DXGI_FORMAT_BC7_UNORM = 98,
|
||||
DXGI_FORMAT_BC7_UNORM_SRGB = 99,
|
||||
DXGI_FORMAT_FORCE_UINT = 0xffffffff
|
||||
} DXGI_FORMAT;
|
||||
|
||||
#endif // __dxgiformat_h__
|
123
SDK/Include/DXGIType.h
Normal file
123
SDK/Include/DXGIType.h
Normal file
@ -0,0 +1,123 @@
|
||||
|
||||
#ifndef __dxgitype_h__
|
||||
#define __dxgitype_h__
|
||||
|
||||
|
||||
#include "dxgiformat.h"
|
||||
|
||||
#define _FACDXGI 0x87a
|
||||
#define MAKE_DXGI_HRESULT(code) MAKE_HRESULT(1, _FACDXGI, code)
|
||||
#define MAKE_DXGI_STATUS(code) MAKE_HRESULT(0, _FACDXGI, code)
|
||||
|
||||
#define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1)
|
||||
#define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2)
|
||||
#define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4)
|
||||
#define DXGI_STATUS_NO_DESKTOP_ACCESS MAKE_DXGI_STATUS(5)
|
||||
#define DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_STATUS(6)
|
||||
#define DXGI_STATUS_MODE_CHANGED MAKE_DXGI_STATUS(7)
|
||||
#define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS MAKE_DXGI_STATUS(8)
|
||||
|
||||
|
||||
#define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1)
|
||||
#define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT(2)
|
||||
#define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT(3)
|
||||
#define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT(4)
|
||||
#define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT(5)
|
||||
#define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT(6)
|
||||
#define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT(7)
|
||||
#define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT(10)
|
||||
#define DXGI_ERROR_FRAME_STATISTICS_DISJOINT MAKE_DXGI_HRESULT(11)
|
||||
#define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_HRESULT(12)
|
||||
#define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT(32)
|
||||
#define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT(33)
|
||||
#define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE MAKE_DXGI_HRESULT(34)
|
||||
#define DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED MAKE_DXGI_HRESULT(35)
|
||||
#define DXGI_ERROR_REMOTE_OUTOFMEMORY MAKE_DXGI_HRESULT(36)
|
||||
|
||||
|
||||
|
||||
#define DXGI_CPU_ACCESS_NONE ( 0 )
|
||||
#define DXGI_CPU_ACCESS_DYNAMIC ( 1 )
|
||||
#define DXGI_CPU_ACCESS_READ_WRITE ( 2 )
|
||||
#define DXGI_CPU_ACCESS_SCRATCH ( 3 )
|
||||
#define DXGI_CPU_ACCESS_FIELD 15
|
||||
|
||||
#define DXGI_USAGE_SHADER_INPUT ( 1L << (0 + 4) )
|
||||
#define DXGI_USAGE_RENDER_TARGET_OUTPUT ( 1L << (1 + 4) )
|
||||
#define DXGI_USAGE_BACK_BUFFER ( 1L << (2 + 4) )
|
||||
#define DXGI_USAGE_SHARED ( 1L << (3 + 4) )
|
||||
#define DXGI_USAGE_READ_ONLY ( 1L << (4 + 4) )
|
||||
#define DXGI_USAGE_DISCARD_ON_PRESENT ( 1L << (5 + 4) )
|
||||
#define DXGI_USAGE_UNORDERED_ACCESS ( 1L << (6 + 4) )
|
||||
|
||||
typedef struct DXGI_RGB
|
||||
{
|
||||
float Red;
|
||||
float Green;
|
||||
float Blue;
|
||||
} DXGI_RGB;
|
||||
|
||||
typedef struct DXGI_GAMMA_CONTROL
|
||||
{
|
||||
DXGI_RGB Scale;
|
||||
DXGI_RGB Offset;
|
||||
DXGI_RGB GammaCurve[ 1025 ];
|
||||
} DXGI_GAMMA_CONTROL;
|
||||
|
||||
typedef struct DXGI_GAMMA_CONTROL_CAPABILITIES
|
||||
{
|
||||
BOOL ScaleAndOffsetSupported;
|
||||
float MaxConvertedValue;
|
||||
float MinConvertedValue;
|
||||
UINT NumGammaControlPoints;
|
||||
float ControlPointPositions[1025];
|
||||
} DXGI_GAMMA_CONTROL_CAPABILITIES;
|
||||
|
||||
typedef struct DXGI_RATIONAL
|
||||
{
|
||||
UINT Numerator;
|
||||
UINT Denominator;
|
||||
} DXGI_RATIONAL;
|
||||
|
||||
typedef enum DXGI_MODE_SCANLINE_ORDER
|
||||
{
|
||||
DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0,
|
||||
DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1,
|
||||
DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2,
|
||||
DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3
|
||||
} DXGI_MODE_SCANLINE_ORDER;
|
||||
|
||||
typedef enum DXGI_MODE_SCALING
|
||||
{
|
||||
DXGI_MODE_SCALING_UNSPECIFIED = 0,
|
||||
DXGI_MODE_SCALING_CENTERED = 1,
|
||||
DXGI_MODE_SCALING_STRETCHED = 2
|
||||
} DXGI_MODE_SCALING;
|
||||
|
||||
typedef enum DXGI_MODE_ROTATION
|
||||
{
|
||||
DXGI_MODE_ROTATION_UNSPECIFIED = 0,
|
||||
DXGI_MODE_ROTATION_IDENTITY = 1,
|
||||
DXGI_MODE_ROTATION_ROTATE90 = 2,
|
||||
DXGI_MODE_ROTATION_ROTATE180 = 3,
|
||||
DXGI_MODE_ROTATION_ROTATE270 = 4
|
||||
} DXGI_MODE_ROTATION;
|
||||
|
||||
typedef struct DXGI_MODE_DESC
|
||||
{
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
DXGI_RATIONAL RefreshRate;
|
||||
DXGI_FORMAT Format;
|
||||
DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
|
||||
DXGI_MODE_SCALING Scaling;
|
||||
} DXGI_MODE_DESC;
|
||||
|
||||
typedef struct DXGI_SAMPLE_DESC
|
||||
{
|
||||
UINT Count;
|
||||
UINT Quality;
|
||||
} DXGI_SAMPLE_DESC;
|
||||
|
||||
#endif // __dxgitype_h__
|
||||
|
65
SDK/Include/Dcommon.h
Normal file
65
SDK/Include/Dcommon.h
Normal file
@ -0,0 +1,65 @@
|
||||
//+--------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// Abstract:
|
||||
// Public API definitions for DWrite and D2D
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#ifndef DCOMMON_H_INCLUDED
|
||||
#define DCOMMON_H_INCLUDED
|
||||
|
||||
//
|
||||
//These macros are defined in the Windows 7 SDK, however to enable development using the technical preview,
|
||||
//they are included here temporarily.
|
||||
//
|
||||
#ifndef DEFINE_ENUM_FLAG_OPERATORS
|
||||
#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
|
||||
extern "C++" { \
|
||||
inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) | ((int)b)); } \
|
||||
inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \
|
||||
inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) & ((int)b)); } \
|
||||
inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \
|
||||
inline ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((int)a)); } \
|
||||
inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) ^ ((int)b)); } \
|
||||
inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __field_ecount_opt
|
||||
#define __field_ecount_opt(x)
|
||||
#endif
|
||||
|
||||
#ifndef __range
|
||||
#define __range(x,y)
|
||||
#endif
|
||||
|
||||
#ifndef __field_ecount
|
||||
#define __field_ecount(x)
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// The measuring method used for text layout.
|
||||
/// </summary>
|
||||
typedef enum DWRITE_MEASURING_MODE
|
||||
{
|
||||
/// <summary>
|
||||
/// Text is measured using glyph ideal metrics whose values are independent to the current display resolution.
|
||||
/// </summary>
|
||||
DWRITE_MEASURING_MODE_NATURAL,
|
||||
|
||||
/// <summary>
|
||||
/// Text is measured using glyph display compatible metrics whose values tuned for the current display resolution.
|
||||
/// </summary>
|
||||
DWRITE_MEASURING_MODE_GDI_CLASSIC,
|
||||
|
||||
/// <summary>
|
||||
/// Text is measured using the same glyph display metrics as text measured by GDI using a font
|
||||
/// created with CLEARTYPE_NATURAL_QUALITY.
|
||||
/// </summary>
|
||||
DWRITE_MEASURING_MODE_GDI_NATURAL
|
||||
|
||||
} DWRITE_MEASURING_MODE;
|
||||
|
||||
#endif /* DCOMMON_H_INCLUDED */
|
99
SDK/Include/DxErr.h
Normal file
99
SDK/Include/DxErr.h
Normal file
@ -0,0 +1,99 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
*
|
||||
* File: dxerr.h
|
||||
* Content: DirectX Error Library Include File
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _DXERR_H_
|
||||
#define _DXERR_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
//
|
||||
// DXGetErrorString
|
||||
//
|
||||
// Desc: Converts a DirectX HRESULT to a string
|
||||
//
|
||||
// Args: HRESULT hr Can be any error code from
|
||||
// XACT XAUDIO2 XAPO XINPUT DXGI D3D10 D3DX10 D3D9 D3DX9 DDRAW DSOUND DINPUT DSHOW
|
||||
//
|
||||
// Return: Converted string
|
||||
//
|
||||
const char* WINAPI DXGetErrorStringA(__in HRESULT hr);
|
||||
const WCHAR* WINAPI DXGetErrorStringW(__in HRESULT hr);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define DXGetErrorString DXGetErrorStringW
|
||||
#else
|
||||
#define DXGetErrorString DXGetErrorStringA
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// DXGetErrorDescription
|
||||
//
|
||||
// Desc: Returns a string description of a DirectX HRESULT
|
||||
//
|
||||
// Args: HRESULT hr Can be any error code from
|
||||
// XACT XAUDIO2 XAPO XINPUT DXGI D3D10 D3DX10 D3D9 D3DX9 DDRAW DSOUND DINPUT DSHOW
|
||||
//
|
||||
// Return: String description
|
||||
//
|
||||
const char* WINAPI DXGetErrorDescriptionA(__in HRESULT hr);
|
||||
const WCHAR* WINAPI DXGetErrorDescriptionW(__in HRESULT hr);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define DXGetErrorDescription DXGetErrorDescriptionW
|
||||
#else
|
||||
#define DXGetErrorDescription DXGetErrorDescriptionA
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// DXTrace
|
||||
//
|
||||
// Desc: Outputs a formatted error message to the debug stream
|
||||
//
|
||||
// Args: CHAR* strFile The current file, typically passed in using the
|
||||
// __FILE__ macro.
|
||||
// DWORD dwLine The current line number, typically passed in using the
|
||||
// __LINE__ macro.
|
||||
// HRESULT hr An HRESULT that will be traced to the debug stream.
|
||||
// CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
|
||||
// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
|
||||
//
|
||||
// Return: The hr that was passed in.
|
||||
//
|
||||
HRESULT WINAPI DXTraceA( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const char* strMsg, __in BOOL bPopMsgBox );
|
||||
HRESULT WINAPI DXTraceW( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const WCHAR* strMsg, __in BOOL bPopMsgBox );
|
||||
|
||||
#ifdef UNICODE
|
||||
#define DXTrace DXTraceW
|
||||
#else
|
||||
#define DXTrace DXTraceA
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// Helper macros
|
||||
//
|
||||
#if defined(DEBUG) | defined(_DEBUG)
|
||||
#define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
|
||||
#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
|
||||
#define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
|
||||
#else
|
||||
#define DXTRACE_MSG(str) (0L)
|
||||
#define DXTRACE_ERR(str,hr) (hr)
|
||||
#define DXTRACE_ERR_MSGBOX(str,hr) (hr)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif // _DXERR_H_
|
120
SDK/Include/PIXPlugin.h
Normal file
120
SDK/Include/PIXPlugin.h
Normal file
@ -0,0 +1,120 @@
|
||||
//==================================================================================================
|
||||
// PIXPlugin.h
|
||||
//
|
||||
// Microsoft PIX Plugin Header
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation, All rights reserved
|
||||
//==================================================================================================
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
// PIX_PLUGIN_SYSTEM_VERSION - Indicates version of the plugin interface the plugin is built with.
|
||||
//==================================================================================================
|
||||
#define PIX_PLUGIN_SYSTEM_VERSION 0x101
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
// PIXCOUNTERID - A unique identifier for each PIX plugin counter.
|
||||
//==================================================================================================
|
||||
typedef int PIXCOUNTERID;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
// PIXCOUNTERDATATYPE - Indicates what type of data the counter produces.
|
||||
//==================================================================================================
|
||||
enum PIXCOUNTERDATATYPE
|
||||
{
|
||||
PCDT_RESERVED,
|
||||
PCDT_FLOAT,
|
||||
PCDT_INT,
|
||||
PCDT_INT64,
|
||||
PCDT_STRING,
|
||||
};
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
// PIXPLUGININFO - This structure is filled out by PIXGetPluginInfo and passed back to PIX.
|
||||
//==================================================================================================
|
||||
struct PIXPLUGININFO
|
||||
{
|
||||
// Filled in by caller:
|
||||
HINSTANCE hinst;
|
||||
|
||||
// Filled in by PIXGetPluginInfo:
|
||||
WCHAR* pstrPluginName; // Name of plugin
|
||||
int iPluginVersion; // Version of this particular plugin
|
||||
int iPluginSystemVersion; // Version of PIX's plugin system this plugin was designed for
|
||||
};
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
// PIXCOUNTERINFO - This structure is filled out by PIXGetCounterInfo and passed back to PIX
|
||||
// to allow PIX to determine information about the counters in the plugin.
|
||||
//==================================================================================================
|
||||
struct PIXCOUNTERINFO
|
||||
{
|
||||
PIXCOUNTERID counterID; // Used to uniquely ID this counter
|
||||
WCHAR* pstrName; // String name of the counter
|
||||
PIXCOUNTERDATATYPE pcdtDataType; // Data type returned by this counter
|
||||
};
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
// PIXGetPluginInfo - This returns basic information about this plugin to PIX.
|
||||
//==================================================================================================
|
||||
BOOL WINAPI PIXGetPluginInfo( PIXPLUGININFO* pPIXPluginInfo );
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
// PIXGetCounterInfo - This returns an array of PIXCOUNTERINFO structs to PIX.
|
||||
// These PIXCOUNTERINFOs allow PIX to enumerate the counters contained
|
||||
// in this plugin.
|
||||
//==================================================================================================
|
||||
BOOL WINAPI PIXGetCounterInfo( DWORD* pdwReturnCounters, PIXCOUNTERINFO** ppCounterInfoList );
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
// PIXGetCounterDesc - This is called by PIX to request a description of the indicated counter.
|
||||
//==================================================================================================
|
||||
BOOL WINAPI PIXGetCounterDesc( PIXCOUNTERID id, WCHAR** ppstrCounterDesc );
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
// PIXBeginExperiment - This called by PIX once per counter when instrumentation starts.
|
||||
//==================================================================================================
|
||||
BOOL WINAPI PIXBeginExperiment( PIXCOUNTERID id, const WCHAR* pstrApplication );
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
// PIXEndFrame - This is called by PIX once per counter at the end of each frame to gather the
|
||||
// counter value for that frame. Note that the pointer to the return data must
|
||||
// continue to point to valid counter data until the next call to PIXEndFrame (or
|
||||
// PIXEndExperiment) for the same counter. So do not set *ppReturnData to the same
|
||||
// pointer for multiple counters, or point to a local variable that will go out of
|
||||
// scope. See the sample PIX plugin for an example of how to structure a plugin
|
||||
// properly.
|
||||
//==================================================================================================
|
||||
BOOL WINAPI PIXEndFrame( PIXCOUNTERID id, UINT iFrame, DWORD* pdwReturnBytes, BYTE** ppReturnData );
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
// PIXEndExperiment - This is called by PIX once per counter when instrumentation ends.
|
||||
//==================================================================================================
|
||||
BOOL WINAPI PIXEndExperiment( PIXCOUNTERID id );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
//==================================================================================================
|
||||
// eof: PIXPlugin.h
|
||||
//==================================================================================================
|
||||
|
316
SDK/Include/X3DAudio.h
Normal file
316
SDK/Include/X3DAudio.h
Normal file
@ -0,0 +1,316 @@
|
||||
/*-========================================================================-_
|
||||
| - X3DAUDIO - |
|
||||
| Copyright (c) Microsoft Corporation. All rights reserved. |
|
||||
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|
||||
|PROJECT: X3DAudio MODEL: Unmanaged User-mode |
|
||||
|VERSION: 1.7 EXCEPT: No Exceptions |
|
||||
|CLASS: N / A MINREQ: WinXP, Xbox360 |
|
||||
|BASE: N / A DIALECT: MSC++ 14.00 |
|
||||
|>------------------------------------------------------------------------<|
|
||||
| DUTY: Cross-platform stand-alone 3D audio math library |
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
|
||||
NOTES:
|
||||
1. USE THE DEBUG DLL TO ENABLE PARAMETER VALIDATION VIA ASSERTS!
|
||||
Here's how:
|
||||
Copy X3DAudioDX_X.dll to where your application exists.
|
||||
The debug DLL can be found under %WINDIR%\system32.
|
||||
Rename X3DAudioDX_X.dll to X3DAudioX_X.dll to use the debug version.
|
||||
|
||||
Only parameters required by DSP settings being calculated as
|
||||
stipulated by the calculation control flags are validated.
|
||||
|
||||
2. Definition of terms:
|
||||
LFE: Low Frequency Effect -- always omnidirectional.
|
||||
LPF: Low Pass Filter, divided into two classifications:
|
||||
Direct -- Applied to the direct signal path,
|
||||
used for obstruction/occlusion effects.
|
||||
Reverb -- Applied to the reverb signal path,
|
||||
used for occlusion effects only.
|
||||
|
||||
3. Volume level is expressed as a linear amplitude scaler:
|
||||
1.0f represents no attenuation applied to the original signal,
|
||||
0.5f denotes an attenuation of 6dB, and 0.0f results in silence.
|
||||
Amplification (volume > 1.0f) is also allowed, and is not clamped.
|
||||
|
||||
LPF values range from 1.0f representing all frequencies pass through,
|
||||
to 0.0f which results in silence as all frequencies are filtered out.
|
||||
|
||||
4. X3DAudio uses a left-handed Cartesian coordinate system with values
|
||||
on the x-axis increasing from left to right, on the y-axis from
|
||||
bottom to top, and on the z-axis from near to far.
|
||||
Azimuths are measured clockwise from a given reference direction.
|
||||
|
||||
Distance measurement is with respect to user-defined world units.
|
||||
Applications may provide coordinates using any system of measure
|
||||
as all non-normalized calculations are scale invariant, with such
|
||||
operations natively occurring in user-defined world unit space.
|
||||
Metric constants are supplied only as a convenience.
|
||||
Distance is calculated using the Euclidean norm formula.
|
||||
|
||||
5. Only real values are permissible with functions using 32-bit
|
||||
float parameters -- NAN and infinite values are not accepted.
|
||||
All computation occurs in 32-bit precision mode. */
|
||||
|
||||
#pragma once
|
||||
//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
|
||||
#include <windef.h> // general windows types
|
||||
#if defined(_XBOX)
|
||||
#include <vectorintrinsics.h>
|
||||
#endif
|
||||
#include <d3d9types.h> // for D3DVECTOR
|
||||
|
||||
// speaker geometry configuration flags, specifies assignment of channels to speaker positions, defined as per WAVEFORMATEXTENSIBLE.dwChannelMask
|
||||
#if !defined(_SPEAKER_POSITIONS_)
|
||||
#define _SPEAKER_POSITIONS_
|
||||
#define SPEAKER_FRONT_LEFT 0x00000001
|
||||
#define SPEAKER_FRONT_RIGHT 0x00000002
|
||||
#define SPEAKER_FRONT_CENTER 0x00000004
|
||||
#define SPEAKER_LOW_FREQUENCY 0x00000008
|
||||
#define SPEAKER_BACK_LEFT 0x00000010
|
||||
#define SPEAKER_BACK_RIGHT 0x00000020
|
||||
#define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040
|
||||
#define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080
|
||||
#define SPEAKER_BACK_CENTER 0x00000100
|
||||
#define SPEAKER_SIDE_LEFT 0x00000200
|
||||
#define SPEAKER_SIDE_RIGHT 0x00000400
|
||||
#define SPEAKER_TOP_CENTER 0x00000800
|
||||
#define SPEAKER_TOP_FRONT_LEFT 0x00001000
|
||||
#define SPEAKER_TOP_FRONT_CENTER 0x00002000
|
||||
#define SPEAKER_TOP_FRONT_RIGHT 0x00004000
|
||||
#define SPEAKER_TOP_BACK_LEFT 0x00008000
|
||||
#define SPEAKER_TOP_BACK_CENTER 0x00010000
|
||||
#define SPEAKER_TOP_BACK_RIGHT 0x00020000
|
||||
#define SPEAKER_RESERVED 0x7FFC0000 // bit mask locations reserved for future use
|
||||
#define SPEAKER_ALL 0x80000000 // used to specify that any possible permutation of speaker configurations
|
||||
#endif
|
||||
|
||||
// standard speaker geometry configurations, used with X3DAudioInitialize
|
||||
#if !defined(SPEAKER_MONO)
|
||||
#define SPEAKER_MONO SPEAKER_FRONT_CENTER
|
||||
#define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT)
|
||||
#define SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY)
|
||||
#define SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER)
|
||||
#define SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
|
||||
#define SPEAKER_4POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
|
||||
#define SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
|
||||
#define SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER)
|
||||
#define SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
|
||||
#define SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
|
||||
#endif
|
||||
|
||||
// Xbox360 speaker geometry configuration, used with X3DAudioInitialize
|
||||
#if defined(_XBOX)
|
||||
#define SPEAKER_XBOX SPEAKER_5POINT1
|
||||
#endif
|
||||
|
||||
|
||||
// size of instance handle in bytes
|
||||
#define X3DAUDIO_HANDLE_BYTESIZE 20
|
||||
|
||||
// float math constants
|
||||
#define X3DAUDIO_PI 3.141592654f
|
||||
#define X3DAUDIO_2PI 6.283185307f
|
||||
|
||||
// speed of sound in meters per second for dry air at approximately 20C, used with X3DAudioInitialize
|
||||
#define X3DAUDIO_SPEED_OF_SOUND 343.5f
|
||||
|
||||
// calculation control flags, used with X3DAudioCalculate
|
||||
#define X3DAUDIO_CALCULATE_MATRIX 0x00000001 // enable matrix coefficient table calculation
|
||||
#define X3DAUDIO_CALCULATE_DELAY 0x00000002 // enable delay time array calculation (stereo final mix only)
|
||||
#define X3DAUDIO_CALCULATE_LPF_DIRECT 0x00000004 // enable LPF direct-path coefficient calculation
|
||||
#define X3DAUDIO_CALCULATE_LPF_REVERB 0x00000008 // enable LPF reverb-path coefficient calculation
|
||||
#define X3DAUDIO_CALCULATE_REVERB 0x00000010 // enable reverb send level calculation
|
||||
#define X3DAUDIO_CALCULATE_DOPPLER 0x00000020 // enable doppler shift factor calculation
|
||||
#define X3DAUDIO_CALCULATE_EMITTER_ANGLE 0x00000040 // enable emitter-to-listener interior angle calculation
|
||||
|
||||
#define X3DAUDIO_CALCULATE_ZEROCENTER 0x00010000 // do not position to front center speaker, signal positioned to remaining speakers instead, front center destination channel will be zero in returned matrix coefficient table, valid only for matrix calculations with final mix formats that have a front center channel
|
||||
#define X3DAUDIO_CALCULATE_REDIRECT_TO_LFE 0x00020000 // apply equal mix of all source channels to LFE destination channel, valid only for matrix calculations with sources that have no LFE channel and final mix formats that have an LFE channel
|
||||
|
||||
|
||||
//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
|
||||
#pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments
|
||||
|
||||
|
||||
// primitive types
|
||||
typedef float FLOAT32; // 32-bit IEEE float
|
||||
typedef D3DVECTOR X3DAUDIO_VECTOR; // float 3D vector
|
||||
|
||||
// instance handle of precalculated constants
|
||||
typedef BYTE X3DAUDIO_HANDLE[X3DAUDIO_HANDLE_BYTESIZE];
|
||||
|
||||
|
||||
// Distance curve point:
|
||||
// Defines a DSP setting at a given normalized distance.
|
||||
typedef struct X3DAUDIO_DISTANCE_CURVE_POINT
|
||||
{
|
||||
FLOAT32 Distance; // normalized distance, must be within [0.0f, 1.0f]
|
||||
FLOAT32 DSPSetting; // DSP setting
|
||||
} X3DAUDIO_DISTANCE_CURVE_POINT, *LPX3DAUDIO_DISTANCE_CURVE_POINT;
|
||||
|
||||
// Distance curve:
|
||||
// A piecewise curve made up of linear segments used to
|
||||
// define DSP behaviour with respect to normalized distance.
|
||||
//
|
||||
// Note that curve point distances are normalized within [0.0f, 1.0f].
|
||||
// X3DAUDIO_EMITTER.CurveDistanceScaler must be used to scale the
|
||||
// normalized distances to user-defined world units.
|
||||
// For distances beyond CurveDistanceScaler * 1.0f,
|
||||
// pPoints[PointCount-1].DSPSetting is used as the DSP setting.
|
||||
//
|
||||
// All distance curve spans must be such that:
|
||||
// pPoints[k-1].DSPSetting + ((pPoints[k].DSPSetting-pPoints[k-1].DSPSetting) / (pPoints[k].Distance-pPoints[k-1].Distance)) * (pPoints[k].Distance-pPoints[k-1].Distance) != NAN or infinite values
|
||||
// For all points in the distance curve where 1 <= k < PointCount.
|
||||
typedef struct X3DAUDIO_DISTANCE_CURVE
|
||||
{
|
||||
X3DAUDIO_DISTANCE_CURVE_POINT* pPoints; // distance curve point array, must have at least PointCount elements with no duplicates and be sorted in ascending order with respect to Distance
|
||||
UINT32 PointCount; // number of distance curve points, must be >= 2 as all distance curves must have at least two endpoints, defining DSP settings at 0.0f and 1.0f normalized distance
|
||||
} X3DAUDIO_DISTANCE_CURVE, *LPX3DAUDIO_DISTANCE_CURVE;
|
||||
static const X3DAUDIO_DISTANCE_CURVE_POINT X3DAudioDefault_LinearCurvePoints[2] = { 0.0f, 1.0f, 1.0f, 0.0f };
|
||||
static const X3DAUDIO_DISTANCE_CURVE X3DAudioDefault_LinearCurve = { (X3DAUDIO_DISTANCE_CURVE_POINT*)&X3DAudioDefault_LinearCurvePoints[0], 2 };
|
||||
|
||||
// Cone:
|
||||
// Specifies directionality for a listener or single-channel emitter by
|
||||
// modifying DSP behaviour with respect to its front orientation.
|
||||
// This is modeled using two sound cones: an inner cone and an outer cone.
|
||||
// On/within the inner cone, DSP settings are scaled by the inner values.
|
||||
// On/beyond the outer cone, DSP settings are scaled by the outer values.
|
||||
// If on both the cones, DSP settings are scaled by the inner values only.
|
||||
// Between the two cones, the scaler is linearly interpolated between the
|
||||
// inner and outer values. Set both cone angles to 0 or X3DAUDIO_2PI for
|
||||
// omnidirectionality using only the outer or inner values respectively.
|
||||
typedef struct X3DAUDIO_CONE
|
||||
{
|
||||
FLOAT32 InnerAngle; // inner cone angle in radians, must be within [0.0f, X3DAUDIO_2PI]
|
||||
FLOAT32 OuterAngle; // outer cone angle in radians, must be within [InnerAngle, X3DAUDIO_2PI]
|
||||
|
||||
FLOAT32 InnerVolume; // volume level scaler on/within inner cone, used only for matrix calculations, must be within [0.0f, 2.0f] when used
|
||||
FLOAT32 OuterVolume; // volume level scaler on/beyond outer cone, used only for matrix calculations, must be within [0.0f, 2.0f] when used
|
||||
FLOAT32 InnerLPF; // LPF (both direct and reverb paths) coefficient subtrahend on/within inner cone, used only for LPF (both direct and reverb paths) calculations, must be within [0.0f, 1.0f] when used
|
||||
FLOAT32 OuterLPF; // LPF (both direct and reverb paths) coefficient subtrahend on/beyond outer cone, used only for LPF (both direct and reverb paths) calculations, must be within [0.0f, 1.0f] when used
|
||||
FLOAT32 InnerReverb; // reverb send level scaler on/within inner cone, used only for reverb calculations, must be within [0.0f, 2.0f] when used
|
||||
FLOAT32 OuterReverb; // reverb send level scaler on/beyond outer cone, used only for reverb calculations, must be within [0.0f, 2.0f] when used
|
||||
} X3DAUDIO_CONE, *LPX3DAUDIO_CONE;
|
||||
static const X3DAUDIO_CONE X3DAudioDefault_DirectionalCone = { X3DAUDIO_PI/2, X3DAUDIO_PI, 1.0f, 0.708f, 0.0f, 0.25f, 0.708f, 1.0f };
|
||||
|
||||
|
||||
// Listener:
|
||||
// Defines a point of 3D audio reception.
|
||||
//
|
||||
// The cone is directed by the listener's front orientation.
|
||||
typedef struct X3DAUDIO_LISTENER
|
||||
{
|
||||
X3DAUDIO_VECTOR OrientFront; // orientation of front direction, used only for matrix and delay calculations or listeners with cones for matrix, LPF (both direct and reverb paths), and reverb calculations, must be normalized when used
|
||||
X3DAUDIO_VECTOR OrientTop; // orientation of top direction, used only for matrix and delay calculations, must be orthonormal with OrientFront when used
|
||||
|
||||
X3DAUDIO_VECTOR Position; // position in user-defined world units, does not affect Velocity
|
||||
X3DAUDIO_VECTOR Velocity; // velocity vector in user-defined world units/second, used only for doppler calculations, does not affect Position
|
||||
|
||||
X3DAUDIO_CONE* pCone; // sound cone, used only for matrix, LPF (both direct and reverb paths), and reverb calculations, NULL specifies omnidirectionality
|
||||
} X3DAUDIO_LISTENER, *LPX3DAUDIO_LISTENER;
|
||||
|
||||
// Emitter:
|
||||
// Defines a 3D audio source, divided into two classifications:
|
||||
//
|
||||
// Single-point -- For use with single-channel sounds.
|
||||
// Positioned at the emitter base, i.e. the channel radius
|
||||
// and azimuth are ignored if the number of channels == 1.
|
||||
//
|
||||
// May be omnidirectional or directional using a cone.
|
||||
// The cone originates from the emitter base position,
|
||||
// and is directed by the emitter's front orientation.
|
||||
//
|
||||
// Multi-point -- For use with multi-channel sounds.
|
||||
// Each non-LFE channel is positioned using an
|
||||
// azimuth along the channel radius with respect to the
|
||||
// front orientation vector in the plane orthogonal to the
|
||||
// top orientation vector. An azimuth of X3DAUDIO_2PI
|
||||
// specifies a channel is an LFE. Such channels are
|
||||
// positioned at the emitter base and are calculated
|
||||
// with respect to pLFECurve only, never pVolumeCurve.
|
||||
//
|
||||
// Multi-point emitters are always omnidirectional,
|
||||
// i.e. the cone is ignored if the number of channels > 1.
|
||||
//
|
||||
// Note that many properties are shared among all channel points,
|
||||
// locking certain behaviour with respect to the emitter base position.
|
||||
// For example, doppler shift is always calculated with respect to the
|
||||
// emitter base position and so is constant for all its channel points.
|
||||
// Distance curve calculations are also with respect to the emitter base
|
||||
// position, with the curves being calculated independently of each other.
|
||||
// For instance, volume and LFE calculations do not affect one another.
|
||||
typedef struct X3DAUDIO_EMITTER
|
||||
{
|
||||
X3DAUDIO_CONE* pCone; // sound cone, used only with single-channel emitters for matrix, LPF (both direct and reverb paths), and reverb calculations, NULL specifies omnidirectionality
|
||||
X3DAUDIO_VECTOR OrientFront; // orientation of front direction, used only for emitter angle calculations or with multi-channel emitters for matrix calculations or single-channel emitters with cones for matrix, LPF (both direct and reverb paths), and reverb calculations, must be normalized when used
|
||||
X3DAUDIO_VECTOR OrientTop; // orientation of top direction, used only with multi-channel emitters for matrix calculations, must be orthonormal with OrientFront when used
|
||||
|
||||
X3DAUDIO_VECTOR Position; // position in user-defined world units, does not affect Velocity
|
||||
X3DAUDIO_VECTOR Velocity; // velocity vector in user-defined world units/second, used only for doppler calculations, does not affect Position
|
||||
|
||||
FLOAT32 InnerRadius; // inner radius, must be within [0.0f, FLT_MAX]
|
||||
FLOAT32 InnerRadiusAngle; // inner radius angle, must be within [0.0f, X3DAUDIO_PI/4.0)
|
||||
|
||||
UINT32 ChannelCount; // number of sound channels, must be > 0
|
||||
FLOAT32 ChannelRadius; // channel radius, used only with multi-channel emitters for matrix calculations, must be >= 0.0f when used
|
||||
FLOAT32* pChannelAzimuths; // channel azimuth array, used only with multi-channel emitters for matrix calculations, contains positions of each channel expressed in radians along the channel radius with respect to the front orientation vector in the plane orthogonal to the top orientation vector, or X3DAUDIO_2PI to specify an LFE channel, must have at least ChannelCount elements, all within [0.0f, X3DAUDIO_2PI] when used
|
||||
|
||||
X3DAUDIO_DISTANCE_CURVE* pVolumeCurve; // volume level distance curve, used only for matrix calculations, NULL specifies a default curve that conforms to the inverse square law, calculated in user-defined world units with distances <= CurveDistanceScaler clamped to no attenuation
|
||||
X3DAUDIO_DISTANCE_CURVE* pLFECurve; // LFE level distance curve, used only for matrix calculations, NULL specifies a default curve that conforms to the inverse square law, calculated in user-defined world units with distances <= CurveDistanceScaler clamped to no attenuation
|
||||
X3DAUDIO_DISTANCE_CURVE* pLPFDirectCurve; // LPF direct-path coefficient distance curve, used only for LPF direct-path calculations, NULL specifies the default curve: [0.0f,1.0f], [1.0f,0.75f]
|
||||
X3DAUDIO_DISTANCE_CURVE* pLPFReverbCurve; // LPF reverb-path coefficient distance curve, used only for LPF reverb-path calculations, NULL specifies the default curve: [0.0f,0.75f], [1.0f,0.75f]
|
||||
X3DAUDIO_DISTANCE_CURVE* pReverbCurve; // reverb send level distance curve, used only for reverb calculations, NULL specifies the default curve: [0.0f,1.0f], [1.0f,0.0f]
|
||||
|
||||
FLOAT32 CurveDistanceScaler; // curve distance scaler, used to scale normalized distance curves to user-defined world units and/or exaggerate their effect, used only for matrix, LPF (both direct and reverb paths), and reverb calculations, must be within [FLT_MIN, FLT_MAX] when used
|
||||
FLOAT32 DopplerScaler; // doppler shift scaler, used to exaggerate doppler shift effect, used only for doppler calculations, must be within [0.0f, FLT_MAX] when used
|
||||
} X3DAUDIO_EMITTER, *LPX3DAUDIO_EMITTER;
|
||||
|
||||
|
||||
// DSP settings:
|
||||
// Receives results from a call to X3DAudioCalculate to be sent
|
||||
// to the low-level audio rendering API for 3D signal processing.
|
||||
//
|
||||
// The user is responsible for allocating the matrix coefficient table,
|
||||
// delay time array, and initializing the channel counts when used.
|
||||
typedef struct X3DAUDIO_DSP_SETTINGS
|
||||
{
|
||||
FLOAT32* pMatrixCoefficients; // [inout] matrix coefficient table, receives an array representing the volume level used to send from source channel S to destination channel D, stored as pMatrixCoefficients[SrcChannelCount * D + S], must have at least SrcChannelCount*DstChannelCount elements
|
||||
FLOAT32* pDelayTimes; // [inout] delay time array, receives delays for each destination channel in milliseconds, must have at least DstChannelCount elements (stereo final mix only)
|
||||
UINT32 SrcChannelCount; // [in] number of source channels, must equal number of channels in respective emitter
|
||||
UINT32 DstChannelCount; // [in] number of destination channels, must equal number of channels of the final mix
|
||||
|
||||
FLOAT32 LPFDirectCoefficient; // [out] LPF direct-path coefficient
|
||||
FLOAT32 LPFReverbCoefficient; // [out] LPF reverb-path coefficient
|
||||
FLOAT32 ReverbLevel; // [out] reverb send level
|
||||
FLOAT32 DopplerFactor; // [out] doppler shift factor, scales resampler ratio for doppler shift effect, where the effective frequency = DopplerFactor * original frequency
|
||||
FLOAT32 EmitterToListenerAngle; // [out] emitter-to-listener interior angle, expressed in radians with respect to the emitter's front orientation
|
||||
|
||||
FLOAT32 EmitterToListenerDistance; // [out] distance in user-defined world units from the emitter base to listener position, always calculated
|
||||
FLOAT32 EmitterVelocityComponent; // [out] component of emitter velocity vector projected onto emitter->listener vector in user-defined world units/second, calculated only for doppler
|
||||
FLOAT32 ListenerVelocityComponent; // [out] component of listener velocity vector projected onto emitter->listener vector in user-defined world units/second, calculated only for doppler
|
||||
} X3DAUDIO_DSP_SETTINGS, *LPX3DAUDIO_DSP_SETTINGS;
|
||||
|
||||
|
||||
//--------------<M-A-C-R-O-S>-----------------------------------------------//
|
||||
// function storage-class attribute and calltype
|
||||
#if defined(_XBOX) || defined(X3DAUDIOSTATIC)
|
||||
#define X3DAUDIO_API_(type) EXTERN_C type STDAPIVCALLTYPE
|
||||
#else
|
||||
#if defined(X3DEXPORT)
|
||||
#define X3DAUDIO_API_(type) EXTERN_C __declspec(dllexport) type STDAPIVCALLTYPE
|
||||
#else
|
||||
#define X3DAUDIO_API_(type) EXTERN_C __declspec(dllimport) type STDAPIVCALLTYPE
|
||||
#endif
|
||||
#endif
|
||||
#define X3DAUDIO_IMP_(type) type STDMETHODVCALLTYPE
|
||||
|
||||
|
||||
//--------------<F-U-N-C-T-I-O-N-S>-----------------------------------------//
|
||||
// initializes instance handle
|
||||
X3DAUDIO_API_(void) X3DAudioInitialize (UINT32 SpeakerChannelMask, FLOAT32 SpeedOfSound, __out X3DAUDIO_HANDLE Instance);
|
||||
|
||||
// calculates DSP settings with respect to 3D parameters
|
||||
X3DAUDIO_API_(void) X3DAudioCalculate (__in const X3DAUDIO_HANDLE Instance, __in const X3DAUDIO_LISTENER* pListener, __in const X3DAUDIO_EMITTER* pEmitter, UINT32 Flags, __inout X3DAUDIO_DSP_SETTINGS* pDSPSettings);
|
||||
|
||||
|
||||
#pragma pack(pop) // revert packing alignment
|
||||
//---------------------------------<-EOF->----------------------------------//
|
645
SDK/Include/XAPO.h
Normal file
645
SDK/Include/XAPO.h
Normal file
@ -0,0 +1,645 @@
|
||||
/*-========================================================================-_
|
||||
| - XAPO - |
|
||||
| Copyright (c) Microsoft Corporation. All rights reserved. |
|
||||
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|
||||
|PROJECT: XAPO MODEL: Unmanaged User-mode |
|
||||
|VERSION: 1.0 EXCEPT: No Exceptions |
|
||||
|CLASS: N / A MINREQ: WinXP, Xbox360 |
|
||||
|BASE: N / A DIALECT: MSC++ 14.00 |
|
||||
|>------------------------------------------------------------------------<|
|
||||
| DUTY: Cross-platform Audio Processing Object interfaces |
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
|
||||
NOTES:
|
||||
1. Definition of terms:
|
||||
DSP: Digital Signal Processing.
|
||||
|
||||
CBR: Constant BitRate -- DSP that consumes a constant number of
|
||||
input samples to produce an output sample.
|
||||
For example, a 22kHz to 44kHz resampler is CBR DSP.
|
||||
Even though the number of input to output samples differ,
|
||||
the ratio between input to output rate remains constant.
|
||||
All user-defined XAPOs are assumed to be CBR as
|
||||
XAudio2 only allows CBR DSP to be added to an effect chain.
|
||||
|
||||
XAPO: Cross-platform Audio Processing Object --
|
||||
a thin wrapper that manages DSP code, allowing it
|
||||
to be easily plugged into an XAudio2 effect chain.
|
||||
|
||||
Frame: A block of samples, one per channel,
|
||||
to be played simultaneously.
|
||||
|
||||
In-Place: Processing such that the input buffer equals the
|
||||
output buffer (i.e. input data modified directly).
|
||||
This form of processing is generally more efficient
|
||||
than using separate memory for input and output.
|
||||
However, an XAPO may not perform format conversion
|
||||
when processing in-place.
|
||||
|
||||
2. XAPO member variables are divided into three classifications:
|
||||
Immutable: Set once via IXAPO::Initialize and remain
|
||||
constant during the lifespan of the XAPO.
|
||||
|
||||
Locked: May change before the XAPO is locked via
|
||||
IXAPO::LockForProcess but remain constant
|
||||
until IXAPO::UnlockForProcess is called.
|
||||
|
||||
Dynamic: May change from one processing pass to the next,
|
||||
usually via IXAPOParameters::SetParameters.
|
||||
XAPOs should assign reasonable defaults to their dynamic
|
||||
variables during IXAPO::Initialize/LockForProcess so
|
||||
that calling IXAPOParameters::SetParameters is not
|
||||
required before processing begins.
|
||||
|
||||
When implementing an XAPO, determine the type of each variable and
|
||||
initialize them in the appropriate method. Immutable variables are
|
||||
generally preferable over locked which are preferable over dynamic.
|
||||
That is, one should strive to minimize XAPO state changes for
|
||||
best performance, maintainability, and ease of use.
|
||||
|
||||
3. To minimize glitches, the realtime audio processing thread must
|
||||
not block. XAPO methods called by the realtime thread are commented
|
||||
as non-blocking and therefore should not use blocking synchronization,
|
||||
allocate memory, access the disk, etc. The XAPO interfaces were
|
||||
designed to allow an effect implementer to move such operations
|
||||
into other methods called on an application controlled thread.
|
||||
|
||||
4. Extending functionality is accomplished through the addition of new
|
||||
COM interfaces. For example, if a new member is added to a parameter
|
||||
structure, a new interface using the new structure should be added,
|
||||
leaving the original interface unchanged.
|
||||
This ensures consistent communication between future versions of
|
||||
XAudio2 and various versions of XAPOs that may exist in an application.
|
||||
|
||||
5. All audio data is interleaved in XAudio2.
|
||||
The default audio format for an effect chain is WAVE_FORMAT_IEEE_FLOAT.
|
||||
|
||||
6. User-defined XAPOs should assume all input and output buffers are
|
||||
16-byte aligned.
|
||||
|
||||
7. See XAPOBase.h for an XAPO base class which provides a default
|
||||
implementation for most of the interface methods defined below. */
|
||||
|
||||
#pragma once
|
||||
//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
|
||||
#include "comdecl.h" // for DEFINE_IID
|
||||
|
||||
// XAPO interface IDs
|
||||
DEFINE_IID(IXAPO, A90BC001, E897, E897, 55, E4, 9E, 47, 00, 00, 00, 00);
|
||||
DEFINE_IID(IXAPOParameters, A90BC001, E897, E897, 55, E4, 9E, 47, 00, 00, 00, 01);
|
||||
|
||||
|
||||
#if !defined(GUID_DEFS_ONLY) // ignore rest if only GUID definitions requested
|
||||
#if defined(_XBOX) // general windows and COM declarations
|
||||
#include <xtl.h>
|
||||
#include <xobjbase.h>
|
||||
#else
|
||||
#include <windows.h>
|
||||
#include <objbase.h>
|
||||
#endif
|
||||
#include "audiodefs.h" // for WAVEFORMATEX etc.
|
||||
|
||||
// XAPO error codes
|
||||
#define FACILITY_XAPO 0x897
|
||||
#define XAPO_E_FORMAT_UNSUPPORTED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_XAPO, 0x01) // requested audio format unsupported
|
||||
|
||||
// supported number of channels (samples per frame) range
|
||||
#define XAPO_MIN_CHANNELS 1
|
||||
#define XAPO_MAX_CHANNELS 64
|
||||
|
||||
// supported framerate range
|
||||
#define XAPO_MIN_FRAMERATE 1000
|
||||
#define XAPO_MAX_FRAMERATE 200000
|
||||
|
||||
// unicode string length, including terminator, used with XAPO_REGISTRATION_PROPERTIES
|
||||
#define XAPO_REGISTRATION_STRING_LENGTH 256
|
||||
|
||||
|
||||
// XAPO property flags, used with XAPO_REGISTRATION_PROPERTIES.Flags:
|
||||
// Number of channels of input and output buffers must match,
|
||||
// applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat.
|
||||
#define XAPO_FLAG_CHANNELS_MUST_MATCH 0x00000001
|
||||
|
||||
// Framerate of input and output buffers must match,
|
||||
// applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat.
|
||||
#define XAPO_FLAG_FRAMERATE_MUST_MATCH 0x00000002
|
||||
|
||||
// Bit depth of input and output buffers must match,
|
||||
// applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat.
|
||||
// Container size of input and output buffers must also match if
|
||||
// XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat is WAVEFORMATEXTENSIBLE.
|
||||
#define XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH 0x00000004
|
||||
|
||||
// Number of input and output buffers must match,
|
||||
// applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.
|
||||
//
|
||||
// Also, XAPO_REGISTRATION_PROPERTIES.MinInputBufferCount must
|
||||
// equal XAPO_REGISTRATION_PROPERTIES.MinOutputBufferCount and
|
||||
// XAPO_REGISTRATION_PROPERTIES.MaxInputBufferCount must equal
|
||||
// XAPO_REGISTRATION_PROPERTIES.MaxOutputBufferCount when used.
|
||||
#define XAPO_FLAG_BUFFERCOUNT_MUST_MATCH 0x00000008
|
||||
|
||||
// XAPO must be run in-place. Use this flag only if your DSP
|
||||
// implementation cannot process separate input and output buffers.
|
||||
// If set, the following flags must also be set:
|
||||
// XAPO_FLAG_CHANNELS_MUST_MATCH
|
||||
// XAPO_FLAG_FRAMERATE_MUST_MATCH
|
||||
// XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH
|
||||
// XAPO_FLAG_BUFFERCOUNT_MUST_MATCH
|
||||
// XAPO_FLAG_INPLACE_SUPPORTED
|
||||
//
|
||||
// Multiple input and output buffers may be used with in-place XAPOs,
|
||||
// though the input buffer count must equal the output buffer count.
|
||||
// When multiple input/output buffers are used, the XAPO may assume
|
||||
// input buffer [N] equals output buffer [N] for in-place processing.
|
||||
#define XAPO_FLAG_INPLACE_REQUIRED 0x00000020
|
||||
|
||||
// XAPO may be run in-place. If the XAPO is used in a chain
|
||||
// such that the requirements for XAPO_FLAG_INPLACE_REQUIRED are met,
|
||||
// XAudio2 will ensure the XAPO is run in-place. If not met, XAudio2
|
||||
// will still run the XAPO albeit with separate input and output buffers.
|
||||
//
|
||||
// For example, consider an effect which may be ran in stereo->5.1 mode or
|
||||
// mono->mono mode. When set to stereo->5.1, it will be run with separate
|
||||
// input and output buffers as format conversion is not permitted in-place.
|
||||
// However, if configured to run mono->mono, the same XAPO can be run
|
||||
// in-place. Thus the same implementation may be conveniently reused
|
||||
// for various input/output configurations, while taking advantage of
|
||||
// in-place processing when possible.
|
||||
#define XAPO_FLAG_INPLACE_SUPPORTED 0x00000010
|
||||
|
||||
|
||||
//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
|
||||
#pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments
|
||||
|
||||
|
||||
// XAPO registration properties, describes general XAPO characteristics, used with IXAPO::GetRegistrationProperties
|
||||
typedef struct XAPO_REGISTRATION_PROPERTIES {
|
||||
CLSID clsid; // COM class ID, used with CoCreate
|
||||
WCHAR FriendlyName[XAPO_REGISTRATION_STRING_LENGTH]; // friendly name unicode string
|
||||
WCHAR CopyrightInfo[XAPO_REGISTRATION_STRING_LENGTH]; // copyright information unicode string
|
||||
UINT32 MajorVersion; // major version
|
||||
UINT32 MinorVersion; // minor version
|
||||
UINT32 Flags; // XAPO property flags, describes supported input/output configuration
|
||||
UINT32 MinInputBufferCount; // minimum number of input buffers required for processing, can be 0
|
||||
UINT32 MaxInputBufferCount; // maximum number of input buffers supported for processing, must be >= MinInputBufferCount
|
||||
UINT32 MinOutputBufferCount; // minimum number of output buffers required for processing, can be 0, must match MinInputBufferCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used
|
||||
UINT32 MaxOutputBufferCount; // maximum number of output buffers supported for processing, must be >= MinOutputBufferCount, must match MaxInputBufferCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used
|
||||
} XAPO_REGISTRATION_PROPERTIES;
|
||||
|
||||
|
||||
// LockForProcess buffer parameters:
|
||||
// Defines buffer parameters that remain constant while an XAPO is locked.
|
||||
// Used with IXAPO::LockForProcess.
|
||||
//
|
||||
// For CBR XAPOs, MaxFrameCount is the only number of frames
|
||||
// IXAPO::Process would have to handle for the respective buffer.
|
||||
typedef struct XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS {
|
||||
const WAVEFORMATEX* pFormat; // buffer audio format
|
||||
UINT32 MaxFrameCount; // maximum number of frames in respective buffer that IXAPO::Process would have to handle, irrespective of dynamic variable settings, can be 0
|
||||
} XAPO_LOCKFORPROCESS_PARAMETERS;
|
||||
|
||||
// Buffer flags:
|
||||
// Describes assumed content of the respective buffer.
|
||||
// Used with XAPO_PROCESS_BUFFER_PARAMETERS.BufferFlags.
|
||||
//
|
||||
// This meta-data can be used by an XAPO to implement
|
||||
// optimizations that require knowledge of a buffer's content.
|
||||
//
|
||||
// For example, XAPOs that always produce silent output from silent input
|
||||
// can check the flag on the input buffer to determine if any signal
|
||||
// processing is necessary. If silent, the XAPO may simply set the flag
|
||||
// on the output buffer to silent and return, optimizing out the work of
|
||||
// processing silent data: XAPOs that generate silence for any reason may
|
||||
// set the buffer's flag accordingly rather than writing out silent
|
||||
// frames to the buffer itself.
|
||||
//
|
||||
// The flags represent what should be assumed is in the respective buffer.
|
||||
// The flags may not reflect what is actually stored in memory.
|
||||
typedef enum XAPO_BUFFER_FLAGS {
|
||||
XAPO_BUFFER_SILENT, // silent data should be assumed, respective memory may be uninitialized
|
||||
XAPO_BUFFER_VALID, // arbitrary data should be assumed (may or may not be silent frames), respective memory initialized
|
||||
} XAPO_BUFFER_FLAGS;
|
||||
|
||||
// Process buffer parameters:
|
||||
// Defines buffer parameters that may change from one
|
||||
// processing pass to the next. Used with IXAPO::Process.
|
||||
//
|
||||
// Note the byte size of the respective buffer must be at least:
|
||||
// XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount * XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat->nBlockAlign
|
||||
//
|
||||
// Although the audio format and maximum size of the respective
|
||||
// buffer is locked (defined by XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS),
|
||||
// the actual memory address of the buffer given is permitted to change
|
||||
// from one processing pass to the next.
|
||||
//
|
||||
// For CBR XAPOs, ValidFrameCount is constant while locked and equals
|
||||
// the respective XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount.
|
||||
typedef struct XAPO_PROCESS_BUFFER_PARAMETERS {
|
||||
void* pBuffer; // audio data buffer, must be non-NULL
|
||||
XAPO_BUFFER_FLAGS BufferFlags; // describes assumed content of pBuffer, does not affect ValidFrameCount
|
||||
UINT32 ValidFrameCount; // number of frames of valid data, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs, does not affect BufferFlags
|
||||
} XAPO_PROCESS_BUFFER_PARAMETERS;
|
||||
|
||||
|
||||
//--------------<M-A-C-R-O-S>-----------------------------------------------//
|
||||
// Memory allocation macros that allow one module to allocate memory and
|
||||
// another to free it, by guaranteeing that the same heap manager is used
|
||||
// regardless of differences between build environments of the two modules.
|
||||
//
|
||||
// Used by IXAPO methods that must allocate arbitrary sized structures
|
||||
// such as WAVEFORMATEX that are subsequently returned to the application.
|
||||
#if defined(_XBOX)
|
||||
#define XAPO_ALLOC_ATTRIBUTES MAKE_XALLOC_ATTRIBUTES ( \
|
||||
0, /* ObjectType */ \
|
||||
FALSE, /* HeapTracksAttributes */ \
|
||||
FALSE, /* MustSucceed */ \
|
||||
FALSE, /* FixedSize */ \
|
||||
eXALLOCAllocatorId_XAUDIO2, /* AllocatorId */ \
|
||||
XALLOC_ALIGNMENT_DEFAULT, /* Alignment */ \
|
||||
XALLOC_MEMPROTECT_READWRITE, /* MemoryProtect */ \
|
||||
FALSE, /* ZeroInitialize */ \
|
||||
XALLOC_MEMTYPE_HEAP /* MemoryType */ \
|
||||
)
|
||||
#define XAPOAlloc(size) XMemAlloc(size, XAPO_ALLOC_ATTRIBUTES)
|
||||
#define XAPOFree(p) XMemFree(p, XAPO_ALLOC_ATTRIBUTES)
|
||||
#else
|
||||
#define XAPOAlloc(size) CoTaskMemAlloc(size)
|
||||
#define XAPOFree(p) CoTaskMemFree(p)
|
||||
#endif
|
||||
|
||||
|
||||
//--------------<I-N-T-E-R-F-A-C-E-S>---------------------------------------//
|
||||
// IXAPO:
|
||||
// The only mandatory XAPO COM interface -- a thin wrapper that manages
|
||||
// DSP code, allowing it to be easily plugged into an XAudio2 effect chain.
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IXAPO
|
||||
DECLARE_INTERFACE_(IXAPO, IUnknown) {
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Allocates a copy of the registration properties of the XAPO.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// ppRegistrationProperties - [out] receives pointer to copy of registration properties, use XAPOFree to free structure, left untouched on failure
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// COM error code
|
||||
////
|
||||
STDMETHOD(GetRegistrationProperties) (THIS_ __deref_out XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties) PURE;
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Queries if an input/output configuration is supported.
|
||||
//
|
||||
// REMARKS:
|
||||
// This method allows XAPOs to express dependency of input format
|
||||
// with respect to output format.
|
||||
//
|
||||
// If the input/output format pair configuration is unsupported,
|
||||
// this method also determines the nearest input format supported.
|
||||
// Nearest meaning closest bit depth, framerate, and channel count,
|
||||
// in that order of importance.
|
||||
//
|
||||
// The behaviour of this method should remain constant after the
|
||||
// XAPO has been initialized.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pOutputFormat - [in] output format known to be supported
|
||||
// pRequestedInputFormat - [in] input format to examine
|
||||
// ppSupportedInputFormat - [out] receives pointer to nearest input format supported if not NULL and input/output configuration unsupported, use XAPOFree to free structure, left untouched on any failure except XAPO_E_FORMAT_UNSUPPORTED
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// COM error code, including:
|
||||
// S_OK - input/output configuration supported, ppSupportedInputFormat left untouched
|
||||
// XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, ppSupportedInputFormat receives pointer to nearest input format supported if not NULL
|
||||
// E_INVALIDARG - either audio format invalid, ppSupportedInputFormat left untouched
|
||||
////
|
||||
STDMETHOD(IsInputFormatSupported) (THIS_ const WAVEFORMATEX* pOutputFormat, const WAVEFORMATEX* pRequestedInputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedInputFormat) PURE;
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Queries if an input/output configuration is supported.
|
||||
//
|
||||
// REMARKS:
|
||||
// This method allows XAPOs to express dependency of output format
|
||||
// with respect to input format.
|
||||
//
|
||||
// If the input/output format pair configuration is unsupported,
|
||||
// this method also determines the nearest output format supported.
|
||||
// Nearest meaning closest bit depth, framerate, and channel count,
|
||||
// in that order of importance.
|
||||
//
|
||||
// The behaviour of this method should remain constant after the
|
||||
// XAPO has been initialized.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pInputFormat - [in] input format known to be supported
|
||||
// pRequestedOutputFormat - [in] output format to examine
|
||||
// ppSupportedOutputFormat - [out] receives pointer to nearest output format supported if not NULL and input/output configuration unsupported, use XAPOFree to free structure, left untouched on any failure except XAPO_E_FORMAT_UNSUPPORTED
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// COM error code, including:
|
||||
// S_OK - input/output configuration supported, ppSupportedOutputFormat left untouched
|
||||
// XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, ppSupportedOutputFormat receives pointer to nearest output format supported if not NULL
|
||||
// E_INVALIDARG - either audio format invalid, ppSupportedOutputFormat left untouched
|
||||
////
|
||||
STDMETHOD(IsOutputFormatSupported) (THIS_ const WAVEFORMATEX* pInputFormat, const WAVEFORMATEX* pRequestedOutputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedOutputFormat) PURE;
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Performs any effect-specific initialization if required.
|
||||
//
|
||||
// REMARKS:
|
||||
// The contents of pData are defined by the XAPO.
|
||||
// Immutable variables (constant during the lifespan of the XAPO)
|
||||
// should be set once via this method.
|
||||
// Once initialized, an XAPO cannot be initialized again.
|
||||
//
|
||||
// An XAPO should be initialized before passing it to XAudio2
|
||||
// as part of an effect chain. XAudio2 will not call this method;
|
||||
// it exists for future content-driven initialization by XACT.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pData - [in] effect-specific initialization parameters, may be NULL if DataByteSize == 0
|
||||
// DataByteSize - [in] size of pData in bytes, may be 0 if DataByteSize is NULL
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// COM error code
|
||||
////
|
||||
STDMETHOD(Initialize) (THIS_ __in_bcount_opt(DataByteSize) const void* pData, UINT32 DataByteSize) PURE;
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Resets variables dependent on frame history.
|
||||
//
|
||||
// REMARKS:
|
||||
// All other variables remain unchanged, including variables set by
|
||||
// IXAPOParameters::SetParameters.
|
||||
//
|
||||
// For example, an effect with delay should zero out its delay line
|
||||
// during this method, but should not reallocate anything as the
|
||||
// XAPO remains locked with a constant input/output configuration.
|
||||
//
|
||||
// XAudio2 calls this method only if the XAPO is locked.
|
||||
// This method should not block as it is called from the
|
||||
// realtime thread.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// void
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
STDMETHOD_(void, Reset) (THIS) PURE;
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Locks the XAPO to a specific input/output configuration,
|
||||
// allowing it to do any final initialization before Process
|
||||
// is called on the realtime thread.
|
||||
//
|
||||
// REMARKS:
|
||||
// Once locked, the input/output configuration and any other locked
|
||||
// variables remain constant until UnlockForProcess is called.
|
||||
//
|
||||
// XAPOs should assert the input/output configuration is supported
|
||||
// and that any required effect-specific initialization is complete.
|
||||
// IsInputFormatSupported, IsOutputFormatSupported, and Initialize
|
||||
// should be called as necessary before this method is called.
|
||||
//
|
||||
// All internal memory buffers required for Process should be
|
||||
// allocated by the time this method returns successfully
|
||||
// as Process is non-blocking and should not allocate memory.
|
||||
//
|
||||
// Once locked, an XAPO cannot be locked again until
|
||||
// UnLockForProcess is called.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// InputLockedParameterCount - [in] number of input buffers, must be within [XAPO_REGISTRATION_PROPERTIES.MinInputBufferCount, XAPO_REGISTRATION_PROPERTIES.MaxInputBufferCount]
|
||||
// pInputLockedParameters - [in] array of input locked buffer parameter structures, may be NULL if InputLockedParameterCount == 0, otherwise must have InputLockedParameterCount elements
|
||||
// OutputLockedParameterCount - [in] number of output buffers, must be within [XAPO_REGISTRATION_PROPERTIES.MinOutputBufferCount, XAPO_REGISTRATION_PROPERTIES.MaxOutputBufferCount], must match InputLockedParameterCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used
|
||||
// pOutputLockedParameters - [in] array of output locked buffer parameter structures, may be NULL if OutputLockedParameterCount == 0, otherwise must have OutputLockedParameterCount elements
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// COM error code
|
||||
////
|
||||
STDMETHOD(LockForProcess) (THIS_ UINT32 InputLockedParameterCount, __in_ecount_opt(InputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters, UINT32 OutputLockedParameterCount, __in_ecount_opt(OutputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters) PURE;
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Opposite of LockForProcess. Variables allocated during
|
||||
// LockForProcess should be deallocated by this method.
|
||||
//
|
||||
// REMARKS:
|
||||
// Unlocking an XAPO allows an XAPO instance to be reused with
|
||||
// different input/output configurations.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// void
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
STDMETHOD_(void, UnlockForProcess) (THIS) PURE;
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Runs the XAPO's DSP code on the given input/output buffers.
|
||||
//
|
||||
// REMARKS:
|
||||
// In addition to writing to the output buffers as appropriate,
|
||||
// an XAPO must set the BufferFlags and ValidFrameCount members
|
||||
// of all elements in pOutputProcessParameters accordingly.
|
||||
//
|
||||
// ppInputProcessParameters will not necessarily be the same as
|
||||
// ppOutputProcessParameters for in-place processing, rather
|
||||
// the pBuffer members of each will point to the same memory.
|
||||
//
|
||||
// Multiple input/output buffers may be used with in-place XAPOs,
|
||||
// though the input buffer count must equal the output buffer count.
|
||||
// When multiple input/output buffers are used with in-place XAPOs,
|
||||
// the XAPO may assume input buffer [N] equals output buffer [N].
|
||||
//
|
||||
// When IsEnabled is FALSE, the XAPO should process thru.
|
||||
// Thru processing means an XAPO should not apply its normal
|
||||
// processing to the given input/output buffers during Process.
|
||||
// It should instead pass data from input to output with as little
|
||||
// modification possible. Effects that perform format conversion
|
||||
// should continue to do so. The effect must ensure transitions
|
||||
// between normal and thru processing do not introduce
|
||||
// discontinuities into the signal.
|
||||
//
|
||||
// XAudio2 calls this method only if the XAPO is locked.
|
||||
// This method should not block as it is called from the
|
||||
// realtime thread.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// InputProcessParameterCount - [in] number of input buffers, matches respective InputLockedParameterCount parameter given to LockForProcess
|
||||
// pInputProcessParameters - [in] array of input process buffer parameter structures, may be NULL if InputProcessParameterCount == 0, otherwise must have InputProcessParameterCount elements
|
||||
// OutputProcessParameterCount - [in] number of output buffers, matches respective OutputLockedParameterCount parameter given to LockForProcess
|
||||
// pOutputProcessParameters - [in/out] array of output process buffer parameter structures, may be NULL if OutputProcessParameterCount == 0, otherwise must have OutputProcessParameterCount elements
|
||||
// IsEnabled - [in] TRUE to process normally, FALSE to process thru
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
STDMETHOD_(void, Process) (THIS_ UINT32 InputProcessParameterCount, __in_ecount_opt(InputProcessParameterCount) const XAPO_PROCESS_BUFFER_PARAMETERS* pInputProcessParameters, UINT32 OutputProcessParameterCount, __inout_ecount_opt(OutputProcessParameterCount) XAPO_PROCESS_BUFFER_PARAMETERS* pOutputProcessParameters, BOOL IsEnabled) PURE;
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Returns the number of input frames required to generate the
|
||||
// requested number of output frames.
|
||||
//
|
||||
// REMARKS:
|
||||
// XAudio2 may call this method to determine how many input frames
|
||||
// an XAPO requires. This is constant for locked CBR XAPOs;
|
||||
// this method need only be called once while an XAPO is locked.
|
||||
//
|
||||
// XAudio2 calls this method only if the XAPO is locked.
|
||||
// This method should not block as it is called from the
|
||||
// realtime thread.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// OutputFrameCount - [in] requested number of output frames, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// number of input frames required
|
||||
////
|
||||
STDMETHOD_(UINT32, CalcInputFrames) (THIS_ UINT32 OutputFrameCount) PURE;
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Returns the number of output frames generated for the
|
||||
// requested number of input frames.
|
||||
//
|
||||
// REMARKS:
|
||||
// XAudio2 may call this method to determine how many output frames
|
||||
// an XAPO will generate. This is constant for locked CBR XAPOs;
|
||||
// this method need only be called once while an XAPO is locked.
|
||||
//
|
||||
// XAudio2 calls this method only if the XAPO is locked.
|
||||
// This method should not block as it is called from the
|
||||
// realtime thread.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// InputFrameCount - [in] requested number of input frames, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// number of output frames generated
|
||||
////
|
||||
STDMETHOD_(UINT32, CalcOutputFrames) (THIS_ UINT32 InputFrameCount) PURE;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// IXAPOParameters:
|
||||
// Optional XAPO COM interface that allows an XAPO to use
|
||||
// effect-specific parameters.
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IXAPOParameters
|
||||
DECLARE_INTERFACE_(IXAPOParameters, IUnknown) {
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Sets effect-specific parameters.
|
||||
//
|
||||
// REMARKS:
|
||||
// This method may only be called on the realtime thread;
|
||||
// no synchronization between it and IXAPO::Process is necessary.
|
||||
//
|
||||
// This method should not block as it is called from the
|
||||
// realtime thread.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pParameters - [in] effect-specific parameter block, must be != NULL
|
||||
// ParameterByteSize - [in] size of pParameters in bytes, must be > 0
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
STDMETHOD_(void, SetParameters) (THIS_ __in_bcount(ParameterByteSize) const void* pParameters, UINT32 ParameterByteSize) PURE;
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Gets effect-specific parameters.
|
||||
//
|
||||
// REMARKS:
|
||||
// Unlike SetParameters, XAudio2 does not call this method on the
|
||||
// realtime thread. Thus, the XAPO must protect variables shared
|
||||
// with SetParameters/Process using appropriate synchronization.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pParameters - [out] receives effect-specific parameter block, must be != NULL
|
||||
// ParameterByteSize - [in] size of pParameters in bytes, must be > 0
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
STDMETHOD_(void, GetParameters) (THIS_ __out_bcount(ParameterByteSize) void* pParameters, UINT32 ParameterByteSize) PURE;
|
||||
};
|
||||
|
||||
|
||||
//--------------<M-A-C-R-O-S>-----------------------------------------------//
|
||||
// macros to allow XAPO interfaces to be used in C code
|
||||
#if !defined(__cplusplus)
|
||||
// IXAPO
|
||||
#define IXAPO_QueryInterface(This, riid, ppInterface) \
|
||||
( (This)->lpVtbl->QueryInterface(This, riid, ppInterface) )
|
||||
|
||||
#define IXAPO_AddRef(This) \
|
||||
( (This)->lpVtbl->AddRef(This) )
|
||||
|
||||
#define IXAPO_Release(This) \
|
||||
( (This)->lpVtbl->Release(This) )
|
||||
|
||||
#define IXAPO_GetRegistrationProperties(This, ppRegistrationProperties) \
|
||||
( (This)->lpVtbl->GetRegistrationProperties(This, ppRegistrationProperties) )
|
||||
|
||||
#define IXAPO_IsInputFormatSupported(This, pOutputFormat, pRequestedInputFormat, ppSupportedInputFormat) \
|
||||
( (This)->lpVtbl->IsInputFormatSupported(This, pOutputFormat, pRequestedInputFormat, ppSupportedInputFormat) )
|
||||
|
||||
#define IXAPO_IsOutputFormatSupported(This, pInputFormat, pRequestedOutputFormat, ppSupportedOutputFormat) \
|
||||
( (This)->lpVtbl->IsOutputFormatSupported(This, pInputFormat, pRequestedOutputFormat, ppSupportedOutputFormat) )
|
||||
|
||||
#define IXAPO_Initialize(This, pData, DataByteSize) \
|
||||
( (This)->lpVtbl->Initialize(This, pData, DataByteSize) )
|
||||
|
||||
#define IXAPO_Reset(This) \
|
||||
( (This)->lpVtbl->Reset(This) )
|
||||
|
||||
#define IXAPO_LockForProcess(This, InputLockedParameterCount, pInputLockedParameters, OutputLockedParameterCount, pOutputLockedParameters) \
|
||||
( (This)->lpVtbl->LockForProcess(This, InputLockedParameterCount, pInputLockedParameters, OutputLockedParameterCount, pOutputLockedParameters) )
|
||||
|
||||
#define IXAPO_UnlockForProcess(This) \
|
||||
( (This)->lpVtbl->UnlockForProcess(This) )
|
||||
|
||||
#define IXAPO_Process(This, InputProcessParameterCount, pInputProcessParameters, OutputProcessParameterCount, pOutputProcessParameters, IsEnabled) \
|
||||
( (This)->lpVtbl->Process(This, InputProcessParameterCount, pInputProcessParameters, OutputProcessParameterCount, pOutputProcessParameters, IsEnabled) )
|
||||
|
||||
#define IXAPO_CalcInputFrames(This, OutputFrameCount) \
|
||||
( (This)->lpVtbl->CalcInputFrames(This, OutputFrameCount) )
|
||||
|
||||
#define IXAPO_CalcOutputFrames(This, InputFrameCount) \
|
||||
( (This)->lpVtbl->CalcOutputFrames(This, InputFrameCount) )
|
||||
|
||||
|
||||
// IXAPOParameters
|
||||
#define IXAPOParameters_QueryInterface(This, riid, ppInterface) \
|
||||
( (This)->lpVtbl->QueryInterface(This, riid, ppInterface) )
|
||||
|
||||
#define IXAPOParameters_AddRef(This) \
|
||||
( (This)->lpVtbl->AddRef(This) )
|
||||
|
||||
#define IXAPOParameters_Release(This) \
|
||||
( (This)->lpVtbl->Release(This) )
|
||||
|
||||
#define IXAPOParameters_SetParameters(This, pParameters, ParameterByteSize) \
|
||||
( (This)->lpVtbl->SetParameters(This, pParameters, ParameterByteSize) )
|
||||
|
||||
#define IXAPOParameters_GetParameters(This, pParameters, ParameterByteSize) \
|
||||
( (This)->lpVtbl->GetParameters(This, pParameters, ParameterByteSize) )
|
||||
#endif // !defined(__cplusplus)
|
||||
|
||||
|
||||
#pragma pack(pop) // revert packing alignment
|
||||
#endif // !defined(GUID_DEFS_ONLY)
|
||||
//---------------------------------<-EOF->----------------------------------//
|
337
SDK/Include/XAPOBase.h
Normal file
337
SDK/Include/XAPOBase.h
Normal file
@ -0,0 +1,337 @@
|
||||
/*-========================================================================-_
|
||||
| - XAPO - |
|
||||
| Copyright (c) Microsoft Corporation. All rights reserved. |
|
||||
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|
||||
|PROJECT: XAPO MODEL: Unmanaged User-mode |
|
||||
|VERSION: 1.0 EXCEPT: No Exceptions |
|
||||
|CLASS: N / A MINREQ: WinXP, Xbox360 |
|
||||
|BASE: N / A DIALECT: MSC++ 14.00 |
|
||||
|>------------------------------------------------------------------------<|
|
||||
| DUTY: XAPO base classes |
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
|
||||
NOTES:
|
||||
1. See XAPO.h for the rules governing XAPO interface behaviour. */
|
||||
|
||||
#pragma once
|
||||
//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
|
||||
#include "XAPO.h"
|
||||
|
||||
// default audio format ranges supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat
|
||||
#define XAPOBASE_DEFAULT_FORMAT_TAG WAVE_FORMAT_IEEE_FLOAT // 32-bit float only, applies to WAVEFORMATEX.wFormatTag or WAVEFORMATEXTENSIBLE.SubFormat when used
|
||||
#define XAPOBASE_DEFAULT_FORMAT_MIN_CHANNELS XAPO_MIN_CHANNELS // minimum channel count, applies to WAVEFORMATEX.nChannels
|
||||
#define XAPOBASE_DEFAULT_FORMAT_MAX_CHANNELS XAPO_MAX_CHANNELS // maximum channel count, applies to WAVEFORMATEX.nChannels
|
||||
#define XAPOBASE_DEFAULT_FORMAT_MIN_FRAMERATE XAPO_MIN_FRAMERATE // minimum framerate, applies to WAVEFORMATEX.nSamplesPerSec
|
||||
#define XAPOBASE_DEFAULT_FORMAT_MAX_FRAMERATE XAPO_MAX_FRAMERATE // maximum framerate, applies to WAVEFORMATEX.nSamplesPerSec
|
||||
#define XAPOBASE_DEFAULT_FORMAT_BITSPERSAMPLE 32 // 32-bit float only, applies to WAVEFORMATEX.wBitsPerSample and WAVEFORMATEXTENSIBLE.wValidBitsPerSample when used
|
||||
|
||||
// default XAPO property flags supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS
|
||||
#define XAPOBASE_DEFAULT_FLAG (XAPO_FLAG_CHANNELS_MUST_MATCH | XAPO_FLAG_FRAMERATE_MUST_MATCH | XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH | XAPO_FLAG_BUFFERCOUNT_MUST_MATCH | XAPO_FLAG_INPLACE_SUPPORTED)
|
||||
|
||||
// default number of input and output buffers supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS
|
||||
#define XAPOBASE_DEFAULT_BUFFER_COUNT 1
|
||||
|
||||
|
||||
//--------------<M-A-C-R-O-S>-----------------------------------------------//
|
||||
// assertion
|
||||
#if !defined(XAPOASSERT)
|
||||
#if XAPODEBUG
|
||||
#define XAPOASSERT(exp) if (!(exp)) { OutputDebugStringA("XAPO ASSERT: " #exp ", {" __FUNCTION__ "}\n"); __debugbreak(); }
|
||||
#else
|
||||
#define XAPOASSERT(exp) __assume(exp)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
|
||||
#pragma pack(push, 8) // set packing alignment to ensure consistency across arbitrary build environments, and ensure synchronization variables used by Interlocked functionality are correctly aligned
|
||||
|
||||
|
||||
// primitive types
|
||||
typedef float FLOAT32; // 32-bit IEEE float
|
||||
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Default implementation of the IXAPO and IUnknown interfaces.
|
||||
// Provides overridable implementations for all methods save IXAPO::Process.
|
||||
////
|
||||
class __declspec(novtable) CXAPOBase: public IXAPO {
|
||||
private:
|
||||
const XAPO_REGISTRATION_PROPERTIES* m_pRegistrationProperties; // pointer to registration properties of the XAPO, set via constructor
|
||||
|
||||
void* m_pfnMatrixMixFunction; // optimal matrix function pointer, used for thru processing
|
||||
FLOAT32* m_pfl32MatrixCoefficients; // matrix coefficient table, used for thru processing
|
||||
UINT32 m_nSrcFormatType; // input format type, used for thru processing
|
||||
BOOL m_fIsScalarMatrix; // TRUE if m_pfl32MatrixCoefficients is diagonal matrix with all main diagonal entries equal, i.e. m_pfnMatrixMixFunction only used for type conversion (no channel conversion), used for thru processing
|
||||
BOOL m_fIsLocked; // TRUE if XAPO locked via CXAPOBase.LockForProcess
|
||||
|
||||
|
||||
protected:
|
||||
LONG m_lReferenceCount; // COM reference count, must be aligned for atomic operations
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Verifies an audio format falls within the default ranges supported.
|
||||
//
|
||||
// REMARKS:
|
||||
// If pFormat is unsupported, and fOverwrite is TRUE,
|
||||
// pFormat is overwritten with the nearest format supported.
|
||||
// Nearest meaning closest bit depth, framerate, and channel count,
|
||||
// in that order of importance.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pFormat - [in/out] audio format to examine
|
||||
// fOverwrite - [in] TRUE to overwrite pFormat if audio format unsupported
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// COM error code, including:
|
||||
// S_OK - audio format supported, pFormat left untouched
|
||||
// XAPO_E_FORMAT_UNSUPPORTED - audio format unsupported, pFormat overwritten with nearest audio format supported if fOverwrite TRUE
|
||||
// E_INVALIDARG - audio format invalid, pFormat left untouched
|
||||
////
|
||||
virtual HRESULT ValidateFormatDefault (__inout WAVEFORMATEX* pFormat, BOOL fOverwrite);
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Verifies that an input/output format pair configuration is supported
|
||||
// with respect to the XAPO property flags.
|
||||
//
|
||||
// REMARKS:
|
||||
// If pRequestedFormat is unsupported, and fOverwrite is TRUE,
|
||||
// pRequestedFormat is overwritten with the nearest format supported.
|
||||
// Nearest meaning closest bit depth, framerate, and channel count,
|
||||
// in that order of importance.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pSupportedFormat - [in] audio format known to be supported
|
||||
// pRequestedFormat - [in/out] audio format to examine, must be WAVEFORMATEXTENSIBLE if fOverwrite TRUE
|
||||
// fOverwrite - [in] TRUE to overwrite pRequestedFormat if input/output configuration unsupported
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// COM error code, including:
|
||||
// S_OK - input/output configuration supported, pRequestedFormat left untouched
|
||||
// XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, pRequestedFormat overwritten with nearest audio format supported if fOverwrite TRUE
|
||||
// E_INVALIDARG - either audio format invalid, pRequestedFormat left untouched
|
||||
////
|
||||
HRESULT ValidateFormatPair (const WAVEFORMATEX* pSupportedFormat, __inout WAVEFORMATEX* pRequestedFormat, BOOL fOverwrite);
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// This method may be called by an IXAPO::Process implementation
|
||||
// for thru processing. It copies/mixes data from source to
|
||||
// destination, making as few changes as possible to the audio data.
|
||||
//
|
||||
// REMARKS:
|
||||
// However, this method is capable of channel upmix/downmix and uses
|
||||
// the same matrix coefficient table used by windows Vista to do so.
|
||||
//
|
||||
// For in-place processing (input buffer == output buffer)
|
||||
// this method does nothing.
|
||||
//
|
||||
// This method should be called only if the XAPO is locked and
|
||||
// XAPO_FLAG_FRAMERATE_MUST_MATCH is used.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pInputBuffer - [in] input buffer, format may be INT8, INT16, INT20 (contained in 24 or 32 bits), INT24 (contained in 24 or 32 bits), INT32, or FLOAT32
|
||||
// pOutputBuffer - [out] output buffer, format must be FLOAT32
|
||||
// FrameCount - [in] number of frames to process
|
||||
// InputChannelCount - [in] number of input channels
|
||||
// OutputChannelCount - [in] number of output channels
|
||||
// MixWithOutput - [in] TRUE to mix with output, FALSE to overwrite output
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
void ProcessThru (__in void* pInputBuffer, __inout FLOAT32* pOutputBuffer, UINT32 FrameCount, WORD InputChannelCount, WORD OutputChannelCount, BOOL MixWithOutput);
|
||||
|
||||
// accessors
|
||||
const XAPO_REGISTRATION_PROPERTIES* GetRegistrationPropertiesInternal () { return m_pRegistrationProperties; }
|
||||
BOOL IsLocked () { return m_fIsLocked; }
|
||||
|
||||
|
||||
public:
|
||||
CXAPOBase (const XAPO_REGISTRATION_PROPERTIES* pRegistrationProperties);
|
||||
virtual ~CXAPOBase ();
|
||||
|
||||
// IUnknown methods:
|
||||
// retrieves the requested interface pointer if supported
|
||||
STDMETHOD(QueryInterface) (REFIID riid, __deref_out_opt void** ppInterface)
|
||||
{
|
||||
XAPOASSERT(ppInterface != NULL);
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
if (riid == __uuidof(IXAPO)) {
|
||||
*ppInterface = static_cast<IXAPO*>(this);
|
||||
AddRef();
|
||||
} else if (riid == __uuidof(IUnknown)) {
|
||||
*ppInterface = static_cast<IUnknown*>(this);
|
||||
AddRef();
|
||||
} else {
|
||||
*ppInterface = NULL;
|
||||
hr = E_NOINTERFACE;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
// increments reference count
|
||||
STDMETHOD_(ULONG, AddRef) ()
|
||||
{
|
||||
return (ULONG)InterlockedIncrement(&m_lReferenceCount);
|
||||
}
|
||||
|
||||
// decrements reference count and deletes the object if the reference count falls to zero
|
||||
STDMETHOD_(ULONG, Release) ()
|
||||
{
|
||||
ULONG uTmpReferenceCount = (ULONG)InterlockedDecrement(&m_lReferenceCount);
|
||||
if (uTmpReferenceCount == 0) {
|
||||
delete this;
|
||||
}
|
||||
return uTmpReferenceCount;
|
||||
}
|
||||
|
||||
// IXAPO methods:
|
||||
// Allocates a copy of the registration properties of the XAPO.
|
||||
// This default implementation returns a copy of the registration
|
||||
// properties given to the constructor, allocated via XAPOAlloc.
|
||||
STDMETHOD(GetRegistrationProperties) (__deref_out XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties);
|
||||
|
||||
// Queries if a specific input format is supported for a given output format.
|
||||
// This default implementation assumes only the format described by the
|
||||
// XAPOBASE_DEFAULT_FORMAT values are supported for both input and output.
|
||||
STDMETHOD(IsInputFormatSupported) (const WAVEFORMATEX* pOutputFormat, const WAVEFORMATEX* pRequestedInputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedInputFormat);
|
||||
|
||||
// Queries if a specific output format is supported for a given input format.
|
||||
// This default implementation assumes only the format described by the
|
||||
// XAPOBASE_DEFAULT_FORMAT values are supported for both input and output.
|
||||
STDMETHOD(IsOutputFormatSupported) (const WAVEFORMATEX* pInputFormat, const WAVEFORMATEX* pRequestedOutputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedOutputFormat);
|
||||
|
||||
// Performs any effect-specific initialization.
|
||||
// This default implementation is a no-op and only returns S_OK.
|
||||
STDMETHOD(Initialize) (__in_bcount_opt(DataByteSize) const void*, UINT32 DataByteSize)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(DataByteSize);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// Resets variables dependent on frame history.
|
||||
// This default implementation is a no-op: this base class contains no
|
||||
// relevant state to reset.
|
||||
STDMETHOD_(void, Reset) () { return; }
|
||||
|
||||
// Notifies XAPO of buffer formats Process() will be given.
|
||||
// This default implementation performs basic input/output format
|
||||
// validation against the XAPO's registration properties.
|
||||
// Derived XAPOs should call the base implementation first.
|
||||
STDMETHOD(LockForProcess) (UINT32 InputLockedParameterCount, __in_ecount_opt(InputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters, UINT32 OutputLockedParameterCount, __in_ecount_opt(OutputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters);
|
||||
|
||||
// Opposite of LockForProcess.
|
||||
// Derived XAPOs should call the base implementation first.
|
||||
STDMETHOD_(void, UnlockForProcess) ();
|
||||
|
||||
// Returns the number of input frames required to generate the requested number of output frames.
|
||||
// By default, this method returns the same number of frames it was passed.
|
||||
STDMETHOD_(UINT32, CalcInputFrames) (UINT32 OutputFrameCount) { return OutputFrameCount; }
|
||||
|
||||
// Returns the number of output frames generated for the requested number of input frames.
|
||||
// By default, this method returns the same number of frames it was passed.
|
||||
STDMETHOD_(UINT32, CalcOutputFrames) (UINT32 InputFrameCount) { return InputFrameCount; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------//
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Extends CXAPOBase, providing a default implementation of the
|
||||
// IXAPOParameters interface with appropriate synchronization to
|
||||
// protect variables shared between IXAPOParameters::GetParameters
|
||||
// and IXAPOParameters::SetParameters/IXAPO::Process.
|
||||
//
|
||||
// This class is for parameter blocks whose size is larger than 4 bytes.
|
||||
// For smaller parameter blocks, use atomic operations directly
|
||||
// on the parameters for synchronization.
|
||||
////
|
||||
class __declspec(novtable) CXAPOParametersBase: public CXAPOBase, public IXAPOParameters {
|
||||
private:
|
||||
BYTE* m_pParameterBlocks; // three contiguous process parameter blocks used for synchronization, user responsible for initialization of parameter blocks before IXAPO::Process/SetParameters/GetParameters called
|
||||
BYTE* m_pCurrentParameters; // pointer to current process parameters, must be aligned for atomic operations
|
||||
BYTE* m_pCurrentParametersInternal; // pointer to current process parameters (temp pointer read by SetParameters/BeginProcess/EndProcess)
|
||||
UINT32 m_uCurrentParametersIndex; // index of current process parameters
|
||||
UINT32 m_uParameterBlockByteSize; // size of a single parameter block in bytes, must be > 0
|
||||
BOOL m_fNewerResultsReady; // TRUE if there exists new processing results not yet picked up by GetParameters(), must be aligned for atomic operations
|
||||
BOOL m_fProducer; // IXAPO::Process produces data to be returned by GetParameters(); SetParameters() disallowed
|
||||
|
||||
|
||||
public:
|
||||
////
|
||||
// PARAMETERS:
|
||||
// pRegistrationProperties - [in] registration properties of the XAPO
|
||||
// pParameterBlocks - [in] three contiguous process parameter blocks used for synchronization
|
||||
// uParameterBlockByteSize - [in] size of one of the parameter blocks, must be > 0
|
||||
// fProducer - [in] TRUE if IXAPO::Process produces data to be returned by GetParameters() (SetParameters() and ParametersChanged() disallowed)
|
||||
////
|
||||
CXAPOParametersBase (const XAPO_REGISTRATION_PROPERTIES* pRegistrationProperties, BYTE* pParameterBlocks, UINT32 uParameterBlockByteSize, BOOL fProducer);
|
||||
virtual ~CXAPOParametersBase ();
|
||||
|
||||
// IUnknown methods:
|
||||
// retrieves the requested interface pointer if supported
|
||||
STDMETHOD(QueryInterface) (REFIID riid, __deref_out_opt void** ppInterface)
|
||||
{
|
||||
XAPOASSERT(ppInterface != NULL);
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
if (riid == __uuidof(IXAPOParameters)) {
|
||||
*ppInterface = static_cast<IXAPOParameters*>(this);
|
||||
CXAPOBase::AddRef();
|
||||
} else {
|
||||
hr = CXAPOBase::QueryInterface(riid, ppInterface);
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
// increments reference count
|
||||
STDMETHOD_(ULONG, AddRef)() { return CXAPOBase::AddRef(); }
|
||||
|
||||
// decrements reference count and deletes the object if the reference count falls to zero
|
||||
STDMETHOD_(ULONG, Release)() { return CXAPOBase::Release(); }
|
||||
|
||||
// IXAPOParameters methods:
|
||||
// Sets effect-specific parameters.
|
||||
// This method may only be called on the realtime audio processing thread.
|
||||
STDMETHOD_(void, SetParameters) (__in_bcount(ParameterByteSize) const void* pParameters, UINT32 ParameterByteSize);
|
||||
|
||||
// Gets effect-specific parameters.
|
||||
// This method may block and should not be called from the realtime thread.
|
||||
// Get the current parameters via BeginProcess.
|
||||
STDMETHOD_(void, GetParameters) (__out_bcount(ParameterByteSize) void* pParameters, UINT32 ParameterByteSize);
|
||||
|
||||
// Called by SetParameters() to allow for user-defined parameter validation.
|
||||
// SetParameters validates that ParameterByteSize == m_uParameterBlockByteSize
|
||||
// so the user may assume/assert ParameterByteSize == m_uParameterBlockByteSize.
|
||||
// This method should not block as it is called from the realtime thread.
|
||||
virtual void OnSetParameters (const void*, UINT32) { }
|
||||
|
||||
// Returns TRUE if SetParameters() has been called since the last processing pass.
|
||||
// May only be used within the XAPO's IXAPO::Process implementation,
|
||||
// before BeginProcess is called.
|
||||
BOOL ParametersChanged ();
|
||||
|
||||
// Returns latest process parameters.
|
||||
// XAPOs must call this method within their IXAPO::Process
|
||||
// implementation to access latest process parameters in threadsafe manner.
|
||||
BYTE* BeginProcess ();
|
||||
|
||||
// Notifies CXAPOParametersBase that the XAPO has finished accessing
|
||||
// the latest process parameters.
|
||||
// XAPOs must call this method within their IXAPO::Process
|
||||
// implementation to access latest process parameters in threadsafe manner.
|
||||
void EndProcess ();
|
||||
};
|
||||
|
||||
|
||||
#pragma pack(pop) // revert packing alignment
|
||||
//---------------------------------<-EOF->----------------------------------//
|
167
SDK/Include/XAPOFX.h
Normal file
167
SDK/Include/XAPOFX.h
Normal file
@ -0,0 +1,167 @@
|
||||
/*-========================================================================-_
|
||||
| - XAPOFX - |
|
||||
| Copyright (c) Microsoft Corporation. All rights reserved. |
|
||||
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|
||||
|PROJECT: XAPOFX MODEL: Unmanaged User-mode |
|
||||
|VERSION: 1.3 EXCEPT: No Exceptions |
|
||||
|CLASS: N / A MINREQ: WinXP, Xbox360 |
|
||||
|BASE: N / A DIALECT: MSC++ 14.00 |
|
||||
|>------------------------------------------------------------------------<|
|
||||
| DUTY: Cross-platform Audio Processing Objects |
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
|
||||
NOTES:
|
||||
1. USE THE DEBUG DLL TO ENABLE PARAMETER VALIDATION VIA ASSERTS!
|
||||
Here's how:
|
||||
Copy XAPOFXDX_X.dll to where your application exists.
|
||||
The debug DLL can be found under %WINDIR%\system32.
|
||||
Rename XAPOFXDX_X.dll to XAPOFXX_X.dll to use the debug version. */
|
||||
|
||||
#pragma once
|
||||
//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
|
||||
#include "comdecl.h" // for DEFINE_CLSID
|
||||
|
||||
// FX class IDs
|
||||
DEFINE_CLSID(FXEQ, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 00);
|
||||
DEFINE_CLSID(FXMasteringLimiter, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 01);
|
||||
DEFINE_CLSID(FXReverb, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 02);
|
||||
DEFINE_CLSID(FXEcho, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 03);
|
||||
|
||||
|
||||
#if !defined(GUID_DEFS_ONLY) // ignore rest if only GUID definitions requested
|
||||
#if defined(_XBOX) // general windows and COM declarations
|
||||
#include <xtl.h>
|
||||
#include <xobjbase.h>
|
||||
#else
|
||||
#include <windows.h>
|
||||
#include <objbase.h>
|
||||
#endif
|
||||
#include <float.h> // float bounds
|
||||
|
||||
|
||||
// EQ parameter bounds (inclusive), used with XEQ:
|
||||
#define FXEQ_MIN_FRAMERATE 22000
|
||||
#define FXEQ_MAX_FRAMERATE 48000
|
||||
|
||||
#define FXEQ_MIN_FREQUENCY_CENTER 20.0f
|
||||
#define FXEQ_MAX_FREQUENCY_CENTER 20000.0f
|
||||
#define FXEQ_DEFAULT_FREQUENCY_CENTER_0 100.0f // band 0
|
||||
#define FXEQ_DEFAULT_FREQUENCY_CENTER_1 800.0f // band 1
|
||||
#define FXEQ_DEFAULT_FREQUENCY_CENTER_2 2000.0f // band 2
|
||||
#define FXEQ_DEFAULT_FREQUENCY_CENTER_3 10000.0f // band 3
|
||||
|
||||
#define FXEQ_MIN_GAIN 0.126f // -18dB
|
||||
#define FXEQ_MAX_GAIN 7.94f // +18dB
|
||||
#define FXEQ_DEFAULT_GAIN 1.0f // 0dB change, all bands
|
||||
|
||||
#define FXEQ_MIN_BANDWIDTH 0.1f
|
||||
#define FXEQ_MAX_BANDWIDTH 2.0f
|
||||
#define FXEQ_DEFAULT_BANDWIDTH 1.0f // all bands
|
||||
|
||||
|
||||
// Mastering limiter parameter bounds (inclusive), used with XMasteringLimiter:
|
||||
#define FXMASTERINGLIMITER_MIN_RELEASE 1
|
||||
#define FXMASTERINGLIMITER_MAX_RELEASE 20
|
||||
#define FXMASTERINGLIMITER_DEFAULT_RELEASE 6
|
||||
|
||||
#define FXMASTERINGLIMITER_MIN_LOUDNESS 1
|
||||
#define FXMASTERINGLIMITER_MAX_LOUDNESS 1800
|
||||
#define FXMASTERINGLIMITER_DEFAULT_LOUDNESS 1000
|
||||
|
||||
|
||||
// Reverb parameter bounds (inclusive), used with XReverb:
|
||||
#define FXREVERB_MIN_DIFFUSION 0.0f
|
||||
#define FXREVERB_MAX_DIFFUSION 1.0f
|
||||
#define FXREVERB_DEFAULT_DIFFUSION 0.9f
|
||||
|
||||
#define FXREVERB_MIN_ROOMSIZE 0.0001f
|
||||
#define FXREVERB_MAX_ROOMSIZE 1.0f
|
||||
#define FXREVERB_DEFAULT_ROOMSIZE 0.6f
|
||||
|
||||
|
||||
// Echo parameter bounds (inclusive), used with XEcho:
|
||||
#define FXECHO_MIN_WETDRYMIX 0.0f
|
||||
#define FXECHO_MAX_WETDRYMIX 1.0f
|
||||
#define FXECHO_DEFAULT_WETDRYMIX 0.5f
|
||||
|
||||
#define FXECHO_MIN_FEEDBACK 0.0f
|
||||
#define FXECHO_MAX_FEEDBACK 1.0f
|
||||
#define FXECHO_DEFAULT_FEEDBACK 0.5f
|
||||
|
||||
#define FXECHO_MIN_DELAY 1.0f
|
||||
#define FXECHO_MAX_DELAY 2000.0f
|
||||
#define FXECHO_DEFAULT_DELAY 500.0f
|
||||
|
||||
|
||||
//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
|
||||
#pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments
|
||||
|
||||
|
||||
// EQ parameters (4 bands), used with IXAPOParameters::SetParameters:
|
||||
// The EQ supports only FLOAT32 audio foramts.
|
||||
// The framerate must be within [22000, 48000] Hz.
|
||||
typedef struct FXEQ_PARAMETERS {
|
||||
float FrequencyCenter0; // center frequency in Hz, band 0
|
||||
float Gain0; // boost/cut
|
||||
float Bandwidth0; // bandwidth, region of EQ is center frequency +/- bandwidth/2
|
||||
float FrequencyCenter1; // band 1
|
||||
float Gain1;
|
||||
float Bandwidth1;
|
||||
float FrequencyCenter2; // band 2
|
||||
float Gain2;
|
||||
float Bandwidth2;
|
||||
float FrequencyCenter3; // band 3
|
||||
float Gain3;
|
||||
float Bandwidth3;
|
||||
} FXEQ_PARAMETERS;
|
||||
|
||||
|
||||
// Mastering limiter parameters, used with IXAPOParameters::SetParameters:
|
||||
// The mastering limiter supports only FLOAT32 audio formats.
|
||||
typedef struct FXMASTERINGLIMITER_PARAMETERS {
|
||||
UINT32 Release; // release time (tuning factor with no specific units)
|
||||
UINT32 Loudness; // loudness target (threshold)
|
||||
} FXMASTERINGLIMITER_PARAMETERS;
|
||||
|
||||
|
||||
// Reverb parameters, used with IXAPOParameters::SetParameters:
|
||||
// The reverb supports only FLOAT32 audio formats with the following
|
||||
// channel configurations:
|
||||
// Input: Mono Output: Mono
|
||||
// Input: Stereo Output: Stereo
|
||||
typedef struct FXREVERB_PARAMETERS {
|
||||
float Diffusion; // diffusion
|
||||
float RoomSize; // room size
|
||||
} FXREVERB_PARAMETERS;
|
||||
|
||||
|
||||
// Echo parameters, used with IXAPOParameters::SetParameters:
|
||||
// The echo supports only FLOAT32 audio formats.
|
||||
typedef struct FXECHO_PARAMETERS {
|
||||
float WetDryMix; // ratio of wet (processed) signal to dry (original) signal
|
||||
float Feedback; // amount of output fed back into input
|
||||
float Delay; // delay (all channels) in milliseconds
|
||||
} FXECHO_PARAMETERS;
|
||||
|
||||
|
||||
//--------------<M-A-C-R-O-S>-----------------------------------------------//
|
||||
// function storage-class attribute and calltype
|
||||
#if defined(_XBOX) || !defined(FXDLL)
|
||||
#define FX_API_(type) EXTERN_C type STDAPIVCALLTYPE
|
||||
#else
|
||||
#if defined(FXEXPORT)
|
||||
#define FX_API_(type) EXTERN_C __declspec(dllexport) type STDAPIVCALLTYPE
|
||||
#else
|
||||
#define FX_API_(type) EXTERN_C __declspec(dllimport) type STDAPIVCALLTYPE
|
||||
#endif
|
||||
#endif
|
||||
#define FX_IMP_(type) type STDMETHODVCALLTYPE
|
||||
|
||||
|
||||
//--------------<F-U-N-C-T-I-O-N-S>-----------------------------------------//
|
||||
// creates instance of requested XAPO, use Release to free instance
|
||||
FX_API_(HRESULT) CreateFX (REFCLSID clsid, __deref_out IUnknown** pEffect);
|
||||
|
||||
|
||||
#pragma pack(pop) // revert packing alignment
|
||||
#endif // !defined(GUID_DEFS_ONLY)
|
||||
//---------------------------------<-EOF->----------------------------------//
|
1282
SDK/Include/XAudio2.h
Normal file
1282
SDK/Include/XAudio2.h
Normal file
File diff suppressed because it is too large
Load Diff
431
SDK/Include/XAudio2fx.h
Normal file
431
SDK/Include/XAudio2fx.h
Normal file
@ -0,0 +1,431 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
*
|
||||
* File: xaudio2fx.h
|
||||
* Content: Declarations for the audio effects included with XAudio2.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef __XAUDIO2FX_INCLUDED__
|
||||
#define __XAUDIO2FX_INCLUDED__
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* XAudio2 effect class IDs.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include "comdecl.h" // For DEFINE_CLSID and DEFINE_IID
|
||||
|
||||
// XAudio 2.0 (March 2008 SDK)
|
||||
//DEFINE_CLSID(AudioVolumeMeter, C0C56F46, 29B1, 44E9, 99, 39, A3, 2C, E8, 68, 67, E2);
|
||||
//DEFINE_CLSID(AudioVolumeMeter_Debug, C0C56F46, 29B1, 44E9, 99, 39, A3, 2C, E8, 68, 67, DB);
|
||||
//DEFINE_CLSID(AudioReverb, 6F6EA3A9, 2CF5, 41CF, 91, C1, 21, 70, B1, 54, 00, 63);
|
||||
//DEFINE_CLSID(AudioReverb_Debug, 6F6EA3A9, 2CF5, 41CF, 91, C1, 21, 70, B1, 54, 00, DB);
|
||||
|
||||
// XAudio 2.1 (June 2008 SDK)
|
||||
//DEFINE_CLSID(AudioVolumeMeter, c1e3f122, a2ea, 442c, 85, 4f, 20, d9, 8f, 83, 57, a1);
|
||||
//DEFINE_CLSID(AudioVolumeMeter_Debug, 6d97a461, b02d, 48ae, b5, 43, 82, bc, 35, fd, fa, e2);
|
||||
//DEFINE_CLSID(AudioReverb, f4769300, b949, 4df9, b3, 33, 00, d3, 39, 32, e9, a6);
|
||||
//DEFINE_CLSID(AudioReverb_Debug, aea2cabc, 8c7c, 46aa, ba, 44, 0e, 6d, 75, 88, a1, f2);
|
||||
|
||||
// XAudio 2.2 (August 2008 SDK)
|
||||
//DEFINE_CLSID(AudioVolumeMeter, f5ca7b34, 8055, 42c0, b8, 36, 21, 61, 29, eb, 7e, 30);
|
||||
//DEFINE_CLSID(AudioVolumeMeter_Debug, f796f5f7, 6059, 4a9f, 98, 2d, 61, ee, c2, ed, 67, ca);
|
||||
//DEFINE_CLSID(AudioReverb, 629cf0de, 3ecc, 41e7, 99, 26, f7, e4, 3e, eb, ec, 51);
|
||||
//DEFINE_CLSID(AudioReverb_Debug, 4aae4299, 3260, 46d4, 97, cc, 6c, c7, 60, c8, 53, 29);
|
||||
|
||||
// XAudio 2.3 (November 2008 SDK)
|
||||
//DEFINE_CLSID(AudioVolumeMeter, e180344b, ac83, 4483, 95, 9e, 18, a5, c5, 6a, 5e, 19);
|
||||
//DEFINE_CLSID(AudioVolumeMeter_Debug, 922a0a56, 7d13, 40ae, a4, 81, 3c, 6c, 60, f1, 14, 01);
|
||||
//DEFINE_CLSID(AudioReverb, 9cab402c, 1d37, 44b4, 88, 6d, fa, 4f, 36, 17, 0a, 4c);
|
||||
//DEFINE_CLSID(AudioReverb_Debug, eadda998, 3be6, 4505, 84, be, ea, 06, 36, 5d, b9, 6b);
|
||||
|
||||
// XAudio 2.4 (March 2009 SDK)
|
||||
//DEFINE_CLSID(AudioVolumeMeter, c7338b95, 52b8, 4542, aa, 79, 42, eb, 01, 6c, 8c, 1c);
|
||||
//DEFINE_CLSID(AudioVolumeMeter_Debug, 524bd872, 5c0b, 4217, bd, b8, 0a, 86, 81, 83, 0b, a5);
|
||||
//DEFINE_CLSID(AudioReverb, 8bb7778b, 645b, 4475, 9a, 73, 1d, e3, 17, 0b, d3, af);
|
||||
//DEFINE_CLSID(AudioReverb_Debug, da7738a2, cd0c, 4367, 9a, ac, d7, ea, d7, c6, 4f, 98);
|
||||
|
||||
// XAudio 2.5 (March 2009 SDK)
|
||||
//DEFINE_CLSID(AudioVolumeMeter, 2139e6da, c341, 4774, 9a, c3, b4, e0, 26, 34, 7f, 64);
|
||||
//DEFINE_CLSID(AudioVolumeMeter_Debug, a5cc4e13, ca00, 416b, a6, ee, 49, fe, e7, b5, 43, d0);
|
||||
//DEFINE_CLSID(AudioReverb, d06df0d0, 8518, 441e, 82, 2f, 54, 51, d5, c5, 95, b8);
|
||||
//DEFINE_CLSID(AudioReverb_Debug, 613604ec, 304c, 45ec, a4, ed, 7a, 1c, 61, 2e, 9e, 72);
|
||||
|
||||
// XAudio 2.6 (February 2010 SDK)
|
||||
//DEFINE_CLSID(AudioVolumeMeter, e48c5a3f, 93ef, 43bb, a0, 92, 2c, 7c, eb, 94, 6f, 27);
|
||||
//DEFINE_CLSID(AudioVolumeMeter_Debug, 9a9eaef7, a9e0, 4088, 9b, 1b, 9c, a0, 3a, 1a, ec, d4);
|
||||
//DEFINE_CLSID(AudioReverb, cecec95a, d894, 491a, be, e3, 5e, 10, 6f, b5, 9f, 2d);
|
||||
//DEFINE_CLSID(AudioReverb_Debug, 99a1c72e, 364c, 4c1b, 96, 23, fd, 5c, 8a, bd, 90, c7);
|
||||
|
||||
// XAudio 2.7 (June 2010 SDK)
|
||||
DEFINE_CLSID(AudioVolumeMeter, cac1105f, 619b, 4d04, 83, 1a, 44, e1, cb, f1, 2d, 57);
|
||||
DEFINE_CLSID(AudioVolumeMeter_Debug, 2d9a0f9c, e67b, 4b24, ab, 44, 92, b3, e7, 70, c0, 20);
|
||||
DEFINE_CLSID(AudioReverb, 6a93130e, 1d53, 41d1, a9, cf, e7, 58, 80, 0b, b1, 79);
|
||||
DEFINE_CLSID(AudioReverb_Debug, c4f82dd4, cb4e, 4ce1, 8b, db, ee, 32, d4, 19, 82, 69);
|
||||
|
||||
// Ignore the rest of this header if only the GUID definitions were requested
|
||||
#ifndef GUID_DEFS_ONLY
|
||||
|
||||
#ifdef _XBOX
|
||||
#include <xobjbase.h> // Xbox COM declarations (IUnknown, etc)
|
||||
#else
|
||||
#include <objbase.h> // Windows COM declarations
|
||||
#endif
|
||||
#include <math.h> // For log10()
|
||||
|
||||
|
||||
// All structures defined in this file should use tight packing
|
||||
#pragma pack(push, 1)
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Effect creation functions. On Windows, these are just inline functions
|
||||
* that call CoCreateInstance and Initialize; the XAUDIO2FX_DEBUG flag can
|
||||
* be used to select the debug version of the effects. On Xbox, these map
|
||||
* to real functions included in xaudio2.lib, and the XAUDIO2FX_DEBUG flag
|
||||
* is ignored; the application must link with the debug library to use the
|
||||
* debug functionality.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
// Use default values for some parameters if building C++ code
|
||||
#ifdef __cplusplus
|
||||
#define DEFAULT(x) =x
|
||||
#else
|
||||
#define DEFAULT(x)
|
||||
#endif
|
||||
|
||||
#define XAUDIO2FX_DEBUG 1 // To select the debug version of an effect
|
||||
|
||||
#ifdef _XBOX
|
||||
|
||||
STDAPI CreateAudioVolumeMeter(__deref_out IUnknown** ppApo);
|
||||
STDAPI CreateAudioReverb(__deref_out IUnknown** ppApo);
|
||||
|
||||
__inline HRESULT XAudio2CreateVolumeMeter(__deref_out IUnknown** ppApo, UINT32 /*Flags*/ DEFAULT(0))
|
||||
{
|
||||
return CreateAudioVolumeMeter(ppApo);
|
||||
}
|
||||
|
||||
__inline HRESULT XAudio2CreateReverb(__deref_out IUnknown** ppApo, UINT32 /*Flags*/ DEFAULT(0))
|
||||
{
|
||||
return CreateAudioReverb(ppApo);
|
||||
}
|
||||
|
||||
#else // Windows
|
||||
|
||||
__inline HRESULT XAudio2CreateVolumeMeter(__deref_out IUnknown** ppApo, UINT32 Flags DEFAULT(0))
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? __uuidof(AudioVolumeMeter_Debug)
|
||||
: __uuidof(AudioVolumeMeter),
|
||||
NULL, CLSCTX_INPROC_SERVER, __uuidof(IUnknown), (void**)ppApo);
|
||||
#else
|
||||
return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? &CLSID_AudioVolumeMeter_Debug
|
||||
: &CLSID_AudioVolumeMeter,
|
||||
NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)ppApo);
|
||||
#endif
|
||||
}
|
||||
|
||||
__inline HRESULT XAudio2CreateReverb(__deref_out IUnknown** ppApo, UINT32 Flags DEFAULT(0))
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? __uuidof(AudioReverb_Debug)
|
||||
: __uuidof(AudioReverb),
|
||||
NULL, CLSCTX_INPROC_SERVER, __uuidof(IUnknown), (void**)ppApo);
|
||||
#else
|
||||
return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? &CLSID_AudioReverb_Debug
|
||||
: &CLSID_AudioReverb,
|
||||
NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)ppApo);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // #ifdef _XBOX
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Volume meter parameters.
|
||||
* The volume meter supports FLOAT32 audio formats and must be used in-place.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
// XAUDIO2FX_VOLUMEMETER_LEVELS: Receives results from GetEffectParameters().
|
||||
// The user is responsible for allocating pPeakLevels, pRMSLevels, and
|
||||
// initializing ChannelCount accordingly.
|
||||
// The volume meter does not support SetEffectParameters().
|
||||
typedef struct XAUDIO2FX_VOLUMEMETER_LEVELS
|
||||
{
|
||||
float* pPeakLevels; // Peak levels table: receives maximum absolute level for each channel
|
||||
// over a processing pass; may be NULL if pRMSLevls != NULL,
|
||||
// otherwise must have at least ChannelCount elements.
|
||||
float* pRMSLevels; // Root mean square levels table: receives RMS level for each channel
|
||||
// over a processing pass; may be NULL if pPeakLevels != NULL,
|
||||
// otherwise must have at least ChannelCount elements.
|
||||
UINT32 ChannelCount; // Number of channels being processed by the volume meter APO
|
||||
} XAUDIO2FX_VOLUMEMETER_LEVELS;
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Reverb parameters.
|
||||
* The reverb supports only FLOAT32 audio with the following channel
|
||||
* configurations:
|
||||
* Input: Mono Output: Mono
|
||||
* Input: Mono Output: 5.1
|
||||
* Input: Stereo Output: Stereo
|
||||
* Input: Stereo Output: 5.1
|
||||
* The framerate must be within [20000, 48000] Hz.
|
||||
*
|
||||
* When using mono input, delay filters associated with the right channel
|
||||
* are not executed. In this case, parameters such as PositionRight and
|
||||
* PositionMatrixRight have no effect. This also means the reverb uses
|
||||
* less CPU when hosted in a mono submix.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#define XAUDIO2FX_REVERB_MIN_FRAMERATE 20000
|
||||
#define XAUDIO2FX_REVERB_MAX_FRAMERATE 48000
|
||||
|
||||
// XAUDIO2FX_REVERB_PARAMETERS: Native parameter set for the reverb effect
|
||||
|
||||
typedef struct XAUDIO2FX_REVERB_PARAMETERS
|
||||
{
|
||||
// ratio of wet (processed) signal to dry (original) signal
|
||||
float WetDryMix; // [0, 100] (percentage)
|
||||
|
||||
// Delay times
|
||||
UINT32 ReflectionsDelay; // [0, 300] in ms
|
||||
BYTE ReverbDelay; // [0, 85] in ms
|
||||
BYTE RearDelay; // [0, 5] in ms
|
||||
|
||||
// Indexed parameters
|
||||
BYTE PositionLeft; // [0, 30] no units
|
||||
BYTE PositionRight; // [0, 30] no units, ignored when configured to mono
|
||||
BYTE PositionMatrixLeft; // [0, 30] no units
|
||||
BYTE PositionMatrixRight; // [0, 30] no units, ignored when configured to mono
|
||||
BYTE EarlyDiffusion; // [0, 15] no units
|
||||
BYTE LateDiffusion; // [0, 15] no units
|
||||
BYTE LowEQGain; // [0, 12] no units
|
||||
BYTE LowEQCutoff; // [0, 9] no units
|
||||
BYTE HighEQGain; // [0, 8] no units
|
||||
BYTE HighEQCutoff; // [0, 14] no units
|
||||
|
||||
// Direct parameters
|
||||
float RoomFilterFreq; // [20, 20000] in Hz
|
||||
float RoomFilterMain; // [-100, 0] in dB
|
||||
float RoomFilterHF; // [-100, 0] in dB
|
||||
float ReflectionsGain; // [-100, 20] in dB
|
||||
float ReverbGain; // [-100, 20] in dB
|
||||
float DecayTime; // [0.1, inf] in seconds
|
||||
float Density; // [0, 100] (percentage)
|
||||
float RoomSize; // [1, 100] in feet
|
||||
} XAUDIO2FX_REVERB_PARAMETERS;
|
||||
|
||||
|
||||
// Maximum, minimum and default values for the parameters above
|
||||
#define XAUDIO2FX_REVERB_MIN_WET_DRY_MIX 0.0f
|
||||
#define XAUDIO2FX_REVERB_MIN_REFLECTIONS_DELAY 0
|
||||
#define XAUDIO2FX_REVERB_MIN_REVERB_DELAY 0
|
||||
#define XAUDIO2FX_REVERB_MIN_REAR_DELAY 0
|
||||
#define XAUDIO2FX_REVERB_MIN_POSITION 0
|
||||
#define XAUDIO2FX_REVERB_MIN_DIFFUSION 0
|
||||
#define XAUDIO2FX_REVERB_MIN_LOW_EQ_GAIN 0
|
||||
#define XAUDIO2FX_REVERB_MIN_LOW_EQ_CUTOFF 0
|
||||
#define XAUDIO2FX_REVERB_MIN_HIGH_EQ_GAIN 0
|
||||
#define XAUDIO2FX_REVERB_MIN_HIGH_EQ_CUTOFF 0
|
||||
#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_FREQ 20.0f
|
||||
#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_MAIN -100.0f
|
||||
#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_HF -100.0f
|
||||
#define XAUDIO2FX_REVERB_MIN_REFLECTIONS_GAIN -100.0f
|
||||
#define XAUDIO2FX_REVERB_MIN_REVERB_GAIN -100.0f
|
||||
#define XAUDIO2FX_REVERB_MIN_DECAY_TIME 0.1f
|
||||
#define XAUDIO2FX_REVERB_MIN_DENSITY 0.0f
|
||||
#define XAUDIO2FX_REVERB_MIN_ROOM_SIZE 0.0f
|
||||
|
||||
#define XAUDIO2FX_REVERB_MAX_WET_DRY_MIX 100.0f
|
||||
#define XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY 300
|
||||
#define XAUDIO2FX_REVERB_MAX_REVERB_DELAY 85
|
||||
#define XAUDIO2FX_REVERB_MAX_REAR_DELAY 5
|
||||
#define XAUDIO2FX_REVERB_MAX_POSITION 30
|
||||
#define XAUDIO2FX_REVERB_MAX_DIFFUSION 15
|
||||
#define XAUDIO2FX_REVERB_MAX_LOW_EQ_GAIN 12
|
||||
#define XAUDIO2FX_REVERB_MAX_LOW_EQ_CUTOFF 9
|
||||
#define XAUDIO2FX_REVERB_MAX_HIGH_EQ_GAIN 8
|
||||
#define XAUDIO2FX_REVERB_MAX_HIGH_EQ_CUTOFF 14
|
||||
#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_FREQ 20000.0f
|
||||
#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_MAIN 0.0f
|
||||
#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_HF 0.0f
|
||||
#define XAUDIO2FX_REVERB_MAX_REFLECTIONS_GAIN 20.0f
|
||||
#define XAUDIO2FX_REVERB_MAX_REVERB_GAIN 20.0f
|
||||
#define XAUDIO2FX_REVERB_MAX_DENSITY 100.0f
|
||||
#define XAUDIO2FX_REVERB_MAX_ROOM_SIZE 100.0f
|
||||
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_WET_DRY_MIX 100.0f
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_REFLECTIONS_DELAY 5
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_REVERB_DELAY 5
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_REAR_DELAY 5
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_POSITION 6
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX 27
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_EARLY_DIFFUSION 8
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_LATE_DIFFUSION 8
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_LOW_EQ_GAIN 8
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_LOW_EQ_CUTOFF 4
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_HIGH_EQ_GAIN 8
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_HIGH_EQ_CUTOFF 4
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_FREQ 5000.0f
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_MAIN 0.0f
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_HF 0.0f
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_REFLECTIONS_GAIN 0.0f
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_REVERB_GAIN 0.0f
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_DECAY_TIME 1.0f
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_DENSITY 100.0f
|
||||
#define XAUDIO2FX_REVERB_DEFAULT_ROOM_SIZE 100.0f
|
||||
|
||||
|
||||
// XAUDIO2FX_REVERB_I3DL2_PARAMETERS: Parameter set compliant with the I3DL2 standard
|
||||
|
||||
typedef struct XAUDIO2FX_REVERB_I3DL2_PARAMETERS
|
||||
{
|
||||
// ratio of wet (processed) signal to dry (original) signal
|
||||
float WetDryMix; // [0, 100] (percentage)
|
||||
|
||||
// Standard I3DL2 parameters
|
||||
INT32 Room; // [-10000, 0] in mB (hundredths of decibels)
|
||||
INT32 RoomHF; // [-10000, 0] in mB (hundredths of decibels)
|
||||
float RoomRolloffFactor; // [0.0, 10.0]
|
||||
float DecayTime; // [0.1, 20.0] in seconds
|
||||
float DecayHFRatio; // [0.1, 2.0]
|
||||
INT32 Reflections; // [-10000, 1000] in mB (hundredths of decibels)
|
||||
float ReflectionsDelay; // [0.0, 0.3] in seconds
|
||||
INT32 Reverb; // [-10000, 2000] in mB (hundredths of decibels)
|
||||
float ReverbDelay; // [0.0, 0.1] in seconds
|
||||
float Diffusion; // [0.0, 100.0] (percentage)
|
||||
float Density; // [0.0, 100.0] (percentage)
|
||||
float HFReference; // [20.0, 20000.0] in Hz
|
||||
} XAUDIO2FX_REVERB_I3DL2_PARAMETERS;
|
||||
|
||||
|
||||
// ReverbConvertI3DL2ToNative: Utility function to map from I3DL2 to native parameters
|
||||
|
||||
__inline void ReverbConvertI3DL2ToNative
|
||||
(
|
||||
__in const XAUDIO2FX_REVERB_I3DL2_PARAMETERS* pI3DL2,
|
||||
__out XAUDIO2FX_REVERB_PARAMETERS* pNative
|
||||
)
|
||||
{
|
||||
float reflectionsDelay;
|
||||
float reverbDelay;
|
||||
|
||||
// RoomRolloffFactor is ignored
|
||||
|
||||
// These parameters have no equivalent in I3DL2
|
||||
pNative->RearDelay = XAUDIO2FX_REVERB_DEFAULT_REAR_DELAY; // 5
|
||||
pNative->PositionLeft = XAUDIO2FX_REVERB_DEFAULT_POSITION; // 6
|
||||
pNative->PositionRight = XAUDIO2FX_REVERB_DEFAULT_POSITION; // 6
|
||||
pNative->PositionMatrixLeft = XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX; // 27
|
||||
pNative->PositionMatrixRight = XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX; // 27
|
||||
pNative->RoomSize = XAUDIO2FX_REVERB_DEFAULT_ROOM_SIZE; // 100
|
||||
pNative->LowEQCutoff = 4;
|
||||
pNative->HighEQCutoff = 6;
|
||||
|
||||
// The rest of the I3DL2 parameters map to the native property set
|
||||
pNative->RoomFilterMain = (float)pI3DL2->Room / 100.0f;
|
||||
pNative->RoomFilterHF = (float)pI3DL2->RoomHF / 100.0f;
|
||||
|
||||
if (pI3DL2->DecayHFRatio >= 1.0f)
|
||||
{
|
||||
INT32 index = (INT32)(-4.0 * log10(pI3DL2->DecayHFRatio));
|
||||
if (index < -8) index = -8;
|
||||
pNative->LowEQGain = (BYTE)((index < 0) ? index + 8 : 8);
|
||||
pNative->HighEQGain = 8;
|
||||
pNative->DecayTime = pI3DL2->DecayTime * pI3DL2->DecayHFRatio;
|
||||
}
|
||||
else
|
||||
{
|
||||
INT32 index = (INT32)(4.0 * log10(pI3DL2->DecayHFRatio));
|
||||
if (index < -8) index = -8;
|
||||
pNative->LowEQGain = 8;
|
||||
pNative->HighEQGain = (BYTE)((index < 0) ? index + 8 : 8);
|
||||
pNative->DecayTime = pI3DL2->DecayTime;
|
||||
}
|
||||
|
||||
reflectionsDelay = pI3DL2->ReflectionsDelay * 1000.0f;
|
||||
if (reflectionsDelay >= XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY) // 300
|
||||
{
|
||||
reflectionsDelay = (float)(XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY - 1);
|
||||
}
|
||||
else if (reflectionsDelay <= 1)
|
||||
{
|
||||
reflectionsDelay = 1;
|
||||
}
|
||||
pNative->ReflectionsDelay = (UINT32)reflectionsDelay;
|
||||
|
||||
reverbDelay = pI3DL2->ReverbDelay * 1000.0f;
|
||||
if (reverbDelay >= XAUDIO2FX_REVERB_MAX_REVERB_DELAY) // 85
|
||||
{
|
||||
reverbDelay = (float)(XAUDIO2FX_REVERB_MAX_REVERB_DELAY - 1);
|
||||
}
|
||||
pNative->ReverbDelay = (BYTE)reverbDelay;
|
||||
|
||||
pNative->ReflectionsGain = pI3DL2->Reflections / 100.0f;
|
||||
pNative->ReverbGain = pI3DL2->Reverb / 100.0f;
|
||||
pNative->EarlyDiffusion = (BYTE)(15.0f * pI3DL2->Diffusion / 100.0f);
|
||||
pNative->LateDiffusion = pNative->EarlyDiffusion;
|
||||
pNative->Density = pI3DL2->Density;
|
||||
pNative->RoomFilterFreq = pI3DL2->HFReference;
|
||||
|
||||
pNative->WetDryMix = pI3DL2->WetDryMix;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Standard I3DL2 reverb presets (100% wet).
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#define XAUDIO2FX_I3DL2_PRESET_DEFAULT {100,-10000, 0,0.0f, 1.00f,0.50f,-10000,0.020f,-10000,0.040f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_GENERIC {100, -1000, -100,0.0f, 1.49f,0.83f, -2602,0.007f, 200,0.011f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_PADDEDCELL {100, -1000,-6000,0.0f, 0.17f,0.10f, -1204,0.001f, 207,0.002f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_ROOM {100, -1000, -454,0.0f, 0.40f,0.83f, -1646,0.002f, 53,0.003f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_BATHROOM {100, -1000,-1200,0.0f, 1.49f,0.54f, -370,0.007f, 1030,0.011f,100.0f, 60.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_LIVINGROOM {100, -1000,-6000,0.0f, 0.50f,0.10f, -1376,0.003f, -1104,0.004f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_STONEROOM {100, -1000, -300,0.0f, 2.31f,0.64f, -711,0.012f, 83,0.017f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_AUDITORIUM {100, -1000, -476,0.0f, 4.32f,0.59f, -789,0.020f, -289,0.030f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_CONCERTHALL {100, -1000, -500,0.0f, 3.92f,0.70f, -1230,0.020f, -2,0.029f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_CAVE {100, -1000, 0,0.0f, 2.91f,1.30f, -602,0.015f, -302,0.022f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_ARENA {100, -1000, -698,0.0f, 7.24f,0.33f, -1166,0.020f, 16,0.030f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_HANGAR {100, -1000,-1000,0.0f,10.05f,0.23f, -602,0.020f, 198,0.030f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_CARPETEDHALLWAY {100, -1000,-4000,0.0f, 0.30f,0.10f, -1831,0.002f, -1630,0.030f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_HALLWAY {100, -1000, -300,0.0f, 1.49f,0.59f, -1219,0.007f, 441,0.011f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_STONECORRIDOR {100, -1000, -237,0.0f, 2.70f,0.79f, -1214,0.013f, 395,0.020f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_ALLEY {100, -1000, -270,0.0f, 1.49f,0.86f, -1204,0.007f, -4,0.011f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_FOREST {100, -1000,-3300,0.0f, 1.49f,0.54f, -2560,0.162f, -613,0.088f, 79.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_CITY {100, -1000, -800,0.0f, 1.49f,0.67f, -2273,0.007f, -2217,0.011f, 50.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_MOUNTAINS {100, -1000,-2500,0.0f, 1.49f,0.21f, -2780,0.300f, -2014,0.100f, 27.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_QUARRY {100, -1000,-1000,0.0f, 1.49f,0.83f,-10000,0.061f, 500,0.025f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_PLAIN {100, -1000,-2000,0.0f, 1.49f,0.50f, -2466,0.179f, -2514,0.100f, 21.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_PARKINGLOT {100, -1000, 0,0.0f, 1.65f,1.50f, -1363,0.008f, -1153,0.012f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_SEWERPIPE {100, -1000,-1000,0.0f, 2.81f,0.14f, 429,0.014f, 648,0.021f, 80.0f, 60.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_UNDERWATER {100, -1000,-4000,0.0f, 1.49f,0.10f, -449,0.007f, 1700,0.011f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_SMALLROOM {100, -1000, -600,0.0f, 1.10f,0.83f, -400,0.005f, 500,0.010f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_MEDIUMROOM {100, -1000, -600,0.0f, 1.30f,0.83f, -1000,0.010f, -200,0.020f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_LARGEROOM {100, -1000, -600,0.0f, 1.50f,0.83f, -1600,0.020f, -1000,0.040f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_MEDIUMHALL {100, -1000, -600,0.0f, 1.80f,0.70f, -1300,0.015f, -800,0.030f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_LARGEHALL {100, -1000, -600,0.0f, 1.80f,0.70f, -2000,0.030f, -1400,0.060f,100.0f,100.0f,5000.0f}
|
||||
#define XAUDIO2FX_I3DL2_PRESET_PLATE {100, -1000, -200,0.0f, 1.30f,0.90f, 0,0.002f, 0,0.010f,100.0f, 75.0f,5000.0f}
|
||||
|
||||
|
||||
// Undo the #pragma pack(push, 1) at the top of this file
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif // #ifndef GUID_DEFS_ONLY
|
||||
#endif // #ifndef __XAUDIO2FX_INCLUDED__
|
754
SDK/Include/XDSP.h
Normal file
754
SDK/Include/XDSP.h
Normal file
@ -0,0 +1,754 @@
|
||||
/*-========================================================================-_
|
||||
| - XDSP - |
|
||||
| Copyright (c) Microsoft Corporation. All rights reserved. |
|
||||
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|
||||
|PROJECT: XDSP MODEL: Unmanaged User-mode |
|
||||
|VERSION: 1.2 EXCEPT: No Exceptions |
|
||||
|CLASS: N / A MINREQ: WinXP, Xbox360 |
|
||||
|BASE: N / A DIALECT: MSC++ 14.00 |
|
||||
|>------------------------------------------------------------------------<|
|
||||
| DUTY: DSP functions with CPU extension specific optimizations |
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
|
||||
NOTES:
|
||||
1. Definition of terms:
|
||||
DSP: Digital Signal Processing.
|
||||
FFT: Fast Fourier Transform.
|
||||
Frame: A block of samples, one per channel,
|
||||
to be played simultaneously.
|
||||
|
||||
2. All buffer parameters must be 16-byte aligned.
|
||||
|
||||
3. All FFT functions support only FLOAT32 audio. */
|
||||
|
||||
#pragma once
|
||||
//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
|
||||
#include <windef.h> // general windows types
|
||||
#include <math.h> // trigonometric functions
|
||||
#if defined(_XBOX) // SIMD intrinsics
|
||||
#include <ppcintrinsics.h>
|
||||
#else
|
||||
#include <emmintrin.h>
|
||||
#endif
|
||||
|
||||
|
||||
//--------------<M-A-C-R-O-S>-----------------------------------------------//
|
||||
// assertion
|
||||
#if !defined(DSPASSERT)
|
||||
#if DBG
|
||||
#define DSPASSERT(exp) if (!(exp)) { OutputDebugStringA("XDSP ASSERT: " #exp ", {" __FUNCTION__ "}\n"); __debugbreak(); }
|
||||
#else
|
||||
#define DSPASSERT(exp) __assume(exp)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// true if n is a power of 2
|
||||
#if !defined(ISPOWEROF2)
|
||||
#define ISPOWEROF2(n) ( ((n)&((n)-1)) == 0 && (n) != 0 )
|
||||
#endif
|
||||
|
||||
|
||||
//--------------<H-E-L-P-E-R-S>---------------------------------------------//
|
||||
namespace XDSP {
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4328 4640) // disable "indirection alignment of formal parameter", "construction of local static object is not thread-safe" compile warnings
|
||||
|
||||
|
||||
// Helper functions, used by the FFT functions.
|
||||
// The application need not call them directly.
|
||||
|
||||
// primitive types
|
||||
typedef __m128 XVECTOR;
|
||||
typedef XVECTOR& XVECTORREF;
|
||||
typedef const XVECTOR& XVECTORREFC;
|
||||
|
||||
|
||||
// Parallel multiplication of four complex numbers, assuming
|
||||
// real and imaginary values are stored in separate vectors.
|
||||
__forceinline void vmulComplex (__out XVECTORREF rResult, __out XVECTORREF iResult, __in XVECTORREFC r1, __in XVECTORREFC i1, __in XVECTORREFC r2, __in XVECTORREFC i2)
|
||||
{
|
||||
// (r1, i1) * (r2, i2) = (r1r2 - i1i2, r1i2 + r2i1)
|
||||
XVECTOR vi1i2 = _mm_mul_ps(i1, i2);
|
||||
XVECTOR vr1r2 = _mm_mul_ps(r1, r2);
|
||||
XVECTOR vr1i2 = _mm_mul_ps(r1, i2);
|
||||
XVECTOR vr2i1 = _mm_mul_ps(r2, i1);
|
||||
rResult = _mm_sub_ps(vr1r2, vi1i2); // real: (r1*r2 - i1*i2)
|
||||
iResult = _mm_add_ps(vr1i2, vr2i1); // imaginary: (r1*i2 + r2*i1)
|
||||
}
|
||||
__forceinline void vmulComplex (__inout XVECTORREF r1, __inout XVECTORREF i1, __in XVECTORREFC r2, __in XVECTORREFC i2)
|
||||
{
|
||||
// (r1, i1) * (r2, i2) = (r1r2 - i1i2, r1i2 + r2i1)
|
||||
XVECTOR vi1i2 = _mm_mul_ps(i1, i2);
|
||||
XVECTOR vr1r2 = _mm_mul_ps(r1, r2);
|
||||
XVECTOR vr1i2 = _mm_mul_ps(r1, i2);
|
||||
XVECTOR vr2i1 = _mm_mul_ps(r2, i1);
|
||||
r1 = _mm_sub_ps(vr1r2, vi1i2); // real: (r1*r2 - i1*i2)
|
||||
i1 = _mm_add_ps(vr1i2, vr2i1); // imaginary: (r1*i2 + r2*i1)
|
||||
}
|
||||
|
||||
|
||||
// Radix-4 decimation-in-time FFT butterfly.
|
||||
// This version assumes that all four elements of the butterfly are
|
||||
// adjacent in a single vector.
|
||||
//
|
||||
// Compute the product of the complex input vector and the
|
||||
// 4-element DFT matrix:
|
||||
// | 1 1 1 1 | | (r1X,i1X) |
|
||||
// | 1 -j -1 j | | (r1Y,i1Y) |
|
||||
// | 1 -1 1 -1 | | (r1Z,i1Z) |
|
||||
// | 1 j -1 -j | | (r1W,i1W) |
|
||||
//
|
||||
// This matrix can be decomposed into two simpler ones to reduce the
|
||||
// number of additions needed. The decomposed matrices look like this:
|
||||
// | 1 0 1 0 | | 1 0 1 0 |
|
||||
// | 0 1 0 -j | | 1 0 -1 0 |
|
||||
// | 1 0 -1 0 | | 0 1 0 1 |
|
||||
// | 0 1 0 j | | 0 1 0 -1 |
|
||||
//
|
||||
// Combine as follows:
|
||||
// | 1 0 1 0 | | (r1X,i1X) | | (r1X + r1Z, i1X + i1Z) |
|
||||
// Temp = | 1 0 -1 0 | * | (r1Y,i1Y) | = | (r1X - r1Z, i1X - i1Z) |
|
||||
// | 0 1 0 1 | | (r1Z,i1Z) | | (r1Y + r1W, i1Y + i1W) |
|
||||
// | 0 1 0 -1 | | (r1W,i1W) | | (r1Y - r1W, i1Y - i1W) |
|
||||
//
|
||||
// | 1 0 1 0 | | (rTempX,iTempX) | | (rTempX + rTempZ, iTempX + iTempZ) |
|
||||
// Result = | 0 1 0 -j | * | (rTempY,iTempY) | = | (rTempY + iTempW, iTempY - rTempW) |
|
||||
// | 1 0 -1 0 | | (rTempZ,iTempZ) | | (rTempX - rTempZ, iTempX - iTempZ) |
|
||||
// | 0 1 0 j | | (rTempW,iTempW) | | (rTempY - iTempW, iTempY + rTempW) |
|
||||
__forceinline void ButterflyDIT4_1 (__inout XVECTORREF r1, __inout XVECTORREF i1)
|
||||
{
|
||||
// sign constants for radix-4 butterflies
|
||||
const static XVECTOR vDFT4SignBits1 = { 0.0f, -0.0f, 0.0f, -0.0f };
|
||||
const static XVECTOR vDFT4SignBits2 = { 0.0f, 0.0f, -0.0f, -0.0f };
|
||||
const static XVECTOR vDFT4SignBits3 = { 0.0f, -0.0f, -0.0f, 0.0f };
|
||||
|
||||
|
||||
// calculating Temp
|
||||
XVECTOR rTemp = _mm_add_ps( _mm_shuffle_ps(r1, r1, _MM_SHUFFLE(1, 1, 0, 0)), // [r1X| r1X|r1Y| r1Y] +
|
||||
_mm_xor_ps(_mm_shuffle_ps(r1, r1, _MM_SHUFFLE(3, 3, 2, 2)), vDFT4SignBits1) ); // [r1Z|-r1Z|r1W|-r1W]
|
||||
XVECTOR iTemp = _mm_add_ps( _mm_shuffle_ps(i1, i1, _MM_SHUFFLE(1, 1, 0, 0)), // [i1X| i1X|i1Y| i1Y] +
|
||||
_mm_xor_ps(_mm_shuffle_ps(i1, i1, _MM_SHUFFLE(3, 3, 2, 2)), vDFT4SignBits1) ); // [i1Z|-i1Z|i1W|-i1W]
|
||||
|
||||
// calculating Result
|
||||
XVECTOR rZrWiZiW = _mm_shuffle_ps(rTemp, iTemp, _MM_SHUFFLE(3, 2, 3, 2)); // [rTempZ|rTempW|iTempZ|iTempW]
|
||||
XVECTOR rZiWrZiW = _mm_shuffle_ps(rZrWiZiW, rZrWiZiW, _MM_SHUFFLE(3, 0, 3, 0)); // [rTempZ|iTempW|rTempZ|iTempW]
|
||||
XVECTOR iZrWiZrW = _mm_shuffle_ps(rZrWiZiW, rZrWiZiW, _MM_SHUFFLE(1, 2, 1, 2)); // [rTempZ|iTempW|rTempZ|iTempW]
|
||||
r1 = _mm_add_ps( _mm_shuffle_ps(rTemp, rTemp, _MM_SHUFFLE(1, 0, 1, 0)), // [rTempX| rTempY| rTempX| rTempY] +
|
||||
_mm_xor_ps(rZiWrZiW, vDFT4SignBits2) ); // [rTempZ| iTempW|-rTempZ|-iTempW]
|
||||
i1 = _mm_add_ps( _mm_shuffle_ps(iTemp, iTemp, _MM_SHUFFLE(1, 0, 1, 0)), // [iTempX| iTempY| iTempX| iTempY] +
|
||||
_mm_xor_ps(iZrWiZrW, vDFT4SignBits3) ); // [iTempZ|-rTempW|-iTempZ| rTempW]
|
||||
}
|
||||
|
||||
// Radix-4 decimation-in-time FFT butterfly.
|
||||
// This version assumes that elements of the butterfly are
|
||||
// in different vectors, so that each vector in the input
|
||||
// contains elements from four different butterflies.
|
||||
// The four separate butterflies are processed in parallel.
|
||||
//
|
||||
// The calculations here are the same as the ones in the single-vector
|
||||
// radix-4 DFT, but instead of being done on a single vector (X,Y,Z,W)
|
||||
// they are done in parallel on sixteen independent complex values.
|
||||
// There is no interdependence between the vector elements:
|
||||
// | 1 0 1 0 | | (rIn0,iIn0) | | (rIn0 + rIn2, iIn0 + iIn2) |
|
||||
// | 1 0 -1 0 | * | (rIn1,iIn1) | = Temp = | (rIn0 - rIn2, iIn0 - iIn2) |
|
||||
// | 0 1 0 1 | | (rIn2,iIn2) | | (rIn1 + rIn3, iIn1 + iIn3) |
|
||||
// | 0 1 0 -1 | | (rIn3,iIn3) | | (rIn1 - rIn3, iIn1 - iIn3) |
|
||||
//
|
||||
// | 1 0 1 0 | | (rTemp0,iTemp0) | | (rTemp0 + rTemp2, iTemp0 + iTemp2) |
|
||||
// Result = | 0 1 0 -j | * | (rTemp1,iTemp1) | = | (rTemp1 + iTemp3, iTemp1 - rTemp3) |
|
||||
// | 1 0 -1 0 | | (rTemp2,iTemp2) | | (rTemp0 - rTemp2, iTemp0 - iTemp2) |
|
||||
// | 0 1 0 j | | (rTemp3,iTemp3) | | (rTemp1 - iTemp3, iTemp1 + rTemp3) |
|
||||
__forceinline void ButterflyDIT4_4 (__inout XVECTORREF r0,
|
||||
__inout XVECTORREF r1,
|
||||
__inout XVECTORREF r2,
|
||||
__inout XVECTORREF r3,
|
||||
__inout XVECTORREF i0,
|
||||
__inout XVECTORREF i1,
|
||||
__inout XVECTORREF i2,
|
||||
__inout XVECTORREF i3,
|
||||
__in_ecount(uStride*4) const XVECTOR* __restrict pUnityTableReal,
|
||||
__in_ecount(uStride*4) const XVECTOR* __restrict pUnityTableImaginary,
|
||||
const UINT32 uStride, const BOOL fLast)
|
||||
{
|
||||
DSPASSERT(pUnityTableReal != NULL);
|
||||
DSPASSERT(pUnityTableImaginary != NULL);
|
||||
DSPASSERT((UINT_PTR)pUnityTableReal % 16 == 0);
|
||||
DSPASSERT((UINT_PTR)pUnityTableImaginary % 16 == 0);
|
||||
DSPASSERT(ISPOWEROF2(uStride));
|
||||
|
||||
XVECTOR rTemp0, rTemp1, rTemp2, rTemp3, rTemp4, rTemp5, rTemp6, rTemp7;
|
||||
XVECTOR iTemp0, iTemp1, iTemp2, iTemp3, iTemp4, iTemp5, iTemp6, iTemp7;
|
||||
|
||||
|
||||
// calculating Temp
|
||||
rTemp0 = _mm_add_ps(r0, r2); iTemp0 = _mm_add_ps(i0, i2);
|
||||
rTemp2 = _mm_add_ps(r1, r3); iTemp2 = _mm_add_ps(i1, i3);
|
||||
rTemp1 = _mm_sub_ps(r0, r2); iTemp1 = _mm_sub_ps(i0, i2);
|
||||
rTemp3 = _mm_sub_ps(r1, r3); iTemp3 = _mm_sub_ps(i1, i3);
|
||||
rTemp4 = _mm_add_ps(rTemp0, rTemp2); iTemp4 = _mm_add_ps(iTemp0, iTemp2);
|
||||
rTemp5 = _mm_add_ps(rTemp1, iTemp3); iTemp5 = _mm_sub_ps(iTemp1, rTemp3);
|
||||
rTemp6 = _mm_sub_ps(rTemp0, rTemp2); iTemp6 = _mm_sub_ps(iTemp0, iTemp2);
|
||||
rTemp7 = _mm_sub_ps(rTemp1, iTemp3); iTemp7 = _mm_add_ps(iTemp1, rTemp3);
|
||||
|
||||
// calculating Result
|
||||
// vmulComplex(rTemp0, iTemp0, rTemp0, iTemp0, pUnityTableReal[0], pUnityTableImaginary[0]); // first one is always trivial
|
||||
vmulComplex(rTemp5, iTemp5, pUnityTableReal[uStride], pUnityTableImaginary[uStride]);
|
||||
vmulComplex(rTemp6, iTemp6, pUnityTableReal[uStride*2], pUnityTableImaginary[uStride*2]);
|
||||
vmulComplex(rTemp7, iTemp7, pUnityTableReal[uStride*3], pUnityTableImaginary[uStride*3]);
|
||||
if (fLast) {
|
||||
ButterflyDIT4_1(rTemp4, iTemp4);
|
||||
ButterflyDIT4_1(rTemp5, iTemp5);
|
||||
ButterflyDIT4_1(rTemp6, iTemp6);
|
||||
ButterflyDIT4_1(rTemp7, iTemp7);
|
||||
}
|
||||
|
||||
|
||||
r0 = rTemp4; i0 = iTemp4;
|
||||
r1 = rTemp5; i1 = iTemp5;
|
||||
r2 = rTemp6; i2 = iTemp6;
|
||||
r3 = rTemp7; i3 = iTemp7;
|
||||
}
|
||||
|
||||
//--------------<F-U-N-C-T-I-O-N-S>-----------------------------------------//
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// 4-sample FFT.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pReal - [inout] real components, must have at least uCount elements
|
||||
// pImaginary - [inout] imaginary components, must have at least uCount elements
|
||||
// uCount - [in] number of FFT iterations
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
__forceinline void FFT4 (__inout_ecount(uCount) XVECTOR* __restrict pReal, __inout_ecount(uCount) XVECTOR* __restrict pImaginary, const UINT32 uCount=1)
|
||||
{
|
||||
DSPASSERT(pReal != NULL);
|
||||
DSPASSERT(pImaginary != NULL);
|
||||
DSPASSERT((UINT_PTR)pReal % 16 == 0);
|
||||
DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
|
||||
DSPASSERT(ISPOWEROF2(uCount));
|
||||
|
||||
for (UINT32 uIndex=0; uIndex<uCount; ++uIndex) {
|
||||
ButterflyDIT4_1(pReal[uIndex], pImaginary[uIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// 8-sample FFT.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pReal - [inout] real components, must have at least uCount*2 elements
|
||||
// pImaginary - [inout] imaginary components, must have at least uCount*2 elements
|
||||
// uCount - [in] number of FFT iterations
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
__forceinline void FFT8 (__inout_ecount(uCount*2) XVECTOR* __restrict pReal, __inout_ecount(uCount*2) XVECTOR* __restrict pImaginary, const UINT32 uCount=1)
|
||||
{
|
||||
DSPASSERT(pReal != NULL);
|
||||
DSPASSERT(pImaginary != NULL);
|
||||
DSPASSERT((UINT_PTR)pReal % 16 == 0);
|
||||
DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
|
||||
DSPASSERT(ISPOWEROF2(uCount));
|
||||
|
||||
static XVECTOR wr1 = { 1.0f, 0.70710677f, 0.0f, -0.70710677f };
|
||||
static XVECTOR wi1 = { 0.0f, -0.70710677f, -1.0f, -0.70710677f };
|
||||
static XVECTOR wr2 = { -1.0f, -0.70710677f, 0.0f, 0.70710677f };
|
||||
static XVECTOR wi2 = { 0.0f, 0.70710677f, 1.0f, 0.70710677f };
|
||||
|
||||
|
||||
for (UINT32 uIndex=0; uIndex<uCount; ++uIndex) {
|
||||
XVECTOR* __restrict pR = pReal + uIndex*2;
|
||||
XVECTOR* __restrict pI = pImaginary + uIndex*2;
|
||||
|
||||
XVECTOR oddsR = _mm_shuffle_ps(pR[0], pR[1], _MM_SHUFFLE(3, 1, 3, 1));
|
||||
XVECTOR evensR = _mm_shuffle_ps(pR[0], pR[1], _MM_SHUFFLE(2, 0, 2, 0));
|
||||
XVECTOR oddsI = _mm_shuffle_ps(pI[0], pI[1], _MM_SHUFFLE(3, 1, 3, 1));
|
||||
XVECTOR evensI = _mm_shuffle_ps(pI[0], pI[1], _MM_SHUFFLE(2, 0, 2, 0));
|
||||
ButterflyDIT4_1(oddsR, oddsI);
|
||||
ButterflyDIT4_1(evensR, evensI);
|
||||
|
||||
XVECTOR r, i;
|
||||
vmulComplex(r, i, oddsR, oddsI, wr1, wi1);
|
||||
pR[0] = _mm_add_ps(evensR, r);
|
||||
pI[0] = _mm_add_ps(evensI, i);
|
||||
|
||||
vmulComplex(r, i, oddsR, oddsI, wr2, wi2);
|
||||
pR[1] = _mm_add_ps(evensR, r);
|
||||
pI[1] = _mm_add_ps(evensI, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// 16-sample FFT.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pReal - [inout] real components, must have at least uCount*4 elements
|
||||
// pImaginary - [inout] imaginary components, must have at least uCount*4 elements
|
||||
// uCount - [in] number of FFT iterations
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
__forceinline void FFT16 (__inout_ecount(uCount*4) XVECTOR* __restrict pReal, __inout_ecount(uCount*4) XVECTOR* __restrict pImaginary, const UINT32 uCount=1)
|
||||
{
|
||||
DSPASSERT(pReal != NULL);
|
||||
DSPASSERT(pImaginary != NULL);
|
||||
DSPASSERT((UINT_PTR)pReal % 16 == 0);
|
||||
DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
|
||||
DSPASSERT(ISPOWEROF2(uCount));
|
||||
|
||||
XVECTOR aUnityTableReal[4] = { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.92387950f, 0.70710677f, 0.38268343f, 1.0f, 0.70710677f, -4.3711388e-008f, -0.70710677f, 1.0f, 0.38268343f, -0.70710677f, -0.92387950f };
|
||||
XVECTOR aUnityTableImaginary[4] = { -0.0f, -0.0f, -0.0f, -0.0f, -0.0f, -0.38268343f, -0.70710677f, -0.92387950f, -0.0f, -0.70710677f, -1.0f, -0.70710677f, -0.0f, -0.92387950f, -0.70710677f, 0.38268343f };
|
||||
|
||||
|
||||
for (UINT32 uIndex=0; uIndex<uCount; ++uIndex) {
|
||||
ButterflyDIT4_4(pReal[uIndex*4],
|
||||
pReal[uIndex*4 + 1],
|
||||
pReal[uIndex*4 + 2],
|
||||
pReal[uIndex*4 + 3],
|
||||
pImaginary[uIndex*4],
|
||||
pImaginary[uIndex*4 + 1],
|
||||
pImaginary[uIndex*4 + 2],
|
||||
pImaginary[uIndex*4 + 3],
|
||||
aUnityTableReal,
|
||||
aUnityTableImaginary,
|
||||
1, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// 2^N-sample FFT.
|
||||
//
|
||||
// REMARKS:
|
||||
// For FFTs length 16 and below, call FFT16(), FFT8(), or FFT4().
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pReal - [inout] real components, must have at least (uLength*uCount)/4 elements
|
||||
// pImaginary - [inout] imaginary components, must have at least (uLength*uCount)/4 elements
|
||||
// pUnityTable - [in] unity table, must have at least uLength*uCount elements, see FFTInitializeUnityTable()
|
||||
// uLength - [in] FFT length in samples, must be a power of 2 > 16
|
||||
// uCount - [in] number of FFT iterations
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
inline void FFT (__inout_ecount((uLength*uCount)/4) XVECTOR* __restrict pReal, __inout_ecount((uLength*uCount)/4) XVECTOR* __restrict pImaginary, __in_ecount(uLength*uCount) const XVECTOR* __restrict pUnityTable, const UINT32 uLength, const UINT32 uCount=1)
|
||||
{
|
||||
DSPASSERT(pReal != NULL);
|
||||
DSPASSERT(pImaginary != NULL);
|
||||
DSPASSERT(pUnityTable != NULL);
|
||||
DSPASSERT((UINT_PTR)pReal % 16 == 0);
|
||||
DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
|
||||
DSPASSERT((UINT_PTR)pUnityTable % 16 == 0);
|
||||
DSPASSERT(uLength > 16);
|
||||
DSPASSERT(ISPOWEROF2(uLength));
|
||||
DSPASSERT(ISPOWEROF2(uCount));
|
||||
|
||||
const XVECTOR* __restrict pUnityTableReal = pUnityTable;
|
||||
const XVECTOR* __restrict pUnityTableImaginary = pUnityTable + (uLength>>2);
|
||||
const UINT32 uTotal = uCount * uLength;
|
||||
const UINT32 uTotal_vectors = uTotal >> 2;
|
||||
const UINT32 uStage_vectors = uLength >> 2;
|
||||
const UINT32 uStage_vectors_mask = uStage_vectors - 1;
|
||||
const UINT32 uStride = uLength >> 4; // stride between butterfly elements
|
||||
const UINT32 uStrideMask = uStride - 1;
|
||||
const UINT32 uStride2 = uStride * 2;
|
||||
const UINT32 uStride3 = uStride * 3;
|
||||
const UINT32 uStrideInvMask = ~uStrideMask;
|
||||
|
||||
|
||||
for (UINT32 uIndex=0; uIndex<(uTotal_vectors>>2); ++uIndex) {
|
||||
const UINT32 n = ((uIndex & uStrideInvMask) << 2) + (uIndex & uStrideMask);
|
||||
ButterflyDIT4_4(pReal[n],
|
||||
pReal[n + uStride],
|
||||
pReal[n + uStride2],
|
||||
pReal[n + uStride3],
|
||||
pImaginary[n ],
|
||||
pImaginary[n + uStride],
|
||||
pImaginary[n + uStride2],
|
||||
pImaginary[n + uStride3],
|
||||
pUnityTableReal + (n & uStage_vectors_mask),
|
||||
pUnityTableImaginary + (n & uStage_vectors_mask),
|
||||
uStride, FALSE);
|
||||
}
|
||||
|
||||
|
||||
if (uLength > 16*4) {
|
||||
FFT(pReal, pImaginary, pUnityTable+(uLength>>1), uLength>>2, uCount*4);
|
||||
} else if (uLength == 16*4) {
|
||||
FFT16(pReal, pImaginary, uCount*4);
|
||||
} else if (uLength == 8*4) {
|
||||
FFT8(pReal, pImaginary, uCount*4);
|
||||
} else if (uLength == 4*4) {
|
||||
FFT4(pReal, pImaginary, uCount*4);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------//
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Initializes unity roots lookup table used by FFT functions.
|
||||
// Once initialized, the table need not be initialized again unless a
|
||||
// different FFT length is desired.
|
||||
//
|
||||
// REMARKS:
|
||||
// The unity tables of FFT length 16 and below are hard coded into the
|
||||
// respective FFT functions and so need not be initialized.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pUnityTable - [out] unity table, receives unity roots lookup table, must have at least uLength elements
|
||||
// uLength - [in] FFT length in frames, must be a power of 2 > 16
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
inline void FFTInitializeUnityTable (__out_ecount(uLength) XVECTOR* __restrict pUnityTable, UINT32 uLength)
|
||||
{
|
||||
DSPASSERT(pUnityTable != NULL);
|
||||
DSPASSERT(uLength > 16);
|
||||
DSPASSERT(ISPOWEROF2(uLength));
|
||||
|
||||
FLOAT32* __restrict pfUnityTable = (FLOAT32* __restrict)pUnityTable;
|
||||
|
||||
|
||||
// initialize unity table for recursive FFT lengths: uLength, uLength/4, uLength/16... > 16
|
||||
do {
|
||||
FLOAT32 flStep = 6.283185307f / uLength; // 2PI / FFT length
|
||||
uLength >>= 2;
|
||||
|
||||
// pUnityTable[0 to uLength*4-1] contains real components for current FFT length
|
||||
// pUnityTable[uLength*4 to uLength*8-1] contains imaginary components for current FFT length
|
||||
for (UINT32 i=0; i<4; ++i) {
|
||||
for (UINT32 j=0; j<uLength; ++j) {
|
||||
UINT32 uIndex = (i*uLength) + j;
|
||||
pfUnityTable[uIndex] = cosf(FLOAT32(i)*FLOAT32(j)*flStep); // real component
|
||||
pfUnityTable[uIndex + uLength*4] = -sinf(FLOAT32(i)*FLOAT32(j)*flStep); // imaginary component
|
||||
}
|
||||
}
|
||||
pfUnityTable += uLength*8;
|
||||
} while (uLength > 16);
|
||||
}
|
||||
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// The FFT functions generate output in bit reversed order.
|
||||
// Use this function to re-arrange them into order of increasing frequency.
|
||||
//
|
||||
// REMARKS:
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pOutput - [out] output buffer, receives samples in order of increasing frequency, cannot overlap pInput, must have at least (1<<uLog2Length)/4 elements
|
||||
// pInput - [in] input buffer, samples in bit reversed order as generated by FFT functions, cannot overlap pOutput, must have at least (1<<uLog2Length)/4 elements
|
||||
// uLog2Length - [in] LOG (base 2) of FFT length in samples, must be >= 2
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
inline void FFTUnswizzle (__out_ecount((1<<uLog2Length)/4) XVECTOR* __restrict pOutput, __in_ecount((1<<uLog2Length)/4) const XVECTOR* __restrict pInput, const UINT32 uLog2Length)
|
||||
{
|
||||
DSPASSERT(pOutput != NULL);
|
||||
DSPASSERT(pInput != NULL);
|
||||
DSPASSERT(uLog2Length >= 2);
|
||||
|
||||
FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput;
|
||||
const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput;
|
||||
const UINT32 uLength = UINT32(1 << uLog2Length);
|
||||
|
||||
|
||||
if ((uLog2Length & 0x1) == 0) {
|
||||
// even powers of two
|
||||
for (UINT32 uIndex=0; uIndex<uLength; ++uIndex) {
|
||||
UINT32 n = uIndex;
|
||||
n = ( (n & 0xcccccccc) >> 2 ) | ( (n & 0x33333333) << 2 );
|
||||
n = ( (n & 0xf0f0f0f0) >> 4 ) | ( (n & 0x0f0f0f0f) << 4 );
|
||||
n = ( (n & 0xff00ff00) >> 8 ) | ( (n & 0x00ff00ff) << 8 );
|
||||
n = ( (n & 0xffff0000) >> 16 ) | ( (n & 0x0000ffff) << 16 );
|
||||
n >>= (32 - uLog2Length);
|
||||
pfOutput[n] = pfInput[uIndex];
|
||||
}
|
||||
} else {
|
||||
// odd powers of two
|
||||
for (UINT32 uIndex=0; uIndex<uLength; ++uIndex) {
|
||||
UINT32 n = (uIndex>>3);
|
||||
n = ( (n & 0xcccccccc) >> 2 ) | ( (n & 0x33333333) << 2 );
|
||||
n = ( (n & 0xf0f0f0f0) >> 4 ) | ( (n & 0x0f0f0f0f) << 4 );
|
||||
n = ( (n & 0xff00ff00) >> 8 ) | ( (n & 0x00ff00ff) << 8 );
|
||||
n = ( (n & 0xffff0000) >> 16 ) | ( (n & 0x0000ffff) << 16 );
|
||||
n >>= (32 - (uLog2Length-3));
|
||||
n |= ((uIndex & 0x7) << (uLog2Length - 3));
|
||||
pfOutput[n] = pfInput[uIndex];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Convert complex components to polar form.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pOutput - [out] output buffer, receives samples in polar form, must have at least uLength/4 elements
|
||||
// pInputReal - [in] input buffer (real components), must have at least uLength/4 elements
|
||||
// pInputImaginary - [in] input buffer (imaginary components), must have at least uLength/4 elements
|
||||
// uLength - [in] FFT length in samples, must be a power of 2 >= 4
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
inline void FFTPolar (__out_ecount(uLength/4) XVECTOR* __restrict pOutput, __in_ecount(uLength/4) const XVECTOR* __restrict pInputReal, __in_ecount(uLength/4) const XVECTOR* __restrict pInputImaginary, const UINT32 uLength)
|
||||
{
|
||||
DSPASSERT(pOutput != NULL);
|
||||
DSPASSERT(pInputReal != NULL);
|
||||
DSPASSERT(pInputImaginary != NULL);
|
||||
DSPASSERT(uLength >= 4);
|
||||
DSPASSERT(ISPOWEROF2(uLength));
|
||||
|
||||
FLOAT32 flOneOverLength = 1.0f / uLength;
|
||||
|
||||
|
||||
// result = sqrtf((real/uLength)^2 + (imaginary/uLength)^2) * 2
|
||||
XVECTOR vOneOverLength = _mm_set_ps1(flOneOverLength);
|
||||
|
||||
for (UINT32 uIndex=0; uIndex<(uLength>>2); ++uIndex) {
|
||||
XVECTOR vReal = _mm_mul_ps(pInputReal[uIndex], vOneOverLength);
|
||||
XVECTOR vImaginary = _mm_mul_ps(pInputImaginary[uIndex], vOneOverLength);
|
||||
XVECTOR vRR = _mm_mul_ps(vReal, vReal);
|
||||
XVECTOR vII = _mm_mul_ps(vImaginary, vImaginary);
|
||||
XVECTOR vRRplusII = _mm_add_ps(vRR, vII);
|
||||
XVECTOR vTotal = _mm_sqrt_ps(vRRplusII);
|
||||
pOutput[uIndex] = _mm_add_ps(vTotal, vTotal);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------//
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Deinterleaves audio samples such that all samples corresponding to
|
||||
|
||||
//
|
||||
// REMARKS:
|
||||
// For example, audio of the form [LRLRLR] becomes [LLLRRR].
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pOutput - [out] output buffer, receives samples in deinterleaved form, cannot overlap pInput, must have at least (uChannelCount*uFrameCount)/4 elements
|
||||
// pInput - [in] input buffer, cannot overlap pOutput, must have at least (uChannelCount*uFrameCount)/4 elements
|
||||
// uChannelCount - [in] number of channels, must be > 1
|
||||
// uFrameCount - [in] number of frames of valid data, must be > 0
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
inline void Deinterleave (__out_ecount((uChannelCount*uFrameCount)/4) XVECTOR* __restrict pOutput, __in_ecount((uChannelCount*uFrameCount)/4) const XVECTOR* __restrict pInput, const UINT32 uChannelCount, const UINT32 uFrameCount)
|
||||
{
|
||||
DSPASSERT(pOutput != NULL);
|
||||
DSPASSERT(pInput != NULL);
|
||||
DSPASSERT(uChannelCount > 1);
|
||||
DSPASSERT(uFrameCount > 0);
|
||||
|
||||
FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput;
|
||||
const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput;
|
||||
|
||||
|
||||
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
|
||||
for (UINT32 uFrame=0; uFrame<uFrameCount; ++uFrame) {
|
||||
pfOutput[uChannel * uFrameCount + uFrame] = pfInput[uFrame * uChannelCount + uChannel];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Interleaves audio samples such that all samples corresponding to
|
||||
|
||||
//
|
||||
// REMARKS:
|
||||
// For example, audio of the form [LLLRRR] becomes [LRLRLR].
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pOutput - [out] output buffer, receives samples in interleaved form, cannot overlap pInput, must have at least (uChannelCount*uFrameCount)/4 elements
|
||||
// pInput - [in] input buffer, cannot overlap pOutput, must have at least (uChannelCount*uFrameCount)/4 elements
|
||||
// uChannelCount - [in] number of channels, must be > 1
|
||||
// uFrameCount - [in] number of frames of valid data, must be > 0
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
inline void Interleave (__out_ecount((uChannelCount*uFrameCount)/4) XVECTOR* __restrict pOutput, __in_ecount((uChannelCount*uFrameCount)/4) const XVECTOR* __restrict pInput, const UINT32 uChannelCount, const UINT32 uFrameCount)
|
||||
{
|
||||
DSPASSERT(pOutput != NULL);
|
||||
DSPASSERT(pInput != NULL);
|
||||
DSPASSERT(uChannelCount > 1);
|
||||
DSPASSERT(uFrameCount > 0);
|
||||
|
||||
FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput;
|
||||
const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput;
|
||||
|
||||
|
||||
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
|
||||
for (UINT32 uFrame=0; uFrame<uFrameCount; ++uFrame) {
|
||||
pfOutput[uFrame * uChannelCount + uChannel] = pfInput[uChannel * uFrameCount + uFrame];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------//
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// This function applies a 2^N-sample FFT and unswizzles the result such
|
||||
// that the samples are in order of increasing frequency.
|
||||
// Audio is first deinterleaved if multichannel.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pReal - [inout] real components, must have at least (1<<uLog2Length*uChannelCount)/4 elements
|
||||
// pImaginary - [out] imaginary components, must have at least (1<<uLog2Length*uChannelCount)/4 elements
|
||||
// pUnityTable - [in] unity table, must have at least (1<<uLog2Length) elements, see FFTInitializeUnityTable()
|
||||
// uChannelCount - [in] number of channels, must be within [1, 6]
|
||||
// uLog2Length - [in] LOG (base 2) of FFT length in frames, must within [2, 9]
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
inline void FFTInterleaved (__inout_ecount((1<<uLog2Length*uChannelCount)/4) XVECTOR* __restrict pReal, __out_ecount((1<<uLog2Length*uChannelCount)/4) XVECTOR* __restrict pImaginary, __in_ecount(1<<uLog2Length) const XVECTOR* __restrict pUnityTable, const UINT32 uChannelCount, const UINT32 uLog2Length)
|
||||
{
|
||||
DSPASSERT(pReal != NULL);
|
||||
DSPASSERT(pImaginary != NULL);
|
||||
DSPASSERT(pUnityTable != NULL);
|
||||
DSPASSERT((UINT_PTR)pReal % 16 == 0);
|
||||
DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
|
||||
DSPASSERT((UINT_PTR)pUnityTable % 16 == 0);
|
||||
DSPASSERT(uChannelCount > 0 && uChannelCount <= 6);
|
||||
DSPASSERT(uLog2Length >= 2 && uLog2Length <= 9);
|
||||
|
||||
XVECTOR vRealTemp[768];
|
||||
XVECTOR vImaginaryTemp[768];
|
||||
const UINT32 uLength = UINT32(1 << uLog2Length);
|
||||
|
||||
|
||||
if (uChannelCount > 1) {
|
||||
Deinterleave(vRealTemp, pReal, uChannelCount, uLength);
|
||||
} else {
|
||||
CopyMemory(vRealTemp, pReal, (uLength>>2)*sizeof(XVECTOR));
|
||||
}
|
||||
for (UINT32 u=0; u<uChannelCount*(uLength>>2); u++) {
|
||||
vImaginaryTemp[u] = _mm_setzero_ps();
|
||||
}
|
||||
|
||||
if (uLength > 16) {
|
||||
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
|
||||
FFT(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)], pUnityTable, uLength);
|
||||
}
|
||||
} else if (uLength == 16) {
|
||||
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
|
||||
FFT16(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
|
||||
}
|
||||
} else if (uLength == 8) {
|
||||
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
|
||||
FFT8(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
|
||||
}
|
||||
} else if (uLength == 4) {
|
||||
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
|
||||
FFT4(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
|
||||
}
|
||||
}
|
||||
|
||||
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
|
||||
FFTUnswizzle(&pReal[uChannel*(uLength>>2)], &vRealTemp[uChannel*(uLength>>2)], uLog2Length);
|
||||
FFTUnswizzle(&pImaginary[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)], uLog2Length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// This function applies a 2^N-sample inverse FFT.
|
||||
// Audio is interleaved if multichannel.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pReal - [inout] real components, must have at least (1<<uLog2Length*uChannelCount)/4 elements
|
||||
// pImaginary - [out] imaginary components, must have at least (1<<uLog2Length*uChannelCount)/4 elements
|
||||
// pUnityTable - [in] unity table, must have at least (1<<uLog2Length) elements, see FFTInitializeUnityTable()
|
||||
// uChannelCount - [in] number of channels, must be > 0
|
||||
// uLog2Length - [in] LOG (base 2) of FFT length in frames, must within [2, 10]
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// void
|
||||
////
|
||||
inline void IFFTDeinterleaved (__inout_ecount((1<<uLog2Length*uChannelCount)/4) XVECTOR* __restrict pReal, __out_ecount((1<<uLog2Length*uChannelCount)/4) XVECTOR* __restrict pImaginary, __in_ecount(1<<uLog2Length) const XVECTOR* __restrict pUnityTable, const UINT32 uChannelCount, const UINT32 uLog2Length)
|
||||
{
|
||||
DSPASSERT(pReal != NULL);
|
||||
DSPASSERT(pImaginary != NULL);
|
||||
DSPASSERT(pUnityTable != NULL);
|
||||
DSPASSERT((UINT_PTR)pReal % 16 == 0);
|
||||
DSPASSERT((UINT_PTR)pImaginary % 16 == 0);
|
||||
DSPASSERT((UINT_PTR)pUnityTable % 16 == 0);
|
||||
DSPASSERT(uChannelCount > 0 && uChannelCount <= 6);
|
||||
DSPASSERT(uLog2Length >= 2 && uLog2Length <= 9);
|
||||
|
||||
XVECTOR vRealTemp[768];
|
||||
XVECTOR vImaginaryTemp[768];
|
||||
const UINT32 uLength = UINT32(1 << uLog2Length);
|
||||
|
||||
|
||||
const XVECTOR vRnp = _mm_set_ps1(1.0f/uLength);
|
||||
const XVECTOR vRnm = _mm_set_ps1(-1.0f/uLength);
|
||||
for (UINT32 u=0; u<uChannelCount*(uLength>>2); u++) {
|
||||
vRealTemp[u] = _mm_mul_ps(pReal[u], vRnp);
|
||||
vImaginaryTemp[u] = _mm_mul_ps(pImaginary[u], vRnm);
|
||||
}
|
||||
|
||||
if (uLength > 16) {
|
||||
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
|
||||
FFT(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)], pUnityTable, uLength);
|
||||
}
|
||||
} else if (uLength == 16) {
|
||||
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
|
||||
FFT16(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
|
||||
}
|
||||
} else if (uLength == 8) {
|
||||
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
|
||||
FFT8(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
|
||||
}
|
||||
} else if (uLength == 4) {
|
||||
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
|
||||
FFT4(&vRealTemp[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)]);
|
||||
}
|
||||
}
|
||||
|
||||
for (UINT32 uChannel=0; uChannel<uChannelCount; ++uChannel) {
|
||||
FFTUnswizzle(&vImaginaryTemp[uChannel*(uLength>>2)], &vRealTemp[uChannel*(uLength>>2)], uLog2Length);
|
||||
}
|
||||
if (uChannelCount > 1) {
|
||||
Interleave(pReal, vImaginaryTemp, uChannelCount, uLength);
|
||||
} else {
|
||||
CopyMemory(pReal, vImaginaryTemp, (uLength>>2)*sizeof(XVECTOR));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma warning(pop)
|
||||
}; // namespace XDSP
|
||||
//---------------------------------<-EOF->----------------------------------//
|
||||
|
283
SDK/Include/XInput.h
Normal file
283
SDK/Include/XInput.h
Normal file
@ -0,0 +1,283 @@
|
||||
/***************************************************************************
|
||||
* *
|
||||
* XInput.h -- This module defines XBOX controller APIs *
|
||||
* and constansts for the Windows platform. *
|
||||
* *
|
||||
* Copyright (c) Microsoft Corp. All rights reserved. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
#ifndef _XINPUT_H_
|
||||
#define _XINPUT_H_
|
||||
|
||||
#include <windef.h>
|
||||
|
||||
// Current name of the DLL shipped in the same SDK as this header.
|
||||
// The name reflects the current version
|
||||
#ifndef XINPUT_USE_9_1_0
|
||||
#define XINPUT_DLL_A "xinput1_3.dll"
|
||||
#define XINPUT_DLL_W L"xinput1_3.dll"
|
||||
#else
|
||||
#define XINPUT_DLL_A "xinput9_1_0.dll"
|
||||
#define XINPUT_DLL_W L"xinput9_1_0.dll"
|
||||
#endif
|
||||
#ifdef UNICODE
|
||||
#define XINPUT_DLL XINPUT_DLL_W
|
||||
#else
|
||||
#define XINPUT_DLL XINPUT_DLL_A
|
||||
#endif
|
||||
|
||||
//
|
||||
// Device types available in XINPUT_CAPABILITIES
|
||||
//
|
||||
#define XINPUT_DEVTYPE_GAMEPAD 0x01
|
||||
|
||||
//
|
||||
// Device subtypes available in XINPUT_CAPABILITIES
|
||||
//
|
||||
#define XINPUT_DEVSUBTYPE_GAMEPAD 0x01
|
||||
|
||||
#ifndef XINPUT_USE_9_1_0
|
||||
|
||||
#define XINPUT_DEVSUBTYPE_WHEEL 0x02
|
||||
#define XINPUT_DEVSUBTYPE_ARCADE_STICK 0x03
|
||||
#define XINPUT_DEVSUBTYPE_FLIGHT_SICK 0x04
|
||||
#define XINPUT_DEVSUBTYPE_DANCE_PAD 0x05
|
||||
#define XINPUT_DEVSUBTYPE_GUITAR 0x06
|
||||
#define XINPUT_DEVSUBTYPE_DRUM_KIT 0x08
|
||||
|
||||
#endif // !XINPUT_USE_9_1_0
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Flags for XINPUT_CAPABILITIES
|
||||
//
|
||||
#define XINPUT_CAPS_VOICE_SUPPORTED 0x0004
|
||||
|
||||
//
|
||||
// Constants for gamepad buttons
|
||||
//
|
||||
#define XINPUT_GAMEPAD_DPAD_UP 0x0001
|
||||
#define XINPUT_GAMEPAD_DPAD_DOWN 0x0002
|
||||
#define XINPUT_GAMEPAD_DPAD_LEFT 0x0004
|
||||
#define XINPUT_GAMEPAD_DPAD_RIGHT 0x0008
|
||||
#define XINPUT_GAMEPAD_START 0x0010
|
||||
#define XINPUT_GAMEPAD_BACK 0x0020
|
||||
#define XINPUT_GAMEPAD_LEFT_THUMB 0x0040
|
||||
#define XINPUT_GAMEPAD_RIGHT_THUMB 0x0080
|
||||
#define XINPUT_GAMEPAD_LEFT_SHOULDER 0x0100
|
||||
#define XINPUT_GAMEPAD_RIGHT_SHOULDER 0x0200
|
||||
#define XINPUT_GAMEPAD_A 0x1000
|
||||
#define XINPUT_GAMEPAD_B 0x2000
|
||||
#define XINPUT_GAMEPAD_X 0x4000
|
||||
#define XINPUT_GAMEPAD_Y 0x8000
|
||||
|
||||
|
||||
//
|
||||
// Gamepad thresholds
|
||||
//
|
||||
#define XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE 7849
|
||||
#define XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE 8689
|
||||
#define XINPUT_GAMEPAD_TRIGGER_THRESHOLD 30
|
||||
|
||||
//
|
||||
// Flags to pass to XInputGetCapabilities
|
||||
//
|
||||
#define XINPUT_FLAG_GAMEPAD 0x00000001
|
||||
|
||||
|
||||
#ifndef XINPUT_USE_9_1_0
|
||||
|
||||
//
|
||||
// Devices that support batteries
|
||||
//
|
||||
#define BATTERY_DEVTYPE_GAMEPAD 0x00
|
||||
#define BATTERY_DEVTYPE_HEADSET 0x01
|
||||
|
||||
//
|
||||
// Flags for battery status level
|
||||
//
|
||||
#define BATTERY_TYPE_DISCONNECTED 0x00 // This device is not connected
|
||||
#define BATTERY_TYPE_WIRED 0x01 // Wired device, no battery
|
||||
#define BATTERY_TYPE_ALKALINE 0x02 // Alkaline battery source
|
||||
#define BATTERY_TYPE_NIMH 0x03 // Nickel Metal Hydride battery source
|
||||
#define BATTERY_TYPE_UNKNOWN 0xFF // Cannot determine the battery type
|
||||
|
||||
// These are only valid for wireless, connected devices, with known battery types
|
||||
// The amount of use time remaining depends on the type of device.
|
||||
#define BATTERY_LEVEL_EMPTY 0x00
|
||||
#define BATTERY_LEVEL_LOW 0x01
|
||||
#define BATTERY_LEVEL_MEDIUM 0x02
|
||||
#define BATTERY_LEVEL_FULL 0x03
|
||||
|
||||
// User index definitions
|
||||
#define XUSER_MAX_COUNT 4
|
||||
|
||||
#define XUSER_INDEX_ANY 0x000000FF
|
||||
|
||||
|
||||
//
|
||||
// Codes returned for the gamepad keystroke
|
||||
//
|
||||
|
||||
#define VK_PAD_A 0x5800
|
||||
#define VK_PAD_B 0x5801
|
||||
#define VK_PAD_X 0x5802
|
||||
#define VK_PAD_Y 0x5803
|
||||
#define VK_PAD_RSHOULDER 0x5804
|
||||
#define VK_PAD_LSHOULDER 0x5805
|
||||
#define VK_PAD_LTRIGGER 0x5806
|
||||
#define VK_PAD_RTRIGGER 0x5807
|
||||
|
||||
#define VK_PAD_DPAD_UP 0x5810
|
||||
#define VK_PAD_DPAD_DOWN 0x5811
|
||||
#define VK_PAD_DPAD_LEFT 0x5812
|
||||
#define VK_PAD_DPAD_RIGHT 0x5813
|
||||
#define VK_PAD_START 0x5814
|
||||
#define VK_PAD_BACK 0x5815
|
||||
#define VK_PAD_LTHUMB_PRESS 0x5816
|
||||
#define VK_PAD_RTHUMB_PRESS 0x5817
|
||||
|
||||
#define VK_PAD_LTHUMB_UP 0x5820
|
||||
#define VK_PAD_LTHUMB_DOWN 0x5821
|
||||
#define VK_PAD_LTHUMB_RIGHT 0x5822
|
||||
#define VK_PAD_LTHUMB_LEFT 0x5823
|
||||
#define VK_PAD_LTHUMB_UPLEFT 0x5824
|
||||
#define VK_PAD_LTHUMB_UPRIGHT 0x5825
|
||||
#define VK_PAD_LTHUMB_DOWNRIGHT 0x5826
|
||||
#define VK_PAD_LTHUMB_DOWNLEFT 0x5827
|
||||
|
||||
#define VK_PAD_RTHUMB_UP 0x5830
|
||||
#define VK_PAD_RTHUMB_DOWN 0x5831
|
||||
#define VK_PAD_RTHUMB_RIGHT 0x5832
|
||||
#define VK_PAD_RTHUMB_LEFT 0x5833
|
||||
#define VK_PAD_RTHUMB_UPLEFT 0x5834
|
||||
#define VK_PAD_RTHUMB_UPRIGHT 0x5835
|
||||
#define VK_PAD_RTHUMB_DOWNRIGHT 0x5836
|
||||
#define VK_PAD_RTHUMB_DOWNLEFT 0x5837
|
||||
|
||||
//
|
||||
// Flags used in XINPUT_KEYSTROKE
|
||||
//
|
||||
#define XINPUT_KEYSTROKE_KEYDOWN 0x0001
|
||||
#define XINPUT_KEYSTROKE_KEYUP 0x0002
|
||||
#define XINPUT_KEYSTROKE_REPEAT 0x0004
|
||||
|
||||
#endif //!XINPUT_USE_9_1_0
|
||||
|
||||
//
|
||||
// Structures used by XInput APIs
|
||||
//
|
||||
typedef struct _XINPUT_GAMEPAD
|
||||
{
|
||||
WORD wButtons;
|
||||
BYTE bLeftTrigger;
|
||||
BYTE bRightTrigger;
|
||||
SHORT sThumbLX;
|
||||
SHORT sThumbLY;
|
||||
SHORT sThumbRX;
|
||||
SHORT sThumbRY;
|
||||
} XINPUT_GAMEPAD, *PXINPUT_GAMEPAD;
|
||||
|
||||
typedef struct _XINPUT_STATE
|
||||
{
|
||||
DWORD dwPacketNumber;
|
||||
XINPUT_GAMEPAD Gamepad;
|
||||
} XINPUT_STATE, *PXINPUT_STATE;
|
||||
|
||||
typedef struct _XINPUT_VIBRATION
|
||||
{
|
||||
WORD wLeftMotorSpeed;
|
||||
WORD wRightMotorSpeed;
|
||||
} XINPUT_VIBRATION, *PXINPUT_VIBRATION;
|
||||
|
||||
typedef struct _XINPUT_CAPABILITIES
|
||||
{
|
||||
BYTE Type;
|
||||
BYTE SubType;
|
||||
WORD Flags;
|
||||
XINPUT_GAMEPAD Gamepad;
|
||||
XINPUT_VIBRATION Vibration;
|
||||
} XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES;
|
||||
|
||||
#ifndef XINPUT_USE_9_1_0
|
||||
|
||||
typedef struct _XINPUT_BATTERY_INFORMATION
|
||||
{
|
||||
BYTE BatteryType;
|
||||
BYTE BatteryLevel;
|
||||
} XINPUT_BATTERY_INFORMATION, *PXINPUT_BATTERY_INFORMATION;
|
||||
|
||||
typedef struct _XINPUT_KEYSTROKE
|
||||
{
|
||||
WORD VirtualKey;
|
||||
WCHAR Unicode;
|
||||
WORD Flags;
|
||||
BYTE UserIndex;
|
||||
BYTE HidCode;
|
||||
} XINPUT_KEYSTROKE, *PXINPUT_KEYSTROKE;
|
||||
|
||||
#endif // !XINPUT_USE_9_1_0
|
||||
|
||||
//
|
||||
// XInput APIs
|
||||
//
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
DWORD WINAPI XInputGetState
|
||||
(
|
||||
__in DWORD dwUserIndex, // Index of the gamer associated with the device
|
||||
__out XINPUT_STATE* pState // Receives the current state
|
||||
);
|
||||
|
||||
DWORD WINAPI XInputSetState
|
||||
(
|
||||
__in DWORD dwUserIndex, // Index of the gamer associated with the device
|
||||
__in XINPUT_VIBRATION* pVibration // The vibration information to send to the controller
|
||||
);
|
||||
|
||||
DWORD WINAPI XInputGetCapabilities
|
||||
(
|
||||
__in DWORD dwUserIndex, // Index of the gamer associated with the device
|
||||
__in DWORD dwFlags, // Input flags that identify the device type
|
||||
__out XINPUT_CAPABILITIES* pCapabilities // Receives the capabilities
|
||||
);
|
||||
|
||||
void WINAPI XInputEnable
|
||||
(
|
||||
__in BOOL enable // [in] Indicates whether xinput is enabled or disabled.
|
||||
);
|
||||
|
||||
DWORD WINAPI XInputGetDSoundAudioDeviceGuids
|
||||
(
|
||||
__in DWORD dwUserIndex, // Index of the gamer associated with the device
|
||||
__out GUID* pDSoundRenderGuid, // DSound device ID for render
|
||||
__out GUID* pDSoundCaptureGuid // DSound device ID for capture
|
||||
);
|
||||
|
||||
#ifndef XINPUT_USE_9_1_0
|
||||
|
||||
DWORD WINAPI XInputGetBatteryInformation
|
||||
(
|
||||
__in DWORD dwUserIndex, // Index of the gamer associated with the device
|
||||
__in BYTE devType, // Which device on this user index
|
||||
__out XINPUT_BATTERY_INFORMATION* pBatteryInformation // Contains the level and types of batteries
|
||||
);
|
||||
|
||||
DWORD WINAPI XInputGetKeystroke
|
||||
(
|
||||
__in DWORD dwUserIndex, // Index of the gamer associated with the device
|
||||
__reserved DWORD dwReserved, // Reserved for future use
|
||||
__out PXINPUT_KEYSTROKE pKeystroke // Pointer to an XINPUT_KEYSTROKE structure that receives an input event.
|
||||
);
|
||||
|
||||
#endif //!XINPUT_USE_9_1_0
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //_XINPUT_H_
|
||||
|
263
SDK/Include/audiodefs.h
Normal file
263
SDK/Include/audiodefs.h
Normal file
@ -0,0 +1,263 @@
|
||||
/***************************************************************************
|
||||
*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
*
|
||||
* File: audiodefs.h
|
||||
* Content: Basic constants and data types for audio work.
|
||||
*
|
||||
* Remarks: This header file defines all of the audio format constants and
|
||||
* structures required for XAudio2 and XACT work. Providing these
|
||||
* in a single location avoids certain dependency problems in the
|
||||
* legacy audio headers (mmreg.h, mmsystem.h, ksmedia.h).
|
||||
*
|
||||
* NOTE: Including the legacy headers after this one may cause a
|
||||
* compilation error, because they define some of the same types
|
||||
* defined here without preprocessor guards to avoid multiple
|
||||
* definitions. If a source file needs one of the old headers,
|
||||
* it must include it before including audiodefs.h.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __AUDIODEFS_INCLUDED__
|
||||
#define __AUDIODEFS_INCLUDED__
|
||||
|
||||
#include <windef.h> // For WORD, DWORD, etc.
|
||||
|
||||
#pragma pack(push, 1) // Pack structures to 1-byte boundaries
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* WAVEFORMATEX: Base structure for many audio formats. Format-specific
|
||||
* extensions can be defined for particular formats by using a non-zero
|
||||
* cbSize value and adding extra fields to the end of this structure.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _WAVEFORMATEX_
|
||||
|
||||
#define _WAVEFORMATEX_
|
||||
typedef struct tWAVEFORMATEX
|
||||
{
|
||||
WORD wFormatTag; // Integer identifier of the format
|
||||
WORD nChannels; // Number of audio channels
|
||||
DWORD nSamplesPerSec; // Audio sample rate
|
||||
DWORD nAvgBytesPerSec; // Bytes per second (possibly approximate)
|
||||
WORD nBlockAlign; // Size in bytes of a sample block (all channels)
|
||||
WORD wBitsPerSample; // Size in bits of a single per-channel sample
|
||||
WORD cbSize; // Bytes of extra data appended to this struct
|
||||
} WAVEFORMATEX;
|
||||
|
||||
#endif
|
||||
|
||||
// Defining pointer types outside of the #if block to make sure they are
|
||||
// defined even if mmreg.h or mmsystem.h is #included before this file
|
||||
|
||||
typedef WAVEFORMATEX *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX;
|
||||
typedef const WAVEFORMATEX *PCWAVEFORMATEX, *LPCWAVEFORMATEX;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* WAVEFORMATEXTENSIBLE: Extended version of WAVEFORMATEX that should be
|
||||
* used as a basis for all new audio formats. The format tag is replaced
|
||||
* with a GUID, allowing new formats to be defined without registering a
|
||||
* format tag with Microsoft. There are also new fields that can be used
|
||||
* to specify the spatial positions for each channel and the bit packing
|
||||
* used for wide samples (e.g. 24-bit PCM samples in 32-bit containers).
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _WAVEFORMATEXTENSIBLE_
|
||||
|
||||
#define _WAVEFORMATEXTENSIBLE_
|
||||
typedef struct
|
||||
{
|
||||
WAVEFORMATEX Format; // Base WAVEFORMATEX data
|
||||
union
|
||||
{
|
||||
WORD wValidBitsPerSample; // Valid bits in each sample container
|
||||
WORD wSamplesPerBlock; // Samples per block of audio data; valid
|
||||
// if wBitsPerSample=0 (but rarely used).
|
||||
WORD wReserved; // Zero if neither case above applies.
|
||||
} Samples;
|
||||
DWORD dwChannelMask; // Positions of the audio channels
|
||||
GUID SubFormat; // Format identifier GUID
|
||||
} WAVEFORMATEXTENSIBLE;
|
||||
|
||||
#endif
|
||||
|
||||
typedef WAVEFORMATEXTENSIBLE *PWAVEFORMATEXTENSIBLE, *LPWAVEFORMATEXTENSIBLE;
|
||||
typedef const WAVEFORMATEXTENSIBLE *PCWAVEFORMATEXTENSIBLE, *LPCWAVEFORMATEXTENSIBLE;
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Define the most common wave format tags used in WAVEFORMATEX formats.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef WAVE_FORMAT_PCM // Pulse Code Modulation
|
||||
|
||||
// If WAVE_FORMAT_PCM is not defined, we need to define some legacy types
|
||||
// for compatibility with the Windows mmreg.h / mmsystem.h header files.
|
||||
|
||||
// Old general format structure (information common to all formats)
|
||||
typedef struct waveformat_tag
|
||||
{
|
||||
WORD wFormatTag;
|
||||
WORD nChannels;
|
||||
DWORD nSamplesPerSec;
|
||||
DWORD nAvgBytesPerSec;
|
||||
WORD nBlockAlign;
|
||||
} WAVEFORMAT, *PWAVEFORMAT, NEAR *NPWAVEFORMAT, FAR *LPWAVEFORMAT;
|
||||
|
||||
// Specific format structure for PCM data
|
||||
typedef struct pcmwaveformat_tag
|
||||
{
|
||||
WAVEFORMAT wf;
|
||||
WORD wBitsPerSample;
|
||||
} PCMWAVEFORMAT, *PPCMWAVEFORMAT, NEAR *NPPCMWAVEFORMAT, FAR *LPPCMWAVEFORMAT;
|
||||
|
||||
#define WAVE_FORMAT_PCM 0x0001
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_ADPCM // Microsoft Adaptive Differental PCM
|
||||
|
||||
// Replicate the Microsoft ADPCM type definitions from mmreg.h.
|
||||
|
||||
typedef struct adpcmcoef_tag
|
||||
{
|
||||
short iCoef1;
|
||||
short iCoef2;
|
||||
} ADPCMCOEFSET;
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4200) // Disable zero-sized array warnings
|
||||
|
||||
typedef struct adpcmwaveformat_tag {
|
||||
WAVEFORMATEX wfx;
|
||||
WORD wSamplesPerBlock;
|
||||
WORD wNumCoef;
|
||||
ADPCMCOEFSET aCoef[]; // Always 7 coefficient pairs for MS ADPCM
|
||||
} ADPCMWAVEFORMAT;
|
||||
|
||||
#pragma warning(pop)
|
||||
|
||||
#define WAVE_FORMAT_ADPCM 0x0002
|
||||
|
||||
#endif
|
||||
|
||||
// Other frequently used format tags
|
||||
|
||||
#ifndef WAVE_FORMAT_UNKNOWN
|
||||
#define WAVE_FORMAT_UNKNOWN 0x0000 // Unknown or invalid format tag
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_IEEE_FLOAT
|
||||
#define WAVE_FORMAT_IEEE_FLOAT 0x0003 // 32-bit floating-point
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_MPEGLAYER3
|
||||
#define WAVE_FORMAT_MPEGLAYER3 0x0055 // ISO/MPEG Layer3
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_DOLBY_AC3_SPDIF
|
||||
#define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 // Dolby Audio Codec 3 over S/PDIF
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_WMAUDIO2
|
||||
#define WAVE_FORMAT_WMAUDIO2 0x0161 // Windows Media Audio
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_WMAUDIO3
|
||||
#define WAVE_FORMAT_WMAUDIO3 0x0162 // Windows Media Audio Pro
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_WMASPDIF
|
||||
#define WAVE_FORMAT_WMASPDIF 0x0164 // Windows Media Audio over S/PDIF
|
||||
#endif
|
||||
|
||||
#ifndef WAVE_FORMAT_EXTENSIBLE
|
||||
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE // All WAVEFORMATEXTENSIBLE formats
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Define the most common wave format GUIDs used in WAVEFORMATEXTENSIBLE
|
||||
* formats. Note that including the Windows ksmedia.h header after this
|
||||
* one will cause build problems; this cannot be avoided, since ksmedia.h
|
||||
* defines these macros without preprocessor guards.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus // uuid() and __uuidof() are only available in C++
|
||||
|
||||
#ifndef KSDATAFORMAT_SUBTYPE_PCM
|
||||
struct __declspec(uuid("00000001-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_PCM_STRUCT;
|
||||
#define KSDATAFORMAT_SUBTYPE_PCM __uuidof(KSDATAFORMAT_SUBTYPE_PCM_STRUCT)
|
||||
#endif
|
||||
|
||||
#ifndef KSDATAFORMAT_SUBTYPE_ADPCM
|
||||
struct __declspec(uuid("00000002-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_ADPCM_STRUCT;
|
||||
#define KSDATAFORMAT_SUBTYPE_ADPCM __uuidof(KSDATAFORMAT_SUBTYPE_ADPCM_STRUCT)
|
||||
#endif
|
||||
|
||||
#ifndef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
|
||||
struct __declspec(uuid("00000003-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT;
|
||||
#define KSDATAFORMAT_SUBTYPE_IEEE_FLOAT __uuidof(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Speaker positions used in the WAVEFORMATEXTENSIBLE dwChannelMask field.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef SPEAKER_FRONT_LEFT
|
||||
#define SPEAKER_FRONT_LEFT 0x00000001
|
||||
#define SPEAKER_FRONT_RIGHT 0x00000002
|
||||
#define SPEAKER_FRONT_CENTER 0x00000004
|
||||
#define SPEAKER_LOW_FREQUENCY 0x00000008
|
||||
#define SPEAKER_BACK_LEFT 0x00000010
|
||||
#define SPEAKER_BACK_RIGHT 0x00000020
|
||||
#define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040
|
||||
#define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080
|
||||
#define SPEAKER_BACK_CENTER 0x00000100
|
||||
#define SPEAKER_SIDE_LEFT 0x00000200
|
||||
#define SPEAKER_SIDE_RIGHT 0x00000400
|
||||
#define SPEAKER_TOP_CENTER 0x00000800
|
||||
#define SPEAKER_TOP_FRONT_LEFT 0x00001000
|
||||
#define SPEAKER_TOP_FRONT_CENTER 0x00002000
|
||||
#define SPEAKER_TOP_FRONT_RIGHT 0x00004000
|
||||
#define SPEAKER_TOP_BACK_LEFT 0x00008000
|
||||
#define SPEAKER_TOP_BACK_CENTER 0x00010000
|
||||
#define SPEAKER_TOP_BACK_RIGHT 0x00020000
|
||||
#define SPEAKER_RESERVED 0x7FFC0000
|
||||
#define SPEAKER_ALL 0x80000000
|
||||
#define _SPEAKER_POSITIONS_
|
||||
#endif
|
||||
|
||||
#ifndef SPEAKER_STEREO
|
||||
#define SPEAKER_MONO (SPEAKER_FRONT_CENTER)
|
||||
#define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT)
|
||||
#define SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY)
|
||||
#define SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER)
|
||||
#define SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
|
||||
#define SPEAKER_4POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
|
||||
#define SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
|
||||
#define SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER)
|
||||
#define SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
|
||||
#define SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
|
||||
#endif
|
||||
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif // #ifndef __AUDIODEFS_INCLUDED__
|
59
SDK/Include/comdecl.h
Normal file
59
SDK/Include/comdecl.h
Normal file
@ -0,0 +1,59 @@
|
||||
// comdecl.h: Macros to facilitate COM interface and GUID declarations.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
#ifndef _COMDECL_H_
|
||||
#define _COMDECL_H_
|
||||
|
||||
#ifndef _XBOX
|
||||
#include <basetyps.h> // For standard COM interface macros
|
||||
#else
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4061)
|
||||
#include <xtl.h> // Required by xobjbase.h
|
||||
#include <xobjbase.h> // Special definitions for Xbox build
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
// The DEFINE_CLSID() and DEFINE_IID() macros defined below allow COM GUIDs to
|
||||
// be declared and defined in such a way that clients can obtain the GUIDs using
|
||||
// either the __uuidof() extension or the old-style CLSID_Foo / IID_IFoo names.
|
||||
// If using the latter approach, the client can also choose whether to get the
|
||||
// GUID definitions by defining the INITGUID preprocessor constant or by linking
|
||||
// to a GUID library. This works in either C or C++.
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#define DECLSPEC_UUID_WRAPPER(x) __declspec(uuid(#x))
|
||||
#ifdef INITGUID
|
||||
|
||||
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||
class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \
|
||||
EXTERN_C const GUID DECLSPEC_SELECTANY CLSID_##className = __uuidof(className)
|
||||
|
||||
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||
interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \
|
||||
EXTERN_C const GUID DECLSPEC_SELECTANY IID_##interfaceName = __uuidof(interfaceName)
|
||||
|
||||
#else // INITGUID
|
||||
|
||||
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||
class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \
|
||||
EXTERN_C const GUID CLSID_##className
|
||||
|
||||
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||
interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \
|
||||
EXTERN_C const GUID IID_##interfaceName
|
||||
|
||||
#endif // INITGUID
|
||||
|
||||
#else // __cplusplus
|
||||
|
||||
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||
DEFINE_GUID(CLSID_##className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
|
||||
|
||||
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||
DEFINE_GUID(IID_##interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // #ifndef _COMDECL_H_
|
143
SDK/Include/d3d10misc.h
Normal file
143
SDK/Include/d3d10misc.h
Normal file
@ -0,0 +1,143 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// File: D3D10Misc.h
|
||||
// Content: D3D10 Device Creation APIs
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __D3D10MISC_H__
|
||||
#define __D3D10MISC_H__
|
||||
|
||||
#include "d3d10.h"
|
||||
|
||||
// ID3D10Blob has been made version-neutral and moved to d3dcommon.h.
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// D3D10_DRIVER_TYPE
|
||||
// ----------------
|
||||
//
|
||||
// This identifier is used to determine the implementation of Direct3D10
|
||||
// to be used.
|
||||
//
|
||||
// Pass one of these values to D3D10CreateDevice
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
typedef enum D3D10_DRIVER_TYPE
|
||||
{
|
||||
D3D10_DRIVER_TYPE_HARDWARE = 0,
|
||||
D3D10_DRIVER_TYPE_REFERENCE = 1,
|
||||
D3D10_DRIVER_TYPE_NULL = 2,
|
||||
D3D10_DRIVER_TYPE_SOFTWARE = 3,
|
||||
D3D10_DRIVER_TYPE_WARP = 5,
|
||||
} D3D10_DRIVER_TYPE;
|
||||
|
||||
DEFINE_GUID(GUID_DeviceType,
|
||||
0xd722fb4d, 0x7a68, 0x437a, 0xb2, 0x0c, 0x58, 0x04, 0xee, 0x24, 0x94, 0xa6);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// D3D10CreateDevice
|
||||
// ------------------
|
||||
//
|
||||
// pAdapter
|
||||
// If NULL, D3D10CreateDevice will choose the primary adapter and
|
||||
// create a new instance from a temporarily created IDXGIFactory.
|
||||
// If non-NULL, D3D10CreateDevice will register the appropriate
|
||||
// device, if necessary (via IDXGIAdapter::RegisterDrver), before
|
||||
// creating the device.
|
||||
// DriverType
|
||||
// Specifies the driver type to be created: hardware, reference or
|
||||
// null.
|
||||
// Software
|
||||
// HMODULE of a DLL implementing a software rasterizer. Must be NULL for
|
||||
// non-Software driver types.
|
||||
// Flags
|
||||
// Any of those documented for D3D10CreateDevice.
|
||||
// SDKVersion
|
||||
// SDK version. Use the D3D10_SDK_VERSION macro.
|
||||
// ppDevice
|
||||
// Pointer to returned interface.
|
||||
//
|
||||
// Return Values
|
||||
// Any of those documented for
|
||||
// CreateDXGIFactory
|
||||
// IDXGIFactory::EnumAdapters
|
||||
// IDXGIAdapter::RegisterDriver
|
||||
// D3D10CreateDevice
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
HRESULT WINAPI D3D10CreateDevice(
|
||||
IDXGIAdapter *pAdapter,
|
||||
D3D10_DRIVER_TYPE DriverType,
|
||||
HMODULE Software,
|
||||
UINT Flags,
|
||||
UINT SDKVersion,
|
||||
ID3D10Device **ppDevice);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// D3D10CreateDeviceAndSwapChain
|
||||
// ------------------------------
|
||||
//
|
||||
// ppAdapter
|
||||
// If NULL, D3D10CreateDevice will choose the primary adapter and
|
||||
// create a new instance from a temporarily created IDXGIFactory.
|
||||
// If non-NULL, D3D10CreateDevice will register the appropriate
|
||||
// device, if necessary (via IDXGIAdapter::RegisterDrver), before
|
||||
// creating the device.
|
||||
// DriverType
|
||||
// Specifies the driver type to be created: hardware, reference or
|
||||
// null.
|
||||
// Software
|
||||
// HMODULE of a DLL implementing a software rasterizer. Must be NULL for
|
||||
// non-Software driver types.
|
||||
// Flags
|
||||
// Any of those documented for D3D10CreateDevice.
|
||||
// SDKVersion
|
||||
// SDK version. Use the D3D10_SDK_VERSION macro.
|
||||
// pSwapChainDesc
|
||||
// Swap chain description, may be NULL.
|
||||
// ppSwapChain
|
||||
// Pointer to returned interface. May be NULL.
|
||||
// ppDevice
|
||||
// Pointer to returned interface.
|
||||
//
|
||||
// Return Values
|
||||
// Any of those documented for
|
||||
// CreateDXGIFactory
|
||||
// IDXGIFactory::EnumAdapters
|
||||
// IDXGIAdapter::RegisterDriver
|
||||
// D3D10CreateDevice
|
||||
// IDXGIFactory::CreateSwapChain
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
HRESULT WINAPI D3D10CreateDeviceAndSwapChain(
|
||||
IDXGIAdapter *pAdapter,
|
||||
D3D10_DRIVER_TYPE DriverType,
|
||||
HMODULE Software,
|
||||
UINT Flags,
|
||||
UINT SDKVersion,
|
||||
DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
|
||||
IDXGISwapChain **ppSwapChain,
|
||||
ID3D10Device **ppDevice);
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// D3D10CreateBlob:
|
||||
// -----------------
|
||||
// Creates a Buffer of n Bytes
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
HRESULT WINAPI D3D10CreateBlob(SIZE_T NumBytes, LPD3D10BLOB *ppBuffer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3D10EFFECT_H__
|
||||
|
||||
|
1361
SDK/Include/d3d10sdklayers.h
Normal file
1361
SDK/Include/d3d10sdklayers.h
Normal file
File diff suppressed because it is too large
Load Diff
2791
SDK/Include/d3d9.h
Normal file
2791
SDK/Include/d3d9.h
Normal file
File diff suppressed because it is too large
Load Diff
567
SDK/Include/d3d9caps.h
Normal file
567
SDK/Include/d3d9caps.h
Normal file
@ -0,0 +1,567 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3d9caps.h
|
||||
* Content: Direct3D capabilities include file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _d3d9CAPS_H
|
||||
#define _d3d9CAPS_H
|
||||
|
||||
#ifndef DIRECT3D_VERSION
|
||||
#define DIRECT3D_VERSION 0x0900
|
||||
#endif //DIRECT3D_VERSION
|
||||
|
||||
// include this file content only if compiling for DX9 interfaces
|
||||
#if(DIRECT3D_VERSION >= 0x0900)
|
||||
|
||||
#if defined(_X86_) || defined(_IA64_)
|
||||
#pragma pack(4)
|
||||
#endif
|
||||
|
||||
typedef struct _D3DVSHADERCAPS2_0
|
||||
{
|
||||
DWORD Caps;
|
||||
INT DynamicFlowControlDepth;
|
||||
INT NumTemps;
|
||||
INT StaticFlowControlDepth;
|
||||
} D3DVSHADERCAPS2_0;
|
||||
|
||||
#define D3DVS20CAPS_PREDICATION (1<<0)
|
||||
|
||||
#define D3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH 24
|
||||
#define D3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH 0
|
||||
#define D3DVS20_MAX_NUMTEMPS 32
|
||||
#define D3DVS20_MIN_NUMTEMPS 12
|
||||
#define D3DVS20_MAX_STATICFLOWCONTROLDEPTH 4
|
||||
#define D3DVS20_MIN_STATICFLOWCONTROLDEPTH 1
|
||||
|
||||
typedef struct _D3DPSHADERCAPS2_0
|
||||
{
|
||||
DWORD Caps;
|
||||
INT DynamicFlowControlDepth;
|
||||
INT NumTemps;
|
||||
INT StaticFlowControlDepth;
|
||||
INT NumInstructionSlots;
|
||||
} D3DPSHADERCAPS2_0;
|
||||
|
||||
#define D3DPS20CAPS_ARBITRARYSWIZZLE (1<<0)
|
||||
#define D3DPS20CAPS_GRADIENTINSTRUCTIONS (1<<1)
|
||||
#define D3DPS20CAPS_PREDICATION (1<<2)
|
||||
#define D3DPS20CAPS_NODEPENDENTREADLIMIT (1<<3)
|
||||
#define D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT (1<<4)
|
||||
|
||||
#define D3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH 24
|
||||
#define D3DPS20_MIN_DYNAMICFLOWCONTROLDEPTH 0
|
||||
#define D3DPS20_MAX_NUMTEMPS 32
|
||||
#define D3DPS20_MIN_NUMTEMPS 12
|
||||
#define D3DPS20_MAX_STATICFLOWCONTROLDEPTH 4
|
||||
#define D3DPS20_MIN_STATICFLOWCONTROLDEPTH 0
|
||||
#define D3DPS20_MAX_NUMINSTRUCTIONSLOTS 512
|
||||
#define D3DPS20_MIN_NUMINSTRUCTIONSLOTS 96
|
||||
|
||||
#define D3DMIN30SHADERINSTRUCTIONS 512
|
||||
#define D3DMAX30SHADERINSTRUCTIONS 32768
|
||||
|
||||
/* D3D9Ex only -- */
|
||||
#if !defined(D3D_DISABLE_9EX)
|
||||
|
||||
typedef struct _D3DOVERLAYCAPS
|
||||
{
|
||||
UINT Caps;
|
||||
UINT MaxOverlayDisplayWidth;
|
||||
UINT MaxOverlayDisplayHeight;
|
||||
} D3DOVERLAYCAPS;
|
||||
|
||||
#define D3DOVERLAYCAPS_FULLRANGERGB 0x00000001
|
||||
#define D3DOVERLAYCAPS_LIMITEDRANGERGB 0x00000002
|
||||
#define D3DOVERLAYCAPS_YCbCr_BT601 0x00000004
|
||||
#define D3DOVERLAYCAPS_YCbCr_BT709 0x00000008
|
||||
#define D3DOVERLAYCAPS_YCbCr_BT601_xvYCC 0x00000010
|
||||
#define D3DOVERLAYCAPS_YCbCr_BT709_xvYCC 0x00000020
|
||||
#define D3DOVERLAYCAPS_STRETCHX 0x00000040
|
||||
#define D3DOVERLAYCAPS_STRETCHY 0x00000080
|
||||
|
||||
|
||||
typedef struct _D3DCONTENTPROTECTIONCAPS
|
||||
{
|
||||
DWORD Caps;
|
||||
GUID KeyExchangeType;
|
||||
UINT BufferAlignmentStart;
|
||||
UINT BlockAlignmentSize;
|
||||
ULONGLONG ProtectedMemorySize;
|
||||
} D3DCONTENTPROTECTIONCAPS;
|
||||
|
||||
#define D3DCPCAPS_SOFTWARE 0x00000001
|
||||
#define D3DCPCAPS_HARDWARE 0x00000002
|
||||
#define D3DCPCAPS_PROTECTIONALWAYSON 0x00000004
|
||||
#define D3DCPCAPS_PARTIALDECRYPTION 0x00000008
|
||||
#define D3DCPCAPS_CONTENTKEY 0x00000010
|
||||
#define D3DCPCAPS_FRESHENSESSIONKEY 0x00000020
|
||||
#define D3DCPCAPS_ENCRYPTEDREADBACK 0x00000040
|
||||
#define D3DCPCAPS_ENCRYPTEDREADBACKKEY 0x00000080
|
||||
#define D3DCPCAPS_SEQUENTIAL_CTR_IV 0x00000100
|
||||
#define D3DCPCAPS_ENCRYPTSLICEDATAONLY 0x00000200
|
||||
|
||||
DEFINE_GUID(D3DCRYPTOTYPE_AES128_CTR,
|
||||
0x9b6bd711, 0x4f74, 0x41c9, 0x9e, 0x7b, 0xb, 0xe2, 0xd7, 0xd9, 0x3b, 0x4f);
|
||||
DEFINE_GUID(D3DCRYPTOTYPE_PROPRIETARY,
|
||||
0xab4e9afd, 0x1d1c, 0x46e6, 0xa7, 0x2f, 0x8, 0x69, 0x91, 0x7b, 0xd, 0xe8);
|
||||
|
||||
DEFINE_GUID(D3DKEYEXCHANGE_RSAES_OAEP,
|
||||
0xc1949895, 0xd72a, 0x4a1d, 0x8e, 0x5d, 0xed, 0x85, 0x7d, 0x17, 0x15, 0x20);
|
||||
DEFINE_GUID(D3DKEYEXCHANGE_DXVA,
|
||||
0x43d3775c, 0x38e5, 0x4924, 0x8d, 0x86, 0xd3, 0xfc, 0xcf, 0x15, 0x3e, 0x9b);
|
||||
|
||||
#endif // !D3D_DISABLE_9EX
|
||||
/* -- D3D9Ex only */
|
||||
|
||||
typedef struct _D3DCAPS9
|
||||
{
|
||||
/* Device Info */
|
||||
D3DDEVTYPE DeviceType;
|
||||
UINT AdapterOrdinal;
|
||||
|
||||
/* Caps from DX7 Draw */
|
||||
DWORD Caps;
|
||||
DWORD Caps2;
|
||||
DWORD Caps3;
|
||||
DWORD PresentationIntervals;
|
||||
|
||||
/* Cursor Caps */
|
||||
DWORD CursorCaps;
|
||||
|
||||
/* 3D Device Caps */
|
||||
DWORD DevCaps;
|
||||
|
||||
DWORD PrimitiveMiscCaps;
|
||||
DWORD RasterCaps;
|
||||
DWORD ZCmpCaps;
|
||||
DWORD SrcBlendCaps;
|
||||
DWORD DestBlendCaps;
|
||||
DWORD AlphaCmpCaps;
|
||||
DWORD ShadeCaps;
|
||||
DWORD TextureCaps;
|
||||
DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture9's
|
||||
DWORD CubeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DCubeTexture9's
|
||||
DWORD VolumeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DVolumeTexture9's
|
||||
DWORD TextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DTexture9's
|
||||
DWORD VolumeTextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DVolumeTexture9's
|
||||
|
||||
DWORD LineCaps; // D3DLINECAPS
|
||||
|
||||
DWORD MaxTextureWidth, MaxTextureHeight;
|
||||
DWORD MaxVolumeExtent;
|
||||
|
||||
DWORD MaxTextureRepeat;
|
||||
DWORD MaxTextureAspectRatio;
|
||||
DWORD MaxAnisotropy;
|
||||
float MaxVertexW;
|
||||
|
||||
float GuardBandLeft;
|
||||
float GuardBandTop;
|
||||
float GuardBandRight;
|
||||
float GuardBandBottom;
|
||||
|
||||
float ExtentsAdjust;
|
||||
DWORD StencilCaps;
|
||||
|
||||
DWORD FVFCaps;
|
||||
DWORD TextureOpCaps;
|
||||
DWORD MaxTextureBlendStages;
|
||||
DWORD MaxSimultaneousTextures;
|
||||
|
||||
DWORD VertexProcessingCaps;
|
||||
DWORD MaxActiveLights;
|
||||
DWORD MaxUserClipPlanes;
|
||||
DWORD MaxVertexBlendMatrices;
|
||||
DWORD MaxVertexBlendMatrixIndex;
|
||||
|
||||
float MaxPointSize;
|
||||
|
||||
DWORD MaxPrimitiveCount; // max number of primitives per DrawPrimitive call
|
||||
DWORD MaxVertexIndex;
|
||||
DWORD MaxStreams;
|
||||
DWORD MaxStreamStride; // max stride for SetStreamSource
|
||||
|
||||
DWORD VertexShaderVersion;
|
||||
DWORD MaxVertexShaderConst; // number of vertex shader constant registers
|
||||
|
||||
DWORD PixelShaderVersion;
|
||||
float PixelShader1xMaxValue; // max value storable in registers of ps.1.x shaders
|
||||
|
||||
// Here are the DX9 specific ones
|
||||
DWORD DevCaps2;
|
||||
|
||||
float MaxNpatchTessellationLevel;
|
||||
DWORD Reserved5;
|
||||
|
||||
UINT MasterAdapterOrdinal; // ordinal of master adaptor for adapter group
|
||||
UINT AdapterOrdinalInGroup; // ordinal inside the adapter group
|
||||
UINT NumberOfAdaptersInGroup; // number of adapters in this adapter group (only if master)
|
||||
DWORD DeclTypes; // Data types, supported in vertex declarations
|
||||
DWORD NumSimultaneousRTs; // Will be at least 1
|
||||
DWORD StretchRectFilterCaps; // Filter caps supported by StretchRect
|
||||
D3DVSHADERCAPS2_0 VS20Caps;
|
||||
D3DPSHADERCAPS2_0 PS20Caps;
|
||||
DWORD VertexTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture9's for texture, used in vertex shaders
|
||||
DWORD MaxVShaderInstructionsExecuted; // maximum number of vertex shader instructions that can be executed
|
||||
DWORD MaxPShaderInstructionsExecuted; // maximum number of pixel shader instructions that can be executed
|
||||
DWORD MaxVertexShader30InstructionSlots;
|
||||
DWORD MaxPixelShader30InstructionSlots;
|
||||
} D3DCAPS9;
|
||||
|
||||
//
|
||||
// BIT DEFINES FOR D3DCAPS9 DWORD MEMBERS
|
||||
//
|
||||
|
||||
//
|
||||
// Caps
|
||||
//
|
||||
#define D3DCAPS_OVERLAY 0x00000800L
|
||||
#define D3DCAPS_READ_SCANLINE 0x00020000L
|
||||
|
||||
//
|
||||
// Caps2
|
||||
//
|
||||
#define D3DCAPS2_FULLSCREENGAMMA 0x00020000L
|
||||
#define D3DCAPS2_CANCALIBRATEGAMMA 0x00100000L
|
||||
#define D3DCAPS2_RESERVED 0x02000000L
|
||||
#define D3DCAPS2_CANMANAGERESOURCE 0x10000000L
|
||||
#define D3DCAPS2_DYNAMICTEXTURES 0x20000000L
|
||||
#define D3DCAPS2_CANAUTOGENMIPMAP 0x40000000L
|
||||
|
||||
/* D3D9Ex only -- */
|
||||
#if !defined(D3D_DISABLE_9EX)
|
||||
|
||||
#define D3DCAPS2_CANSHARERESOURCE 0x80000000L
|
||||
|
||||
#endif // !D3D_DISABLE_9EX
|
||||
/* -- D3D9Ex only */
|
||||
|
||||
//
|
||||
// Caps3
|
||||
//
|
||||
#define D3DCAPS3_RESERVED 0x8000001fL
|
||||
|
||||
// Indicates that the device can respect the ALPHABLENDENABLE render state
|
||||
// when fullscreen while using the FLIP or DISCARD swap effect.
|
||||
// COPY and COPYVSYNC swap effects work whether or not this flag is set.
|
||||
#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020L
|
||||
|
||||
// Indicates that the device can perform a gamma correction from
|
||||
// a windowed back buffer containing linear content to the sRGB desktop.
|
||||
#define D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION 0x00000080L
|
||||
|
||||
#define D3DCAPS3_COPY_TO_VIDMEM 0x00000100L /* Device can acclerate copies from sysmem to local vidmem */
|
||||
#define D3DCAPS3_COPY_TO_SYSTEMMEM 0x00000200L /* Device can acclerate copies from local vidmem to sysmem */
|
||||
#define D3DCAPS3_DXVAHD 0x00000400L
|
||||
|
||||
|
||||
//
|
||||
// PresentationIntervals
|
||||
//
|
||||
#define D3DPRESENT_INTERVAL_DEFAULT 0x00000000L
|
||||
#define D3DPRESENT_INTERVAL_ONE 0x00000001L
|
||||
#define D3DPRESENT_INTERVAL_TWO 0x00000002L
|
||||
#define D3DPRESENT_INTERVAL_THREE 0x00000004L
|
||||
#define D3DPRESENT_INTERVAL_FOUR 0x00000008L
|
||||
#define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000L
|
||||
|
||||
//
|
||||
// CursorCaps
|
||||
//
|
||||
// Driver supports HW color cursor in at least hi-res modes(height >=400)
|
||||
#define D3DCURSORCAPS_COLOR 0x00000001L
|
||||
// Driver supports HW cursor also in low-res modes(height < 400)
|
||||
#define D3DCURSORCAPS_LOWRES 0x00000002L
|
||||
|
||||
//
|
||||
// DevCaps
|
||||
//
|
||||
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */
|
||||
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */
|
||||
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
|
||||
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */
|
||||
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */
|
||||
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */
|
||||
#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */
|
||||
#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */
|
||||
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
|
||||
#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */
|
||||
#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */
|
||||
#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/
|
||||
#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */
|
||||
#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */
|
||||
#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */
|
||||
#define D3DDEVCAPS_PUREDEVICE 0x00100000L /* Device supports D3DCREATE_PUREDEVICE */
|
||||
#define D3DDEVCAPS_QUINTICRTPATCHES 0x00200000L /* Device supports quintic Beziers and BSplines */
|
||||
#define D3DDEVCAPS_RTPATCHES 0x00400000L /* Device supports Rect and Tri patches */
|
||||
#define D3DDEVCAPS_RTPATCHHANDLEZERO 0x00800000L /* Indicates that RT Patches may be drawn efficiently using handle 0 */
|
||||
#define D3DDEVCAPS_NPATCHES 0x01000000L /* Device supports N-Patches */
|
||||
|
||||
//
|
||||
// PrimitiveMiscCaps
|
||||
//
|
||||
#define D3DPMISCCAPS_MASKZ 0x00000002L
|
||||
#define D3DPMISCCAPS_CULLNONE 0x00000010L
|
||||
#define D3DPMISCCAPS_CULLCW 0x00000020L
|
||||
#define D3DPMISCCAPS_CULLCCW 0x00000040L
|
||||
#define D3DPMISCCAPS_COLORWRITEENABLE 0x00000080L
|
||||
#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x00000100L /* Device correctly clips scaled points to clip planes */
|
||||
#define D3DPMISCCAPS_CLIPTLVERTS 0x00000200L /* device will clip post-transformed vertex primitives */
|
||||
#define D3DPMISCCAPS_TSSARGTEMP 0x00000400L /* device supports D3DTA_TEMP for temporary register */
|
||||
#define D3DPMISCCAPS_BLENDOP 0x00000800L /* device supports D3DRS_BLENDOP */
|
||||
#define D3DPMISCCAPS_NULLREFERENCE 0x00001000L /* Reference Device that doesnt render */
|
||||
#define D3DPMISCCAPS_INDEPENDENTWRITEMASKS 0x00004000L /* Device supports independent write masks for MET or MRT */
|
||||
#define D3DPMISCCAPS_PERSTAGECONSTANT 0x00008000L /* Device supports per-stage constants */
|
||||
#define D3DPMISCCAPS_FOGANDSPECULARALPHA 0x00010000L /* Device supports separate fog and specular alpha (many devices
|
||||
use the specular alpha channel to store fog factor) */
|
||||
#define D3DPMISCCAPS_SEPARATEALPHABLEND 0x00020000L /* Device supports separate blend settings for the alpha channel */
|
||||
#define D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS 0x00040000L /* Device supports different bit depths for MRT */
|
||||
#define D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING 0x00080000L /* Device supports post-pixel shader operations for MRT */
|
||||
#define D3DPMISCCAPS_FOGVERTEXCLAMPED 0x00100000L /* Device clamps fog blend factor per vertex */
|
||||
|
||||
/* D3D9Ex only -- */
|
||||
#if !defined(D3D_DISABLE_9EX)
|
||||
|
||||
#define D3DPMISCCAPS_POSTBLENDSRGBCONVERT 0x00200000L /* Indicates device can perform conversion to sRGB after blending. */
|
||||
|
||||
#endif // !D3D_DISABLE_9EX
|
||||
/* -- D3D9Ex only */
|
||||
|
||||
|
||||
//
|
||||
// LineCaps
|
||||
//
|
||||
#define D3DLINECAPS_TEXTURE 0x00000001L
|
||||
#define D3DLINECAPS_ZTEST 0x00000002L
|
||||
#define D3DLINECAPS_BLEND 0x00000004L
|
||||
#define D3DLINECAPS_ALPHACMP 0x00000008L
|
||||
#define D3DLINECAPS_FOG 0x00000010L
|
||||
#define D3DLINECAPS_ANTIALIAS 0x00000020L
|
||||
|
||||
//
|
||||
// RasterCaps
|
||||
//
|
||||
#define D3DPRASTERCAPS_DITHER 0x00000001L
|
||||
#define D3DPRASTERCAPS_ZTEST 0x00000010L
|
||||
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
|
||||
#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
|
||||
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
|
||||
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
|
||||
#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
|
||||
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
|
||||
#define D3DPRASTERCAPS_WBUFFER 0x00040000L
|
||||
#define D3DPRASTERCAPS_WFOG 0x00100000L
|
||||
#define D3DPRASTERCAPS_ZFOG 0x00200000L
|
||||
#define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L /* Device iterates colors perspective correct */
|
||||
#define D3DPRASTERCAPS_SCISSORTEST 0x01000000L
|
||||
#define D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS 0x02000000L
|
||||
#define D3DPRASTERCAPS_DEPTHBIAS 0x04000000L
|
||||
#define D3DPRASTERCAPS_MULTISAMPLE_TOGGLE 0x08000000L
|
||||
|
||||
//
|
||||
// ZCmpCaps, AlphaCmpCaps
|
||||
//
|
||||
#define D3DPCMPCAPS_NEVER 0x00000001L
|
||||
#define D3DPCMPCAPS_LESS 0x00000002L
|
||||
#define D3DPCMPCAPS_EQUAL 0x00000004L
|
||||
#define D3DPCMPCAPS_LESSEQUAL 0x00000008L
|
||||
#define D3DPCMPCAPS_GREATER 0x00000010L
|
||||
#define D3DPCMPCAPS_NOTEQUAL 0x00000020L
|
||||
#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L
|
||||
#define D3DPCMPCAPS_ALWAYS 0x00000080L
|
||||
|
||||
//
|
||||
// SourceBlendCaps, DestBlendCaps
|
||||
//
|
||||
#define D3DPBLENDCAPS_ZERO 0x00000001L
|
||||
#define D3DPBLENDCAPS_ONE 0x00000002L
|
||||
#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L
|
||||
#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L
|
||||
#define D3DPBLENDCAPS_SRCALPHA 0x00000010L
|
||||
#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L
|
||||
#define D3DPBLENDCAPS_DESTALPHA 0x00000040L
|
||||
#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L
|
||||
#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L
|
||||
#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L
|
||||
#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L
|
||||
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L
|
||||
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L
|
||||
#define D3DPBLENDCAPS_BLENDFACTOR 0x00002000L /* Supports both D3DBLEND_BLENDFACTOR and D3DBLEND_INVBLENDFACTOR */
|
||||
|
||||
/* D3D9Ex only -- */
|
||||
#if !defined(D3D_DISABLE_9EX)
|
||||
|
||||
#define D3DPBLENDCAPS_SRCCOLOR2 0x00004000L
|
||||
#define D3DPBLENDCAPS_INVSRCCOLOR2 0x00008000L
|
||||
|
||||
#endif // !D3D_DISABLE_9EX
|
||||
/* -- D3D9Ex only */
|
||||
|
||||
|
||||
//
|
||||
// ShadeCaps
|
||||
//
|
||||
#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L
|
||||
#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L
|
||||
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L
|
||||
#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L
|
||||
|
||||
//
|
||||
// TextureCaps
|
||||
//
|
||||
#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L /* Perspective-correct texturing is supported */
|
||||
#define D3DPTEXTURECAPS_POW2 0x00000002L /* Power-of-2 texture dimensions are required - applies to non-Cube/Volume textures only. */
|
||||
#define D3DPTEXTURECAPS_ALPHA 0x00000004L /* Alpha in texture pixels is supported */
|
||||
#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L /* Only square textures are supported */
|
||||
#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L /* Texture indices are not scaled by the texture size prior to interpolation */
|
||||
#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L /* Device can draw alpha from texture palettes */
|
||||
// Device can use non-POW2 textures if:
|
||||
// 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
|
||||
// 2) D3DRS_WRAP(N) is zero for this texture's coordinates
|
||||
// 3) mip mapping is not enabled (use magnification filter only)
|
||||
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L
|
||||
#define D3DPTEXTURECAPS_PROJECTED 0x00000400L /* Device can do D3DTTFF_PROJECTED */
|
||||
#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L /* Device can do cubemap textures */
|
||||
#define D3DPTEXTURECAPS_VOLUMEMAP 0x00002000L /* Device can do volume textures */
|
||||
#define D3DPTEXTURECAPS_MIPMAP 0x00004000L /* Device can do mipmapped textures */
|
||||
#define D3DPTEXTURECAPS_MIPVOLUMEMAP 0x00008000L /* Device can do mipmapped volume textures */
|
||||
#define D3DPTEXTURECAPS_MIPCUBEMAP 0x00010000L /* Device can do mipmapped cube maps */
|
||||
#define D3DPTEXTURECAPS_CUBEMAP_POW2 0x00020000L /* Device requires that cubemaps be power-of-2 dimension */
|
||||
#define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x00040000L /* Device requires that volume maps be power-of-2 dimension */
|
||||
#define D3DPTEXTURECAPS_NOPROJECTEDBUMPENV 0x00200000L /* Device does not support projected bump env lookup operation
|
||||
in programmable and fixed function pixel shaders */
|
||||
|
||||
//
|
||||
// TextureFilterCaps, StretchRectFilterCaps
|
||||
//
|
||||
#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L /* Min Filter */
|
||||
#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L
|
||||
#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L
|
||||
#define D3DPTFILTERCAPS_MINFPYRAMIDALQUAD 0x00000800L
|
||||
#define D3DPTFILTERCAPS_MINFGAUSSIANQUAD 0x00001000L
|
||||
#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L /* Mip Filter */
|
||||
#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L
|
||||
|
||||
/* D3D9Ex only -- */
|
||||
#if !defined(D3D_DISABLE_9EX)
|
||||
|
||||
#define D3DPTFILTERCAPS_CONVOLUTIONMONO 0x00040000L /* Min and Mag for the convolution mono filter */
|
||||
|
||||
#endif // !D3D_DISABLE_9EX
|
||||
/* -- D3D9Ex only */
|
||||
|
||||
#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L /* Mag Filter */
|
||||
#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L
|
||||
#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L
|
||||
#define D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD 0x08000000L
|
||||
#define D3DPTFILTERCAPS_MAGFGAUSSIANQUAD 0x10000000L
|
||||
|
||||
//
|
||||
// TextureAddressCaps
|
||||
//
|
||||
#define D3DPTADDRESSCAPS_WRAP 0x00000001L
|
||||
#define D3DPTADDRESSCAPS_MIRROR 0x00000002L
|
||||
#define D3DPTADDRESSCAPS_CLAMP 0x00000004L
|
||||
#define D3DPTADDRESSCAPS_BORDER 0x00000008L
|
||||
#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L
|
||||
#define D3DPTADDRESSCAPS_MIRRORONCE 0x00000020L
|
||||
|
||||
//
|
||||
// StencilCaps
|
||||
//
|
||||
#define D3DSTENCILCAPS_KEEP 0x00000001L
|
||||
#define D3DSTENCILCAPS_ZERO 0x00000002L
|
||||
#define D3DSTENCILCAPS_REPLACE 0x00000004L
|
||||
#define D3DSTENCILCAPS_INCRSAT 0x00000008L
|
||||
#define D3DSTENCILCAPS_DECRSAT 0x00000010L
|
||||
#define D3DSTENCILCAPS_INVERT 0x00000020L
|
||||
#define D3DSTENCILCAPS_INCR 0x00000040L
|
||||
#define D3DSTENCILCAPS_DECR 0x00000080L
|
||||
#define D3DSTENCILCAPS_TWOSIDED 0x00000100L
|
||||
|
||||
//
|
||||
// TextureOpCaps
|
||||
//
|
||||
#define D3DTEXOPCAPS_DISABLE 0x00000001L
|
||||
#define D3DTEXOPCAPS_SELECTARG1 0x00000002L
|
||||
#define D3DTEXOPCAPS_SELECTARG2 0x00000004L
|
||||
#define D3DTEXOPCAPS_MODULATE 0x00000008L
|
||||
#define D3DTEXOPCAPS_MODULATE2X 0x00000010L
|
||||
#define D3DTEXOPCAPS_MODULATE4X 0x00000020L
|
||||
#define D3DTEXOPCAPS_ADD 0x00000040L
|
||||
#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L
|
||||
#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L
|
||||
#define D3DTEXOPCAPS_SUBTRACT 0x00000200L
|
||||
#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L
|
||||
#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L
|
||||
#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L
|
||||
#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L
|
||||
#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L
|
||||
#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L
|
||||
#define D3DTEXOPCAPS_PREMODULATE 0x00010000L
|
||||
#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L
|
||||
#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L
|
||||
#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L
|
||||
#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L
|
||||
#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L
|
||||
#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L
|
||||
#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L
|
||||
#define D3DTEXOPCAPS_MULTIPLYADD 0x01000000L
|
||||
#define D3DTEXOPCAPS_LERP 0x02000000L
|
||||
|
||||
//
|
||||
// FVFCaps
|
||||
//
|
||||
#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */
|
||||
#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */
|
||||
#define D3DFVFCAPS_PSIZE 0x00100000L /* Device can receive point size */
|
||||
|
||||
//
|
||||
// VertexProcessingCaps
|
||||
//
|
||||
#define D3DVTXPCAPS_TEXGEN 0x00000001L /* device can do texgen */
|
||||
#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L /* device can do DX7-level colormaterialsource ops */
|
||||
#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L /* device can do directional lights */
|
||||
#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L /* device can do positional lights (includes point and spot) */
|
||||
#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L /* device can do local viewer */
|
||||
#define D3DVTXPCAPS_TWEENING 0x00000040L /* device can do vertex tweening */
|
||||
#define D3DVTXPCAPS_TEXGEN_SPHEREMAP 0x00000100L /* device supports D3DTSS_TCI_SPHEREMAP */
|
||||
#define D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER 0x00000200L /* device does not support TexGen in non-local
|
||||
viewer mode */
|
||||
|
||||
//
|
||||
// DevCaps2
|
||||
//
|
||||
#define D3DDEVCAPS2_STREAMOFFSET 0x00000001L /* Device supports offsets in streams. Must be set by DX9 drivers */
|
||||
#define D3DDEVCAPS2_DMAPNPATCH 0x00000002L /* Device supports displacement maps for N-Patches*/
|
||||
#define D3DDEVCAPS2_ADAPTIVETESSRTPATCH 0x00000004L /* Device supports adaptive tesselation of RT-patches*/
|
||||
#define D3DDEVCAPS2_ADAPTIVETESSNPATCH 0x00000008L /* Device supports adaptive tesselation of N-patches*/
|
||||
#define D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES 0x00000010L /* Device supports StretchRect calls with a texture as the source*/
|
||||
#define D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH 0x00000020L /* Device supports presampled displacement maps for N-Patches */
|
||||
#define D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET 0x00000040L /* Vertex elements in a vertex declaration can share the same stream offset */
|
||||
|
||||
//
|
||||
// DeclTypes
|
||||
//
|
||||
#define D3DDTCAPS_UBYTE4 0x00000001L
|
||||
#define D3DDTCAPS_UBYTE4N 0x00000002L
|
||||
#define D3DDTCAPS_SHORT2N 0x00000004L
|
||||
#define D3DDTCAPS_SHORT4N 0x00000008L
|
||||
#define D3DDTCAPS_USHORT2N 0x00000010L
|
||||
#define D3DDTCAPS_USHORT4N 0x00000020L
|
||||
#define D3DDTCAPS_UDEC3 0x00000040L
|
||||
#define D3DDTCAPS_DEC3N 0x00000080L
|
||||
#define D3DDTCAPS_FLOAT16_2 0x00000100L
|
||||
#define D3DDTCAPS_FLOAT16_4 0x00000200L
|
||||
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif /* (DIRECT3D_VERSION >= 0x0900) */
|
||||
#endif /* _d3d9CAPS_H_ */
|
||||
|
2416
SDK/Include/d3d9types.h
Normal file
2416
SDK/Include/d3d9types.h
Normal file
File diff suppressed because it is too large
Load Diff
290
SDK/Include/d3dx10async.h
Normal file
290
SDK/Include/d3dx10async.h
Normal file
@ -0,0 +1,290 @@
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// File: D3DX10Async.h
|
||||
// Content: D3DX10 Asynchronous Effect / Shader loaders / compilers
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __D3DX10ASYNC_H__
|
||||
#define __D3DX10ASYNC_H__
|
||||
|
||||
#include "d3dx10.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10Compile:
|
||||
// ------------------
|
||||
// Compiles an effect or shader.
|
||||
//
|
||||
// Parameters:
|
||||
// pSrcFile
|
||||
// Source file name.
|
||||
// hSrcModule
|
||||
// Module handle. if NULL, current module will be used.
|
||||
// pSrcResource
|
||||
// Resource name in module.
|
||||
// pSrcData
|
||||
// Pointer to source code.
|
||||
// SrcDataLen
|
||||
// Size of source code, in bytes.
|
||||
// pDefines
|
||||
// Optional NULL-terminated array of preprocessor macro definitions.
|
||||
// pInclude
|
||||
// Optional interface pointer to use for handling #include directives.
|
||||
// If this parameter is NULL, #includes will be honored when compiling
|
||||
// from file, and will error when compiling from resource or memory.
|
||||
// pFunctionName
|
||||
// Name of the entrypoint function where execution should begin.
|
||||
// pProfile
|
||||
// Instruction set to be used when generating code. Currently supported
|
||||
// profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "vs_3_0",
|
||||
// "vs_3_sw", "vs_4_0", "vs_4_1",
|
||||
// "ps_2_0", "ps_2_a", "ps_2_b", "ps_2_sw", "ps_3_0",
|
||||
// "ps_3_sw", "ps_4_0", "ps_4_1",
|
||||
// "gs_4_0", "gs_4_1",
|
||||
// "tx_1_0",
|
||||
// "fx_4_0", "fx_4_1"
|
||||
// Note that this entrypoint does not compile fx_2_0 targets, for that
|
||||
// you need to use the D3DX9 function.
|
||||
// Flags1
|
||||
// See D3D10_SHADER_xxx flags.
|
||||
// Flags2
|
||||
// See D3D10_EFFECT_xxx flags.
|
||||
// ppShader
|
||||
// Returns a buffer containing the created shader. This buffer contains
|
||||
// the compiled shader code, as well as any embedded debug and symbol
|
||||
// table info. (See D3D10GetShaderConstantTable)
|
||||
// ppErrorMsgs
|
||||
// Returns a buffer containing a listing of errors and warnings that were
|
||||
// encountered during the compile. If you are running in a debugger,
|
||||
// these are the same messages you will see in your debug output.
|
||||
// pHResult
|
||||
// Pointer to a memory location to receive the return value upon completion.
|
||||
// Maybe NULL if not needed.
|
||||
// If pPump != NULL, pHResult must be a valid memory location until the
|
||||
// the asynchronous execution completes.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI D3DX10CompileFromFileA(LPCSTR pSrcFile,CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
|
||||
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX10CompileFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
|
||||
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10CompileFromFile D3DX10CompileFromFileW
|
||||
#else
|
||||
#define D3DX10CompileFromFile D3DX10CompileFromFileA
|
||||
#endif
|
||||
|
||||
HRESULT WINAPI D3DX10CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX10CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10CompileFromResource D3DX10CompileFromResourceW
|
||||
#else
|
||||
#define D3DX10CompileFromResource D3DX10CompileFromResourceA
|
||||
#endif
|
||||
|
||||
HRESULT WINAPI D3DX10CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
|
||||
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10CreateEffectFromXXXX:
|
||||
// --------------------------
|
||||
// Creates an effect from a binary effect or file
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
// [in]
|
||||
//
|
||||
//
|
||||
// pFileName
|
||||
// Name of the ASCII (uncompiled) or binary (compiled) Effect file to load
|
||||
//
|
||||
// hModule
|
||||
// Handle to the module containing the resource to compile from
|
||||
// pResourceName
|
||||
// Name of the resource within hModule to compile from
|
||||
//
|
||||
// pData
|
||||
// Blob of effect data, either ASCII (uncompiled) or binary (compiled)
|
||||
// DataLength
|
||||
// Length of the data blob
|
||||
//
|
||||
// pDefines
|
||||
// Optional NULL-terminated array of preprocessor macro definitions.
|
||||
// pInclude
|
||||
// Optional interface pointer to use for handling #include directives.
|
||||
// If this parameter is NULL, #includes will be honored when compiling
|
||||
// from file, and will error when compiling from resource or memory.
|
||||
// pProfile
|
||||
// Profile to use when compiling the effect.
|
||||
// HLSLFlags
|
||||
// Compilation flags pertaining to shaders and data types, honored by
|
||||
// the HLSL compiler
|
||||
// FXFlags
|
||||
// Compilation flags pertaining to Effect compilation, honored
|
||||
// by the Effect compiler
|
||||
// pDevice
|
||||
// Pointer to the D3D10 device on which to create Effect resources
|
||||
// pEffectPool
|
||||
// Pointer to an Effect pool to share variables with or NULL
|
||||
//
|
||||
// [out]
|
||||
//
|
||||
// ppEffect
|
||||
// Address of the newly created Effect interface
|
||||
// ppEffectPool
|
||||
// Address of the newly created Effect pool interface
|
||||
// ppErrors
|
||||
// If non-NULL, address of a buffer with error messages that occurred
|
||||
// during parsing or compilation
|
||||
// pHResult
|
||||
// Pointer to a memory location to receive the return value upon completion.
|
||||
// Maybe NULL if not needed.
|
||||
// If pPump != NULL, pHResult must be a valid memory location until the
|
||||
// the asynchronous execution completes.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
||||
HRESULT WINAPI D3DX10CreateEffectFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
|
||||
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
|
||||
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX10CreateEffectFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
|
||||
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
|
||||
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX10CreateEffectFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
|
||||
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
|
||||
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX10CreateEffectFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
|
||||
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
|
||||
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX10CreateEffectFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
|
||||
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
|
||||
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);
|
||||
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10CreateEffectFromFile D3DX10CreateEffectFromFileW
|
||||
#define D3DX10CreateEffectFromResource D3DX10CreateEffectFromResourceW
|
||||
#else
|
||||
#define D3DX10CreateEffectFromFile D3DX10CreateEffectFromFileA
|
||||
#define D3DX10CreateEffectFromResource D3DX10CreateEffectFromResourceA
|
||||
#endif
|
||||
|
||||
HRESULT WINAPI D3DX10CreateEffectPoolFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
|
||||
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump,
|
||||
ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX10CreateEffectPoolFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
|
||||
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump,
|
||||
ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX10CreateEffectPoolFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
|
||||
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
|
||||
ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX10CreateEffectPoolFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
|
||||
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
|
||||
ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX10CreateEffectPoolFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
|
||||
ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
|
||||
ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10CreateEffectPoolFromFile D3DX10CreateEffectPoolFromFileW
|
||||
#define D3DX10CreateEffectPoolFromResource D3DX10CreateEffectPoolFromResourceW
|
||||
#else
|
||||
#define D3DX10CreateEffectPoolFromFile D3DX10CreateEffectPoolFromFileA
|
||||
#define D3DX10CreateEffectPoolFromResource D3DX10CreateEffectPoolFromResourceA
|
||||
#endif
|
||||
|
||||
HRESULT WINAPI D3DX10PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX10PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX10PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX10PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
HRESULT WINAPI D3DX10PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
|
||||
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10PreprocessShaderFromFile D3DX10PreprocessShaderFromFileW
|
||||
#define D3DX10PreprocessShaderFromResource D3DX10PreprocessShaderFromResourceW
|
||||
#else
|
||||
#define D3DX10PreprocessShaderFromFile D3DX10PreprocessShaderFromFileA
|
||||
#define D3DX10PreprocessShaderFromResource D3DX10PreprocessShaderFromResourceA
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Async processors
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI D3DX10CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
|
||||
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2,
|
||||
ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
|
||||
|
||||
HRESULT WINAPI D3DX10CreateAsyncEffectCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
|
||||
LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice,
|
||||
ID3D10EffectPool *pPool, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
|
||||
|
||||
HRESULT WINAPI D3DX10CreateAsyncEffectPoolCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
|
||||
LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice,
|
||||
ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
|
||||
|
||||
HRESULT WINAPI D3DX10CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
|
||||
ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX10 Asynchronous texture I/O (advanced mode)
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI D3DX10CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX10DataLoader **ppDataLoader);
|
||||
HRESULT WINAPI D3DX10CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX10DataLoader **ppDataLoader);
|
||||
HRESULT WINAPI D3DX10CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX10DataLoader **ppDataLoader);
|
||||
HRESULT WINAPI D3DX10CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX10DataLoader **ppDataLoader);
|
||||
HRESULT WINAPI D3DX10CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX10DataLoader **ppDataLoader);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DX10CreateAsyncFileLoader D3DX10CreateAsyncFileLoaderW
|
||||
#define D3DX10CreateAsyncResourceLoader D3DX10CreateAsyncResourceLoaderW
|
||||
#else
|
||||
#define D3DX10CreateAsyncFileLoader D3DX10CreateAsyncFileLoaderA
|
||||
#define D3DX10CreateAsyncResourceLoader D3DX10CreateAsyncResourceLoaderA
|
||||
#endif
|
||||
|
||||
HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor);
|
||||
HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor(D3DX10_IMAGE_INFO *pImageInfo, ID3DX10DataProcessor **ppDataProcessor);
|
||||
HRESULT WINAPI D3DX10CreateAsyncShaderResourceViewProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3DX10ASYNC_H__
|
||||
|
||||
|
78
SDK/Include/d3dx9.h
Normal file
78
SDK/Include/d3dx9.h
Normal file
@ -0,0 +1,78 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||
//
|
||||
// File: d3dx9.h
|
||||
// Content: D3DX utility library
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __D3DX_INTERNAL__
|
||||
#error Incorrect D3DX header used
|
||||
#endif
|
||||
|
||||
#ifndef __D3DX9_H__
|
||||
#define __D3DX9_H__
|
||||
|
||||
|
||||
// Defines
|
||||
#include <limits.h>
|
||||
|
||||
#define D3DX_DEFAULT ((UINT) -1)
|
||||
#define D3DX_DEFAULT_NONPOW2 ((UINT) -2)
|
||||
#define D3DX_DEFAULT_FLOAT FLT_MAX
|
||||
#define D3DX_FROM_FILE ((UINT) -3)
|
||||
#define D3DFMT_FROM_FILE ((D3DFORMAT) -3)
|
||||
|
||||
#ifndef D3DXINLINE
|
||||
#ifdef _MSC_VER
|
||||
#if (_MSC_VER >= 1200)
|
||||
#define D3DXINLINE __forceinline
|
||||
#else
|
||||
#define D3DXINLINE __inline
|
||||
#endif
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
#define D3DXINLINE inline
|
||||
#else
|
||||
#define D3DXINLINE
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// Includes
|
||||
#include "d3d9.h"
|
||||
#include "d3dx9math.h"
|
||||
#include "d3dx9core.h"
|
||||
#include "d3dx9xof.h"
|
||||
#include "d3dx9mesh.h"
|
||||
#include "d3dx9shader.h"
|
||||
#include "d3dx9effect.h"
|
||||
|
||||
#include "d3dx9tex.h"
|
||||
#include "d3dx9shape.h"
|
||||
#include "d3dx9anim.h"
|
||||
|
||||
|
||||
|
||||
// Errors
|
||||
#define _FACDD 0x876
|
||||
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
|
||||
|
||||
enum _D3DXERR {
|
||||
D3DXERR_CANNOTMODIFYINDEXBUFFER = MAKE_DDHRESULT(2900),
|
||||
D3DXERR_INVALIDMESH = MAKE_DDHRESULT(2901),
|
||||
D3DXERR_CANNOTATTRSORT = MAKE_DDHRESULT(2902),
|
||||
D3DXERR_SKINNINGNOTSUPPORTED = MAKE_DDHRESULT(2903),
|
||||
D3DXERR_TOOMANYINFLUENCES = MAKE_DDHRESULT(2904),
|
||||
D3DXERR_INVALIDDATA = MAKE_DDHRESULT(2905),
|
||||
D3DXERR_LOADEDMESHASNODATA = MAKE_DDHRESULT(2906),
|
||||
D3DXERR_DUPLICATENAMEDFRAGMENT = MAKE_DDHRESULT(2907),
|
||||
D3DXERR_CANNOTREMOVELASTITEM = MAKE_DDHRESULT(2908),
|
||||
};
|
||||
|
||||
|
||||
#endif //__D3DX9_H__
|
||||
|
1114
SDK/Include/d3dx9anim.h
Normal file
1114
SDK/Include/d3dx9anim.h
Normal file
File diff suppressed because it is too large
Load Diff
753
SDK/Include/d3dx9core.h
Normal file
753
SDK/Include/d3dx9core.h
Normal file
@ -0,0 +1,753 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||
//
|
||||
// File: d3dx9core.h
|
||||
// Content: D3DX core types and functions
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "d3dx9.h"
|
||||
|
||||
#ifndef __D3DX9CORE_H__
|
||||
#define __D3DX9CORE_H__
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// D3DX_SDK_VERSION:
|
||||
// -----------------
|
||||
// This identifier is passed to D3DXCheckVersion in order to ensure that an
|
||||
// application was built against the correct header files and lib files.
|
||||
// This number is incremented whenever a header (or other) change would
|
||||
// require applications to be rebuilt. If the version doesn't match,
|
||||
// D3DXCheckVersion will return FALSE. (The number itself has no meaning.)
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define D3DX_VERSION 0x0902
|
||||
|
||||
#define D3DX_SDK_VERSION 43
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
BOOL WINAPI
|
||||
D3DXCheckVersion(UINT D3DSdkVersion, UINT D3DXSdkVersion);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// D3DXDebugMute
|
||||
// Mutes D3DX and D3D debug spew (TRUE - mute, FALSE - not mute)
|
||||
//
|
||||
// returns previous mute value
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
BOOL WINAPI
|
||||
D3DXDebugMute(BOOL Mute);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// D3DXGetDriverLevel:
|
||||
// Returns driver version information:
|
||||
//
|
||||
// 700 - DX7 level driver
|
||||
// 800 - DX8 level driver
|
||||
// 900 - DX9 level driver
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
UINT WINAPI
|
||||
D3DXGetDriverLevel(LPDIRECT3DDEVICE9 pDevice);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXBuffer:
|
||||
// ------------
|
||||
// The buffer object is used by D3DX to return arbitrary size data.
|
||||
//
|
||||
// GetBufferPointer -
|
||||
// Returns a pointer to the beginning of the buffer.
|
||||
//
|
||||
// GetBufferSize -
|
||||
// Returns the size of the buffer, in bytes.
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef interface ID3DXBuffer ID3DXBuffer;
|
||||
typedef interface ID3DXBuffer *LPD3DXBUFFER;
|
||||
|
||||
// {8BA5FB08-5195-40e2-AC58-0D989C3A0102}
|
||||
DEFINE_GUID(IID_ID3DXBuffer,
|
||||
0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXBuffer
|
||||
|
||||
DECLARE_INTERFACE_(ID3DXBuffer, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DXBuffer
|
||||
STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
|
||||
STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// D3DXSPRITE flags:
|
||||
// -----------------
|
||||
// D3DXSPRITE_DONOTSAVESTATE
|
||||
// Specifies device state is not to be saved and restored in Begin/End.
|
||||
// D3DXSPRITE_DONOTMODIFY_RENDERSTATE
|
||||
// Specifies device render state is not to be changed in Begin. The device
|
||||
// is assumed to be in a valid state to draw vertices containing POSITION0,
|
||||
// TEXCOORD0, and COLOR0 data.
|
||||
// D3DXSPRITE_OBJECTSPACE
|
||||
// The WORLD, VIEW, and PROJECTION transforms are NOT modified. The
|
||||
// transforms currently set to the device are used to transform the sprites
|
||||
// when the batch is drawn (at Flush or End). If this is not specified,
|
||||
// WORLD, VIEW, and PROJECTION transforms are modified so that sprites are
|
||||
// drawn in screenspace coordinates.
|
||||
// D3DXSPRITE_BILLBOARD
|
||||
// Rotates each sprite about its center so that it is facing the viewer.
|
||||
// D3DXSPRITE_ALPHABLEND
|
||||
// Enables ALPHABLEND(SRCALPHA, INVSRCALPHA) and ALPHATEST(alpha > 0).
|
||||
// ID3DXFont expects this to be set when drawing text.
|
||||
// D3DXSPRITE_SORT_TEXTURE
|
||||
// Sprites are sorted by texture prior to drawing. This is recommended when
|
||||
// drawing non-overlapping sprites of uniform depth. For example, drawing
|
||||
// screen-aligned text with ID3DXFont.
|
||||
// D3DXSPRITE_SORT_DEPTH_FRONTTOBACK
|
||||
// Sprites are sorted by depth front-to-back prior to drawing. This is
|
||||
// recommended when drawing opaque sprites of varying depths.
|
||||
// D3DXSPRITE_SORT_DEPTH_BACKTOFRONT
|
||||
// Sprites are sorted by depth back-to-front prior to drawing. This is
|
||||
// recommended when drawing transparent sprites of varying depths.
|
||||
// D3DXSPRITE_DO_NOT_ADDREF_TEXTURE
|
||||
// Disables calling AddRef() on every draw, and Release() on Flush() for
|
||||
// better performance.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define D3DXSPRITE_DONOTSAVESTATE (1 << 0)
|
||||
#define D3DXSPRITE_DONOTMODIFY_RENDERSTATE (1 << 1)
|
||||
#define D3DXSPRITE_OBJECTSPACE (1 << 2)
|
||||
#define D3DXSPRITE_BILLBOARD (1 << 3)
|
||||
#define D3DXSPRITE_ALPHABLEND (1 << 4)
|
||||
#define D3DXSPRITE_SORT_TEXTURE (1 << 5)
|
||||
#define D3DXSPRITE_SORT_DEPTH_FRONTTOBACK (1 << 6)
|
||||
#define D3DXSPRITE_SORT_DEPTH_BACKTOFRONT (1 << 7)
|
||||
#define D3DXSPRITE_DO_NOT_ADDREF_TEXTURE (1 << 8)
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXSprite:
|
||||
// ------------
|
||||
// This object intends to provide an easy way to drawing sprites using D3D.
|
||||
//
|
||||
// Begin -
|
||||
// Prepares device for drawing sprites.
|
||||
//
|
||||
// Draw -
|
||||
// Draws a sprite. Before transformation, the sprite is the size of
|
||||
// SrcRect, with its top-left corner specified by Position. The color
|
||||
// and alpha channels are modulated by Color.
|
||||
//
|
||||
// Flush -
|
||||
// Forces all batched sprites to submitted to the device.
|
||||
//
|
||||
// End -
|
||||
// Restores device state to how it was when Begin was called.
|
||||
//
|
||||
// OnLostDevice, OnResetDevice -
|
||||
// Call OnLostDevice() on this object before calling Reset() on the
|
||||
// device, so that this object can release any stateblocks and video
|
||||
// memory resources. After Reset(), the call OnResetDevice().
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef interface ID3DXSprite ID3DXSprite;
|
||||
typedef interface ID3DXSprite *LPD3DXSPRITE;
|
||||
|
||||
|
||||
// {BA0B762D-7D28-43ec-B9DC-2F84443B0614}
|
||||
DEFINE_GUID(IID_ID3DXSprite,
|
||||
0xba0b762d, 0x7d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14);
|
||||
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXSprite
|
||||
|
||||
DECLARE_INTERFACE_(ID3DXSprite, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DXSprite
|
||||
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
|
||||
|
||||
STDMETHOD(GetTransform)(THIS_ D3DXMATRIX *pTransform) PURE;
|
||||
STDMETHOD(SetTransform)(THIS_ CONST D3DXMATRIX *pTransform) PURE;
|
||||
|
||||
STDMETHOD(SetWorldViewRH)(THIS_ CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) PURE;
|
||||
STDMETHOD(SetWorldViewLH)(THIS_ CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) PURE;
|
||||
|
||||
STDMETHOD(Begin)(THIS_ DWORD Flags) PURE;
|
||||
STDMETHOD(Draw)(THIS_ LPDIRECT3DTEXTURE9 pTexture, CONST RECT *pSrcRect, CONST D3DXVECTOR3 *pCenter, CONST D3DXVECTOR3 *pPosition, D3DCOLOR Color) PURE;
|
||||
STDMETHOD(Flush)(THIS) PURE;
|
||||
STDMETHOD(End)(THIS) PURE;
|
||||
|
||||
STDMETHOD(OnLostDevice)(THIS) PURE;
|
||||
STDMETHOD(OnResetDevice)(THIS) PURE;
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateSprite(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
LPD3DXSPRITE* ppSprite);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXFont:
|
||||
// ----------
|
||||
// Font objects contain the textures and resources needed to render a specific
|
||||
// font on a specific device.
|
||||
//
|
||||
// GetGlyphData -
|
||||
// Returns glyph cache data, for a given glyph.
|
||||
//
|
||||
// PreloadCharacters/PreloadGlyphs/PreloadText -
|
||||
// Preloads glyphs into the glyph cache textures.
|
||||
//
|
||||
// DrawText -
|
||||
// Draws formatted text on a D3D device. Some parameters are
|
||||
// surprisingly similar to those of GDI's DrawText function. See GDI
|
||||
// documentation for a detailed description of these parameters.
|
||||
// If pSprite is NULL, an internal sprite object will be used.
|
||||
//
|
||||
// OnLostDevice, OnResetDevice -
|
||||
// Call OnLostDevice() on this object before calling Reset() on the
|
||||
// device, so that this object can release any stateblocks and video
|
||||
// memory resources. After Reset(), the call OnResetDevice().
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct _D3DXFONT_DESCA
|
||||
{
|
||||
INT Height;
|
||||
UINT Width;
|
||||
UINT Weight;
|
||||
UINT MipLevels;
|
||||
BOOL Italic;
|
||||
BYTE CharSet;
|
||||
BYTE OutputPrecision;
|
||||
BYTE Quality;
|
||||
BYTE PitchAndFamily;
|
||||
CHAR FaceName[LF_FACESIZE];
|
||||
|
||||
} D3DXFONT_DESCA, *LPD3DXFONT_DESCA;
|
||||
|
||||
typedef struct _D3DXFONT_DESCW
|
||||
{
|
||||
INT Height;
|
||||
UINT Width;
|
||||
UINT Weight;
|
||||
UINT MipLevels;
|
||||
BOOL Italic;
|
||||
BYTE CharSet;
|
||||
BYTE OutputPrecision;
|
||||
BYTE Quality;
|
||||
BYTE PitchAndFamily;
|
||||
WCHAR FaceName[LF_FACESIZE];
|
||||
|
||||
} D3DXFONT_DESCW, *LPD3DXFONT_DESCW;
|
||||
|
||||
#ifdef UNICODE
|
||||
typedef D3DXFONT_DESCW D3DXFONT_DESC;
|
||||
typedef LPD3DXFONT_DESCW LPD3DXFONT_DESC;
|
||||
#else
|
||||
typedef D3DXFONT_DESCA D3DXFONT_DESC;
|
||||
typedef LPD3DXFONT_DESCA LPD3DXFONT_DESC;
|
||||
#endif
|
||||
|
||||
|
||||
typedef interface ID3DXFont ID3DXFont;
|
||||
typedef interface ID3DXFont *LPD3DXFONT;
|
||||
|
||||
|
||||
// {D79DBB70-5F21-4d36-BBC2-FF525C213CDC}
|
||||
DEFINE_GUID(IID_ID3DXFont,
|
||||
0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc);
|
||||
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXFont
|
||||
|
||||
DECLARE_INTERFACE_(ID3DXFont, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DXFont
|
||||
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *ppDevice) PURE;
|
||||
STDMETHOD(GetDescA)(THIS_ D3DXFONT_DESCA *pDesc) PURE;
|
||||
STDMETHOD(GetDescW)(THIS_ D3DXFONT_DESCW *pDesc) PURE;
|
||||
STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *pTextMetrics) PURE;
|
||||
STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *pTextMetrics) PURE;
|
||||
|
||||
STDMETHOD_(HDC, GetDC)(THIS) PURE;
|
||||
STDMETHOD(GetGlyphData)(THIS_ UINT Glyph, LPDIRECT3DTEXTURE9 *ppTexture, RECT *pBlackBox, POINT *pCellInc) PURE;
|
||||
|
||||
STDMETHOD(PreloadCharacters)(THIS_ UINT First, UINT Last) PURE;
|
||||
STDMETHOD(PreloadGlyphs)(THIS_ UINT First, UINT Last) PURE;
|
||||
STDMETHOD(PreloadTextA)(THIS_ LPCSTR pString, INT Count) PURE;
|
||||
STDMETHOD(PreloadTextW)(THIS_ LPCWSTR pString, INT Count) PURE;
|
||||
|
||||
STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DXSPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE;
|
||||
STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DXSPRITE pSprite, LPCWSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE;
|
||||
|
||||
STDMETHOD(OnLostDevice)(THIS) PURE;
|
||||
STDMETHOD(OnResetDevice)(THIS) PURE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
#ifdef UNICODE
|
||||
HRESULT GetDesc(D3DXFONT_DESCW *pDesc) { return GetDescW(pDesc); }
|
||||
HRESULT PreloadText(LPCWSTR pString, INT Count) { return PreloadTextW(pString, Count); }
|
||||
#else
|
||||
HRESULT GetDesc(D3DXFONT_DESCA *pDesc) { return GetDescA(pDesc); }
|
||||
HRESULT PreloadText(LPCSTR pString, INT Count) { return PreloadTextA(pString, Count); }
|
||||
#endif
|
||||
#endif //__cplusplus
|
||||
};
|
||||
|
||||
#ifndef GetTextMetrics
|
||||
#ifdef UNICODE
|
||||
#define GetTextMetrics GetTextMetricsW
|
||||
#else
|
||||
#define GetTextMetrics GetTextMetricsA
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef DrawText
|
||||
#ifdef UNICODE
|
||||
#define DrawText DrawTextW
|
||||
#else
|
||||
#define DrawText DrawTextA
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateFontA(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
INT Height,
|
||||
UINT Width,
|
||||
UINT Weight,
|
||||
UINT MipLevels,
|
||||
BOOL Italic,
|
||||
DWORD CharSet,
|
||||
DWORD OutputPrecision,
|
||||
DWORD Quality,
|
||||
DWORD PitchAndFamily,
|
||||
LPCSTR pFaceName,
|
||||
LPD3DXFONT* ppFont);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateFontW(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
INT Height,
|
||||
UINT Width,
|
||||
UINT Weight,
|
||||
UINT MipLevels,
|
||||
BOOL Italic,
|
||||
DWORD CharSet,
|
||||
DWORD OutputPrecision,
|
||||
DWORD Quality,
|
||||
DWORD PitchAndFamily,
|
||||
LPCWSTR pFaceName,
|
||||
LPD3DXFONT* ppFont);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DXCreateFont D3DXCreateFontW
|
||||
#else
|
||||
#define D3DXCreateFont D3DXCreateFontA
|
||||
#endif
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateFontIndirectA(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
CONST D3DXFONT_DESCA* pDesc,
|
||||
LPD3DXFONT* ppFont);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateFontIndirectW(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
CONST D3DXFONT_DESCW* pDesc,
|
||||
LPD3DXFONT* ppFont);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DXCreateFontIndirect D3DXCreateFontIndirectW
|
||||
#else
|
||||
#define D3DXCreateFontIndirect D3DXCreateFontIndirectA
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXRenderToSurface:
|
||||
// ---------------------
|
||||
// This object abstracts rendering to surfaces. These surfaces do not
|
||||
// necessarily need to be render targets. If they are not, a compatible
|
||||
// render target is used, and the result copied into surface at end scene.
|
||||
//
|
||||
// BeginScene, EndScene -
|
||||
// Call BeginScene() and EndScene() at the beginning and ending of your
|
||||
// scene. These calls will setup and restore render targets, viewports,
|
||||
// etc..
|
||||
//
|
||||
// OnLostDevice, OnResetDevice -
|
||||
// Call OnLostDevice() on this object before calling Reset() on the
|
||||
// device, so that this object can release any stateblocks and video
|
||||
// memory resources. After Reset(), the call OnResetDevice().
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct _D3DXRTS_DESC
|
||||
{
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
D3DFORMAT Format;
|
||||
BOOL DepthStencil;
|
||||
D3DFORMAT DepthStencilFormat;
|
||||
|
||||
} D3DXRTS_DESC, *LPD3DXRTS_DESC;
|
||||
|
||||
|
||||
typedef interface ID3DXRenderToSurface ID3DXRenderToSurface;
|
||||
typedef interface ID3DXRenderToSurface *LPD3DXRENDERTOSURFACE;
|
||||
|
||||
|
||||
// {6985F346-2C3D-43b3-BE8B-DAAE8A03D894}
|
||||
DEFINE_GUID(IID_ID3DXRenderToSurface,
|
||||
0x6985f346, 0x2c3d, 0x43b3, 0xbe, 0x8b, 0xda, 0xae, 0x8a, 0x3, 0xd8, 0x94);
|
||||
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXRenderToSurface
|
||||
|
||||
DECLARE_INTERFACE_(ID3DXRenderToSurface, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DXRenderToSurface
|
||||
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
|
||||
STDMETHOD(GetDesc)(THIS_ D3DXRTS_DESC* pDesc) PURE;
|
||||
|
||||
STDMETHOD(BeginScene)(THIS_ LPDIRECT3DSURFACE9 pSurface, CONST D3DVIEWPORT9* pViewport) PURE;
|
||||
STDMETHOD(EndScene)(THIS_ DWORD MipFilter) PURE;
|
||||
|
||||
STDMETHOD(OnLostDevice)(THIS) PURE;
|
||||
STDMETHOD(OnResetDevice)(THIS) PURE;
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateRenderToSurface(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
UINT Width,
|
||||
UINT Height,
|
||||
D3DFORMAT Format,
|
||||
BOOL DepthStencil,
|
||||
D3DFORMAT DepthStencilFormat,
|
||||
LPD3DXRENDERTOSURFACE* ppRenderToSurface);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXRenderToEnvMap:
|
||||
// --------------------
|
||||
// This object abstracts rendering to environment maps. These surfaces
|
||||
// do not necessarily need to be render targets. If they are not, a
|
||||
// compatible render target is used, and the result copied into the
|
||||
// environment map at end scene.
|
||||
//
|
||||
// BeginCube, BeginSphere, BeginHemisphere, BeginParabolic -
|
||||
// This function initiates the rendering of the environment map. As
|
||||
// parameters, you pass the textures in which will get filled in with
|
||||
// the resulting environment map.
|
||||
//
|
||||
// Face -
|
||||
// Call this function to initiate the drawing of each face. For each
|
||||
// environment map, you will call this six times.. once for each face
|
||||
// in D3DCUBEMAP_FACES.
|
||||
//
|
||||
// End -
|
||||
// This will restore all render targets, and if needed compose all the
|
||||
// rendered faces into the environment map surfaces.
|
||||
//
|
||||
// OnLostDevice, OnResetDevice -
|
||||
// Call OnLostDevice() on this object before calling Reset() on the
|
||||
// device, so that this object can release any stateblocks and video
|
||||
// memory resources. After Reset(), the call OnResetDevice().
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct _D3DXRTE_DESC
|
||||
{
|
||||
UINT Size;
|
||||
UINT MipLevels;
|
||||
D3DFORMAT Format;
|
||||
BOOL DepthStencil;
|
||||
D3DFORMAT DepthStencilFormat;
|
||||
|
||||
} D3DXRTE_DESC, *LPD3DXRTE_DESC;
|
||||
|
||||
|
||||
typedef interface ID3DXRenderToEnvMap ID3DXRenderToEnvMap;
|
||||
typedef interface ID3DXRenderToEnvMap *LPD3DXRenderToEnvMap;
|
||||
|
||||
|
||||
// {313F1B4B-C7B0-4fa2-9D9D-8D380B64385E}
|
||||
DEFINE_GUID(IID_ID3DXRenderToEnvMap,
|
||||
0x313f1b4b, 0xc7b0, 0x4fa2, 0x9d, 0x9d, 0x8d, 0x38, 0xb, 0x64, 0x38, 0x5e);
|
||||
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXRenderToEnvMap
|
||||
|
||||
DECLARE_INTERFACE_(ID3DXRenderToEnvMap, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DXRenderToEnvMap
|
||||
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
|
||||
STDMETHOD(GetDesc)(THIS_ D3DXRTE_DESC* pDesc) PURE;
|
||||
|
||||
STDMETHOD(BeginCube)(THIS_
|
||||
LPDIRECT3DCUBETEXTURE9 pCubeTex) PURE;
|
||||
|
||||
STDMETHOD(BeginSphere)(THIS_
|
||||
LPDIRECT3DTEXTURE9 pTex) PURE;
|
||||
|
||||
STDMETHOD(BeginHemisphere)(THIS_
|
||||
LPDIRECT3DTEXTURE9 pTexZPos,
|
||||
LPDIRECT3DTEXTURE9 pTexZNeg) PURE;
|
||||
|
||||
STDMETHOD(BeginParabolic)(THIS_
|
||||
LPDIRECT3DTEXTURE9 pTexZPos,
|
||||
LPDIRECT3DTEXTURE9 pTexZNeg) PURE;
|
||||
|
||||
STDMETHOD(Face)(THIS_ D3DCUBEMAP_FACES Face, DWORD MipFilter) PURE;
|
||||
STDMETHOD(End)(THIS_ DWORD MipFilter) PURE;
|
||||
|
||||
STDMETHOD(OnLostDevice)(THIS) PURE;
|
||||
STDMETHOD(OnResetDevice)(THIS) PURE;
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateRenderToEnvMap(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
UINT Size,
|
||||
UINT MipLevels,
|
||||
D3DFORMAT Format,
|
||||
BOOL DepthStencil,
|
||||
D3DFORMAT DepthStencilFormat,
|
||||
LPD3DXRenderToEnvMap* ppRenderToEnvMap);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXLine:
|
||||
// ------------
|
||||
// This object intends to provide an easy way to draw lines using D3D.
|
||||
//
|
||||
// Begin -
|
||||
// Prepares device for drawing lines
|
||||
//
|
||||
// Draw -
|
||||
// Draws a line strip in screen-space.
|
||||
// Input is in the form of a array defining points on the line strip. of D3DXVECTOR2
|
||||
//
|
||||
// DrawTransform -
|
||||
// Draws a line in screen-space with a specified input transformation matrix.
|
||||
//
|
||||
// End -
|
||||
// Restores device state to how it was when Begin was called.
|
||||
//
|
||||
// SetPattern -
|
||||
// Applies a stipple pattern to the line. Input is one 32-bit
|
||||
// DWORD which describes the stipple pattern. 1 is opaque, 0 is
|
||||
// transparent.
|
||||
//
|
||||
// SetPatternScale -
|
||||
// Stretches the stipple pattern in the u direction. Input is one
|
||||
// floating-point value. 0.0f is no scaling, whereas 1.0f doubles
|
||||
// the length of the stipple pattern.
|
||||
//
|
||||
// SetWidth -
|
||||
// Specifies the thickness of the line in the v direction. Input is
|
||||
// one floating-point value.
|
||||
//
|
||||
// SetAntialias -
|
||||
// Toggles line antialiasing. Input is a BOOL.
|
||||
// TRUE = Antialiasing on.
|
||||
// FALSE = Antialiasing off.
|
||||
//
|
||||
// SetGLLines -
|
||||
// Toggles non-antialiased OpenGL line emulation. Input is a BOOL.
|
||||
// TRUE = OpenGL line emulation on.
|
||||
// FALSE = OpenGL line emulation off.
|
||||
//
|
||||
// OpenGL line: Regular line:
|
||||
// *\ *\
|
||||
// | \ / \
|
||||
// | \ *\ \
|
||||
// *\ \ \ \
|
||||
// \ \ \ \
|
||||
// \ * \ *
|
||||
// \ | \ /
|
||||
// \| *
|
||||
// *
|
||||
//
|
||||
// OnLostDevice, OnResetDevice -
|
||||
// Call OnLostDevice() on this object before calling Reset() on the
|
||||
// device, so that this object can release any stateblocks and video
|
||||
// memory resources. After Reset(), the call OnResetDevice().
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
typedef interface ID3DXLine ID3DXLine;
|
||||
typedef interface ID3DXLine *LPD3DXLINE;
|
||||
|
||||
|
||||
// {D379BA7F-9042-4ac4-9F5E-58192A4C6BD8}
|
||||
DEFINE_GUID(IID_ID3DXLine,
|
||||
0xd379ba7f, 0x9042, 0x4ac4, 0x9f, 0x5e, 0x58, 0x19, 0x2a, 0x4c, 0x6b, 0xd8);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXLine
|
||||
|
||||
DECLARE_INTERFACE_(ID3DXLine, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// ID3DXLine
|
||||
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
|
||||
|
||||
STDMETHOD(Begin)(THIS) PURE;
|
||||
|
||||
STDMETHOD(Draw)(THIS_ CONST D3DXVECTOR2 *pVertexList,
|
||||
DWORD dwVertexListCount, D3DCOLOR Color) PURE;
|
||||
|
||||
STDMETHOD(DrawTransform)(THIS_ CONST D3DXVECTOR3 *pVertexList,
|
||||
DWORD dwVertexListCount, CONST D3DXMATRIX* pTransform,
|
||||
D3DCOLOR Color) PURE;
|
||||
|
||||
STDMETHOD(SetPattern)(THIS_ DWORD dwPattern) PURE;
|
||||
STDMETHOD_(DWORD, GetPattern)(THIS) PURE;
|
||||
|
||||
STDMETHOD(SetPatternScale)(THIS_ FLOAT fPatternScale) PURE;
|
||||
STDMETHOD_(FLOAT, GetPatternScale)(THIS) PURE;
|
||||
|
||||
STDMETHOD(SetWidth)(THIS_ FLOAT fWidth) PURE;
|
||||
STDMETHOD_(FLOAT, GetWidth)(THIS) PURE;
|
||||
|
||||
STDMETHOD(SetAntialias)(THIS_ BOOL bAntialias) PURE;
|
||||
STDMETHOD_(BOOL, GetAntialias)(THIS) PURE;
|
||||
|
||||
STDMETHOD(SetGLLines)(THIS_ BOOL bGLLines) PURE;
|
||||
STDMETHOD_(BOOL, GetGLLines)(THIS) PURE;
|
||||
|
||||
STDMETHOD(End)(THIS) PURE;
|
||||
|
||||
STDMETHOD(OnLostDevice)(THIS) PURE;
|
||||
STDMETHOD(OnResetDevice)(THIS) PURE;
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateLine(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
LPD3DXLINE* ppLine);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3DX9CORE_H__
|
||||
|
873
SDK/Include/d3dx9effect.h
Normal file
873
SDK/Include/d3dx9effect.h
Normal file
@ -0,0 +1,873 @@
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// File: d3dx9effect.h
|
||||
// Content: D3DX effect types and Shaders
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "d3dx9.h"
|
||||
|
||||
#ifndef __D3DX9EFFECT_H__
|
||||
#define __D3DX9EFFECT_H__
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXFX_DONOTSAVESTATE
|
||||
// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag
|
||||
// is specified, device state is not saved or restored in Begin/End.
|
||||
// D3DXFX_DONOTSAVESHADERSTATE
|
||||
// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag
|
||||
// is specified, shader device state is not saved or restored in Begin/End.
|
||||
// This includes pixel/vertex shaders and shader constants
|
||||
// D3DXFX_DONOTSAVESAMPLERSTATE
|
||||
// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag
|
||||
// is specified, sampler device state is not saved or restored in Begin/End.
|
||||
// D3DXFX_NOT_CLONEABLE
|
||||
// This flag is used as a parameter to the D3DXCreateEffect family of APIs.
|
||||
// When this flag is specified, the effect will be non-cloneable and will not
|
||||
// contain any shader binary data.
|
||||
// Furthermore, GetPassDesc will not return shader function pointers.
|
||||
// Setting this flag reduces effect memory usage by about 50%.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define D3DXFX_DONOTSAVESTATE (1 << 0)
|
||||
#define D3DXFX_DONOTSAVESHADERSTATE (1 << 1)
|
||||
#define D3DXFX_DONOTSAVESAMPLERSTATE (1 << 2)
|
||||
|
||||
#define D3DXFX_NOT_CLONEABLE (1 << 11)
|
||||
#define D3DXFX_LARGEADDRESSAWARE (1 << 17)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DX_PARAMETER_SHARED
|
||||
// Indicates that the value of a parameter will be shared with all effects
|
||||
// which share the same namespace. Changing the value in one effect will
|
||||
// change it in all.
|
||||
//
|
||||
// D3DX_PARAMETER_LITERAL
|
||||
// Indicates that the value of this parameter can be treated as literal.
|
||||
// Literal parameters can be marked when the effect is compiled, and their
|
||||
// cannot be changed after the effect is compiled. Shared parameters cannot
|
||||
// be literal.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define D3DX_PARAMETER_SHARED (1 << 0)
|
||||
#define D3DX_PARAMETER_LITERAL (1 << 1)
|
||||
#define D3DX_PARAMETER_ANNOTATION (1 << 2)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXEFFECT_DESC:
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef struct _D3DXEFFECT_DESC
|
||||
{
|
||||
LPCSTR Creator; // Creator string
|
||||
UINT Parameters; // Number of parameters
|
||||
UINT Techniques; // Number of techniques
|
||||
UINT Functions; // Number of function entrypoints
|
||||
|
||||
} D3DXEFFECT_DESC;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXPARAMETER_DESC:
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef struct _D3DXPARAMETER_DESC
|
||||
{
|
||||
LPCSTR Name; // Parameter name
|
||||
LPCSTR Semantic; // Parameter semantic
|
||||
D3DXPARAMETER_CLASS Class; // Class
|
||||
D3DXPARAMETER_TYPE Type; // Component type
|
||||
UINT Rows; // Number of rows
|
||||
UINT Columns; // Number of columns
|
||||
UINT Elements; // Number of array elements
|
||||
UINT Annotations; // Number of annotations
|
||||
UINT StructMembers; // Number of structure member sub-parameters
|
||||
DWORD Flags; // D3DX_PARAMETER_* flags
|
||||
UINT Bytes; // Parameter size, in bytes
|
||||
|
||||
} D3DXPARAMETER_DESC;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXTECHNIQUE_DESC:
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef struct _D3DXTECHNIQUE_DESC
|
||||
{
|
||||
LPCSTR Name; // Technique name
|
||||
UINT Passes; // Number of passes
|
||||
UINT Annotations; // Number of annotations
|
||||
|
||||
} D3DXTECHNIQUE_DESC;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXPASS_DESC:
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef struct _D3DXPASS_DESC
|
||||
{
|
||||
LPCSTR Name; // Pass name
|
||||
UINT Annotations; // Number of annotations
|
||||
|
||||
CONST DWORD *pVertexShaderFunction; // Vertex shader function
|
||||
CONST DWORD *pPixelShaderFunction; // Pixel shader function
|
||||
|
||||
} D3DXPASS_DESC;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXFUNCTION_DESC:
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef struct _D3DXFUNCTION_DESC
|
||||
{
|
||||
LPCSTR Name; // Function name
|
||||
UINT Annotations; // Number of annotations
|
||||
|
||||
} D3DXFUNCTION_DESC;
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXEffectPool ///////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef interface ID3DXEffectPool ID3DXEffectPool;
|
||||
typedef interface ID3DXEffectPool *LPD3DXEFFECTPOOL;
|
||||
|
||||
// {9537AB04-3250-412e-8213-FCD2F8677933}
|
||||
DEFINE_GUID(IID_ID3DXEffectPool,
|
||||
0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33);
|
||||
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXEffectPool
|
||||
|
||||
DECLARE_INTERFACE_(ID3DXEffectPool, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// No public methods
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXBaseEffect ///////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef interface ID3DXBaseEffect ID3DXBaseEffect;
|
||||
typedef interface ID3DXBaseEffect *LPD3DXBASEEFFECT;
|
||||
|
||||
// {017C18AC-103F-4417-8C51-6BF6EF1E56BE}
|
||||
DEFINE_GUID(IID_ID3DXBaseEffect,
|
||||
0x17c18ac, 0x103f, 0x4417, 0x8c, 0x51, 0x6b, 0xf6, 0xef, 0x1e, 0x56, 0xbe);
|
||||
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXBaseEffect
|
||||
|
||||
DECLARE_INTERFACE_(ID3DXBaseEffect, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// Descs
|
||||
STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE;
|
||||
STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE;
|
||||
STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
|
||||
STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE;
|
||||
STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE;
|
||||
|
||||
// Handle operations
|
||||
STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE;
|
||||
|
||||
// Get/Set Parameters
|
||||
STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE;
|
||||
STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE;
|
||||
STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE;
|
||||
STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE;
|
||||
STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE;
|
||||
STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE;
|
||||
STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE;
|
||||
STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE;
|
||||
STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE;
|
||||
STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE;
|
||||
STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE;
|
||||
STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE;
|
||||
STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE;
|
||||
STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE;
|
||||
STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE;
|
||||
STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE;
|
||||
STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
|
||||
STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE;
|
||||
STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
|
||||
STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
|
||||
STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
|
||||
STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
|
||||
STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
|
||||
STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
|
||||
STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
|
||||
STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
|
||||
STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
|
||||
STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
|
||||
STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
|
||||
STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
|
||||
STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE;
|
||||
STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE;
|
||||
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
|
||||
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE;
|
||||
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE;
|
||||
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE;
|
||||
|
||||
//Set Range of an Array to pass to device
|
||||
//Useful for sending only a subrange of an array down to the device
|
||||
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ID3DXEffectStateManager:
|
||||
// ------------------------
|
||||
// This is a user implemented interface that can be used to manage device
|
||||
// state changes made by an Effect.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef interface ID3DXEffectStateManager ID3DXEffectStateManager;
|
||||
typedef interface ID3DXEffectStateManager *LPD3DXEFFECTSTATEMANAGER;
|
||||
|
||||
// {79AAB587-6DBC-4fa7-82DE-37FA1781C5CE}
|
||||
DEFINE_GUID(IID_ID3DXEffectStateManager,
|
||||
0x79aab587, 0x6dbc, 0x4fa7, 0x82, 0xde, 0x37, 0xfa, 0x17, 0x81, 0xc5, 0xce);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXEffectStateManager
|
||||
|
||||
DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown)
|
||||
{
|
||||
// The user must correctly implement QueryInterface, AddRef, and Release.
|
||||
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// The following methods are called by the Effect when it wants to make
|
||||
// the corresponding device call. Note that:
|
||||
// 1. Users manage the state and are therefore responsible for making the
|
||||
// the corresponding device calls themselves inside their callbacks.
|
||||
// 2. Effects pay attention to the return values of the callbacks, and so
|
||||
// users must pay attention to what they return in their callbacks.
|
||||
|
||||
STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX *pMatrix) PURE;
|
||||
STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9 *pMaterial) PURE;
|
||||
STDMETHOD(SetLight)(THIS_ DWORD Index, CONST D3DLIGHT9 *pLight) PURE;
|
||||
STDMETHOD(LightEnable)(THIS_ DWORD Index, BOOL Enable) PURE;
|
||||
STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD Value) PURE;
|
||||
STDMETHOD(SetTexture)(THIS_ DWORD Stage, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
|
||||
STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) PURE;
|
||||
STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) PURE;
|
||||
STDMETHOD(SetNPatchMode)(THIS_ FLOAT NumSegments) PURE;
|
||||
STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE;
|
||||
STDMETHOD(SetVertexShader)(THIS_ LPDIRECT3DVERTEXSHADER9 pShader) PURE;
|
||||
STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT RegisterIndex, CONST FLOAT *pConstantData, UINT RegisterCount) PURE;
|
||||
STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT RegisterIndex, CONST INT *pConstantData, UINT RegisterCount) PURE;
|
||||
STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT RegisterIndex, CONST BOOL *pConstantData, UINT RegisterCount) PURE;
|
||||
STDMETHOD(SetPixelShader)(THIS_ LPDIRECT3DPIXELSHADER9 pShader) PURE;
|
||||
STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT RegisterIndex, CONST FLOAT *pConstantData, UINT RegisterCount) PURE;
|
||||
STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT RegisterIndex, CONST INT *pConstantData, UINT RegisterCount) PURE;
|
||||
STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT RegisterIndex, CONST BOOL *pConstantData, UINT RegisterCount) PURE;
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXEffect ///////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef interface ID3DXEffect ID3DXEffect;
|
||||
typedef interface ID3DXEffect *LPD3DXEFFECT;
|
||||
|
||||
// {F6CEB4B3-4E4C-40dd-B883-8D8DE5EA0CD5}
|
||||
DEFINE_GUID(IID_ID3DXEffect,
|
||||
0xf6ceb4b3, 0x4e4c, 0x40dd, 0xb8, 0x83, 0x8d, 0x8d, 0xe5, 0xea, 0xc, 0xd5);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXEffect
|
||||
|
||||
DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect)
|
||||
{
|
||||
// ID3DXBaseEffect
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// Descs
|
||||
STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE;
|
||||
STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE;
|
||||
STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
|
||||
STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE;
|
||||
STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE;
|
||||
|
||||
// Handle operations
|
||||
STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE;
|
||||
|
||||
// Get/Set Parameters
|
||||
STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE;
|
||||
STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE;
|
||||
STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE;
|
||||
STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE;
|
||||
STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE;
|
||||
STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE;
|
||||
STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE;
|
||||
STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE;
|
||||
STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE;
|
||||
STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE;
|
||||
STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE;
|
||||
STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE;
|
||||
STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE;
|
||||
STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE;
|
||||
STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE;
|
||||
STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE;
|
||||
STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
|
||||
STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE;
|
||||
STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
|
||||
STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
|
||||
STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
|
||||
STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
|
||||
STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
|
||||
STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
|
||||
STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
|
||||
STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
|
||||
STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
|
||||
STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
|
||||
STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
|
||||
STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
|
||||
STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE;
|
||||
STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE;
|
||||
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
|
||||
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE;
|
||||
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE;
|
||||
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE;
|
||||
|
||||
//Set Range of an Array to pass to device
|
||||
//Usefull for sending only a subrange of an array down to the device
|
||||
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE;
|
||||
// ID3DXBaseEffect
|
||||
|
||||
|
||||
// Pool
|
||||
STDMETHOD(GetPool)(THIS_ LPD3DXEFFECTPOOL* ppPool) PURE;
|
||||
|
||||
// Selecting and setting a technique
|
||||
STDMETHOD(SetTechnique)(THIS_ D3DXHANDLE hTechnique) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetCurrentTechnique)(THIS) PURE;
|
||||
STDMETHOD(ValidateTechnique)(THIS_ D3DXHANDLE hTechnique) PURE;
|
||||
STDMETHOD(FindNextValidTechnique)(THIS_ D3DXHANDLE hTechnique, D3DXHANDLE *pTechnique) PURE;
|
||||
STDMETHOD_(BOOL, IsParameterUsed)(THIS_ D3DXHANDLE hParameter, D3DXHANDLE hTechnique) PURE;
|
||||
|
||||
// Using current technique
|
||||
// Begin starts active technique
|
||||
// BeginPass begins a pass
|
||||
// CommitChanges updates changes to any set calls in the pass. This should be called before
|
||||
// any DrawPrimitive call to d3d
|
||||
// EndPass ends a pass
|
||||
// End ends active technique
|
||||
STDMETHOD(Begin)(THIS_ UINT *pPasses, DWORD Flags) PURE;
|
||||
STDMETHOD(BeginPass)(THIS_ UINT Pass) PURE;
|
||||
STDMETHOD(CommitChanges)(THIS) PURE;
|
||||
STDMETHOD(EndPass)(THIS) PURE;
|
||||
STDMETHOD(End)(THIS) PURE;
|
||||
|
||||
// Managing D3D Device
|
||||
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE;
|
||||
STDMETHOD(OnLostDevice)(THIS) PURE;
|
||||
STDMETHOD(OnResetDevice)(THIS) PURE;
|
||||
|
||||
// Logging device calls
|
||||
STDMETHOD(SetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER pManager) PURE;
|
||||
STDMETHOD(GetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER *ppManager) PURE;
|
||||
|
||||
// Parameter blocks
|
||||
STDMETHOD(BeginParameterBlock)(THIS) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, EndParameterBlock)(THIS) PURE;
|
||||
STDMETHOD(ApplyParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE;
|
||||
STDMETHOD(DeleteParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE;
|
||||
|
||||
// Cloning
|
||||
STDMETHOD(CloneEffect)(THIS_ LPDIRECT3DDEVICE9 pDevice, LPD3DXEFFECT* ppEffect) PURE;
|
||||
|
||||
// Fast path for setting variables directly in ID3DXEffect
|
||||
STDMETHOD(SetRawValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT ByteOffset, UINT Bytes) PURE;
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXEffectCompiler ///////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef interface ID3DXEffectCompiler ID3DXEffectCompiler;
|
||||
typedef interface ID3DXEffectCompiler *LPD3DXEFFECTCOMPILER;
|
||||
|
||||
// {51B8A949-1A31-47e6-BEA0-4B30DB53F1E0}
|
||||
DEFINE_GUID(IID_ID3DXEffectCompiler,
|
||||
0x51b8a949, 0x1a31, 0x47e6, 0xbe, 0xa0, 0x4b, 0x30, 0xdb, 0x53, 0xf1, 0xe0);
|
||||
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXEffectCompiler
|
||||
|
||||
DECLARE_INTERFACE_(ID3DXEffectCompiler, ID3DXBaseEffect)
|
||||
{
|
||||
// ID3DXBaseEffect
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
// Descs
|
||||
STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE;
|
||||
STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE;
|
||||
STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
|
||||
STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE;
|
||||
STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE;
|
||||
|
||||
// Handle operations
|
||||
STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE;
|
||||
STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE;
|
||||
|
||||
// Get/Set Parameters
|
||||
STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE;
|
||||
STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE;
|
||||
STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE;
|
||||
STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE;
|
||||
STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE;
|
||||
STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE;
|
||||
STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE;
|
||||
STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE;
|
||||
STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE;
|
||||
STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE;
|
||||
STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE;
|
||||
STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE;
|
||||
STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE;
|
||||
STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE;
|
||||
STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE;
|
||||
STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE;
|
||||
STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
|
||||
STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE;
|
||||
STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
|
||||
STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
|
||||
STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
|
||||
STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
|
||||
STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
|
||||
STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
|
||||
STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE;
|
||||
STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE;
|
||||
STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
|
||||
STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE;
|
||||
STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
|
||||
STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE;
|
||||
STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE;
|
||||
STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE;
|
||||
STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE;
|
||||
STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE;
|
||||
STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE;
|
||||
STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE;
|
||||
|
||||
//Set Range of an Array to pass to device
|
||||
//Usefull for sending only a subrange of an array down to the device
|
||||
STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE;
|
||||
// ID3DXBaseEffect
|
||||
|
||||
// Parameter sharing, specialization, and information
|
||||
STDMETHOD(SetLiteral)(THIS_ D3DXHANDLE hParameter, BOOL Literal) PURE;
|
||||
STDMETHOD(GetLiteral)(THIS_ D3DXHANDLE hParameter, BOOL *pLiteral) PURE;
|
||||
|
||||
// Compilation
|
||||
STDMETHOD(CompileEffect)(THIS_ DWORD Flags,
|
||||
LPD3DXBUFFER* ppEffect, LPD3DXBUFFER* ppErrorMsgs) PURE;
|
||||
|
||||
STDMETHOD(CompileShader)(THIS_ D3DXHANDLE hFunction, LPCSTR pTarget, DWORD Flags,
|
||||
LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs, LPD3DXCONSTANTTABLE* ppConstantTable) PURE;
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// APIs //////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXCreateEffectPool:
|
||||
// ---------------------
|
||||
// Creates an effect pool. Pools are used for sharing parameters between
|
||||
// multiple effects. For all effects within a pool, shared parameters of the
|
||||
// same name all share the same value.
|
||||
//
|
||||
// Parameters:
|
||||
// ppPool
|
||||
// Returns the created pool.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectPool(
|
||||
LPD3DXEFFECTPOOL* ppPool);
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXCreateEffect:
|
||||
// -----------------
|
||||
// Creates an effect from an ascii or binary effect description.
|
||||
//
|
||||
// Parameters:
|
||||
// pDevice
|
||||
// Pointer of the device on which to create the effect
|
||||
// pSrcFile
|
||||
// Name of the file containing the effect description
|
||||
// hSrcModule
|
||||
// Module handle. if NULL, current module will be used.
|
||||
// pSrcResource
|
||||
// Resource name in module
|
||||
// pSrcData
|
||||
// Pointer to effect description
|
||||
// SrcDataSize
|
||||
// Size of the effect description in bytes
|
||||
// pDefines
|
||||
// Optional NULL-terminated array of preprocessor macro definitions.
|
||||
// Flags
|
||||
// See D3DXSHADER_xxx flags.
|
||||
// pSkipConstants
|
||||
// A list of semi-colon delimited variable names. The effect will
|
||||
// not set these variables to the device when they are referenced
|
||||
// by a shader. NOTE: the variables specified here must be
|
||||
// register bound in the file and must not be used in expressions
|
||||
// in passes or samplers or the file will not load.
|
||||
// pInclude
|
||||
// Optional interface pointer to use for handling #include directives.
|
||||
// If this parameter is NULL, #includes will be honored when compiling
|
||||
// from file, and will error when compiling from resource or memory.
|
||||
// pPool
|
||||
// Pointer to ID3DXEffectPool object to use for shared parameters.
|
||||
// If NULL, no parameters will be shared.
|
||||
// ppEffect
|
||||
// Returns a buffer containing created effect.
|
||||
// ppCompilationErrors
|
||||
// Returns a buffer containing any error messages which occurred during
|
||||
// compile. Or NULL if you do not care about the error messages.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectFromFileA(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
LPCSTR pSrcFile,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTPOOL pPool,
|
||||
LPD3DXEFFECT* ppEffect,
|
||||
LPD3DXBUFFER* ppCompilationErrors);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectFromFileW(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
LPCWSTR pSrcFile,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTPOOL pPool,
|
||||
LPD3DXEFFECT* ppEffect,
|
||||
LPD3DXBUFFER* ppCompilationErrors);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileW
|
||||
#else
|
||||
#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileA
|
||||
#endif
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectFromResourceA(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
HMODULE hSrcModule,
|
||||
LPCSTR pSrcResource,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTPOOL pPool,
|
||||
LPD3DXEFFECT* ppEffect,
|
||||
LPD3DXBUFFER* ppCompilationErrors);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectFromResourceW(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
HMODULE hSrcModule,
|
||||
LPCWSTR pSrcResource,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTPOOL pPool,
|
||||
LPD3DXEFFECT* ppEffect,
|
||||
LPD3DXBUFFER* ppCompilationErrors);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceW
|
||||
#else
|
||||
#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceA
|
||||
#endif
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffect(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
LPCVOID pSrcData,
|
||||
UINT SrcDataLen,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTPOOL pPool,
|
||||
LPD3DXEFFECT* ppEffect,
|
||||
LPD3DXBUFFER* ppCompilationErrors);
|
||||
|
||||
//
|
||||
// Ex functions that accept pSkipConstants in addition to other parameters
|
||||
//
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectFromFileExA(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
LPCSTR pSrcFile,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
LPCSTR pSkipConstants,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTPOOL pPool,
|
||||
LPD3DXEFFECT* ppEffect,
|
||||
LPD3DXBUFFER* ppCompilationErrors);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectFromFileExW(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
LPCWSTR pSrcFile,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
LPCSTR pSkipConstants,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTPOOL pPool,
|
||||
LPD3DXEFFECT* ppEffect,
|
||||
LPD3DXBUFFER* ppCompilationErrors);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExW
|
||||
#else
|
||||
#define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExA
|
||||
#endif
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectFromResourceExA(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
HMODULE hSrcModule,
|
||||
LPCSTR pSrcResource,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
LPCSTR pSkipConstants,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTPOOL pPool,
|
||||
LPD3DXEFFECT* ppEffect,
|
||||
LPD3DXBUFFER* ppCompilationErrors);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectFromResourceExW(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
HMODULE hSrcModule,
|
||||
LPCWSTR pSrcResource,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
LPCSTR pSkipConstants,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTPOOL pPool,
|
||||
LPD3DXEFFECT* ppEffect,
|
||||
LPD3DXBUFFER* ppCompilationErrors);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExW
|
||||
#else
|
||||
#define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExA
|
||||
#endif
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectEx(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
LPCVOID pSrcData,
|
||||
UINT SrcDataLen,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
LPCSTR pSkipConstants,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTPOOL pPool,
|
||||
LPD3DXEFFECT* ppEffect,
|
||||
LPD3DXBUFFER* ppCompilationErrors);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXCreateEffectCompiler:
|
||||
// -------------------------
|
||||
// Creates an effect from an ascii or binary effect description.
|
||||
//
|
||||
// Parameters:
|
||||
// pSrcFile
|
||||
// Name of the file containing the effect description
|
||||
// hSrcModule
|
||||
// Module handle. if NULL, current module will be used.
|
||||
// pSrcResource
|
||||
// Resource name in module
|
||||
// pSrcData
|
||||
// Pointer to effect description
|
||||
// SrcDataSize
|
||||
// Size of the effect description in bytes
|
||||
// pDefines
|
||||
// Optional NULL-terminated array of preprocessor macro definitions.
|
||||
// pInclude
|
||||
// Optional interface pointer to use for handling #include directives.
|
||||
// If this parameter is NULL, #includes will be honored when compiling
|
||||
// from file, and will error when compiling from resource or memory.
|
||||
// pPool
|
||||
// Pointer to ID3DXEffectPool object to use for shared parameters.
|
||||
// If NULL, no parameters will be shared.
|
||||
// ppCompiler
|
||||
// Returns a buffer containing created effect compiler.
|
||||
// ppParseErrors
|
||||
// Returns a buffer containing any error messages which occurred during
|
||||
// parse. Or NULL if you do not care about the error messages.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectCompilerFromFileA(
|
||||
LPCSTR pSrcFile,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTCOMPILER* ppCompiler,
|
||||
LPD3DXBUFFER* ppParseErrors);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectCompilerFromFileW(
|
||||
LPCWSTR pSrcFile,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTCOMPILER* ppCompiler,
|
||||
LPD3DXBUFFER* ppParseErrors);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DXCreateEffectCompilerFromFile D3DXCreateEffectCompilerFromFileW
|
||||
#else
|
||||
#define D3DXCreateEffectCompilerFromFile D3DXCreateEffectCompilerFromFileA
|
||||
#endif
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectCompilerFromResourceA(
|
||||
HMODULE hSrcModule,
|
||||
LPCSTR pSrcResource,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTCOMPILER* ppCompiler,
|
||||
LPD3DXBUFFER* ppParseErrors);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectCompilerFromResourceW(
|
||||
HMODULE hSrcModule,
|
||||
LPCWSTR pSrcResource,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTCOMPILER* ppCompiler,
|
||||
LPD3DXBUFFER* ppParseErrors);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DXCreateEffectCompilerFromResource D3DXCreateEffectCompilerFromResourceW
|
||||
#else
|
||||
#define D3DXCreateEffectCompilerFromResource D3DXCreateEffectCompilerFromResourceA
|
||||
#endif
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateEffectCompiler(
|
||||
LPCSTR pSrcData,
|
||||
UINT SrcDataLen,
|
||||
CONST D3DXMACRO* pDefines,
|
||||
LPD3DXINCLUDE pInclude,
|
||||
DWORD Flags,
|
||||
LPD3DXEFFECTCOMPILER* ppCompiler,
|
||||
LPD3DXBUFFER* ppParseErrors);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXDisassembleEffect:
|
||||
// -----------------------
|
||||
//
|
||||
// Parameters:
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXDisassembleEffect(
|
||||
LPD3DXEFFECT pEffect,
|
||||
BOOL EnableColorCode,
|
||||
LPD3DXBUFFER *ppDisassembly);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3DX9EFFECT_H__
|
||||
|
||||
|
1796
SDK/Include/d3dx9math.h
Normal file
1796
SDK/Include/d3dx9math.h
Normal file
File diff suppressed because it is too large
Load Diff
2251
SDK/Include/d3dx9math.inl
Normal file
2251
SDK/Include/d3dx9math.inl
Normal file
File diff suppressed because it is too large
Load Diff
3007
SDK/Include/d3dx9mesh.h
Normal file
3007
SDK/Include/d3dx9mesh.h
Normal file
File diff suppressed because it is too large
Load Diff
1010
SDK/Include/d3dx9shader.h
Normal file
1010
SDK/Include/d3dx9shader.h
Normal file
File diff suppressed because it is too large
Load Diff
221
SDK/Include/d3dx9shape.h
Normal file
221
SDK/Include/d3dx9shape.h
Normal file
@ -0,0 +1,221 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||
//
|
||||
// File: d3dx9shapes.h
|
||||
// Content: D3DX simple shapes
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "d3dx9.h"
|
||||
|
||||
#ifndef __D3DX9SHAPES_H__
|
||||
#define __D3DX9SHAPES_H__
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Functions:
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// D3DXCreatePolygon:
|
||||
// ------------------
|
||||
// Creates a mesh containing an n-sided polygon. The polygon is centered
|
||||
// at the origin.
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
// pDevice The D3D device with which the mesh is going to be used.
|
||||
// Length Length of each side.
|
||||
// Sides Number of sides the polygon has. (Must be >= 3)
|
||||
// ppMesh The mesh object which will be created
|
||||
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
|
||||
//-------------------------------------------------------------------------
|
||||
HRESULT WINAPI
|
||||
D3DXCreatePolygon(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
FLOAT Length,
|
||||
UINT Sides,
|
||||
LPD3DXMESH* ppMesh,
|
||||
LPD3DXBUFFER* ppAdjacency);
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// D3DXCreateBox:
|
||||
// --------------
|
||||
// Creates a mesh containing an axis-aligned box. The box is centered at
|
||||
// the origin.
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
// pDevice The D3D device with which the mesh is going to be used.
|
||||
// Width Width of box (along X-axis)
|
||||
// Height Height of box (along Y-axis)
|
||||
// Depth Depth of box (along Z-axis)
|
||||
// ppMesh The mesh object which will be created
|
||||
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
|
||||
//-------------------------------------------------------------------------
|
||||
HRESULT WINAPI
|
||||
D3DXCreateBox(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
FLOAT Width,
|
||||
FLOAT Height,
|
||||
FLOAT Depth,
|
||||
LPD3DXMESH* ppMesh,
|
||||
LPD3DXBUFFER* ppAdjacency);
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// D3DXCreateCylinder:
|
||||
// -------------------
|
||||
// Creates a mesh containing a cylinder. The generated cylinder is
|
||||
// centered at the origin, and its axis is aligned with the Z-axis.
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
// pDevice The D3D device with which the mesh is going to be used.
|
||||
// Radius1 Radius at -Z end (should be >= 0.0f)
|
||||
// Radius2 Radius at +Z end (should be >= 0.0f)
|
||||
// Length Length of cylinder (along Z-axis)
|
||||
// Slices Number of slices about the main axis
|
||||
// Stacks Number of stacks along the main axis
|
||||
// ppMesh The mesh object which will be created
|
||||
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
|
||||
//-------------------------------------------------------------------------
|
||||
HRESULT WINAPI
|
||||
D3DXCreateCylinder(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
FLOAT Radius1,
|
||||
FLOAT Radius2,
|
||||
FLOAT Length,
|
||||
UINT Slices,
|
||||
UINT Stacks,
|
||||
LPD3DXMESH* ppMesh,
|
||||
LPD3DXBUFFER* ppAdjacency);
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// D3DXCreateSphere:
|
||||
// -----------------
|
||||
// Creates a mesh containing a sphere. The sphere is centered at the
|
||||
// origin.
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
// pDevice The D3D device with which the mesh is going to be used.
|
||||
// Radius Radius of the sphere (should be >= 0.0f)
|
||||
// Slices Number of slices about the main axis
|
||||
// Stacks Number of stacks along the main axis
|
||||
// ppMesh The mesh object which will be created
|
||||
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
|
||||
//-------------------------------------------------------------------------
|
||||
HRESULT WINAPI
|
||||
D3DXCreateSphere(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
FLOAT Radius,
|
||||
UINT Slices,
|
||||
UINT Stacks,
|
||||
LPD3DXMESH* ppMesh,
|
||||
LPD3DXBUFFER* ppAdjacency);
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// D3DXCreateTorus:
|
||||
// ----------------
|
||||
// Creates a mesh containing a torus. The generated torus is centered at
|
||||
// the origin, and its axis is aligned with the Z-axis.
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
// pDevice The D3D device with which the mesh is going to be used.
|
||||
// InnerRadius Inner radius of the torus (should be >= 0.0f)
|
||||
// OuterRadius Outer radius of the torue (should be >= 0.0f)
|
||||
// Sides Number of sides in a cross-section (must be >= 3)
|
||||
// Rings Number of rings making up the torus (must be >= 3)
|
||||
// ppMesh The mesh object which will be created
|
||||
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
|
||||
//-------------------------------------------------------------------------
|
||||
HRESULT WINAPI
|
||||
D3DXCreateTorus(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
FLOAT InnerRadius,
|
||||
FLOAT OuterRadius,
|
||||
UINT Sides,
|
||||
UINT Rings,
|
||||
LPD3DXMESH* ppMesh,
|
||||
LPD3DXBUFFER* ppAdjacency);
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// D3DXCreateTeapot:
|
||||
// -----------------
|
||||
// Creates a mesh containing a teapot.
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
// pDevice The D3D device with which the mesh is going to be used.
|
||||
// ppMesh The mesh object which will be created
|
||||
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
|
||||
//-------------------------------------------------------------------------
|
||||
HRESULT WINAPI
|
||||
D3DXCreateTeapot(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
LPD3DXMESH* ppMesh,
|
||||
LPD3DXBUFFER* ppAdjacency);
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// D3DXCreateText:
|
||||
// ---------------
|
||||
// Creates a mesh containing the specified text using the font associated
|
||||
// with the device context.
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
// pDevice The D3D device with which the mesh is going to be used.
|
||||
// hDC Device context, with desired font selected
|
||||
// pText Text to generate
|
||||
// Deviation Maximum chordal deviation from true font outlines
|
||||
// Extrusion Amount to extrude text in -Z direction
|
||||
// ppMesh The mesh object which will be created
|
||||
// pGlyphMetrics Address of buffer to receive glyph metric data (or NULL)
|
||||
//-------------------------------------------------------------------------
|
||||
HRESULT WINAPI
|
||||
D3DXCreateTextA(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
HDC hDC,
|
||||
LPCSTR pText,
|
||||
FLOAT Deviation,
|
||||
FLOAT Extrusion,
|
||||
LPD3DXMESH* ppMesh,
|
||||
LPD3DXBUFFER* ppAdjacency,
|
||||
LPGLYPHMETRICSFLOAT pGlyphMetrics);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DXCreateTextW(
|
||||
LPDIRECT3DDEVICE9 pDevice,
|
||||
HDC hDC,
|
||||
LPCWSTR pText,
|
||||
FLOAT Deviation,
|
||||
FLOAT Extrusion,
|
||||
LPD3DXMESH* ppMesh,
|
||||
LPD3DXBUFFER* ppAdjacency,
|
||||
LPGLYPHMETRICSFLOAT pGlyphMetrics);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DXCreateText D3DXCreateTextW
|
||||
#else
|
||||
#define D3DXCreateText D3DXCreateTextA
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3DX9SHAPES_H__
|
||||
|
1735
SDK/Include/d3dx9tex.h
Normal file
1735
SDK/Include/d3dx9tex.h
Normal file
File diff suppressed because it is too large
Load Diff
299
SDK/Include/d3dx9xof.h
Normal file
299
SDK/Include/d3dx9xof.h
Normal file
@ -0,0 +1,299 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||
//
|
||||
// File: d3dx9xof.h
|
||||
// Content: D3DX .X File types and functions
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "d3dx9.h"
|
||||
|
||||
#if !defined( __D3DX9XOF_H__ )
|
||||
#define __D3DX9XOF_H__
|
||||
|
||||
#if defined( __cplusplus )
|
||||
extern "C" {
|
||||
#endif // defined( __cplusplus )
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXF_FILEFORMAT
|
||||
// This flag is used to specify what file type to use when saving to disk.
|
||||
// _BINARY, and _TEXT are mutually exclusive, while
|
||||
// _COMPRESSED is an optional setting that works with all file types.
|
||||
//----------------------------------------------------------------------------
|
||||
typedef DWORD D3DXF_FILEFORMAT;
|
||||
|
||||
#define D3DXF_FILEFORMAT_BINARY 0
|
||||
#define D3DXF_FILEFORMAT_TEXT 1
|
||||
#define D3DXF_FILEFORMAT_COMPRESSED 2
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXF_FILESAVEOPTIONS
|
||||
// This flag is used to specify where to save the file to. Each flag is
|
||||
// mutually exclusive, indicates the data location of the file, and also
|
||||
// chooses which additional data will specify the location.
|
||||
// _TOFILE is paired with a filename (LPCSTR)
|
||||
// _TOWFILE is paired with a filename (LPWSTR)
|
||||
//----------------------------------------------------------------------------
|
||||
typedef DWORD D3DXF_FILESAVEOPTIONS;
|
||||
|
||||
#define D3DXF_FILESAVE_TOFILE 0x00L
|
||||
#define D3DXF_FILESAVE_TOWFILE 0x01L
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXF_FILELOADOPTIONS
|
||||
// This flag is used to specify where to load the file from. Each flag is
|
||||
// mutually exclusive, indicates the data location of the file, and also
|
||||
// chooses which additional data will specify the location.
|
||||
// _FROMFILE is paired with a filename (LPCSTR)
|
||||
// _FROMWFILE is paired with a filename (LPWSTR)
|
||||
// _FROMRESOURCE is paired with a (D3DXF_FILELOADRESOUCE*) description.
|
||||
// _FROMMEMORY is paired with a (D3DXF_FILELOADMEMORY*) description.
|
||||
//----------------------------------------------------------------------------
|
||||
typedef DWORD D3DXF_FILELOADOPTIONS;
|
||||
|
||||
#define D3DXF_FILELOAD_FROMFILE 0x00L
|
||||
#define D3DXF_FILELOAD_FROMWFILE 0x01L
|
||||
#define D3DXF_FILELOAD_FROMRESOURCE 0x02L
|
||||
#define D3DXF_FILELOAD_FROMMEMORY 0x03L
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXF_FILELOADRESOURCE:
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef struct _D3DXF_FILELOADRESOURCE
|
||||
{
|
||||
HMODULE hModule; // Desc
|
||||
LPCSTR lpName; // Desc
|
||||
LPCSTR lpType; // Desc
|
||||
} D3DXF_FILELOADRESOURCE;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DXF_FILELOADMEMORY:
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef struct _D3DXF_FILELOADMEMORY
|
||||
{
|
||||
LPCVOID lpMemory; // Desc
|
||||
SIZE_T dSize; // Desc
|
||||
} D3DXF_FILELOADMEMORY;
|
||||
|
||||
#if defined( _WIN32 ) && !defined( _NO_COM )
|
||||
|
||||
// {cef08cf9-7b4f-4429-9624-2a690a933201}
|
||||
DEFINE_GUID( IID_ID3DXFile,
|
||||
0xcef08cf9, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
|
||||
|
||||
// {cef08cfa-7b4f-4429-9624-2a690a933201}
|
||||
DEFINE_GUID( IID_ID3DXFileSaveObject,
|
||||
0xcef08cfa, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
|
||||
|
||||
// {cef08cfb-7b4f-4429-9624-2a690a933201}
|
||||
DEFINE_GUID( IID_ID3DXFileSaveData,
|
||||
0xcef08cfb, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
|
||||
|
||||
// {cef08cfc-7b4f-4429-9624-2a690a933201}
|
||||
DEFINE_GUID( IID_ID3DXFileEnumObject,
|
||||
0xcef08cfc, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
|
||||
|
||||
// {cef08cfd-7b4f-4429-9624-2a690a933201}
|
||||
DEFINE_GUID( IID_ID3DXFileData,
|
||||
0xcef08cfd, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
|
||||
|
||||
#endif // defined( _WIN32 ) && !defined( _NO_COM )
|
||||
|
||||
#if defined( __cplusplus )
|
||||
#if !defined( DECLSPEC_UUID )
|
||||
#if _MSC_VER >= 1100
|
||||
#define DECLSPEC_UUID( x ) __declspec( uuid( x ) )
|
||||
#else // !( _MSC_VER >= 1100 )
|
||||
#define DECLSPEC_UUID( x )
|
||||
#endif // !( _MSC_VER >= 1100 )
|
||||
#endif // !defined( DECLSPEC_UUID )
|
||||
|
||||
interface DECLSPEC_UUID( "cef08cf9-7b4f-4429-9624-2a690a933201" )
|
||||
ID3DXFile;
|
||||
interface DECLSPEC_UUID( "cef08cfa-7b4f-4429-9624-2a690a933201" )
|
||||
ID3DXFileSaveObject;
|
||||
interface DECLSPEC_UUID( "cef08cfb-7b4f-4429-9624-2a690a933201" )
|
||||
ID3DXFileSaveData;
|
||||
interface DECLSPEC_UUID( "cef08cfc-7b4f-4429-9624-2a690a933201" )
|
||||
ID3DXFileEnumObject;
|
||||
interface DECLSPEC_UUID( "cef08cfd-7b4f-4429-9624-2a690a933201" )
|
||||
ID3DXFileData;
|
||||
|
||||
#if defined( _COM_SMARTPTR_TYPEDEF )
|
||||
_COM_SMARTPTR_TYPEDEF( ID3DXFile,
|
||||
__uuidof( ID3DXFile ) );
|
||||
_COM_SMARTPTR_TYPEDEF( ID3DXFileSaveObject,
|
||||
__uuidof( ID3DXFileSaveObject ) );
|
||||
_COM_SMARTPTR_TYPEDEF( ID3DXFileSaveData,
|
||||
__uuidof( ID3DXFileSaveData ) );
|
||||
_COM_SMARTPTR_TYPEDEF( ID3DXFileEnumObject,
|
||||
__uuidof( ID3DXFileEnumObject ) );
|
||||
_COM_SMARTPTR_TYPEDEF( ID3DXFileData,
|
||||
__uuidof( ID3DXFileData ) );
|
||||
#endif // defined( _COM_SMARTPTR_TYPEDEF )
|
||||
#endif // defined( __cplusplus )
|
||||
|
||||
typedef interface ID3DXFile ID3DXFile;
|
||||
typedef interface ID3DXFileSaveObject ID3DXFileSaveObject;
|
||||
typedef interface ID3DXFileSaveData ID3DXFileSaveData;
|
||||
typedef interface ID3DXFileEnumObject ID3DXFileEnumObject;
|
||||
typedef interface ID3DXFileData ID3DXFileData;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXFile /////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXFile
|
||||
|
||||
DECLARE_INTERFACE_( ID3DXFile, IUnknown )
|
||||
{
|
||||
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
|
||||
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
|
||||
STDMETHOD_( ULONG, Release )( THIS ) PURE;
|
||||
|
||||
STDMETHOD( CreateEnumObject )( THIS_ LPCVOID, D3DXF_FILELOADOPTIONS,
|
||||
ID3DXFileEnumObject** ) PURE;
|
||||
STDMETHOD( CreateSaveObject )( THIS_ LPCVOID, D3DXF_FILESAVEOPTIONS,
|
||||
D3DXF_FILEFORMAT, ID3DXFileSaveObject** ) PURE;
|
||||
STDMETHOD( RegisterTemplates )( THIS_ LPCVOID, SIZE_T ) PURE;
|
||||
STDMETHOD( RegisterEnumTemplates )( THIS_ ID3DXFileEnumObject* ) PURE;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXFileSaveObject ///////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXFileSaveObject
|
||||
|
||||
DECLARE_INTERFACE_( ID3DXFileSaveObject, IUnknown )
|
||||
{
|
||||
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
|
||||
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
|
||||
STDMETHOD_( ULONG, Release )( THIS ) PURE;
|
||||
|
||||
STDMETHOD( GetFile )( THIS_ ID3DXFile** ) PURE;
|
||||
STDMETHOD( AddDataObject )( THIS_ REFGUID, LPCSTR, CONST GUID*,
|
||||
SIZE_T, LPCVOID, ID3DXFileSaveData** ) PURE;
|
||||
STDMETHOD( Save )( THIS ) PURE;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXFileSaveData /////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXFileSaveData
|
||||
|
||||
DECLARE_INTERFACE_( ID3DXFileSaveData, IUnknown )
|
||||
{
|
||||
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
|
||||
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
|
||||
STDMETHOD_( ULONG, Release )( THIS ) PURE;
|
||||
|
||||
STDMETHOD( GetSave )( THIS_ ID3DXFileSaveObject** ) PURE;
|
||||
STDMETHOD( GetName )( THIS_ LPSTR, SIZE_T* ) PURE;
|
||||
STDMETHOD( GetId )( THIS_ LPGUID ) PURE;
|
||||
STDMETHOD( GetType )( THIS_ GUID* ) PURE;
|
||||
STDMETHOD( AddDataObject )( THIS_ REFGUID, LPCSTR, CONST GUID*,
|
||||
SIZE_T, LPCVOID, ID3DXFileSaveData** ) PURE;
|
||||
STDMETHOD( AddDataReference )( THIS_ LPCSTR, CONST GUID* ) PURE;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXFileEnumObject ///////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXFileEnumObject
|
||||
|
||||
DECLARE_INTERFACE_( ID3DXFileEnumObject, IUnknown )
|
||||
{
|
||||
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
|
||||
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
|
||||
STDMETHOD_( ULONG, Release )( THIS ) PURE;
|
||||
|
||||
STDMETHOD( GetFile )( THIS_ ID3DXFile** ) PURE;
|
||||
STDMETHOD( GetChildren )( THIS_ SIZE_T* ) PURE;
|
||||
STDMETHOD( GetChild )( THIS_ SIZE_T, ID3DXFileData** ) PURE;
|
||||
STDMETHOD( GetDataObjectById )( THIS_ REFGUID, ID3DXFileData** ) PURE;
|
||||
STDMETHOD( GetDataObjectByName )( THIS_ LPCSTR, ID3DXFileData** ) PURE;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ID3DXFileData /////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3DXFileData
|
||||
|
||||
DECLARE_INTERFACE_( ID3DXFileData, IUnknown )
|
||||
{
|
||||
STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
|
||||
STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
|
||||
STDMETHOD_( ULONG, Release )( THIS ) PURE;
|
||||
|
||||
STDMETHOD( GetEnum )( THIS_ ID3DXFileEnumObject** ) PURE;
|
||||
STDMETHOD( GetName )( THIS_ LPSTR, SIZE_T* ) PURE;
|
||||
STDMETHOD( GetId )( THIS_ LPGUID ) PURE;
|
||||
STDMETHOD( Lock )( THIS_ SIZE_T*, LPCVOID* ) PURE;
|
||||
STDMETHOD( Unlock )( THIS ) PURE;
|
||||
STDMETHOD( GetType )( THIS_ GUID* ) PURE;
|
||||
STDMETHOD_( BOOL, IsReference )( THIS ) PURE;
|
||||
STDMETHOD( GetChildren )( THIS_ SIZE_T* ) PURE;
|
||||
STDMETHOD( GetChild )( THIS_ SIZE_T, ID3DXFileData** ) PURE;
|
||||
};
|
||||
|
||||
STDAPI D3DXFileCreate( ID3DXFile** lplpDirectXFile );
|
||||
|
||||
/*
|
||||
* DirectX File errors.
|
||||
*/
|
||||
|
||||
#define _FACD3DXF 0x876
|
||||
|
||||
#define D3DXFERR_BADOBJECT MAKE_HRESULT( 1, _FACD3DXF, 900 )
|
||||
#define D3DXFERR_BADVALUE MAKE_HRESULT( 1, _FACD3DXF, 901 )
|
||||
#define D3DXFERR_BADTYPE MAKE_HRESULT( 1, _FACD3DXF, 902 )
|
||||
#define D3DXFERR_NOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 903 )
|
||||
#define D3DXFERR_NOTDONEYET MAKE_HRESULT( 1, _FACD3DXF, 904 )
|
||||
#define D3DXFERR_FILENOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 905 )
|
||||
#define D3DXFERR_RESOURCENOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 906 )
|
||||
#define D3DXFERR_BADRESOURCE MAKE_HRESULT( 1, _FACD3DXF, 907 )
|
||||
#define D3DXFERR_BADFILETYPE MAKE_HRESULT( 1, _FACD3DXF, 908 )
|
||||
#define D3DXFERR_BADFILEVERSION MAKE_HRESULT( 1, _FACD3DXF, 909 )
|
||||
#define D3DXFERR_BADFILEFLOATSIZE MAKE_HRESULT( 1, _FACD3DXF, 910 )
|
||||
#define D3DXFERR_BADFILE MAKE_HRESULT( 1, _FACD3DXF, 911 )
|
||||
#define D3DXFERR_PARSEERROR MAKE_HRESULT( 1, _FACD3DXF, 912 )
|
||||
#define D3DXFERR_BADARRAYSIZE MAKE_HRESULT( 1, _FACD3DXF, 913 )
|
||||
#define D3DXFERR_BADDATAREFERENCE MAKE_HRESULT( 1, _FACD3DXF, 914 )
|
||||
#define D3DXFERR_NOMOREOBJECTS MAKE_HRESULT( 1, _FACD3DXF, 915 )
|
||||
#define D3DXFERR_NOMOREDATA MAKE_HRESULT( 1, _FACD3DXF, 916 )
|
||||
#define D3DXFERR_BADCACHEFILE MAKE_HRESULT( 1, _FACD3DXF, 917 )
|
||||
|
||||
/*
|
||||
* DirectX File object types.
|
||||
*/
|
||||
|
||||
#ifndef WIN_TYPES
|
||||
#define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype
|
||||
#endif
|
||||
|
||||
WIN_TYPES(ID3DXFile, D3DXFILE);
|
||||
WIN_TYPES(ID3DXFileEnumObject, D3DXFILEENUMOBJECT);
|
||||
WIN_TYPES(ID3DXFileSaveObject, D3DXFILESAVEOBJECT);
|
||||
WIN_TYPES(ID3DXFileData, D3DXFILEDATA);
|
||||
WIN_TYPES(ID3DXFileSaveData, D3DXFILESAVEDATA);
|
||||
|
||||
#if defined( __cplusplus )
|
||||
} // extern "C"
|
||||
#endif // defined( __cplusplus )
|
||||
|
||||
#endif // !defined( __D3DX9XOF_H__ )
|
||||
|
||||
|
94
SDK/Include/detours.cpp
Normal file
94
SDK/Include/detours.cpp
Normal file
@ -0,0 +1,94 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
// Matthew L (Azorbix)
|
||||
// detours.cpp/h
|
||||
//
|
||||
// Created for Game-Deception
|
||||
//
|
||||
// Credits:
|
||||
// Dom1n1k
|
||||
// LanceVorgin
|
||||
// P47R!CK
|
||||
//
|
||||
// Changes by Hans211:
|
||||
// - use mlde32 instead of ade32
|
||||
// - store length of hook in 1st byte of allocated room
|
||||
// - use push xxxx ret as hook instead of jmp
|
||||
// - length of detour is optional
|
||||
// -----------------------------------------------------------------------------
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include "detours.h"
|
||||
|
||||
|
||||
int DetourASMlen(BYTE *src, int minlen) // find out asm instruction length
|
||||
{
|
||||
int i,len;
|
||||
|
||||
for (len=0; len<minlen; len+=i) {
|
||||
i=mlde32((void *)src);
|
||||
if (i<=0) return 0;
|
||||
src+=i;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
void *DetourCreate(BYTE *src, const BYTE *dst, int minlen)
|
||||
{
|
||||
BYTE *jmp, *org;
|
||||
DWORD dwback;
|
||||
DWORD jumpto, newjump;
|
||||
int len;
|
||||
|
||||
len=DetourASMlen(src,(minlen<6)?6:minlen);
|
||||
if (len==0 && minlen>=6) len=minlen;
|
||||
if (len==0) return 0;
|
||||
|
||||
org=jmp = (BYTE*)malloc(len+5+1); // room for nobytes + jmplen + size byte
|
||||
jmp[0]=len; // save length in first byte
|
||||
jmp++;
|
||||
|
||||
VirtualProtect(src,len,PAGE_READWRITE,&dwback);
|
||||
|
||||
if(src[0] == 0xE9)
|
||||
{
|
||||
jmp = (BYTE*)malloc(10);
|
||||
jumpto = (*(DWORD*)(src+1))+((DWORD)src)+5;
|
||||
newjump = (jumpto-(DWORD)(jmp+5));
|
||||
jmp[0] = 0xE9;
|
||||
*(DWORD*)(jmp+1) = newjump;
|
||||
jmp += 5;
|
||||
jmp[0] = 0xE9;
|
||||
*(DWORD*)(jmp+1) = (DWORD)(src-jmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
jmp = (BYTE*)malloc(5+len);
|
||||
memcpy(jmp,src,len);
|
||||
jmp += len;
|
||||
jmp[0] = 0xE9;
|
||||
*(DWORD*)(jmp+1) = (DWORD)(src+len-jmp)-5;
|
||||
}
|
||||
src[0] = 0xE9;
|
||||
*(DWORD*)(src+1) = (DWORD)(dst - src) - 5;
|
||||
|
||||
for(int i = 5; i < len; i++)
|
||||
src[i] = 0x90;
|
||||
VirtualProtect(src,len,dwback,&dwback);
|
||||
return (jmp-len);
|
||||
}
|
||||
|
||||
// restore == return value of DetourCreate
|
||||
void DetourRemove(BYTE *src, BYTE *restore, int len)
|
||||
{
|
||||
DWORD dwBack;
|
||||
|
||||
len=*(BYTE *)(restore-1); // ignore len parameter, only for backward competability
|
||||
|
||||
VirtualProtect(src, len, PAGE_EXECUTE_READWRITE, &dwBack);
|
||||
memcpy(src, restore, len);
|
||||
restore[0] = 0xE9;
|
||||
|
||||
*(DWORD*)(restore+1) = (DWORD)(src - restore) - 5;
|
||||
VirtualProtect(src, len, dwBack, &dwBack);
|
||||
}
|
10
SDK/Include/detours.h
Normal file
10
SDK/Include/detours.h
Normal file
@ -0,0 +1,10 @@
|
||||
#ifndef _DETOURS_H
|
||||
#define _DETOURS_H
|
||||
|
||||
extern "C" int __cdecl mlde32(void *codeptr);
|
||||
|
||||
int DetourLen(BYTE *src, int minlen);
|
||||
void *DetourCreate(BYTE *src, const BYTE *dst, const int minlen=0);
|
||||
void DetourRemove(BYTE *src, BYTE *restore, const int len=0);
|
||||
|
||||
#endif
|
4417
SDK/Include/dinput.h
Normal file
4417
SDK/Include/dinput.h
Normal file
File diff suppressed because it is too large
Load Diff
755
SDK/Include/dinputd.h
Normal file
755
SDK/Include/dinputd.h
Normal file
@ -0,0 +1,755 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 1995-2000 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: dinputd.h
|
||||
* Content: DirectInput include file for device driver implementors
|
||||
*
|
||||
****************************************************************************/
|
||||
#ifndef __DINPUTD_INCLUDED__
|
||||
#define __DINPUTD_INCLUDED__
|
||||
|
||||
#ifndef DIRECTINPUT_VERSION
|
||||
#define DIRECTINPUT_VERSION 0x0800
|
||||
#pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800")
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Interfaces
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef DIJ_RINGZERO
|
||||
|
||||
DEFINE_GUID(IID_IDirectInputEffectDriver, 0x02538130,0x898F,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
|
||||
DEFINE_GUID(IID_IDirectInputJoyConfig, 0x1DE12AB1,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
|
||||
DEFINE_GUID(IID_IDirectInputPIDDriver, 0xEEC6993A,0xB3FD,0x11D2,0xA9,0x16,0x00,0xC0,0x4F,0xB9,0x86,0x38);
|
||||
|
||||
DEFINE_GUID(IID_IDirectInputJoyConfig8, 0xeb0d7dfa,0x1990,0x4f27,0xb4,0xd6,0xed,0xf2,0xee,0xc4,0xa4,0x4c);
|
||||
|
||||
#endif /* DIJ_RINGZERO */
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IDirectInputEffectDriver
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
typedef struct DIOBJECTATTRIBUTES {
|
||||
DWORD dwFlags;
|
||||
WORD wUsagePage;
|
||||
WORD wUsage;
|
||||
} DIOBJECTATTRIBUTES, *LPDIOBJECTATTRIBUTES;
|
||||
typedef const DIOBJECTATTRIBUTES *LPCDIOBJECTATTRIBUTES;
|
||||
|
||||
typedef struct DIFFOBJECTATTRIBUTES {
|
||||
DWORD dwFFMaxForce;
|
||||
DWORD dwFFForceResolution;
|
||||
} DIFFOBJECTATTRIBUTES, *LPDIFFOBJECTATTRIBUTES;
|
||||
typedef const DIFFOBJECTATTRIBUTES *LPCDIFFOBJECTATTRIBUTES;
|
||||
|
||||
typedef struct DIOBJECTCALIBRATION {
|
||||
LONG lMin;
|
||||
LONG lCenter;
|
||||
LONG lMax;
|
||||
} DIOBJECTCALIBRATION, *LPDIOBJECTCALIBRATION;
|
||||
typedef const DIOBJECTCALIBRATION *LPCDIOBJECTCALIBRATION;
|
||||
|
||||
typedef struct DIPOVCALIBRATION {
|
||||
LONG lMin[5];
|
||||
LONG lMax[5];
|
||||
} DIPOVCALIBRATION, *LPDIPOVCALIBRATION;
|
||||
typedef const DIPOVCALIBRATION *LPCDIPOVCALIBRATION;
|
||||
|
||||
typedef struct DIEFFECTATTRIBUTES {
|
||||
DWORD dwEffectId;
|
||||
DWORD dwEffType;
|
||||
DWORD dwStaticParams;
|
||||
DWORD dwDynamicParams;
|
||||
DWORD dwCoords;
|
||||
} DIEFFECTATTRIBUTES, *LPDIEFFECTATTRIBUTES;
|
||||
typedef const DIEFFECTATTRIBUTES *LPCDIEFFECTATTRIBUTES;
|
||||
|
||||
typedef struct DIFFDEVICEATTRIBUTES {
|
||||
DWORD dwFlags;
|
||||
DWORD dwFFSamplePeriod;
|
||||
DWORD dwFFMinTimeResolution;
|
||||
} DIFFDEVICEATTRIBUTES, *LPDIFFDEVICEATTRIBUTES;
|
||||
typedef const DIFFDEVICEATTRIBUTES *LPCDIFFDEVICEATTRIBUTES;
|
||||
|
||||
typedef struct DIDRIVERVERSIONS {
|
||||
DWORD dwSize;
|
||||
DWORD dwFirmwareRevision;
|
||||
DWORD dwHardwareRevision;
|
||||
DWORD dwFFDriverVersion;
|
||||
} DIDRIVERVERSIONS, *LPDIDRIVERVERSIONS;
|
||||
typedef const DIDRIVERVERSIONS *LPCDIDRIVERVERSIONS;
|
||||
|
||||
typedef struct DIDEVICESTATE {
|
||||
DWORD dwSize;
|
||||
DWORD dwState;
|
||||
DWORD dwLoad;
|
||||
} DIDEVICESTATE, *LPDIDEVICESTATE;
|
||||
|
||||
#define DEV_STS_EFFECT_RUNNING DIEGES_PLAYING
|
||||
|
||||
#ifndef DIJ_RINGZERO
|
||||
|
||||
typedef struct DIHIDFFINITINFO {
|
||||
DWORD dwSize;
|
||||
LPWSTR pwszDeviceInterface;
|
||||
GUID GuidInstance;
|
||||
} DIHIDFFINITINFO, *LPDIHIDFFINITINFO;
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectInputEffectDriver
|
||||
|
||||
DECLARE_INTERFACE_(IDirectInputEffectDriver, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release)(THIS) PURE;
|
||||
|
||||
/*** IDirectInputEffectDriver methods ***/
|
||||
STDMETHOD(DeviceID)(THIS_ DWORD,DWORD,DWORD,DWORD,LPVOID) PURE;
|
||||
STDMETHOD(GetVersions)(THIS_ LPDIDRIVERVERSIONS) PURE;
|
||||
STDMETHOD(Escape)(THIS_ DWORD,DWORD,LPDIEFFESCAPE) PURE;
|
||||
STDMETHOD(SetGain)(THIS_ DWORD,DWORD) PURE;
|
||||
STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD,DWORD) PURE;
|
||||
STDMETHOD(GetForceFeedbackState)(THIS_ DWORD,LPDIDEVICESTATE) PURE;
|
||||
STDMETHOD(DownloadEffect)(THIS_ DWORD,DWORD,LPDWORD,LPCDIEFFECT,DWORD) PURE;
|
||||
STDMETHOD(DestroyEffect)(THIS_ DWORD,DWORD) PURE;
|
||||
STDMETHOD(StartEffect)(THIS_ DWORD,DWORD,DWORD,DWORD) PURE;
|
||||
STDMETHOD(StopEffect)(THIS_ DWORD,DWORD) PURE;
|
||||
STDMETHOD(GetEffectStatus)(THIS_ DWORD,DWORD,LPDWORD) PURE;
|
||||
};
|
||||
|
||||
typedef struct IDirectInputEffectDriver *LPDIRECTINPUTEFFECTDRIVER;
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectInputEffectDriver_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectInputEffectDriver_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->lpVtbl->DeviceID(p,a,b,c,d,e)
|
||||
#define IDirectInputEffectDriver_GetVersions(p,a) (p)->lpVtbl->GetVersions(p,a)
|
||||
#define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->lpVtbl->Escape(p,a,b,c)
|
||||
#define IDirectInputEffectDriver_SetGain(p,a,b) (p)->lpVtbl->SetGain(p,a,b)
|
||||
#define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->lpVtbl->SendForceFeedbackCommand(p,a,b)
|
||||
#define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->lpVtbl->GetForceFeedbackState(p,a,b)
|
||||
#define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->lpVtbl->DownloadEffect(p,a,b,c,d,e)
|
||||
#define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->lpVtbl->DestroyEffect(p,a,b)
|
||||
#define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->lpVtbl->StartEffect(p,a,b,c,d)
|
||||
#define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->lpVtbl->StopEffect(p,a,b)
|
||||
#define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->lpVtbl->GetEffectStatus(p,a,b,c)
|
||||
#else
|
||||
#define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectInputEffectDriver_AddRef(p) (p)->AddRef()
|
||||
#define IDirectInputEffectDriver_Release(p) (p)->Release()
|
||||
#define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->DeviceID(a,b,c,d,e)
|
||||
#define IDirectInputEffectDriver_GetVersions(p,a) (p)->GetVersions(a)
|
||||
#define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->Escape(a,b,c)
|
||||
#define IDirectInputEffectDriver_SetGain(p,a,b) (p)->SetGain(a,b)
|
||||
#define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->SendForceFeedbackCommand(a,b)
|
||||
#define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->GetForceFeedbackState(a,b)
|
||||
#define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->DownloadEffect(a,b,c,d,e)
|
||||
#define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->DestroyEffect(a,b)
|
||||
#define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->StartEffect(a,b,c,d)
|
||||
#define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->StopEffect(a,b)
|
||||
#define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->GetEffectStatus(a,b,c)
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* DIJ_RINGZERO */
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* IDirectInputJoyConfig
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Definitions copied from the DDK
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef JOY_HW_NONE
|
||||
|
||||
/* pre-defined joystick types */
|
||||
#define JOY_HW_NONE 0
|
||||
#define JOY_HW_CUSTOM 1
|
||||
#define JOY_HW_2A_2B_GENERIC 2
|
||||
#define JOY_HW_2A_4B_GENERIC 3
|
||||
#define JOY_HW_2B_GAMEPAD 4
|
||||
#define JOY_HW_2B_FLIGHTYOKE 5
|
||||
#define JOY_HW_2B_FLIGHTYOKETHROTTLE 6
|
||||
#define JOY_HW_3A_2B_GENERIC 7
|
||||
#define JOY_HW_3A_4B_GENERIC 8
|
||||
#define JOY_HW_4B_GAMEPAD 9
|
||||
#define JOY_HW_4B_FLIGHTYOKE 10
|
||||
#define JOY_HW_4B_FLIGHTYOKETHROTTLE 11
|
||||
#define JOY_HW_TWO_2A_2B_WITH_Y 12
|
||||
#define JOY_HW_LASTENTRY 13
|
||||
|
||||
|
||||
/* calibration flags */
|
||||
#define JOY_ISCAL_XY 0x00000001l /* XY are calibrated */
|
||||
#define JOY_ISCAL_Z 0x00000002l /* Z is calibrated */
|
||||
#define JOY_ISCAL_R 0x00000004l /* R is calibrated */
|
||||
#define JOY_ISCAL_U 0x00000008l /* U is calibrated */
|
||||
#define JOY_ISCAL_V 0x00000010l /* V is calibrated */
|
||||
#define JOY_ISCAL_POV 0x00000020l /* POV is calibrated */
|
||||
|
||||
/* point of view constants */
|
||||
#define JOY_POV_NUMDIRS 4
|
||||
#define JOY_POVVAL_FORWARD 0
|
||||
#define JOY_POVVAL_BACKWARD 1
|
||||
#define JOY_POVVAL_LEFT 2
|
||||
#define JOY_POVVAL_RIGHT 3
|
||||
|
||||
/* Specific settings for joystick hardware */
|
||||
#define JOY_HWS_HASZ 0x00000001l /* has Z info? */
|
||||
#define JOY_HWS_HASPOV 0x00000002l /* point of view hat present */
|
||||
#define JOY_HWS_POVISBUTTONCOMBOS 0x00000004l /* pov done through combo of buttons */
|
||||
#define JOY_HWS_POVISPOLL 0x00000008l /* pov done through polling */
|
||||
#define JOY_HWS_ISYOKE 0x00000010l /* joystick is a flight yoke */
|
||||
#define JOY_HWS_ISGAMEPAD 0x00000020l /* joystick is a game pad */
|
||||
#define JOY_HWS_ISCARCTRL 0x00000040l /* joystick is a car controller */
|
||||
/* X defaults to J1 X axis */
|
||||
#define JOY_HWS_XISJ1Y 0x00000080l /* X is on J1 Y axis */
|
||||
#define JOY_HWS_XISJ2X 0x00000100l /* X is on J2 X axis */
|
||||
#define JOY_HWS_XISJ2Y 0x00000200l /* X is on J2 Y axis */
|
||||
/* Y defaults to J1 Y axis */
|
||||
#define JOY_HWS_YISJ1X 0x00000400l /* Y is on J1 X axis */
|
||||
#define JOY_HWS_YISJ2X 0x00000800l /* Y is on J2 X axis */
|
||||
#define JOY_HWS_YISJ2Y 0x00001000l /* Y is on J2 Y axis */
|
||||
/* Z defaults to J2 Y axis */
|
||||
#define JOY_HWS_ZISJ1X 0x00002000l /* Z is on J1 X axis */
|
||||
#define JOY_HWS_ZISJ1Y 0x00004000l /* Z is on J1 Y axis */
|
||||
#define JOY_HWS_ZISJ2X 0x00008000l /* Z is on J2 X axis */
|
||||
/* POV defaults to J2 Y axis, if it is not button based */
|
||||
#define JOY_HWS_POVISJ1X 0x00010000l /* pov done through J1 X axis */
|
||||
#define JOY_HWS_POVISJ1Y 0x00020000l /* pov done through J1 Y axis */
|
||||
#define JOY_HWS_POVISJ2X 0x00040000l /* pov done through J2 X axis */
|
||||
/* R defaults to J2 X axis */
|
||||
#define JOY_HWS_HASR 0x00080000l /* has R (4th axis) info */
|
||||
#define JOY_HWS_RISJ1X 0x00100000l /* R done through J1 X axis */
|
||||
#define JOY_HWS_RISJ1Y 0x00200000l /* R done through J1 Y axis */
|
||||
#define JOY_HWS_RISJ2Y 0x00400000l /* R done through J2 X axis */
|
||||
/* U & V for future hardware */
|
||||
#define JOY_HWS_HASU 0x00800000l /* has U (5th axis) info */
|
||||
#define JOY_HWS_HASV 0x01000000l /* has V (6th axis) info */
|
||||
|
||||
/* Usage settings */
|
||||
#define JOY_US_HASRUDDER 0x00000001l /* joystick configured with rudder */
|
||||
#define JOY_US_PRESENT 0x00000002l /* is joystick actually present? */
|
||||
#define JOY_US_ISOEM 0x00000004l /* joystick is an OEM defined type */
|
||||
|
||||
/* reserved for future use -> as link to next possible dword */
|
||||
#define JOY_US_RESERVED 0x80000000l /* reserved */
|
||||
|
||||
|
||||
/* Settings for TypeInfo Flags1 */
|
||||
#define JOYTYPE_ZEROGAMEENUMOEMDATA 0x00000001l /* Zero GameEnum's OEM data field */
|
||||
#define JOYTYPE_NOAUTODETECTGAMEPORT 0x00000002l /* Device does not support Autodetect gameport*/
|
||||
#define JOYTYPE_NOHIDDIRECT 0x00000004l /* Do not use HID directly for this device */
|
||||
#define JOYTYPE_ANALOGCOMPAT 0x00000008l /* Expose the analog compatible ID */
|
||||
#define JOYTYPE_DEFAULTPROPSHEET 0x80000000l /* CPL overrides custom property sheet */
|
||||
|
||||
/* Settings for TypeInfo Flags2 */
|
||||
#define JOYTYPE_DEVICEHIDE 0x00010000l /* Hide unclassified devices */
|
||||
#define JOYTYPE_MOUSEHIDE 0x00020000l /* Hide mice */
|
||||
#define JOYTYPE_KEYBHIDE 0x00040000l /* Hide keyboards */
|
||||
#define JOYTYPE_GAMEHIDE 0x00080000l /* Hide game controllers */
|
||||
#define JOYTYPE_HIDEACTIVE 0x00100000l /* Hide flags are active */
|
||||
#define JOYTYPE_INFOMASK 0x00E00000l /* Mask for type specific info */
|
||||
#define JOYTYPE_INFODEFAULT 0x00000000l /* Use default axis mappings */
|
||||
#define JOYTYPE_INFOYYPEDALS 0x00200000l /* Use Y as a combined pedals axis */
|
||||
#define JOYTYPE_INFOZYPEDALS 0x00400000l /* Use Z for accelerate, Y for brake */
|
||||
#define JOYTYPE_INFOYRPEDALS 0x00600000l /* Use Y for accelerate, R for brake */
|
||||
#define JOYTYPE_INFOZRPEDALS 0x00800000l /* Use Z for accelerate, R for brake */
|
||||
#define JOYTYPE_INFOZISSLIDER 0x00200000l /* Use Z as a slider */
|
||||
#define JOYTYPE_INFOZISZ 0x00400000l /* Use Z as Z axis */
|
||||
#define JOYTYPE_ENABLEINPUTREPORT 0x01000000l /* Enable initial input reports */
|
||||
|
||||
/* struct for storing x,y, z, and rudder values */
|
||||
typedef struct joypos_tag {
|
||||
DWORD dwX;
|
||||
DWORD dwY;
|
||||
DWORD dwZ;
|
||||
DWORD dwR;
|
||||
DWORD dwU;
|
||||
DWORD dwV;
|
||||
} JOYPOS, FAR *LPJOYPOS;
|
||||
|
||||
/* struct for storing ranges */
|
||||
typedef struct joyrange_tag {
|
||||
JOYPOS jpMin;
|
||||
JOYPOS jpMax;
|
||||
JOYPOS jpCenter;
|
||||
} JOYRANGE,FAR *LPJOYRANGE;
|
||||
|
||||
/*
|
||||
* dwTimeout - value at which to timeout joystick polling
|
||||
* jrvRanges - range of values app wants returned for axes
|
||||
* jpDeadZone - area around center to be considered
|
||||
* as "dead". specified as a percentage
|
||||
* (0-100). Only X & Y handled by system driver
|
||||
*/
|
||||
typedef struct joyreguservalues_tag {
|
||||
DWORD dwTimeOut;
|
||||
JOYRANGE jrvRanges;
|
||||
JOYPOS jpDeadZone;
|
||||
} JOYREGUSERVALUES, FAR *LPJOYREGUSERVALUES;
|
||||
|
||||
typedef struct joyreghwsettings_tag {
|
||||
DWORD dwFlags;
|
||||
DWORD dwNumButtons;
|
||||
} JOYREGHWSETTINGS, FAR *LPJOYHWSETTINGS;
|
||||
|
||||
/* range of values returned by the hardware (filled in by calibration) */
|
||||
/*
|
||||
* jrvHardware - values returned by hardware
|
||||
* dwPOVValues - POV values returned by hardware
|
||||
* dwCalFlags - what has been calibrated
|
||||
*/
|
||||
typedef struct joyreghwvalues_tag {
|
||||
JOYRANGE jrvHardware;
|
||||
DWORD dwPOVValues[JOY_POV_NUMDIRS];
|
||||
DWORD dwCalFlags;
|
||||
} JOYREGHWVALUES, FAR *LPJOYREGHWVALUES;
|
||||
|
||||
/* hardware configuration */
|
||||
/*
|
||||
* hws - hardware settings
|
||||
* dwUsageSettings - usage settings
|
||||
* hwv - values returned by hardware
|
||||
* dwType - type of joystick
|
||||
* dwReserved - reserved for OEM drivers
|
||||
*/
|
||||
typedef struct joyreghwconfig_tag {
|
||||
JOYREGHWSETTINGS hws;
|
||||
DWORD dwUsageSettings;
|
||||
JOYREGHWVALUES hwv;
|
||||
DWORD dwType;
|
||||
DWORD dwReserved;
|
||||
} JOYREGHWCONFIG, FAR *LPJOYREGHWCONFIG;
|
||||
|
||||
/* joystick calibration info structure */
|
||||
typedef struct joycalibrate_tag {
|
||||
UINT wXbase;
|
||||
UINT wXdelta;
|
||||
UINT wYbase;
|
||||
UINT wYdelta;
|
||||
UINT wZbase;
|
||||
UINT wZdelta;
|
||||
} JOYCALIBRATE;
|
||||
typedef JOYCALIBRATE FAR *LPJOYCALIBRATE;
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef DIJ_RINGZERO
|
||||
|
||||
#define MAX_JOYSTRING 256
|
||||
typedef BOOL (FAR PASCAL * LPDIJOYTYPECALLBACK)(LPCWSTR, LPVOID);
|
||||
|
||||
#ifndef MAX_JOYSTICKOEMVXDNAME
|
||||
#define MAX_JOYSTICKOEMVXDNAME 260
|
||||
#endif
|
||||
|
||||
#define DITC_REGHWSETTINGS 0x00000001
|
||||
#define DITC_CLSIDCONFIG 0x00000002
|
||||
#define DITC_DISPLAYNAME 0x00000004
|
||||
#define DITC_CALLOUT 0x00000008
|
||||
#define DITC_HARDWAREID 0x00000010
|
||||
#define DITC_FLAGS1 0x00000020
|
||||
#define DITC_FLAGS2 0x00000040
|
||||
#define DITC_MAPFILE 0x00000080
|
||||
|
||||
|
||||
|
||||
/* This structure is defined for DirectX 5.0 compatibility */
|
||||
|
||||
typedef struct DIJOYTYPEINFO_DX5 {
|
||||
DWORD dwSize;
|
||||
JOYREGHWSETTINGS hws;
|
||||
CLSID clsidConfig;
|
||||
WCHAR wszDisplayName[MAX_JOYSTRING];
|
||||
WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
|
||||
} DIJOYTYPEINFO_DX5, *LPDIJOYTYPEINFO_DX5;
|
||||
typedef const DIJOYTYPEINFO_DX5 *LPCDIJOYTYPEINFO_DX5;
|
||||
|
||||
/* This structure is defined for DirectX 6.1 compatibility */
|
||||
typedef struct DIJOYTYPEINFO_DX6 {
|
||||
DWORD dwSize;
|
||||
JOYREGHWSETTINGS hws;
|
||||
CLSID clsidConfig;
|
||||
WCHAR wszDisplayName[MAX_JOYSTRING];
|
||||
WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
|
||||
WCHAR wszHardwareId[MAX_JOYSTRING];
|
||||
DWORD dwFlags1;
|
||||
} DIJOYTYPEINFO_DX6, *LPDIJOYTYPEINFO_DX6;
|
||||
typedef const DIJOYTYPEINFO_DX6 *LPCDIJOYTYPEINFO_DX6;
|
||||
|
||||
typedef struct DIJOYTYPEINFO {
|
||||
DWORD dwSize;
|
||||
JOYREGHWSETTINGS hws;
|
||||
CLSID clsidConfig;
|
||||
WCHAR wszDisplayName[MAX_JOYSTRING];
|
||||
WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
|
||||
#if(DIRECTINPUT_VERSION >= 0x05b2)
|
||||
WCHAR wszHardwareId[MAX_JOYSTRING];
|
||||
DWORD dwFlags1;
|
||||
#if(DIRECTINPUT_VERSION >= 0x0800)
|
||||
DWORD dwFlags2;
|
||||
WCHAR wszMapFile[MAX_JOYSTRING];
|
||||
#endif /* DIRECTINPUT_VERSION >= 0x0800 */
|
||||
#endif /* DIRECTINPUT_VERSION >= 0x05b2 */
|
||||
} DIJOYTYPEINFO, *LPDIJOYTYPEINFO;
|
||||
typedef const DIJOYTYPEINFO *LPCDIJOYTYPEINFO;
|
||||
#define DIJC_GUIDINSTANCE 0x00000001
|
||||
#define DIJC_REGHWCONFIGTYPE 0x00000002
|
||||
#define DIJC_GAIN 0x00000004
|
||||
#define DIJC_CALLOUT 0x00000008
|
||||
#define DIJC_WDMGAMEPORT 0x00000010
|
||||
|
||||
/* This structure is defined for DirectX 5.0 compatibility */
|
||||
|
||||
typedef struct DIJOYCONFIG_DX5 {
|
||||
DWORD dwSize;
|
||||
GUID guidInstance;
|
||||
JOYREGHWCONFIG hwc;
|
||||
DWORD dwGain;
|
||||
WCHAR wszType[MAX_JOYSTRING];
|
||||
WCHAR wszCallout[MAX_JOYSTRING];
|
||||
} DIJOYCONFIG_DX5, *LPDIJOYCONFIG_DX5;
|
||||
typedef const DIJOYCONFIG_DX5 *LPCDIJOYCONFIG_DX5;
|
||||
|
||||
typedef struct DIJOYCONFIG {
|
||||
DWORD dwSize;
|
||||
GUID guidInstance;
|
||||
JOYREGHWCONFIG hwc;
|
||||
DWORD dwGain;
|
||||
WCHAR wszType[MAX_JOYSTRING];
|
||||
WCHAR wszCallout[MAX_JOYSTRING];
|
||||
#if(DIRECTINPUT_VERSION >= 0x05b2)
|
||||
GUID guidGameport;
|
||||
#endif /* DIRECTINPUT_VERSION >= 0x05b2 */
|
||||
} DIJOYCONFIG, *LPDIJOYCONFIG;
|
||||
typedef const DIJOYCONFIG *LPCDIJOYCONFIG;
|
||||
|
||||
|
||||
#define DIJU_USERVALUES 0x00000001
|
||||
#define DIJU_GLOBALDRIVER 0x00000002
|
||||
#define DIJU_GAMEPORTEMULATOR 0x00000004
|
||||
|
||||
typedef struct DIJOYUSERVALUES {
|
||||
DWORD dwSize;
|
||||
JOYREGUSERVALUES ruv;
|
||||
WCHAR wszGlobalDriver[MAX_JOYSTRING];
|
||||
WCHAR wszGameportEmulator[MAX_JOYSTRING];
|
||||
} DIJOYUSERVALUES, *LPDIJOYUSERVALUES;
|
||||
typedef const DIJOYUSERVALUES *LPCDIJOYUSERVALUES;
|
||||
|
||||
DEFINE_GUID(GUID_KeyboardClass, 0x4D36E96B,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
|
||||
DEFINE_GUID(GUID_MediaClass, 0x4D36E96C,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
|
||||
DEFINE_GUID(GUID_MouseClass, 0x4D36E96F,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
|
||||
DEFINE_GUID(GUID_HIDClass, 0x745A17A0,0x74D3,0x11D0,0xB6,0xFE,0x00,0xA0,0xC9,0x0F,0x57,0xDA);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectInputJoyConfig
|
||||
|
||||
DECLARE_INTERFACE_(IDirectInputJoyConfig, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release)(THIS) PURE;
|
||||
|
||||
/*** IDirectInputJoyConfig methods ***/
|
||||
STDMETHOD(Acquire)(THIS) PURE;
|
||||
STDMETHOD(Unacquire)(THIS) PURE;
|
||||
STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
|
||||
STDMETHOD(SendNotify)(THIS) PURE;
|
||||
STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE;
|
||||
STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE;
|
||||
STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD) PURE;
|
||||
STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE;
|
||||
STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE;
|
||||
STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE;
|
||||
STDMETHOD(DeleteConfig)(THIS_ UINT) PURE;
|
||||
STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE;
|
||||
STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE;
|
||||
STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE;
|
||||
STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE;
|
||||
STDMETHOD(OpenConfigKey)(THIS_ UINT,DWORD,PHKEY) PURE;
|
||||
};
|
||||
|
||||
typedef struct IDirectInputJoyConfig *LPDIRECTINPUTJOYCONFIG;
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectInputJoyConfig_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectInputJoyConfig_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectInputJoyConfig_Acquire(p) (p)->lpVtbl->Acquire(p)
|
||||
#define IDirectInputJoyConfig_Unacquire(p) (p)->lpVtbl->Unacquire(p)
|
||||
#define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
|
||||
#define IDirectInputJoyConfig_SendNotify(p) (p)->lpVtbl->SendNotify(p)
|
||||
#define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b)
|
||||
#define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c)
|
||||
#define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->lpVtbl->SetTypeInfo(p,a,b,c)
|
||||
#define IDirectInputJoyConfig_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a)
|
||||
#define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c)
|
||||
#define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c)
|
||||
#define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a)
|
||||
#define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b)
|
||||
#define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b)
|
||||
#define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b)
|
||||
#define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c)
|
||||
#define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->lpVtbl->OpenConfigKey(p,a,b,c)
|
||||
#else
|
||||
#define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectInputJoyConfig_AddRef(p) (p)->AddRef()
|
||||
#define IDirectInputJoyConfig_Release(p) (p)->Release()
|
||||
#define IDirectInputJoyConfig_Acquire(p) (p)->Acquire()
|
||||
#define IDirectInputJoyConfig_Unacquire(p) (p)->Unacquire()
|
||||
#define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
|
||||
#define IDirectInputJoyConfig_SendNotify(p) (p)->SendNotify()
|
||||
#define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->EnumTypes(a,b)
|
||||
#define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c)
|
||||
#define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->SetTypeInfo(a,b,c)
|
||||
#define IDirectInputJoyConfig_DeleteType(p,a) (p)->DeleteType(a)
|
||||
#define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c)
|
||||
#define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c)
|
||||
#define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->DeleteConfig(a)
|
||||
#define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->GetUserValues(a,b)
|
||||
#define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->SetUserValues(a,b)
|
||||
#define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b)
|
||||
#define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c)
|
||||
#define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->OpenConfigKey(a,b,c)
|
||||
#endif
|
||||
|
||||
#endif /* DIJ_RINGZERO */
|
||||
|
||||
#if(DIRECTINPUT_VERSION >= 0x0800)
|
||||
|
||||
#ifndef DIJ_RINGZERO
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectInputJoyConfig8
|
||||
|
||||
DECLARE_INTERFACE_(IDirectInputJoyConfig8, IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release)(THIS) PURE;
|
||||
|
||||
/*** IDirectInputJoyConfig8 methods ***/
|
||||
STDMETHOD(Acquire)(THIS) PURE;
|
||||
STDMETHOD(Unacquire)(THIS) PURE;
|
||||
STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
|
||||
STDMETHOD(SendNotify)(THIS) PURE;
|
||||
STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE;
|
||||
STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE;
|
||||
STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD,LPWSTR) PURE;
|
||||
STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE;
|
||||
STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE;
|
||||
STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE;
|
||||
STDMETHOD(DeleteConfig)(THIS_ UINT) PURE;
|
||||
STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE;
|
||||
STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE;
|
||||
STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE;
|
||||
STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE;
|
||||
STDMETHOD(OpenAppStatusKey)(THIS_ PHKEY) PURE;
|
||||
};
|
||||
|
||||
typedef struct IDirectInputJoyConfig8 *LPDIRECTINPUTJOYCONFIG8;
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectInputJoyConfig8_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectInputJoyConfig8_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectInputJoyConfig8_Acquire(p) (p)->lpVtbl->Acquire(p)
|
||||
#define IDirectInputJoyConfig8_Unacquire(p) (p)->lpVtbl->Unacquire(p)
|
||||
#define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
|
||||
#define IDirectInputJoyConfig8_SendNotify(p) (p)->lpVtbl->SendNotify(p)
|
||||
#define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b)
|
||||
#define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c)
|
||||
#define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->lpVtbl->SetTypeInfo(p,a,b,c,d)
|
||||
#define IDirectInputJoyConfig8_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a)
|
||||
#define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c)
|
||||
#define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c)
|
||||
#define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a)
|
||||
#define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b)
|
||||
#define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b)
|
||||
#define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b)
|
||||
#define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c)
|
||||
#define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->lpVtbl->OpenAppStatusKey(p,a)
|
||||
#else
|
||||
#define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectInputJoyConfig8_AddRef(p) (p)->AddRef()
|
||||
#define IDirectInputJoyConfig8_Release(p) (p)->Release()
|
||||
#define IDirectInputJoyConfig8_Acquire(p) (p)->Acquire()
|
||||
#define IDirectInputJoyConfig8_Unacquire(p) (p)->Unacquire()
|
||||
#define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
|
||||
#define IDirectInputJoyConfig8_SendNotify(p) (p)->SendNotify()
|
||||
#define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->EnumTypes(a,b)
|
||||
#define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c)
|
||||
#define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->SetTypeInfo(a,b,c,d)
|
||||
#define IDirectInputJoyConfig8_DeleteType(p,a) (p)->DeleteType(a)
|
||||
#define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c)
|
||||
#define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c)
|
||||
#define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->DeleteConfig(a)
|
||||
#define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->GetUserValues(a,b)
|
||||
#define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->SetUserValues(a,b)
|
||||
#define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b)
|
||||
#define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c)
|
||||
#define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->OpenAppStatusKey(a)
|
||||
#endif
|
||||
|
||||
#endif /* DIJ_RINGZERO */
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Notification Messages
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* RegisterWindowMessage with this to get DirectInput notification messages */
|
||||
#define DIRECTINPUT_NOTIFICATION_MSGSTRINGA "DIRECTINPUT_NOTIFICATION_MSGSTRING"
|
||||
#define DIRECTINPUT_NOTIFICATION_MSGSTRINGW L"DIRECTINPUT_NOTIFICATION_MSGSTRING"
|
||||
|
||||
#ifdef UNICODE
|
||||
#define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGW
|
||||
#else
|
||||
#define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGA
|
||||
#endif
|
||||
|
||||
#define DIMSGWP_NEWAPPSTART 0x00000001
|
||||
#define DIMSGWP_DX8APPSTART 0x00000002
|
||||
#define DIMSGWP_DX8MAPPERAPPSTART 0x00000003
|
||||
|
||||
#endif /* DIRECTINPUT_VERSION >= 0x0800 */
|
||||
|
||||
#define DIAPPIDFLAG_NOTIME 0x00000001
|
||||
#define DIAPPIDFLAG_NOSIZE 0x00000002
|
||||
|
||||
#define DIRECTINPUT_REGSTR_VAL_APPIDFLAGA "AppIdFlag"
|
||||
#define DIRECTINPUT_REGSTR_KEY_LASTAPPA "MostRecentApplication"
|
||||
#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA "MostRecentMapperApplication"
|
||||
#define DIRECTINPUT_REGSTR_VAL_VERSIONA "Version"
|
||||
#define DIRECTINPUT_REGSTR_VAL_NAMEA "Name"
|
||||
#define DIRECTINPUT_REGSTR_VAL_IDA "Id"
|
||||
#define DIRECTINPUT_REGSTR_VAL_MAPPERA "UsesMapper"
|
||||
#define DIRECTINPUT_REGSTR_VAL_LASTSTARTA "MostRecentStart"
|
||||
|
||||
#define DIRECTINPUT_REGSTR_VAL_APPIDFLAGW L"AppIdFlag"
|
||||
#define DIRECTINPUT_REGSTR_KEY_LASTAPPW L"MostRecentApplication"
|
||||
#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW L"MostRecentMapperApplication"
|
||||
#define DIRECTINPUT_REGSTR_VAL_VERSIONW L"Version"
|
||||
#define DIRECTINPUT_REGSTR_VAL_NAMEW L"Name"
|
||||
#define DIRECTINPUT_REGSTR_VAL_IDW L"Id"
|
||||
#define DIRECTINPUT_REGSTR_VAL_MAPPERW L"UsesMapper"
|
||||
#define DIRECTINPUT_REGSTR_VAL_LASTSTARTW L"MostRecentStart"
|
||||
|
||||
#ifdef UNICODE
|
||||
#define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGW
|
||||
#define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPW
|
||||
#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW
|
||||
#define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONW
|
||||
#define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEW
|
||||
#define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDW
|
||||
#define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERW
|
||||
#define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTW
|
||||
#else
|
||||
#define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGA
|
||||
#define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPA
|
||||
#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA
|
||||
#define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONA
|
||||
#define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEA
|
||||
#define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDA
|
||||
#define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERA
|
||||
#define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTA
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Return Codes
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#define DIERR_NOMOREITEMS \
|
||||
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NO_MORE_ITEMS)
|
||||
|
||||
/*
|
||||
* Device driver-specific codes.
|
||||
*/
|
||||
|
||||
#define DIERR_DRIVERFIRST 0x80040300L
|
||||
#define DIERR_DRIVERLAST 0x800403FFL
|
||||
|
||||
/*
|
||||
* Unless the specific driver has been precisely identified, no meaning
|
||||
* should be attributed to these values other than that the driver
|
||||
* originated the error. However, to illustrate the types of error that
|
||||
* may be causing the failure, the PID force feedback driver distributed
|
||||
* with DirectX 7 could return the following errors:
|
||||
*
|
||||
* DIERR_DRIVERFIRST + 1
|
||||
* The requested usage was not found.
|
||||
* DIERR_DRIVERFIRST + 2
|
||||
* The parameter block couldn't be downloaded to the device.
|
||||
* DIERR_DRIVERFIRST + 3
|
||||
* PID initialization failed.
|
||||
* DIERR_DRIVERFIRST + 4
|
||||
* The provided values couldn't be scaled.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Device installer errors.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Registry entry or DLL for class installer invalid
|
||||
* or class installer not found.
|
||||
*/
|
||||
#define DIERR_INVALIDCLASSINSTALLER 0x80040400L
|
||||
|
||||
/*
|
||||
* The user cancelled the install operation.
|
||||
*/
|
||||
#define DIERR_CANCELLED 0x80040401L
|
||||
|
||||
/*
|
||||
* The INF file for the selected device could not be
|
||||
* found or is invalid or is damaged.
|
||||
*/
|
||||
#define DIERR_BADINF 0x80040402L
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Map files
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Delete particular data from default map file.
|
||||
*/
|
||||
#define DIDIFT_DELETE 0x01000000
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* __DINPUTD_INCLUDED__ */
|
195
SDK/Include/dsconf.h
Normal file
195
SDK/Include/dsconf.h
Normal file
@ -0,0 +1,195 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
*
|
||||
* File: dsconf.h
|
||||
* Content: DirectSound configuration interface include file
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef __DSCONF_INCLUDED__
|
||||
#define __DSCONF_INCLUDED__
|
||||
|
||||
#ifndef __DSOUND_INCLUDED__
|
||||
#error dsound.h not included
|
||||
#endif // __DSOUND_INCLUDED__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
|
||||
// DirectSound Private Component GUID {11AB3EC0-25EC-11d1-A4D8-00C04FC28ACA}
|
||||
DEFINE_GUID(CLSID_DirectSoundPrivate, 0x11ab3ec0, 0x25ec, 0x11d1, 0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
|
||||
|
||||
|
||||
//
|
||||
// DirectSound Device Properties {84624F82-25EC-11d1-A4D8-00C04FC28ACA}
|
||||
//
|
||||
|
||||
DEFINE_GUID(DSPROPSETID_DirectSoundDevice, 0x84624f82, 0x25ec, 0x11d1, 0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A = 1,
|
||||
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1 = 2,
|
||||
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 = 3,
|
||||
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W = 4,
|
||||
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A = 5,
|
||||
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W = 6,
|
||||
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A = 7,
|
||||
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W = 8,
|
||||
} DSPROPERTY_DIRECTSOUNDDEVICE;
|
||||
|
||||
#if DIRECTSOUND_VERSION >= 0x0700
|
||||
#ifdef UNICODE
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W
|
||||
#else // UNICODE
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A
|
||||
#endif // UNICODE
|
||||
#else // DIRECTSOUND_VERSION >= 0x0700
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1
|
||||
#endif // DIRECTSOUND_VERSION >= 0x0700
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DIRECTSOUNDDEVICE_TYPE_EMULATED,
|
||||
DIRECTSOUNDDEVICE_TYPE_VXD,
|
||||
DIRECTSOUNDDEVICE_TYPE_WDM
|
||||
} DIRECTSOUNDDEVICE_TYPE;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DIRECTSOUNDDEVICE_DATAFLOW_RENDER,
|
||||
DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
|
||||
} DIRECTSOUNDDEVICE_DATAFLOW;
|
||||
|
||||
|
||||
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
|
||||
{
|
||||
LPSTR DeviceName; // waveIn/waveOut device name
|
||||
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Data flow (i.e. waveIn or waveOut)
|
||||
GUID DeviceId; // DirectSound device id
|
||||
} DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA;
|
||||
|
||||
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
|
||||
{
|
||||
LPWSTR DeviceName; // waveIn/waveOut device name
|
||||
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Data flow (i.e. waveIn or waveOut)
|
||||
GUID DeviceId; // DirectSound device id
|
||||
} DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA;
|
||||
|
||||
#ifdef UNICODE
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
|
||||
#define PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
|
||||
#else // UNICODE
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
|
||||
#define PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
|
||||
#endif // UNICODE
|
||||
|
||||
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
|
||||
{
|
||||
GUID DeviceId; // DirectSound device id
|
||||
CHAR DescriptionA[0x100]; // Device description (ANSI)
|
||||
WCHAR DescriptionW[0x100]; // Device description (Unicode)
|
||||
CHAR ModuleA[MAX_PATH]; // Device driver module (ANSI)
|
||||
WCHAR ModuleW[MAX_PATH]; // Device driver module (Unicode)
|
||||
DIRECTSOUNDDEVICE_TYPE Type; // Device type
|
||||
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow
|
||||
ULONG WaveDeviceId; // Wave device id
|
||||
ULONG Devnode; // Devnode (or DevInst)
|
||||
} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA;
|
||||
|
||||
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
|
||||
{
|
||||
DIRECTSOUNDDEVICE_TYPE Type; // Device type
|
||||
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow
|
||||
GUID DeviceId; // DirectSound device id
|
||||
LPSTR Description; // Device description
|
||||
LPSTR Module; // Device driver module
|
||||
LPSTR Interface; // Device interface
|
||||
ULONG WaveDeviceId; // Wave device id
|
||||
} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA;
|
||||
|
||||
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
|
||||
{
|
||||
DIRECTSOUNDDEVICE_TYPE Type; // Device type
|
||||
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow
|
||||
GUID DeviceId; // DirectSound device id
|
||||
LPWSTR Description; // Device description
|
||||
LPWSTR Module; // Device driver module
|
||||
LPWSTR Interface; // Device interface
|
||||
ULONG WaveDeviceId; // Wave device id
|
||||
} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA;
|
||||
|
||||
#if DIRECTSOUND_VERSION >= 0x0700
|
||||
#ifdef UNICODE
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
|
||||
#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
|
||||
#else // UNICODE
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
|
||||
#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
|
||||
#endif // UNICODE
|
||||
#else // DIRECTSOUND_VERSION >= 0x0700
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
|
||||
#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
|
||||
#endif // DIRECTSOUND_VERSION >= 0x0700
|
||||
|
||||
typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA, LPVOID);
|
||||
typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA, LPVOID);
|
||||
typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA, LPVOID);
|
||||
|
||||
#if DIRECTSOUND_VERSION >= 0x0700
|
||||
#ifdef UNICODE
|
||||
#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW
|
||||
#else // UNICODE
|
||||
#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA
|
||||
#endif // UNICODE
|
||||
#else // DIRECTSOUND_VERSION >= 0x0700
|
||||
#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1
|
||||
#endif // DIRECTSOUND_VERSION >= 0x0700
|
||||
|
||||
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
|
||||
{
|
||||
LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1 Callback; // Callback function pointer
|
||||
LPVOID Context; // Callback function context argument
|
||||
} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA;
|
||||
|
||||
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
|
||||
{
|
||||
LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA Callback; // Callback function pointer
|
||||
LPVOID Context; // Callback function context argument
|
||||
} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA;
|
||||
|
||||
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
|
||||
{
|
||||
LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW Callback; // Callback function pointer
|
||||
LPVOID Context; // Callback function context argument
|
||||
} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA;
|
||||
|
||||
#if DIRECTSOUND_VERSION >= 0x0700
|
||||
#ifdef UNICODE
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
|
||||
#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
|
||||
#else // UNICODE
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
|
||||
#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
|
||||
#endif // UNICODE
|
||||
#else // DIRECTSOUND_VERSION >= 0x0700
|
||||
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
|
||||
#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
|
||||
#endif // DIRECTSOUND_VERSION >= 0x0700
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // __DSCONF_INCLUDED__
|
||||
|
283
SDK/Include/dsetup.h
Normal file
283
SDK/Include/dsetup.h
Normal file
@ -0,0 +1,283 @@
|
||||
/*==========================================================================
|
||||
*
|
||||
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: dsetup.h
|
||||
* Content: DirectXSetup, error codes and flags
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __DSETUP_H__
|
||||
#define __DSETUP_H__
|
||||
|
||||
#include <windows.h> // windows stuff
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define FOURCC_VERS mmioFOURCC('v','e','r','s')
|
||||
|
||||
// DSETUP Error Codes, must remain compatible with previous setup.
|
||||
#define DSETUPERR_SUCCESS_RESTART 1
|
||||
#define DSETUPERR_SUCCESS 0
|
||||
#define DSETUPERR_BADWINDOWSVERSION -1
|
||||
#define DSETUPERR_SOURCEFILENOTFOUND -2
|
||||
#define DSETUPERR_NOCOPY -5
|
||||
#define DSETUPERR_OUTOFDISKSPACE -6
|
||||
#define DSETUPERR_CANTFINDINF -7
|
||||
#define DSETUPERR_CANTFINDDIR -8
|
||||
#define DSETUPERR_INTERNAL -9
|
||||
#define DSETUPERR_UNKNOWNOS -11
|
||||
#define DSETUPERR_NEWERVERSION -14
|
||||
#define DSETUPERR_NOTADMIN -15
|
||||
#define DSETUPERR_UNSUPPORTEDPROCESSOR -16
|
||||
#define DSETUPERR_MISSINGCAB_MANAGEDDX -17
|
||||
#define DSETUPERR_NODOTNETFRAMEWORKINSTALLED -18
|
||||
#define DSETUPERR_CABDOWNLOADFAIL -19
|
||||
#define DSETUPERR_DXCOMPONENTFILEINUSE -20
|
||||
#define DSETUPERR_UNTRUSTEDCABINETFILE -21
|
||||
|
||||
// DSETUP flags. DirectX 5.0 apps should use these flags only.
|
||||
#define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */
|
||||
#define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */
|
||||
#define DSETUP_DXCORE 0x00010000 /* install DirectX runtime */
|
||||
#define DSETUP_DIRECTX (DSETUP_DXCORE|DSETUP_DDRAWDRV|DSETUP_DSOUNDDRV)
|
||||
#define DSETUP_MANAGEDDX 0x00004000 /* OBSOLETE. install managed DirectX */
|
||||
#define DSETUP_TESTINSTALL 0x00020000 /* just test install, don't do anything */
|
||||
|
||||
// These OBSOLETE flags are here for compatibility with pre-DX5 apps only.
|
||||
// They are present to allow DX3 apps to be recompiled with DX5 and still work.
|
||||
// DO NOT USE THEM for DX5. They will go away in future DX releases.
|
||||
#define DSETUP_DDRAW 0x00000001 /* OBSOLETE. install DirectDraw */
|
||||
#define DSETUP_DSOUND 0x00000002 /* OBSOLETE. install DirectSound */
|
||||
#define DSETUP_DPLAY 0x00000004 /* OBSOLETE. install DirectPlay */
|
||||
#define DSETUP_DPLAYSP 0x00000020 /* OBSOLETE. install DirectPlay Providers */
|
||||
#define DSETUP_DVIDEO 0x00000040 /* OBSOLETE. install DirectVideo */
|
||||
#define DSETUP_D3D 0x00000200 /* OBSOLETE. install Direct3D */
|
||||
#define DSETUP_DINPUT 0x00000800 /* OBSOLETE. install DirectInput */
|
||||
#define DSETUP_DIRECTXSETUP 0x00001000 /* OBSOLETE. install DirectXSetup DLL's */
|
||||
#define DSETUP_NOUI 0x00002000 /* OBSOLETE. install DirectX with NO UI */
|
||||
#define DSETUP_PROMPTFORDRIVERS 0x10000000 /* OBSOLETE. prompt when replacing display/audio drivers */
|
||||
#define DSETUP_RESTOREDRIVERS 0x20000000 /* OBSOLETE. restore display/audio drivers */
|
||||
|
||||
|
||||
|
||||
//******************************************************************
|
||||
// DirectX Setup Callback mechanism
|
||||
//******************************************************************
|
||||
|
||||
// DSETUP Message Info Codes, passed to callback as Reason parameter.
|
||||
#define DSETUP_CB_MSG_NOMESSAGE 0
|
||||
#define DSETUP_CB_MSG_INTERNAL_ERROR 10
|
||||
#define DSETUP_CB_MSG_BEGIN_INSTALL 13
|
||||
#define DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME 14
|
||||
#define DSETUP_CB_MSG_PROGRESS 18
|
||||
#define DSETUP_CB_MSG_WARNING_DISABLED_COMPONENT 19
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct _DSETUP_CB_PROGRESS
|
||||
{
|
||||
DWORD dwPhase;
|
||||
DWORD dwInPhaseMaximum;
|
||||
DWORD dwInPhaseProgress;
|
||||
DWORD dwOverallMaximum;
|
||||
DWORD dwOverallProgress;
|
||||
} DSETUP_CB_PROGRESS;
|
||||
|
||||
|
||||
enum _DSETUP_CB_PROGRESS_PHASE
|
||||
{
|
||||
DSETUP_INITIALIZING,
|
||||
DSETUP_EXTRACTING,
|
||||
DSETUP_COPYING,
|
||||
DSETUP_FINALIZING
|
||||
};
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
//
|
||||
// Data Structures
|
||||
//
|
||||
#ifndef UNICODE_ONLY
|
||||
|
||||
typedef struct _DIRECTXREGISTERAPPA {
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
LPSTR lpszApplicationName;
|
||||
LPGUID lpGUID;
|
||||
LPSTR lpszFilename;
|
||||
LPSTR lpszCommandLine;
|
||||
LPSTR lpszPath;
|
||||
LPSTR lpszCurrentDirectory;
|
||||
} DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA;
|
||||
|
||||
typedef struct _DIRECTXREGISTERAPP2A {
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
LPSTR lpszApplicationName;
|
||||
LPGUID lpGUID;
|
||||
LPSTR lpszFilename;
|
||||
LPSTR lpszCommandLine;
|
||||
LPSTR lpszPath;
|
||||
LPSTR lpszCurrentDirectory;
|
||||
LPSTR lpszLauncherName;
|
||||
} DIRECTXREGISTERAPP2A, *PDIRECTXREGISTERAPP2A, *LPDIRECTXREGISTERAPP2A;
|
||||
|
||||
#endif //!UNICODE_ONLY
|
||||
#ifndef ANSI_ONLY
|
||||
|
||||
typedef struct _DIRECTXREGISTERAPPW {
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
LPWSTR lpszApplicationName;
|
||||
LPGUID lpGUID;
|
||||
LPWSTR lpszFilename;
|
||||
LPWSTR lpszCommandLine;
|
||||
LPWSTR lpszPath;
|
||||
LPWSTR lpszCurrentDirectory;
|
||||
} DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW;
|
||||
|
||||
typedef struct _DIRECTXREGISTERAPP2W {
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
LPWSTR lpszApplicationName;
|
||||
LPGUID lpGUID;
|
||||
LPWSTR lpszFilename;
|
||||
LPWSTR lpszCommandLine;
|
||||
LPWSTR lpszPath;
|
||||
LPWSTR lpszCurrentDirectory;
|
||||
LPWSTR lpszLauncherName;
|
||||
} DIRECTXREGISTERAPP2W, *PDIRECTXREGISTERAPP2W, *LPDIRECTXREGISTERAPP2W;
|
||||
#endif //!ANSI_ONLY
|
||||
#ifdef UNICODE
|
||||
typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP;
|
||||
typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP;
|
||||
typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP;
|
||||
typedef DIRECTXREGISTERAPP2W DIRECTXREGISTERAPP2;
|
||||
typedef PDIRECTXREGISTERAPP2W PDIRECTXREGISTERAPP2;
|
||||
typedef LPDIRECTXREGISTERAPP2W LPDIRECTXREGISTERAPP2;
|
||||
#else
|
||||
typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP;
|
||||
typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP;
|
||||
typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP;
|
||||
typedef DIRECTXREGISTERAPP2A DIRECTXREGISTERAPP2;
|
||||
typedef PDIRECTXREGISTERAPP2A PDIRECTXREGISTERAPP2;
|
||||
typedef LPDIRECTXREGISTERAPP2A LPDIRECTXREGISTERAPP2;
|
||||
#endif // UNICODE
|
||||
|
||||
|
||||
//
|
||||
// API
|
||||
//
|
||||
|
||||
#ifndef UNICODE_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXSetupA(
|
||||
HWND hWnd,
|
||||
__in_opt LPSTR lpszRootPath,
|
||||
DWORD dwFlags
|
||||
);
|
||||
#endif //!UNICODE_ONLY
|
||||
#ifndef ANSI_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXSetupW(
|
||||
HWND hWnd,
|
||||
__in_opt LPWSTR lpszRootPath,
|
||||
DWORD dwFlags
|
||||
);
|
||||
#endif //!ANSI_ONLY
|
||||
#ifdef UNICODE
|
||||
#define DirectXSetup DirectXSetupW
|
||||
#else
|
||||
#define DirectXSetup DirectXSetupA
|
||||
#endif // !UNICODE
|
||||
|
||||
#ifndef UNICODE_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXRegisterApplicationA(
|
||||
HWND hWnd,
|
||||
LPVOID lpDXRegApp
|
||||
);
|
||||
#endif //!UNICODE_ONLY
|
||||
#ifndef ANSI_ONLY
|
||||
INT
|
||||
WINAPI
|
||||
DirectXRegisterApplicationW(
|
||||
HWND hWnd,
|
||||
LPVOID lpDXRegApp
|
||||
);
|
||||
#endif //!ANSI_ONLY
|
||||
#ifdef UNICODE
|
||||
#define DirectXRegisterApplication DirectXRegisterApplicationW
|
||||
#else
|
||||
#define DirectXRegisterApplication DirectXRegisterApplicationA
|
||||
#endif // !UNICODE
|
||||
|
||||
INT
|
||||
WINAPI
|
||||
DirectXUnRegisterApplication(
|
||||
HWND hWnd,
|
||||
LPGUID lpGUID
|
||||
);
|
||||
|
||||
//
|
||||
// Function Pointers
|
||||
//
|
||||
#ifdef UNICODE
|
||||
typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD);
|
||||
typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID);
|
||||
#else
|
||||
typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD);
|
||||
typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID);
|
||||
#endif // UNICODE
|
||||
|
||||
typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason,
|
||||
DWORD MsgType, /* Same as flags to MessageBox */
|
||||
LPSTR szMessage,
|
||||
LPSTR szName,
|
||||
void *pInfo);
|
||||
|
||||
INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback);
|
||||
INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion);
|
||||
INT WINAPI DirectXSetupShowEULA(HWND hWndParent);
|
||||
#ifndef UNICODE_ONLY
|
||||
UINT
|
||||
WINAPI
|
||||
DirectXSetupGetEULAA(
|
||||
__out_ecount(cchEULA) LPSTR lpszEULA,
|
||||
UINT cchEULA,
|
||||
WORD LangID
|
||||
);
|
||||
#endif //!UNICODE_ONLY
|
||||
#ifndef ANSI_ONLY
|
||||
UINT
|
||||
WINAPI
|
||||
DirectXSetupGetEULAW(
|
||||
__out_ecount(cchEULA) LPWSTR lpszEULA,
|
||||
UINT cchEULA,
|
||||
WORD LangID
|
||||
);
|
||||
#endif //!ANSI_ONLY
|
||||
#ifdef UNICODE
|
||||
#define DirectXSetupGetEULA DirectXSetupGetEULAW
|
||||
typedef UINT (WINAPI * LPDIRECTXSETUPGETEULA)(LPWSTR, UINT, WORD);
|
||||
#else
|
||||
#define DirectXSetupGetEULA DirectXSetupGetEULAA
|
||||
typedef UINT (WINAPI * LPDIRECTXSETUPGETEULA)(LPSTR, UINT, WORD);
|
||||
#endif // !UNICODE
|
||||
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
2385
SDK/Include/dsound.h
Normal file
2385
SDK/Include/dsound.h
Normal file
File diff suppressed because it is too large
Load Diff
187
SDK/Include/dxdiag.h
Normal file
187
SDK/Include/dxdiag.h
Normal file
@ -0,0 +1,187 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: dxdiag.h
|
||||
* Content: DirectX Diagnostic Tool include file
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _DXDIAG_H_
|
||||
#define _DXDIAG_H_
|
||||
|
||||
#include <ole2.h> // for DECLARE_INTERFACE_ and HRESULT
|
||||
|
||||
// This identifier is passed to IDxDiagProvider::Initialize in order to ensure that an
|
||||
// application was built against the correct header files. This number is
|
||||
// incremented whenever a header (or other) change would require applications
|
||||
// to be rebuilt. If the version doesn't match, IDxDiagProvider::Initialize will fail.
|
||||
// (The number itself has no meaning.)
|
||||
#define DXDIAG_DX9_SDK_VERSION 111
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DxDiag Errors
|
||||
*
|
||||
****************************************************************************/
|
||||
#define DXDIAG_E_INSUFFICIENT_BUFFER ((HRESULT)0x8007007AL) // HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DxDiag CLSIDs
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
// {A65B8071-3BFE-4213-9A5B-491DA4461CA7}
|
||||
DEFINE_GUID(CLSID_DxDiagProvider,
|
||||
0xA65B8071, 0x3BFE, 0x4213, 0x9A, 0x5B, 0x49, 0x1D, 0xA4, 0x46, 0x1C, 0xA7);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DxDiag Interface IIDs
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
// {9C6B4CB0-23F8-49CC-A3ED-45A55000A6D2}
|
||||
DEFINE_GUID(IID_IDxDiagProvider,
|
||||
0x9C6B4CB0, 0x23F8, 0x49CC, 0xA3, 0xED, 0x45, 0xA5, 0x50, 0x00, 0xA6, 0xD2);
|
||||
|
||||
// {0x7D0F462F-0x4064-0x4862-BC7F-933E5058C10F}
|
||||
DEFINE_GUID(IID_IDxDiagContainer,
|
||||
0x7D0F462F, 0x4064, 0x4862, 0xBC, 0x7F, 0x93, 0x3E, 0x50, 0x58, 0xC1, 0x0F);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DxDiag Interface Pointer definitions
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
typedef struct IDxDiagProvider *LPDXDIAGPROVIDER, *PDXDIAGPROVIDER;
|
||||
|
||||
typedef struct IDxDiagContainer *LPDXDIAGCONTAINER, *PDXDIAGCONTAINER;
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DxDiag Structures
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
typedef struct _DXDIAG_INIT_PARAMS
|
||||
{
|
||||
DWORD dwSize; // Size of this structure.
|
||||
DWORD dwDxDiagHeaderVersion; // Pass in DXDIAG_DX9_SDK_VERSION. This verifies
|
||||
// the header and dll are correctly matched.
|
||||
BOOL bAllowWHQLChecks; // If true, allow dxdiag to check if drivers are
|
||||
// digital signed as logo'd by WHQL which may
|
||||
// connect via internet to update WHQL certificates.
|
||||
VOID* pReserved; // Reserved. Must be NULL.
|
||||
} DXDIAG_INIT_PARAMS;
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DxDiag Application Interfaces
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
//
|
||||
// COM definition for IDxDiagProvider
|
||||
//
|
||||
#undef INTERFACE // External COM Implementation
|
||||
#define INTERFACE IDxDiagProvider
|
||||
DECLARE_INTERFACE_(IDxDiagProvider,IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
/*** IDxDiagProvider methods ***/
|
||||
STDMETHOD(Initialize) (THIS_ DXDIAG_INIT_PARAMS* pParams) PURE;
|
||||
STDMETHOD(GetRootContainer) (THIS_ IDxDiagContainer **ppInstance) PURE;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// COM definition for IDxDiagContainer
|
||||
//
|
||||
#undef INTERFACE // External COM Implementation
|
||||
#define INTERFACE IDxDiagContainer
|
||||
DECLARE_INTERFACE_(IDxDiagContainer,IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
/*** IDxDiagContainer methods ***/
|
||||
STDMETHOD(GetNumberOfChildContainers) (THIS_ DWORD *pdwCount) PURE;
|
||||
STDMETHOD(EnumChildContainerNames) (THIS_ DWORD dwIndex, LPWSTR pwszContainer, DWORD cchContainer) PURE;
|
||||
STDMETHOD(GetChildContainer) (THIS_ LPCWSTR pwszContainer, IDxDiagContainer **ppInstance) PURE;
|
||||
STDMETHOD(GetNumberOfProps) (THIS_ DWORD *pdwCount) PURE;
|
||||
STDMETHOD(EnumPropNames) (THIS_ DWORD dwIndex, LPWSTR pwszPropName, DWORD cchPropName) PURE;
|
||||
STDMETHOD(GetProp) (THIS_ LPCWSTR pwszPropName, VARIANT *pvarProp) PURE;
|
||||
};
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* DxDiag application interface macros
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
#define IDxDiagProvider_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDxDiagProvider_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDxDiagProvider_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDxDiagProvider_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
|
||||
#define IDxDiagProvider_GetRootContainer(p,a) (p)->lpVtbl->GetRootContainer(p,a)
|
||||
|
||||
#define IDxDiagContainer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDxDiagContainer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDxDiagContainer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDxDiagContainer_GetNumberOfChildContainers(p,a) (p)->lpVtbl->GetNumberOfChildContainers(p,a)
|
||||
#define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->lpVtbl->EnumChildContainerNames(p,a,b,c)
|
||||
#define IDxDiagContainer_GetChildContainer(p,a,b) (p)->lpVtbl->GetChildContainer(p,a,b)
|
||||
#define IDxDiagContainer_GetNumberOfProps(p,a) (p)->lpVtbl->GetNumberOfProps(p,a)
|
||||
#define IDxDiagContainer_EnumProps(p,a,b) (p)->lpVtbl->EnumProps(p,a,b,c)
|
||||
#define IDxDiagContainer_GetProp(p,a,b) (p)->lpVtbl->GetProp(p,a,b)
|
||||
|
||||
#else /* C++ */
|
||||
|
||||
#define IDxDiagProvider_QueryInterface(p,a,b) (p)->QueryInterface(p,a,b)
|
||||
#define IDxDiagProvider_AddRef(p) (p)->AddRef(p)
|
||||
#define IDxDiagProvider_Release(p) (p)->Release(p)
|
||||
#define IDxDiagProvider_Initialize(p,a,b) (p)->Initialize(p,a,b)
|
||||
#define IDxDiagProvider_GetRootContainer(p,a) (p)->GetRootContainer(p,a)
|
||||
|
||||
#define IDxDiagContainer_QueryInterface(p,a,b) (p)->QueryInterface(p,a,b)
|
||||
#define IDxDiagContainer_AddRef(p) (p)->AddRef(p)
|
||||
#define IDxDiagContainer_Release(p) (p)->Release(p)
|
||||
#define IDxDiagContainer_GetNumberOfChildContainers(p,a) (p)->GetNumberOfChildContainers(p,a)
|
||||
#define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->EnumChildContainerNames(p,a,b,c)
|
||||
#define IDxDiagContainer_GetChildContainer(p,a,b) (p)->GetChildContainer(p,a,b)
|
||||
#define IDxDiagContainer_GetNumberOfProps(p,a) (p)->GetNumberOfProps(p,a)
|
||||
#define IDxDiagContainer_EnumProps(p,a,b) (p)->EnumProps(p,a,b,c)
|
||||
#define IDxDiagContainer_GetProp(p,a,b) (p)->GetProp(p,a,b)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _DXDIAG_H_ */
|
||||
|
||||
|
239
SDK/Include/dxfile.h
Normal file
239
SDK/Include/dxfile.h
Normal file
@ -0,0 +1,239 @@
|
||||
/***************************************************************************
|
||||
*
|
||||
* Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: dxfile.h
|
||||
*
|
||||
* Content: DirectX File public header file
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __DXFILE_H__
|
||||
#define __DXFILE_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef DWORD DXFILEFORMAT;
|
||||
|
||||
#define DXFILEFORMAT_BINARY 0
|
||||
#define DXFILEFORMAT_TEXT 1
|
||||
#define DXFILEFORMAT_COMPRESSED 2
|
||||
|
||||
typedef DWORD DXFILELOADOPTIONS;
|
||||
|
||||
#define DXFILELOAD_FROMFILE 0x00L
|
||||
#define DXFILELOAD_FROMRESOURCE 0x01L
|
||||
#define DXFILELOAD_FROMMEMORY 0x02L
|
||||
#define DXFILELOAD_FROMSTREAM 0x04L
|
||||
#define DXFILELOAD_FROMURL 0x08L
|
||||
|
||||
typedef struct _DXFILELOADRESOURCE {
|
||||
HMODULE hModule;
|
||||
LPCTSTR lpName;
|
||||
LPCTSTR lpType;
|
||||
}DXFILELOADRESOURCE, *LPDXFILELOADRESOURCE;
|
||||
|
||||
typedef struct _DXFILELOADMEMORY {
|
||||
LPVOID lpMemory;
|
||||
DWORD dSize;
|
||||
}DXFILELOADMEMORY, *LPDXFILELOADMEMORY;
|
||||
|
||||
/*
|
||||
* DirectX File object types.
|
||||
*/
|
||||
|
||||
#ifndef WIN_TYPES
|
||||
#define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype
|
||||
#endif
|
||||
|
||||
WIN_TYPES(IDirectXFile, DIRECTXFILE);
|
||||
WIN_TYPES(IDirectXFileEnumObject, DIRECTXFILEENUMOBJECT);
|
||||
WIN_TYPES(IDirectXFileSaveObject, DIRECTXFILESAVEOBJECT);
|
||||
WIN_TYPES(IDirectXFileObject, DIRECTXFILEOBJECT);
|
||||
WIN_TYPES(IDirectXFileData, DIRECTXFILEDATA);
|
||||
WIN_TYPES(IDirectXFileDataReference, DIRECTXFILEDATAREFERENCE);
|
||||
WIN_TYPES(IDirectXFileBinary, DIRECTXFILEBINARY);
|
||||
|
||||
/*
|
||||
* API for creating IDirectXFile interface.
|
||||
*/
|
||||
|
||||
STDAPI DirectXFileCreate(LPDIRECTXFILE *lplpDirectXFile);
|
||||
|
||||
/*
|
||||
* The methods for IUnknown
|
||||
*/
|
||||
|
||||
#define IUNKNOWN_METHODS(kind) \
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) kind; \
|
||||
STDMETHOD_(ULONG, AddRef) (THIS) kind; \
|
||||
STDMETHOD_(ULONG, Release) (THIS) kind
|
||||
|
||||
/*
|
||||
* The methods for IDirectXFileObject
|
||||
*/
|
||||
|
||||
#define IDIRECTXFILEOBJECT_METHODS(kind) \
|
||||
STDMETHOD(GetName) (THIS_ LPSTR, LPDWORD) kind; \
|
||||
STDMETHOD(GetId) (THIS_ LPGUID) kind
|
||||
|
||||
/*
|
||||
* DirectX File interfaces.
|
||||
*/
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectXFile
|
||||
|
||||
DECLARE_INTERFACE_(IDirectXFile, IUnknown)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
STDMETHOD(CreateEnumObject) (THIS_ LPVOID, DXFILELOADOPTIONS,
|
||||
LPDIRECTXFILEENUMOBJECT *) PURE;
|
||||
STDMETHOD(CreateSaveObject) (THIS_ LPCSTR, DXFILEFORMAT,
|
||||
LPDIRECTXFILESAVEOBJECT *) PURE;
|
||||
STDMETHOD(RegisterTemplates) (THIS_ LPVOID, DWORD) PURE;
|
||||
};
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectXFileEnumObject
|
||||
|
||||
DECLARE_INTERFACE_(IDirectXFileEnumObject, IUnknown)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
STDMETHOD(GetNextDataObject) (THIS_ LPDIRECTXFILEDATA *) PURE;
|
||||
STDMETHOD(GetDataObjectById) (THIS_ REFGUID, LPDIRECTXFILEDATA *) PURE;
|
||||
STDMETHOD(GetDataObjectByName) (THIS_ LPCSTR, LPDIRECTXFILEDATA *) PURE;
|
||||
};
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectXFileSaveObject
|
||||
|
||||
DECLARE_INTERFACE_(IDirectXFileSaveObject, IUnknown)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
STDMETHOD(SaveTemplates) (THIS_ DWORD, const GUID **) PURE;
|
||||
STDMETHOD(CreateDataObject) (THIS_ REFGUID, LPCSTR, const GUID *,
|
||||
DWORD, LPVOID, LPDIRECTXFILEDATA *) PURE;
|
||||
STDMETHOD(SaveData) (THIS_ LPDIRECTXFILEDATA) PURE;
|
||||
};
|
||||
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectXFileObject
|
||||
|
||||
DECLARE_INTERFACE_(IDirectXFileObject, IUnknown)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
IDIRECTXFILEOBJECT_METHODS(PURE);
|
||||
};
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectXFileData
|
||||
|
||||
DECLARE_INTERFACE_(IDirectXFileData, IDirectXFileObject)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
IDIRECTXFILEOBJECT_METHODS(PURE);
|
||||
|
||||
STDMETHOD(GetData) (THIS_ LPCSTR, DWORD *, void **) PURE;
|
||||
STDMETHOD(GetType) (THIS_ const GUID **) PURE;
|
||||
STDMETHOD(GetNextObject) (THIS_ LPDIRECTXFILEOBJECT *) PURE;
|
||||
STDMETHOD(AddDataObject) (THIS_ LPDIRECTXFILEDATA) PURE;
|
||||
STDMETHOD(AddDataReference) (THIS_ LPCSTR, const GUID *) PURE;
|
||||
STDMETHOD(AddBinaryObject) (THIS_ LPCSTR, const GUID *, LPCSTR, LPVOID, DWORD) PURE;
|
||||
};
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectXFileDataReference
|
||||
|
||||
DECLARE_INTERFACE_(IDirectXFileDataReference, IDirectXFileObject)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
IDIRECTXFILEOBJECT_METHODS(PURE);
|
||||
|
||||
STDMETHOD(Resolve) (THIS_ LPDIRECTXFILEDATA *) PURE;
|
||||
};
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectXFileBinary
|
||||
|
||||
DECLARE_INTERFACE_(IDirectXFileBinary, IDirectXFileObject)
|
||||
{
|
||||
IUNKNOWN_METHODS(PURE);
|
||||
IDIRECTXFILEOBJECT_METHODS(PURE);
|
||||
|
||||
STDMETHOD(GetSize) (THIS_ DWORD *) PURE;
|
||||
STDMETHOD(GetMimeType) (THIS_ LPCSTR *) PURE;
|
||||
STDMETHOD(Read) (THIS_ LPVOID, DWORD, LPDWORD) PURE;
|
||||
};
|
||||
|
||||
/*
|
||||
* DirectXFile Object Class Id (for CoCreateInstance())
|
||||
*/
|
||||
|
||||
DEFINE_GUID(CLSID_CDirectXFile, 0x4516ec43, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
|
||||
|
||||
/*
|
||||
* DirectX File Interface GUIDs.
|
||||
*/
|
||||
|
||||
DEFINE_GUID(IID_IDirectXFile, 0x3d82ab40, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
DEFINE_GUID(IID_IDirectXFileEnumObject, 0x3d82ab41, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
DEFINE_GUID(IID_IDirectXFileSaveObject, 0x3d82ab42, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
DEFINE_GUID(IID_IDirectXFileObject, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
DEFINE_GUID(IID_IDirectXFileData, 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
DEFINE_GUID(IID_IDirectXFileDataReference, 0x3d82ab45, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
DEFINE_GUID(IID_IDirectXFileBinary, 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
|
||||
/*
|
||||
* DirectX File Header template's GUID.
|
||||
*/
|
||||
|
||||
DEFINE_GUID(TID_DXFILEHeader, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
|
||||
|
||||
/*
|
||||
* DirectX File errors.
|
||||
*/
|
||||
|
||||
#define _FACDD 0x876
|
||||
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
|
||||
|
||||
#define DXFILE_OK 0
|
||||
|
||||
#define DXFILEERR_BADOBJECT MAKE_DDHRESULT(850)
|
||||
#define DXFILEERR_BADVALUE MAKE_DDHRESULT(851)
|
||||
#define DXFILEERR_BADTYPE MAKE_DDHRESULT(852)
|
||||
#define DXFILEERR_BADSTREAMHANDLE MAKE_DDHRESULT(853)
|
||||
#define DXFILEERR_BADALLOC MAKE_DDHRESULT(854)
|
||||
#define DXFILEERR_NOTFOUND MAKE_DDHRESULT(855)
|
||||
#define DXFILEERR_NOTDONEYET MAKE_DDHRESULT(856)
|
||||
#define DXFILEERR_FILENOTFOUND MAKE_DDHRESULT(857)
|
||||
#define DXFILEERR_RESOURCENOTFOUND MAKE_DDHRESULT(858)
|
||||
#define DXFILEERR_URLNOTFOUND MAKE_DDHRESULT(859)
|
||||
#define DXFILEERR_BADRESOURCE MAKE_DDHRESULT(860)
|
||||
#define DXFILEERR_BADFILETYPE MAKE_DDHRESULT(861)
|
||||
#define DXFILEERR_BADFILEVERSION MAKE_DDHRESULT(862)
|
||||
#define DXFILEERR_BADFILEFLOATSIZE MAKE_DDHRESULT(863)
|
||||
#define DXFILEERR_BADFILECOMPRESSIONTYPE MAKE_DDHRESULT(864)
|
||||
#define DXFILEERR_BADFILE MAKE_DDHRESULT(865)
|
||||
#define DXFILEERR_PARSEERROR MAKE_DDHRESULT(866)
|
||||
#define DXFILEERR_NOTEMPLATE MAKE_DDHRESULT(867)
|
||||
#define DXFILEERR_BADARRAYSIZE MAKE_DDHRESULT(868)
|
||||
#define DXFILEERR_BADDATAREFERENCE MAKE_DDHRESULT(869)
|
||||
#define DXFILEERR_INTERNALERROR MAKE_DDHRESULT(870)
|
||||
#define DXFILEERR_NOMOREOBJECTS MAKE_DDHRESULT(871)
|
||||
#define DXFILEERR_BADINTRINSICS MAKE_DDHRESULT(872)
|
||||
#define DXFILEERR_NOMORESTREAMHANDLES MAKE_DDHRESULT(873)
|
||||
#define DXFILEERR_NOMOREDATA MAKE_DDHRESULT(874)
|
||||
#define DXFILEERR_BADCACHEFILE MAKE_DDHRESULT(875)
|
||||
#define DXFILEERR_NOINTERNET MAKE_DDHRESULT(876)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* _DXFILE_H_ */
|
18
SDK/Include/dxsdkver.h
Normal file
18
SDK/Include/dxsdkver.h
Normal file
@ -0,0 +1,18 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
*
|
||||
* File: dxsdkver.h
|
||||
* Content: DirectX SDK Version Include File
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _DXSDKVER_H_
|
||||
#define _DXSDKVER_H_
|
||||
|
||||
#define _DXSDK_PRODUCT_MAJOR 9
|
||||
#define _DXSDK_PRODUCT_MINOR 29
|
||||
#define _DXSDK_BUILD_MAJOR 1962
|
||||
#define _DXSDK_BUILD_MINOR 0
|
||||
|
||||
#endif // _DXSDKVER_H_
|
||||
|
719
SDK/Include/gameux.h
Normal file
719
SDK/Include/gameux.h
Normal file
@ -0,0 +1,719 @@
|
||||
|
||||
|
||||
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 7.00.0550 */
|
||||
/* Compiler settings for gameux.idl:
|
||||
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0550
|
||||
protocol : dce , ms_ext, c_ext, robust
|
||||
error checks: allocation ref bounds_check enum stub_data
|
||||
VC __declspec() decoration level:
|
||||
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
|
||||
DECLSPEC_UUID(), MIDL_INTERFACE()
|
||||
*/
|
||||
/* @@MIDL_FILE_HEADING( ) */
|
||||
|
||||
#pragma warning( disable: 4049 ) /* more than 64k source lines */
|
||||
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCSAL_H_VERSION__
|
||||
#define __REQUIRED_RPCSAL_H_VERSION__ 100
|
||||
#endif
|
||||
|
||||
#include "rpc.h"
|
||||
#include "rpcndr.h"
|
||||
|
||||
#ifndef __RPCNDR_H_VERSION__
|
||||
#error this stub requires an updated version of <rpcndr.h>
|
||||
#endif // __RPCNDR_H_VERSION__
|
||||
|
||||
#ifndef COM_NO_WINDOWS_H
|
||||
#include "windows.h"
|
||||
#include "ole2.h"
|
||||
#endif /*COM_NO_WINDOWS_H*/
|
||||
|
||||
#ifndef __gameux_h__
|
||||
#define __gameux_h__
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
#ifndef __IGameExplorer_FWD_DEFINED__
|
||||
#define __IGameExplorer_FWD_DEFINED__
|
||||
typedef interface IGameExplorer IGameExplorer;
|
||||
#endif /* __IGameExplorer_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __IGameStatistics_FWD_DEFINED__
|
||||
#define __IGameStatistics_FWD_DEFINED__
|
||||
typedef interface IGameStatistics IGameStatistics;
|
||||
#endif /* __IGameStatistics_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __IGameStatisticsMgr_FWD_DEFINED__
|
||||
#define __IGameStatisticsMgr_FWD_DEFINED__
|
||||
typedef interface IGameStatisticsMgr IGameStatisticsMgr;
|
||||
#endif /* __IGameStatisticsMgr_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __IGameExplorer2_FWD_DEFINED__
|
||||
#define __IGameExplorer2_FWD_DEFINED__
|
||||
typedef interface IGameExplorer2 IGameExplorer2;
|
||||
#endif /* __IGameExplorer2_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __GameExplorer_FWD_DEFINED__
|
||||
#define __GameExplorer_FWD_DEFINED__
|
||||
|
||||
#ifdef __cplusplus
|
||||
typedef class GameExplorer GameExplorer;
|
||||
#else
|
||||
typedef struct GameExplorer GameExplorer;
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GameExplorer_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __GameStatistics_FWD_DEFINED__
|
||||
#define __GameStatistics_FWD_DEFINED__
|
||||
|
||||
#ifdef __cplusplus
|
||||
typedef class GameStatistics GameStatistics;
|
||||
#else
|
||||
typedef struct GameStatistics GameStatistics;
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GameStatistics_FWD_DEFINED__ */
|
||||
|
||||
|
||||
/* header files for imported files */
|
||||
#include "oaidl.h"
|
||||
#include "ocidl.h"
|
||||
#include "shobjidl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
|
||||
/* interface __MIDL_itf_gameux_0000_0000 */
|
||||
/* [local] */
|
||||
|
||||
#define ID_GDF_XML __GDF_XML
|
||||
#define ID_GDF_THUMBNAIL __GDF_THUMBNAIL
|
||||
#define ID_ICON_ICO __ICON_ICO
|
||||
#define ID_GDF_XML_STR L"__GDF_XML"
|
||||
#define ID_GDF_THUMBNAIL_STR L"__GDF_THUMBNAIL"
|
||||
typedef /* [v1_enum] */
|
||||
enum GAME_INSTALL_SCOPE
|
||||
{ GIS_NOT_INSTALLED = 1,
|
||||
GIS_CURRENT_USER = 2,
|
||||
GIS_ALL_USERS = 3
|
||||
} GAME_INSTALL_SCOPE;
|
||||
|
||||
|
||||
|
||||
extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0000_v0_0_c_ifspec;
|
||||
extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0000_v0_0_s_ifspec;
|
||||
|
||||
#ifndef __IGameExplorer_INTERFACE_DEFINED__
|
||||
#define __IGameExplorer_INTERFACE_DEFINED__
|
||||
|
||||
/* interface IGameExplorer */
|
||||
/* [unique][helpstring][uuid][object] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_IGameExplorer;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("E7B2FB72-D728-49B3-A5F2-18EBF5F1349E")
|
||||
IGameExplorer : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddGame(
|
||||
/* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
|
||||
/* [in] */ __RPC__in BSTR bstrGameInstallDirectory,
|
||||
/* [in] */ GAME_INSTALL_SCOPE installScope,
|
||||
/* [out][in] */ __RPC__inout GUID *pguidInstanceID) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveGame(
|
||||
/* [in] */ GUID guidInstanceID) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UpdateGame(
|
||||
/* [in] */ GUID guidInstanceID) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VerifyAccess(
|
||||
/* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
|
||||
/* [out] */ __RPC__out BOOL *pfHasAccess) = 0;
|
||||
|
||||
};
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct IGameExplorerVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
__RPC__in IGameExplorer * This,
|
||||
/* [in] */ __RPC__in REFIID riid,
|
||||
/* [annotation][iid_is][out] */
|
||||
__RPC__deref_out void **ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
__RPC__in IGameExplorer * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
__RPC__in IGameExplorer * This);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AddGame )(
|
||||
__RPC__in IGameExplorer * This,
|
||||
/* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
|
||||
/* [in] */ __RPC__in BSTR bstrGameInstallDirectory,
|
||||
/* [in] */ GAME_INSTALL_SCOPE installScope,
|
||||
/* [out][in] */ __RPC__inout GUID *pguidInstanceID);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveGame )(
|
||||
__RPC__in IGameExplorer * This,
|
||||
/* [in] */ GUID guidInstanceID);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *UpdateGame )(
|
||||
__RPC__in IGameExplorer * This,
|
||||
/* [in] */ GUID guidInstanceID);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VerifyAccess )(
|
||||
__RPC__in IGameExplorer * This,
|
||||
/* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
|
||||
/* [out] */ __RPC__out BOOL *pfHasAccess);
|
||||
|
||||
END_INTERFACE
|
||||
} IGameExplorerVtbl;
|
||||
|
||||
interface IGameExplorer
|
||||
{
|
||||
CONST_VTBL struct IGameExplorerVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define IGameExplorer_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define IGameExplorer_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define IGameExplorer_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#define IGameExplorer_AddGame(This,bstrGDFBinaryPath,bstrGameInstallDirectory,installScope,pguidInstanceID) \
|
||||
( (This)->lpVtbl -> AddGame(This,bstrGDFBinaryPath,bstrGameInstallDirectory,installScope,pguidInstanceID) )
|
||||
|
||||
#define IGameExplorer_RemoveGame(This,guidInstanceID) \
|
||||
( (This)->lpVtbl -> RemoveGame(This,guidInstanceID) )
|
||||
|
||||
#define IGameExplorer_UpdateGame(This,guidInstanceID) \
|
||||
( (This)->lpVtbl -> UpdateGame(This,guidInstanceID) )
|
||||
|
||||
#define IGameExplorer_VerifyAccess(This,bstrGDFBinaryPath,pfHasAccess) \
|
||||
( (This)->lpVtbl -> VerifyAccess(This,bstrGDFBinaryPath,pfHasAccess) )
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __IGameExplorer_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
/* interface __MIDL_itf_gameux_0000_0001 */
|
||||
/* [local] */
|
||||
|
||||
typedef /* [v1_enum] */
|
||||
enum GAMESTATS_OPEN_TYPE
|
||||
{ GAMESTATS_OPEN_OPENORCREATE = 0,
|
||||
GAMESTATS_OPEN_OPENONLY = 1
|
||||
} GAMESTATS_OPEN_TYPE;
|
||||
|
||||
typedef /* [v1_enum] */
|
||||
enum GAMESTATS_OPEN_RESULT
|
||||
{ GAMESTATS_OPEN_CREATED = 0,
|
||||
GAMESTATS_OPEN_OPENED = 1
|
||||
} GAMESTATS_OPEN_RESULT;
|
||||
|
||||
|
||||
|
||||
extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0001_v0_0_c_ifspec;
|
||||
extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0001_v0_0_s_ifspec;
|
||||
|
||||
#ifndef __IGameStatistics_INTERFACE_DEFINED__
|
||||
#define __IGameStatistics_INTERFACE_DEFINED__
|
||||
|
||||
/* interface IGameStatistics */
|
||||
/* [unique][helpstring][uuid][object] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_IGameStatistics;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("3887C9CA-04A0-42ae-BC4C-5FA6C7721145")
|
||||
IGameStatistics : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxCategoryLength(
|
||||
/* [retval][out] */ __RPC__out UINT *cch) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxNameLength(
|
||||
/* [retval][out] */ __RPC__out UINT *cch) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxValueLength(
|
||||
/* [retval][out] */ __RPC__out UINT *cch) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxCategories(
|
||||
/* [retval][out] */ __RPC__out WORD *pMax) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxStatsPerCategory(
|
||||
/* [retval][out] */ __RPC__out WORD *pMax) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCategoryTitle(
|
||||
/* [in] */ WORD categoryIndex,
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR title) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCategoryTitle(
|
||||
/* [in] */ WORD categoryIndex,
|
||||
/* [retval][string][out] */ __RPC__deref_out_opt_string LPWSTR *pTitle) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStatistic(
|
||||
/* [in] */ WORD categoryIndex,
|
||||
/* [in] */ WORD statIndex,
|
||||
/* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pName,
|
||||
/* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pValue) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStatistic(
|
||||
/* [in] */ WORD categoryIndex,
|
||||
/* [in] */ WORD statIndex,
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR name,
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR value) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Save(
|
||||
/* [in] */ BOOL trackChanges) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetLastPlayedCategory(
|
||||
/* [in] */ UINT categoryIndex) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetLastPlayedCategory(
|
||||
/* [retval][out] */ __RPC__out UINT *pCategoryIndex) = 0;
|
||||
|
||||
};
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct IGameStatisticsVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
__RPC__in IGameStatistics * This,
|
||||
/* [in] */ __RPC__in REFIID riid,
|
||||
/* [annotation][iid_is][out] */
|
||||
__RPC__deref_out void **ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
__RPC__in IGameStatistics * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
__RPC__in IGameStatistics * This);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxCategoryLength )(
|
||||
__RPC__in IGameStatistics * This,
|
||||
/* [retval][out] */ __RPC__out UINT *cch);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxNameLength )(
|
||||
__RPC__in IGameStatistics * This,
|
||||
/* [retval][out] */ __RPC__out UINT *cch);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxValueLength )(
|
||||
__RPC__in IGameStatistics * This,
|
||||
/* [retval][out] */ __RPC__out UINT *cch);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxCategories )(
|
||||
__RPC__in IGameStatistics * This,
|
||||
/* [retval][out] */ __RPC__out WORD *pMax);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxStatsPerCategory )(
|
||||
__RPC__in IGameStatistics * This,
|
||||
/* [retval][out] */ __RPC__out WORD *pMax);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCategoryTitle )(
|
||||
__RPC__in IGameStatistics * This,
|
||||
/* [in] */ WORD categoryIndex,
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR title);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCategoryTitle )(
|
||||
__RPC__in IGameStatistics * This,
|
||||
/* [in] */ WORD categoryIndex,
|
||||
/* [retval][string][out] */ __RPC__deref_out_opt_string LPWSTR *pTitle);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStatistic )(
|
||||
__RPC__in IGameStatistics * This,
|
||||
/* [in] */ WORD categoryIndex,
|
||||
/* [in] */ WORD statIndex,
|
||||
/* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pName,
|
||||
/* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pValue);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStatistic )(
|
||||
__RPC__in IGameStatistics * This,
|
||||
/* [in] */ WORD categoryIndex,
|
||||
/* [in] */ WORD statIndex,
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR name,
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR value);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Save )(
|
||||
__RPC__in IGameStatistics * This,
|
||||
/* [in] */ BOOL trackChanges);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetLastPlayedCategory )(
|
||||
__RPC__in IGameStatistics * This,
|
||||
/* [in] */ UINT categoryIndex);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetLastPlayedCategory )(
|
||||
__RPC__in IGameStatistics * This,
|
||||
/* [retval][out] */ __RPC__out UINT *pCategoryIndex);
|
||||
|
||||
END_INTERFACE
|
||||
} IGameStatisticsVtbl;
|
||||
|
||||
interface IGameStatistics
|
||||
{
|
||||
CONST_VTBL struct IGameStatisticsVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define IGameStatistics_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define IGameStatistics_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define IGameStatistics_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#define IGameStatistics_GetMaxCategoryLength(This,cch) \
|
||||
( (This)->lpVtbl -> GetMaxCategoryLength(This,cch) )
|
||||
|
||||
#define IGameStatistics_GetMaxNameLength(This,cch) \
|
||||
( (This)->lpVtbl -> GetMaxNameLength(This,cch) )
|
||||
|
||||
#define IGameStatistics_GetMaxValueLength(This,cch) \
|
||||
( (This)->lpVtbl -> GetMaxValueLength(This,cch) )
|
||||
|
||||
#define IGameStatistics_GetMaxCategories(This,pMax) \
|
||||
( (This)->lpVtbl -> GetMaxCategories(This,pMax) )
|
||||
|
||||
#define IGameStatistics_GetMaxStatsPerCategory(This,pMax) \
|
||||
( (This)->lpVtbl -> GetMaxStatsPerCategory(This,pMax) )
|
||||
|
||||
#define IGameStatistics_SetCategoryTitle(This,categoryIndex,title) \
|
||||
( (This)->lpVtbl -> SetCategoryTitle(This,categoryIndex,title) )
|
||||
|
||||
#define IGameStatistics_GetCategoryTitle(This,categoryIndex,pTitle) \
|
||||
( (This)->lpVtbl -> GetCategoryTitle(This,categoryIndex,pTitle) )
|
||||
|
||||
#define IGameStatistics_GetStatistic(This,categoryIndex,statIndex,pName,pValue) \
|
||||
( (This)->lpVtbl -> GetStatistic(This,categoryIndex,statIndex,pName,pValue) )
|
||||
|
||||
#define IGameStatistics_SetStatistic(This,categoryIndex,statIndex,name,value) \
|
||||
( (This)->lpVtbl -> SetStatistic(This,categoryIndex,statIndex,name,value) )
|
||||
|
||||
#define IGameStatistics_Save(This,trackChanges) \
|
||||
( (This)->lpVtbl -> Save(This,trackChanges) )
|
||||
|
||||
#define IGameStatistics_SetLastPlayedCategory(This,categoryIndex) \
|
||||
( (This)->lpVtbl -> SetLastPlayedCategory(This,categoryIndex) )
|
||||
|
||||
#define IGameStatistics_GetLastPlayedCategory(This,pCategoryIndex) \
|
||||
( (This)->lpVtbl -> GetLastPlayedCategory(This,pCategoryIndex) )
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __IGameStatistics_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __IGameStatisticsMgr_INTERFACE_DEFINED__
|
||||
#define __IGameStatisticsMgr_INTERFACE_DEFINED__
|
||||
|
||||
/* interface IGameStatisticsMgr */
|
||||
/* [unique][helpstring][uuid][object] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_IGameStatisticsMgr;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("AFF3EA11-E70E-407d-95DD-35E612C41CE2")
|
||||
IGameStatisticsMgr : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetGameStatistics(
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath,
|
||||
/* [in] */ GAMESTATS_OPEN_TYPE openType,
|
||||
/* [out] */ __RPC__out GAMESTATS_OPEN_RESULT *pOpenResult,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IGameStatistics **ppiStats) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveGameStatistics(
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath) = 0;
|
||||
|
||||
};
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct IGameStatisticsMgrVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
__RPC__in IGameStatisticsMgr * This,
|
||||
/* [in] */ __RPC__in REFIID riid,
|
||||
/* [annotation][iid_is][out] */
|
||||
__RPC__deref_out void **ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
__RPC__in IGameStatisticsMgr * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
__RPC__in IGameStatisticsMgr * This);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetGameStatistics )(
|
||||
__RPC__in IGameStatisticsMgr * This,
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath,
|
||||
/* [in] */ GAMESTATS_OPEN_TYPE openType,
|
||||
/* [out] */ __RPC__out GAMESTATS_OPEN_RESULT *pOpenResult,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IGameStatistics **ppiStats);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveGameStatistics )(
|
||||
__RPC__in IGameStatisticsMgr * This,
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath);
|
||||
|
||||
END_INTERFACE
|
||||
} IGameStatisticsMgrVtbl;
|
||||
|
||||
interface IGameStatisticsMgr
|
||||
{
|
||||
CONST_VTBL struct IGameStatisticsMgrVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define IGameStatisticsMgr_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define IGameStatisticsMgr_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define IGameStatisticsMgr_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#define IGameStatisticsMgr_GetGameStatistics(This,GDFBinaryPath,openType,pOpenResult,ppiStats) \
|
||||
( (This)->lpVtbl -> GetGameStatistics(This,GDFBinaryPath,openType,pOpenResult,ppiStats) )
|
||||
|
||||
#define IGameStatisticsMgr_RemoveGameStatistics(This,GDFBinaryPath) \
|
||||
( (This)->lpVtbl -> RemoveGameStatistics(This,GDFBinaryPath) )
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __IGameStatisticsMgr_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __IGameExplorer2_INTERFACE_DEFINED__
|
||||
#define __IGameExplorer2_INTERFACE_DEFINED__
|
||||
|
||||
/* interface IGameExplorer2 */
|
||||
/* [unique][helpstring][uuid][object] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_IGameExplorer2;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("86874AA7-A1ED-450d-A7EB-B89E20B2FFF3")
|
||||
IGameExplorer2 : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE InstallGame(
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath,
|
||||
/* [unique][in] */ __RPC__in_opt LPCWSTR installDirectory,
|
||||
/* [in] */ GAME_INSTALL_SCOPE installScope) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UninstallGame(
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath) = 0;
|
||||
|
||||
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CheckAccess(
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath,
|
||||
/* [retval][out] */ __RPC__out BOOL *pHasAccess) = 0;
|
||||
|
||||
};
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct IGameExplorer2Vtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
__RPC__in IGameExplorer2 * This,
|
||||
/* [in] */ __RPC__in REFIID riid,
|
||||
/* [annotation][iid_is][out] */
|
||||
__RPC__deref_out void **ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
__RPC__in IGameExplorer2 * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
__RPC__in IGameExplorer2 * This);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *InstallGame )(
|
||||
__RPC__in IGameExplorer2 * This,
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath,
|
||||
/* [unique][in] */ __RPC__in_opt LPCWSTR installDirectory,
|
||||
/* [in] */ GAME_INSTALL_SCOPE installScope);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *UninstallGame )(
|
||||
__RPC__in IGameExplorer2 * This,
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath);
|
||||
|
||||
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CheckAccess )(
|
||||
__RPC__in IGameExplorer2 * This,
|
||||
/* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath,
|
||||
/* [retval][out] */ __RPC__out BOOL *pHasAccess);
|
||||
|
||||
END_INTERFACE
|
||||
} IGameExplorer2Vtbl;
|
||||
|
||||
interface IGameExplorer2
|
||||
{
|
||||
CONST_VTBL struct IGameExplorer2Vtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define IGameExplorer2_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define IGameExplorer2_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define IGameExplorer2_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#define IGameExplorer2_InstallGame(This,binaryGDFPath,installDirectory,installScope) \
|
||||
( (This)->lpVtbl -> InstallGame(This,binaryGDFPath,installDirectory,installScope) )
|
||||
|
||||
#define IGameExplorer2_UninstallGame(This,binaryGDFPath) \
|
||||
( (This)->lpVtbl -> UninstallGame(This,binaryGDFPath) )
|
||||
|
||||
#define IGameExplorer2_CheckAccess(This,binaryGDFPath,pHasAccess) \
|
||||
( (This)->lpVtbl -> CheckAccess(This,binaryGDFPath,pHasAccess) )
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __IGameExplorer2_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
|
||||
#ifndef __gameuxLib_LIBRARY_DEFINED__
|
||||
#define __gameuxLib_LIBRARY_DEFINED__
|
||||
|
||||
/* library gameuxLib */
|
||||
/* [helpstring][version][uuid] */
|
||||
|
||||
|
||||
EXTERN_C const IID LIBID_gameuxLib;
|
||||
|
||||
EXTERN_C const CLSID CLSID_GameExplorer;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
class DECLSPEC_UUID("9A5EA990-3034-4D6F-9128-01F3C61022BC")
|
||||
GameExplorer;
|
||||
#endif
|
||||
|
||||
EXTERN_C const CLSID CLSID_GameStatistics;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
class DECLSPEC_UUID("DBC85A2C-C0DC-4961-B6E2-D28B62C11AD4")
|
||||
GameStatistics;
|
||||
#endif
|
||||
#endif /* __gameuxLib_LIBRARY_DEFINED__ */
|
||||
|
||||
/* Additional Prototypes for ALL interfaces */
|
||||
|
||||
unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * );
|
||||
unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * );
|
||||
unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * );
|
||||
void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * );
|
||||
|
||||
unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * );
|
||||
unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * );
|
||||
unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * );
|
||||
void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * );
|
||||
|
||||
/* end of Additional Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
223
SDK/Include/rmxfguid.h
Normal file
223
SDK/Include/rmxfguid.h
Normal file
@ -0,0 +1,223 @@
|
||||
/***************************************************************************
|
||||
*
|
||||
* Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: rmxfguid.h
|
||||
*
|
||||
* Content: Defines GUIDs of D3DRM's templates.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __RMXFGUID_H_
|
||||
#define __RMXFGUID_H_
|
||||
|
||||
/* {2B957100-9E9A-11cf-AB39-0020AF71E433} */
|
||||
DEFINE_GUID(TID_D3DRMInfo,
|
||||
0x2b957100, 0x9e9a, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
|
||||
/* {3D82AB44-62DA-11cf-AB39-0020AF71E433} */
|
||||
DEFINE_GUID(TID_D3DRMMesh,
|
||||
0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
|
||||
/* {3D82AB5E-62DA-11cf-AB39-0020AF71E433} */
|
||||
DEFINE_GUID(TID_D3DRMVector,
|
||||
0x3d82ab5e, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
|
||||
/* {3D82AB5F-62DA-11cf-AB39-0020AF71E433} */
|
||||
DEFINE_GUID(TID_D3DRMMeshFace,
|
||||
0x3d82ab5f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
|
||||
/* {3D82AB4D-62DA-11cf-AB39-0020AF71E433} */
|
||||
DEFINE_GUID(TID_D3DRMMaterial,
|
||||
0x3d82ab4d, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
|
||||
/* {35FF44E1-6C7C-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMMaterialArray,
|
||||
0x35ff44e1, 0x6c7c, 0x11cf, 0x8F, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {3D82AB46-62DA-11cf-AB39-0020AF71E433} */
|
||||
DEFINE_GUID(TID_D3DRMFrame,
|
||||
0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
|
||||
/* {F6F23F41-7686-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMFrameTransformMatrix,
|
||||
0xf6f23f41, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {F6F23F42-7686-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMMeshMaterialList,
|
||||
0xf6f23f42, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {F6F23F40-7686-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMMeshTextureCoords,
|
||||
0xf6f23f40, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {F6F23F43-7686-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMMeshNormals,
|
||||
0xf6f23f43, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {F6F23F44-7686-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMCoords2d,
|
||||
0xf6f23f44, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {F6F23F45-7686-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMMatrix4x4,
|
||||
0xf6f23f45, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {3D82AB4F-62DA-11cf-AB39-0020AF71E433} */
|
||||
DEFINE_GUID(TID_D3DRMAnimation,
|
||||
0x3d82ab4f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
|
||||
/* {3D82AB50-62DA-11cf-AB39-0020AF71E433} */
|
||||
DEFINE_GUID(TID_D3DRMAnimationSet,
|
||||
0x3d82ab50, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
|
||||
/* {10DD46A8-775B-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMAnimationKey,
|
||||
0x10dd46a8, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
|
||||
|
||||
/* {10DD46A9-775B-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMFloatKeys,
|
||||
0x10dd46a9, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
|
||||
|
||||
/* {01411840-7786-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMMaterialAmbientColor,
|
||||
0x01411840, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
|
||||
|
||||
/* {01411841-7786-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMMaterialDiffuseColor,
|
||||
0x01411841, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
|
||||
|
||||
/* {01411842-7786-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMMaterialSpecularColor,
|
||||
0x01411842, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
|
||||
|
||||
/* {D3E16E80-7835-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMMaterialEmissiveColor,
|
||||
0xd3e16e80, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {01411843-7786-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMMaterialPower,
|
||||
0x01411843, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
|
||||
|
||||
/* {35FF44E0-6C7C-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMColorRGBA,
|
||||
0x35ff44e0, 0x6c7c, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
|
||||
|
||||
/* {D3E16E81-7835-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMColorRGB,
|
||||
0xd3e16e81, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {A42790E0-7810-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMGuid,
|
||||
0xa42790e0, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {A42790E1-7810-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMTextureFilename,
|
||||
0xa42790e1, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {A42790E2-7810-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMTextureReference,
|
||||
0xa42790e2, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {1630B820-7842-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMIndexedColor,
|
||||
0x1630b820, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {1630B821-7842-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMMeshVertexColors,
|
||||
0x1630b821, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {4885AE60-78E8-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMMaterialWrap,
|
||||
0x4885ae60, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {537DA6A0-CA37-11d0-941C-0080C80CFA7B} */
|
||||
DEFINE_GUID(TID_D3DRMBoolean,
|
||||
0x537da6a0, 0xca37, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
|
||||
|
||||
/* {ED1EC5C0-C0A8-11d0-941C-0080C80CFA7B} */
|
||||
DEFINE_GUID(TID_D3DRMMeshFaceWraps,
|
||||
0xed1ec5c0, 0xc0a8, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
|
||||
|
||||
/* {4885AE63-78E8-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMBoolean2d,
|
||||
0x4885ae63, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {F406B180-7B3B-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMTimedFloatKeys,
|
||||
0xf406b180, 0x7b3b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {E2BF56C0-840F-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMAnimationOptions,
|
||||
0xe2bf56c0, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {E2BF56C1-840F-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMFramePosition,
|
||||
0xe2bf56c1, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {E2BF56C2-840F-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMFrameVelocity,
|
||||
0xe2bf56c2, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {E2BF56C3-840F-11cf-8F52-0040333594A3} */
|
||||
DEFINE_GUID(TID_D3DRMFrameRotation,
|
||||
0xe2bf56c3, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
|
||||
|
||||
/* {3D82AB4A-62DA-11cf-AB39-0020AF71E433} */
|
||||
DEFINE_GUID(TID_D3DRMLight,
|
||||
0x3d82ab4a, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
|
||||
/* {3D82AB51-62DA-11cf-AB39-0020AF71E433} */
|
||||
DEFINE_GUID(TID_D3DRMCamera,
|
||||
0x3d82ab51, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
|
||||
/* {E5745280-B24F-11cf-9DD5-00AA00A71A2F} */
|
||||
DEFINE_GUID(TID_D3DRMAppData,
|
||||
0xe5745280, 0xb24f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
|
||||
|
||||
/* {AED22740-B31F-11cf-9DD5-00AA00A71A2F} */
|
||||
DEFINE_GUID(TID_D3DRMLightUmbra,
|
||||
0xaed22740, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
|
||||
|
||||
/* {AED22742-B31F-11cf-9DD5-00AA00A71A2F} */
|
||||
DEFINE_GUID(TID_D3DRMLightRange,
|
||||
0xaed22742, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
|
||||
|
||||
/* {AED22741-B31F-11cf-9DD5-00AA00A71A2F} */
|
||||
DEFINE_GUID(TID_D3DRMLightPenumbra,
|
||||
0xaed22741, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
|
||||
|
||||
/* {A8A98BA0-C5E5-11cf-B941-0080C80CFA7B} */
|
||||
DEFINE_GUID(TID_D3DRMLightAttenuation,
|
||||
0xa8a98ba0, 0xc5e5, 0x11cf, 0xb9, 0x41, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
|
||||
|
||||
/* {3A23EEA0-94B1-11d0-AB39-0020AF71E433} */
|
||||
DEFINE_GUID(TID_D3DRMInlineData,
|
||||
0x3a23eea0, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
|
||||
/* {3A23EEA1-94B1-11d0-AB39-0020AF71E433} */
|
||||
DEFINE_GUID(TID_D3DRMUrl,
|
||||
0x3a23eea1, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
|
||||
|
||||
/* {8A63C360-997D-11d0-941C-0080C80CFA7B} */
|
||||
DEFINE_GUID(TID_D3DRMProgressiveMesh,
|
||||
0x8A63C360, 0x997D, 0x11d0, 0x94, 0x1C, 0x0, 0x80, 0xC8, 0x0C, 0xFA, 0x7B);
|
||||
|
||||
/* {98116AA0-BDBA-11d1-82C0-00A0C9697271} */
|
||||
DEFINE_GUID(TID_D3DRMExternalVisual,
|
||||
0x98116AA0, 0xBDBA, 0x11d1, 0x82, 0xC0, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x71);
|
||||
|
||||
/* {7F0F21E0-BFE1-11d1-82C0-00A0C9697271} */
|
||||
DEFINE_GUID(TID_D3DRMStringProperty,
|
||||
0x7f0f21e0, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
|
||||
|
||||
/* {7F0F21E1-BFE1-11d1-82C0-00A0C9697271} */
|
||||
DEFINE_GUID(TID_D3DRMPropertyBag,
|
||||
0x7f0f21e1, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
|
||||
|
||||
// {7F5D5EA0-D53A-11d1-82C0-00A0C9697271}
|
||||
DEFINE_GUID(TID_D3DRMRightHanded,
|
||||
0x7f5d5ea0, 0xd53a, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
|
||||
|
||||
#endif /* __RMXFGUID_H_ */
|
||||
|
339
SDK/Include/rmxftmpl.h
Normal file
339
SDK/Include/rmxftmpl.h
Normal file
@ -0,0 +1,339 @@
|
||||
/* D3DRM XFile templates in binary form */
|
||||
|
||||
#ifndef _RMXFTMPL_H_
|
||||
#define _RMXFTMPL_H_
|
||||
|
||||
unsigned char D3DRM_XTEMPLATES[] = {
|
||||
0x78, 0x6f, 0x66, 0x20, 0x30, 0x33, 0x30, 0x32, 0x62,
|
||||
0x69, 0x6e, 0x20, 0x30, 0x30, 0x36, 0x34, 0x1f, 0, 0x1,
|
||||
0, 0x6, 0, 0, 0, 0x48, 0x65, 0x61, 0x64, 0x65,
|
||||
0x72, 0xa, 0, 0x5, 0, 0x43, 0xab, 0x82, 0x3d, 0xda,
|
||||
0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4,
|
||||
0x33, 0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x6d,
|
||||
0x61, 0x6a, 0x6f, 0x72, 0x14, 0, 0x28, 0, 0x1, 0,
|
||||
0x5, 0, 0, 0, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x14,
|
||||
0, 0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x66,
|
||||
0x6c, 0x61, 0x67, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0,
|
||||
0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74,
|
||||
0x6f, 0x72, 0xa, 0, 0x5, 0, 0x5e, 0xab, 0x82, 0x3d,
|
||||
0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71,
|
||||
0xe4, 0x33, 0x2a, 0, 0x1, 0, 0x1, 0, 0, 0,
|
||||
0x78, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0, 0,
|
||||
0, 0x79, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0,
|
||||
0, 0, 0x7a, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1,
|
||||
0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64,
|
||||
0x73, 0x32, 0x64, 0xa, 0, 0x5, 0, 0x44, 0x3f, 0xf2,
|
||||
0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
|
||||
0x35, 0x94, 0xa3, 0x2a, 0, 0x1, 0, 0x1, 0, 0,
|
||||
0, 0x75, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0,
|
||||
0, 0, 0x76, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1,
|
||||
0, 0x9, 0, 0, 0, 0x4d, 0x61, 0x74, 0x72, 0x69,
|
||||
0x78, 0x34, 0x78, 0x34, 0xa, 0, 0x5, 0, 0x45, 0x3f,
|
||||
0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40,
|
||||
0x33, 0x35, 0x94, 0xa3, 0x34, 0, 0x2a, 0, 0x1, 0,
|
||||
0x6, 0, 0, 0, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78,
|
||||
0xe, 0, 0x3, 0, 0x10, 0, 0, 0, 0xf, 0,
|
||||
0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x9, 0,
|
||||
0, 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42,
|
||||
0x41, 0xa, 0, 0x5, 0, 0xe0, 0x44, 0xff, 0x35, 0x7c,
|
||||
0x6c, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94,
|
||||
0xa3, 0x2a, 0, 0x1, 0, 0x3, 0, 0, 0, 0x72,
|
||||
0x65, 0x64, 0x14, 0, 0x2a, 0, 0x1, 0, 0x5, 0,
|
||||
0, 0, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x14, 0, 0x2a,
|
||||
0, 0x1, 0, 0x4, 0, 0, 0, 0x62, 0x6c, 0x75,
|
||||
0x65, 0x14, 0, 0x2a, 0, 0x1, 0, 0x5, 0, 0,
|
||||
0, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x14, 0, 0xb, 0,
|
||||
0x1f, 0, 0x1, 0, 0x8, 0, 0, 0, 0x43, 0x6f,
|
||||
0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0xa, 0, 0x5, 0,
|
||||
0x81, 0x6e, 0xe1, 0xd3, 0x35, 0x78, 0xcf, 0x11, 0x8f, 0x52,
|
||||
0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x2a, 0, 0x1, 0,
|
||||
0x3, 0, 0, 0, 0x72, 0x65, 0x64, 0x14, 0, 0x2a,
|
||||
0, 0x1, 0, 0x5, 0, 0, 0, 0x67, 0x72, 0x65,
|
||||
0x65, 0x6e, 0x14, 0, 0x2a, 0, 0x1, 0, 0x4, 0,
|
||||
0, 0, 0x62, 0x6c, 0x75, 0x65, 0x14, 0, 0xb, 0,
|
||||
0x1f, 0, 0x1, 0, 0xc, 0, 0, 0, 0x49, 0x6e,
|
||||
0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
|
||||
0xa, 0, 0x5, 0, 0x20, 0xb8, 0x30, 0x16, 0x42, 0x78,
|
||||
0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3,
|
||||
0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x69, 0x6e,
|
||||
0x64, 0x65, 0x78, 0x14, 0, 0x1, 0, 0x9, 0, 0,
|
||||
0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41,
|
||||
0x1, 0, 0xa, 0, 0, 0, 0x69, 0x6e, 0x64, 0x65,
|
||||
0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0xb, 0,
|
||||
0x1f, 0, 0x1, 0, 0x7, 0, 0, 0, 0x42, 0x6f,
|
||||
0x6f, 0x6c, 0x65, 0x61, 0x6e, 0xa, 0, 0x5, 0, 0xa0,
|
||||
0xa6, 0x7d, 0x53, 0x37, 0xca, 0xd0, 0x11, 0x94, 0x1c, 0,
|
||||
0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1, 0, 0x9,
|
||||
0, 0, 0, 0x74, 0x72, 0x75, 0x65, 0x66, 0x61, 0x6c,
|
||||
0x73, 0x65, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
|
||||
0x9, 0, 0, 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61,
|
||||
0x6e, 0x32, 0x64, 0xa, 0, 0x5, 0, 0x63, 0xae, 0x85,
|
||||
0x48, 0xe8, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
|
||||
0x35, 0x94, 0xa3, 0x1, 0, 0x7, 0, 0, 0, 0x42,
|
||||
0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x1, 0, 0x1, 0,
|
||||
0, 0, 0x75, 0x14, 0, 0x1, 0, 0x7, 0, 0,
|
||||
0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x1, 0,
|
||||
0x1, 0, 0, 0, 0x76, 0x14, 0, 0xb, 0, 0x1f,
|
||||
0, 0x1, 0, 0xc, 0, 0, 0, 0x4d, 0x61, 0x74,
|
||||
0x65, 0x72, 0x69, 0x61, 0x6c, 0x57, 0x72, 0x61, 0x70, 0xa,
|
||||
0, 0x5, 0, 0x60, 0xae, 0x85, 0x48, 0xe8, 0x78, 0xcf,
|
||||
0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x1,
|
||||
0, 0x7, 0, 0, 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65,
|
||||
0x61, 0x6e, 0x1, 0, 0x1, 0, 0, 0, 0x75, 0x14,
|
||||
0, 0x1, 0, 0x7, 0, 0, 0, 0x42, 0x6f, 0x6f,
|
||||
0x6c, 0x65, 0x61, 0x6e, 0x1, 0, 0x1, 0, 0, 0,
|
||||
0x76, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0xf,
|
||||
0, 0, 0, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65,
|
||||
0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0xa, 0,
|
||||
0x5, 0, 0xe1, 0x90, 0x27, 0xa4, 0x10, 0x78, 0xcf, 0x11,
|
||||
0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x31, 0,
|
||||
0x1, 0, 0x8, 0, 0, 0, 0x66, 0x69, 0x6c, 0x65,
|
||||
0x6e, 0x61, 0x6d, 0x65, 0x14, 0, 0xb, 0, 0x1f, 0,
|
||||
0x1, 0, 0x8, 0, 0, 0, 0x4d, 0x61, 0x74, 0x65,
|
||||
0x72, 0x69, 0x61, 0x6c, 0xa, 0, 0x5, 0, 0x4d, 0xab,
|
||||
0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20,
|
||||
0xaf, 0x71, 0xe4, 0x33, 0x1, 0, 0x9, 0, 0, 0,
|
||||
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41, 0x1,
|
||||
0, 0x9, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x43,
|
||||
0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0x2a, 0, 0x1, 0,
|
||||
0x5, 0, 0, 0, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x14,
|
||||
0, 0x1, 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6c,
|
||||
0x6f, 0x72, 0x52, 0x47, 0x42, 0x1, 0, 0xd, 0, 0,
|
||||
0, 0x73, 0x70, 0x65, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x43,
|
||||
0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0x1, 0, 0x8, 0,
|
||||
0, 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42,
|
||||
0x1, 0, 0xd, 0, 0, 0, 0x65, 0x6d, 0x69, 0x73,
|
||||
0x73, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x14,
|
||||
0, 0xe, 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf,
|
||||
0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x8, 0, 0,
|
||||
0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65, 0xa,
|
||||
0, 0x5, 0, 0x5f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf,
|
||||
0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29,
|
||||
0, 0x1, 0, 0x12, 0, 0, 0, 0x6e, 0x46, 0x61,
|
||||
0x63, 0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e,
|
||||
0x64, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29,
|
||||
0, 0x1, 0, 0x11, 0, 0, 0, 0x66, 0x61, 0x63,
|
||||
0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64,
|
||||
0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1, 0, 0x12, 0,
|
||||
0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x56, 0x65, 0x72,
|
||||
0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73,
|
||||
0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
|
||||
0xd, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61,
|
||||
0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x73, 0xa, 0, 0x5,
|
||||
0, 0xc0, 0xc5, 0x1e, 0xed, 0xa8, 0xc0, 0xd0, 0x11, 0x94,
|
||||
0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1,
|
||||
0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65,
|
||||
0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73,
|
||||
0x14, 0, 0x34, 0, 0x1, 0, 0x9, 0, 0, 0,
|
||||
0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x32, 0x64, 0x1,
|
||||
0, 0xe, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x57,
|
||||
0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0xe,
|
||||
0, 0x1, 0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61,
|
||||
0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0,
|
||||
0x1, 0, 0x11, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68,
|
||||
0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f,
|
||||
0x72, 0x64, 0x73, 0xa, 0, 0x5, 0, 0x40, 0x3f, 0xf2,
|
||||
0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
|
||||
0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xe, 0, 0,
|
||||
0, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43,
|
||||
0x6f, 0x6f, 0x72, 0x64, 0x73, 0x14, 0, 0x34, 0, 0x1,
|
||||
0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64,
|
||||
0x73, 0x32, 0x64, 0x1, 0, 0xd, 0, 0, 0, 0x74,
|
||||
0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f, 0x72,
|
||||
0x64, 0x73, 0xe, 0, 0x1, 0, 0xe, 0, 0, 0,
|
||||
0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f,
|
||||
0x6f, 0x72, 0x64, 0x73, 0xf, 0, 0x14, 0, 0xb, 0,
|
||||
0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x4d, 0x65,
|
||||
0x73, 0x68, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c,
|
||||
0x4c, 0x69, 0x73, 0x74, 0xa, 0, 0x5, 0, 0x42, 0x3f,
|
||||
0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40,
|
||||
0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa, 0,
|
||||
0, 0, 0x6e, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61,
|
||||
0x6c, 0x73, 0x14, 0, 0x29, 0, 0x1, 0, 0xc, 0,
|
||||
0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x49, 0x6e, 0x64,
|
||||
0x65, 0x78, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29, 0,
|
||||
0x1, 0, 0xb, 0, 0, 0, 0x66, 0x61, 0x63, 0x65,
|
||||
0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0xe, 0, 0x1,
|
||||
0, 0xc, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65,
|
||||
0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0xf, 0, 0x14,
|
||||
0, 0xe, 0, 0x1, 0, 0x8, 0, 0, 0, 0x4d,
|
||||
0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0xf, 0, 0xb,
|
||||
0, 0x1f, 0, 0x1, 0, 0xb, 0, 0, 0, 0x4d,
|
||||
0x65, 0x73, 0x68, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73,
|
||||
0xa, 0, 0x5, 0, 0x43, 0x3f, 0xf2, 0xf6, 0x86, 0x76,
|
||||
0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3,
|
||||
0x29, 0, 0x1, 0, 0x8, 0, 0, 0, 0x6e, 0x4e,
|
||||
0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0, 0x34, 0,
|
||||
0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74,
|
||||
0x6f, 0x72, 0x1, 0, 0x7, 0, 0, 0, 0x6e, 0x6f,
|
||||
0x72, 0x6d, 0x61, 0x6c, 0x73, 0xe, 0, 0x1, 0, 0x8,
|
||||
0, 0, 0, 0x6e, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c,
|
||||
0x73, 0xf, 0, 0x14, 0, 0x29, 0, 0x1, 0, 0xc,
|
||||
0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x4e, 0x6f,
|
||||
0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0, 0x34, 0, 0x1,
|
||||
0, 0x8, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46,
|
||||
0x61, 0x63, 0x65, 0x1, 0, 0xb, 0, 0, 0, 0x66,
|
||||
0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73,
|
||||
0xe, 0, 0x1, 0, 0xc, 0, 0, 0, 0x6e, 0x46,
|
||||
0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73,
|
||||
0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
|
||||
0x10, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x56, 0x65,
|
||||
0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73,
|
||||
0xa, 0, 0x5, 0, 0x21, 0xb8, 0x30, 0x16, 0x42, 0x78,
|
||||
0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3,
|
||||
0x29, 0, 0x1, 0, 0xd, 0, 0, 0, 0x6e, 0x56,
|
||||
0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
|
||||
0x73, 0x14, 0, 0x34, 0, 0x1, 0, 0xc, 0, 0,
|
||||
0, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f,
|
||||
0x6c, 0x6f, 0x72, 0x1, 0, 0xc, 0, 0, 0, 0x76,
|
||||
0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
|
||||
0x73, 0xe, 0, 0x1, 0, 0xd, 0, 0, 0, 0x6e,
|
||||
0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f,
|
||||
0x72, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0,
|
||||
0x1, 0, 0x4, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68,
|
||||
0xa, 0, 0x5, 0, 0x44, 0xab, 0x82, 0x3d, 0xda, 0x62,
|
||||
0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33,
|
||||
0x29, 0, 0x1, 0, 0x9, 0, 0, 0, 0x6e, 0x56,
|
||||
0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34,
|
||||
0, 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63,
|
||||
0x74, 0x6f, 0x72, 0x1, 0, 0x8, 0, 0, 0, 0x76,
|
||||
0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1,
|
||||
0, 0x9, 0, 0, 0, 0x6e, 0x56, 0x65, 0x72, 0x74,
|
||||
0x69, 0x63, 0x65, 0x73, 0xf, 0, 0x14, 0, 0x29, 0,
|
||||
0x1, 0, 0x6, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63,
|
||||
0x65, 0x73, 0x14, 0, 0x34, 0, 0x1, 0, 0x8, 0,
|
||||
0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65,
|
||||
0x1, 0, 0x5, 0, 0, 0, 0x66, 0x61, 0x63, 0x65,
|
||||
0x73, 0xe, 0, 0x1, 0, 0x6, 0, 0, 0, 0x6e,
|
||||
0x46, 0x61, 0x63, 0x65, 0x73, 0xf, 0, 0x14, 0, 0xe,
|
||||
0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb,
|
||||
0, 0x1f, 0, 0x1, 0, 0x14, 0, 0, 0, 0x46,
|
||||
0x72, 0x61, 0x6d, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
|
||||
0x6f, 0x72, 0x6d, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0xa,
|
||||
0, 0x5, 0, 0x41, 0x3f, 0xf2, 0xf6, 0x86, 0x76, 0xcf,
|
||||
0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x1,
|
||||
0, 0x9, 0, 0, 0, 0x4d, 0x61, 0x74, 0x72, 0x69,
|
||||
0x78, 0x34, 0x78, 0x34, 0x1, 0, 0xb, 0, 0, 0,
|
||||
0x66, 0x72, 0x61, 0x6d, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69,
|
||||
0x78, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x5,
|
||||
0, 0, 0, 0x46, 0x72, 0x61, 0x6d, 0x65, 0xa, 0,
|
||||
0x5, 0, 0x46, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11,
|
||||
0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0xe, 0,
|
||||
0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb, 0,
|
||||
0x1f, 0, 0x1, 0, 0x9, 0, 0, 0, 0x46, 0x6c,
|
||||
0x6f, 0x61, 0x74, 0x4b, 0x65, 0x79, 0x73, 0xa, 0, 0x5,
|
||||
0, 0xa9, 0x46, 0xdd, 0x10, 0x5b, 0x77, 0xcf, 0x11, 0x8f,
|
||||
0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1,
|
||||
0, 0x7, 0, 0, 0, 0x6e, 0x56, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x73, 0x14, 0, 0x34, 0, 0x2a, 0, 0x1, 0,
|
||||
0x6, 0, 0, 0, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73,
|
||||
0xe, 0, 0x1, 0, 0x7, 0, 0, 0, 0x6e, 0x56,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x73, 0xf, 0, 0x14, 0, 0xb,
|
||||
0, 0x1f, 0, 0x1, 0, 0xe, 0, 0, 0, 0x54,
|
||||
0x69, 0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b,
|
||||
0x65, 0x79, 0x73, 0xa, 0, 0x5, 0, 0x80, 0xb1, 0x6,
|
||||
0xf4, 0x3b, 0x7b, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
|
||||
0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0x4, 0, 0,
|
||||
0, 0x74, 0x69, 0x6d, 0x65, 0x14, 0, 0x1, 0, 0x9,
|
||||
0, 0, 0, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65,
|
||||
0x79, 0x73, 0x1, 0, 0x6, 0, 0, 0, 0x74, 0x66,
|
||||
0x6b, 0x65, 0x79, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0,
|
||||
0x1, 0, 0xc, 0, 0, 0, 0x41, 0x6e, 0x69, 0x6d,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0xa, 0,
|
||||
0x5, 0, 0xa8, 0x46, 0xdd, 0x10, 0x5b, 0x77, 0xcf, 0x11,
|
||||
0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0,
|
||||
0x1, 0, 0x7, 0, 0, 0, 0x6b, 0x65, 0x79, 0x54,
|
||||
0x79, 0x70, 0x65, 0x14, 0, 0x29, 0, 0x1, 0, 0x5,
|
||||
0, 0, 0, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x14, 0,
|
||||
0x34, 0, 0x1, 0, 0xe, 0, 0, 0, 0x54, 0x69,
|
||||
0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65,
|
||||
0x79, 0x73, 0x1, 0, 0x4, 0, 0, 0, 0x6b, 0x65,
|
||||
0x79, 0x73, 0xe, 0, 0x1, 0, 0x5, 0, 0, 0,
|
||||
0x6e, 0x4b, 0x65, 0x79, 0x73, 0xf, 0, 0x14, 0, 0xb,
|
||||
0, 0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x41,
|
||||
0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa, 0, 0x5, 0, 0xc0,
|
||||
0x56, 0xbf, 0xe2, 0xf, 0x84, 0xcf, 0x11, 0x8f, 0x52, 0,
|
||||
0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa,
|
||||
0, 0, 0, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f,
|
||||
0x73, 0x65, 0x64, 0x14, 0, 0x29, 0, 0x1, 0, 0xf,
|
||||
0, 0, 0, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x14, 0,
|
||||
0xb, 0, 0x1f, 0, 0x1, 0, 0x9, 0, 0, 0,
|
||||
0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa,
|
||||
0, 0x5, 0, 0x4f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf,
|
||||
0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0xe,
|
||||
0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb,
|
||||
0, 0x1f, 0, 0x1, 0, 0xc, 0, 0, 0, 0x41,
|
||||
0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65,
|
||||
0x74, 0xa, 0, 0x5, 0, 0x50, 0xab, 0x82, 0x3d, 0xda,
|
||||
0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4,
|
||||
0x33, 0xe, 0, 0x1, 0, 0x9, 0, 0, 0, 0x41,
|
||||
0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xf, 0,
|
||||
0xb, 0, 0x1f, 0, 0x1, 0, 0xa, 0, 0, 0,
|
||||
0x49, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61,
|
||||
0xa, 0, 0x5, 0, 0xa0, 0xee, 0x23, 0x3a, 0xb1, 0x94,
|
||||
0xd0, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33,
|
||||
0xe, 0, 0x1, 0, 0x6, 0, 0, 0, 0x42, 0x49,
|
||||
0x4e, 0x41, 0x52, 0x59, 0xf, 0, 0xb, 0, 0x1f, 0,
|
||||
0x1, 0, 0x3, 0, 0, 0, 0x55, 0x72, 0x6c, 0xa,
|
||||
0, 0x5, 0, 0xa1, 0xee, 0x23, 0x3a, 0xb1, 0x94, 0xd0,
|
||||
0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29,
|
||||
0, 0x1, 0, 0x5, 0, 0, 0, 0x6e, 0x55, 0x72,
|
||||
0x6c, 0x73, 0x14, 0, 0x34, 0, 0x31, 0, 0x1, 0,
|
||||
0x4, 0, 0, 0, 0x75, 0x72, 0x6c, 0x73, 0xe, 0,
|
||||
0x1, 0, 0x5, 0, 0, 0, 0x6e, 0x55, 0x72, 0x6c,
|
||||
0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1,
|
||||
0, 0xf, 0, 0, 0, 0x50, 0x72, 0x6f, 0x67, 0x72,
|
||||
0x65, 0x73, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x68,
|
||||
0xa, 0, 0x5, 0, 0x60, 0xc3, 0x63, 0x8a, 0x7d, 0x99,
|
||||
0xd0, 0x11, 0x94, 0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b,
|
||||
0xe, 0, 0x1, 0, 0x3, 0, 0, 0, 0x55, 0x72,
|
||||
0x6c, 0x13, 0, 0x1, 0, 0xa, 0, 0, 0, 0x49,
|
||||
0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0xf,
|
||||
0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x4, 0, 0,
|
||||
0, 0x47, 0x75, 0x69, 0x64, 0xa, 0, 0x5, 0, 0xe0,
|
||||
0x90, 0x27, 0xa4, 0x10, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0,
|
||||
0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0x5,
|
||||
0, 0, 0, 0x64, 0x61, 0x74, 0x61, 0x31, 0x14, 0,
|
||||
0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x64, 0x61,
|
||||
0x74, 0x61, 0x32, 0x14, 0, 0x28, 0, 0x1, 0, 0x5,
|
||||
0, 0, 0, 0x64, 0x61, 0x74, 0x61, 0x33, 0x14, 0,
|
||||
0x34, 0, 0x2d, 0, 0x1, 0, 0x5, 0, 0, 0,
|
||||
0x64, 0x61, 0x74, 0x61, 0x34, 0xe, 0, 0x3, 0, 0x8,
|
||||
0, 0, 0, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f,
|
||||
0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74, 0x72,
|
||||
0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74,
|
||||
0x79, 0xa, 0, 0x5, 0, 0xe0, 0x21, 0xf, 0x7f, 0xe1,
|
||||
0xbf, 0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72,
|
||||
0x71, 0x31, 0, 0x1, 0, 0x3, 0, 0, 0, 0x6b,
|
||||
0x65, 0x79, 0x14, 0, 0x31, 0, 0x1, 0, 0x5, 0,
|
||||
0, 0, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x14, 0, 0xb,
|
||||
0, 0x1f, 0, 0x1, 0, 0xb, 0, 0, 0, 0x50,
|
||||
0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x42, 0x61, 0x67,
|
||||
0xa, 0, 0x5, 0, 0xe1, 0x21, 0xf, 0x7f, 0xe1, 0xbf,
|
||||
0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71,
|
||||
0xe, 0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74,
|
||||
0x72, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72,
|
||||
0x74, 0x79, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
|
||||
0xe, 0, 0, 0, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e,
|
||||
0x61, 0x6c, 0x56, 0x69, 0x73, 0x75, 0x61, 0x6c, 0xa, 0,
|
||||
0x5, 0, 0xa0, 0x6a, 0x11, 0x98, 0xba, 0xbd, 0xd1, 0x11,
|
||||
0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71, 0x1, 0,
|
||||
0x4, 0, 0, 0, 0x47, 0x75, 0x69, 0x64, 0x1, 0,
|
||||
0x12, 0, 0, 0, 0x67, 0x75, 0x69, 0x64, 0x45, 0x78,
|
||||
0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x69, 0x73, 0x75,
|
||||
0x61, 0x6c, 0x14, 0, 0xe, 0, 0x12, 0, 0x12, 0,
|
||||
0x12, 0, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
|
||||
0xb, 0, 0, 0, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48,
|
||||
0x61, 0x6e, 0x64, 0x65, 0x64, 0xa, 0, 0x5, 0, 0xa0,
|
||||
0x5e, 0x5d, 0x7f, 0x3a, 0xd5, 0xd1, 0x11, 0x82, 0xc0, 0,
|
||||
0xa0, 0xc9, 0x69, 0x72, 0x71, 0x29, 0, 0x1, 0, 0xc,
|
||||
0, 0, 0, 0x62, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48,
|
||||
0x61, 0x6e, 0x64, 0x65, 0x64, 0x14, 0, 0xb, 0
|
||||
};
|
||||
|
||||
#define D3DRM_XTEMPLATE_BYTES 3278
|
||||
|
||||
#endif /* _RMXFTMPL_H_ */
|
499
SDK/Include/rpcsal.h
Normal file
499
SDK/Include/rpcsal.h
Normal file
@ -0,0 +1,499 @@
|
||||
/****************************************************************\
|
||||
* *
|
||||
* rpcsal.h - markers for documenting the semantics of RPC APIs *
|
||||
* *
|
||||
* Version 1.0 *
|
||||
* *
|
||||
* Copyright (c) 2004 Microsoft Corporation. All rights reserved. *
|
||||
* *
|
||||
\****************************************************************/
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// Introduction
|
||||
//
|
||||
// rpcsal.h provides a set of annotations to describe how RPC functions use their
|
||||
// parameters - the assumptions it makes about them, adn the guarantees it makes
|
||||
// upon finishing. These annotations are similar to those found in specstrings.h,
|
||||
// but are designed to be used by the MIDL compiler when it generates annotations
|
||||
// enabled header files.
|
||||
//
|
||||
// IDL authors do not need to annotate their functions declarations. The MIDL compiler
|
||||
// will interpret the IDL directives and use one of the annotations contained
|
||||
// in this header. This documentation is intended to help those trying to understand
|
||||
// the MIDL-generated header files or those who maintain their own copies of these files.
|
||||
//
|
||||
// -------------------------------------------------------------------------------
|
||||
// Differences between rpcsal.h and specstrings.h
|
||||
//
|
||||
// There are a few important differences between the annotations found in rpcsal.h and
|
||||
// those in specstrings.h:
|
||||
//
|
||||
// 1. [in] parameters are not marked as read-only. They may be used for scratch space
|
||||
// at the server and changes will not affect the client.
|
||||
// 2. String versions of each macro alleviates the need for a special type definition
|
||||
//
|
||||
// -------------------------------------------------------------------------------
|
||||
// Interpreting RPC Annotations
|
||||
//
|
||||
// These annotations are interpreted precisely in the same way as those in specstrings.h.
|
||||
// Please refer to that header for information related to general usage in annotations.
|
||||
//
|
||||
// To construct an RPC annotation, concatenate the appropriate value from each category
|
||||
// along with a leading __RPC_. A typical annotation looks like "__RPC__in_string".
|
||||
//
|
||||
// |----------------------------------------------------------------------------------|
|
||||
// | RPC Annotations |
|
||||
// |------------|------------|---------|--------|----------|----------|---------------|
|
||||
// | Level | Usage | Size | Output | Optional | String | Parameters |
|
||||
// |------------|------------|---------|--------|----------|----------|---------------|
|
||||
// | <> | <> | <> | <> | <> | <> | <> |
|
||||
// | _deref | _in | _ecount | _full | _opt | _string | (size) |
|
||||
// | _deref_opt | _out | _bcount | _part | | | (size,length) |
|
||||
// | | _inout | | | | | |
|
||||
// | | | | | | | |
|
||||
// |------------|------------|---------|--------|----------|----------|---------------|
|
||||
//
|
||||
// Level: Describes the buffer pointer's level of indirection from the parameter or
|
||||
// return value 'p'.
|
||||
//
|
||||
// <> : p is the buffer pointer.
|
||||
// _deref : *p is the buffer pointer. p must not be NULL.
|
||||
// _deref_opt : *p may be the buffer pointer. p may be NULL, in which case the rest of
|
||||
// the annotation is ignored.
|
||||
//
|
||||
// Usage: Describes how the function uses the buffer.
|
||||
//
|
||||
// <> : The buffer is not accessed. If used on the return value or with _deref, the
|
||||
// function will provide the buffer, and it will be uninitialized at exit.
|
||||
// Otherwise, the caller must provide the buffer. This should only be used
|
||||
// for alloc and free functions.
|
||||
// _in : The function will only read from the buffer. The caller must provide the
|
||||
// buffer and initialize it. Cannot be used with _deref.
|
||||
// _out : The function will only write to the buffer. If used on the return value or
|
||||
// with _deref, the function will provide the buffer and initialize it.
|
||||
// Otherwise, the caller must provide the buffer, and the function will
|
||||
// initialize it.
|
||||
// _inout : The function may freely read from and write to the buffer. The caller must
|
||||
// provide the buffer and initialize it. If used with _deref, the buffer may
|
||||
// be reallocated by the function.
|
||||
//
|
||||
// Size: Describes the total size of the buffer. This may be less than the space actually
|
||||
// allocated for the buffer, in which case it describes the accessible amount.
|
||||
//
|
||||
// <> : No buffer size is given. If the type specifies the buffer size (such as
|
||||
// with LPSTR and LPWSTR), that amount is used. Otherwise, the buffer is one
|
||||
// element long. Must be used with _in, _out, or _inout.
|
||||
// _ecount : The buffer size is an explicit element count.
|
||||
// _bcount : The buffer size is an explicit byte count.
|
||||
//
|
||||
// Output: Describes how much of the buffer will be initialized by the function. For
|
||||
// _inout buffers, this also describes how much is initialized at entry. Omit this
|
||||
// category for _in buffers; they must be fully initialized by the caller.
|
||||
//
|
||||
// <> : The type specifies how much is initialized. For instance, a function initializing
|
||||
// an LPWSTR must NULL-terminate the string.
|
||||
// _full : The function initializes the entire buffer.
|
||||
// _part : The function initializes part of the buffer, and explicitly indicates how much.
|
||||
//
|
||||
// Optional: Describes if the buffer itself is optional.
|
||||
//
|
||||
// <> : The pointer to the buffer must not be NULL.
|
||||
// _opt : The pointer to the buffer might be NULL. It will be checked before being dereferenced.
|
||||
//
|
||||
// String: Describes if the buffer is NULL terminated
|
||||
//
|
||||
// <> : The buffer is not assumed to be NULL terminated
|
||||
// _string : The buffer is assumed to be NULL terminated once it has been initialized
|
||||
//
|
||||
// Parameters: Gives explicit counts for the size and length of the buffer.
|
||||
//
|
||||
// <> : There is no explicit count. Use when neither _ecount nor _bcount is used.
|
||||
// (size) : Only the buffer's total size is given. Use with _ecount or _bcount but not _part.
|
||||
// (size,length) : The buffer's total size and initialized length are given. Use with _ecount_part
|
||||
// and _bcount_part.
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// 1. Specifying two buffer annotations on a single parameter results in unspecified behavior
|
||||
// (e.g. __RPC__in_bcount(5) __RPC__out_bcount(6)
|
||||
//
|
||||
// 2. The size of the buffer and the amount that has been initialized are separate concepts.
|
||||
// Specify the size using _ecount or _bcount. Specify the amount that is initialized using
|
||||
// _full, _part, or _string. As a special case, a single element buffer does not need
|
||||
// _ecount, _bcount, _full, or _part
|
||||
//
|
||||
// 3. The count may be less than the total size of the buffer in which case it describes the
|
||||
// accessible portion.
|
||||
//
|
||||
// 4. "__RPC__opt" and "__RPC_deref" are not valid annotations.
|
||||
//
|
||||
// 5. The placement of _opt when using _deref is important:
|
||||
// __RPC__deref_opt_... : Input may be NULL
|
||||
// __RPC__deref_..._opt : Output may be NULL
|
||||
// __RPC__deref_opt_..._opt : Both input and output may be NULL
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <specstrings.h>
|
||||
|
||||
#ifndef __RPCSAL_H_VERSION__
|
||||
#define __RPCSAL_H_VERSION__ ( 100 )
|
||||
#endif // __RPCSAL_H_VERSION__
|
||||
|
||||
#ifdef __REQUIRED_RPCSAL_H_VERSION__
|
||||
#if ( __RPCSAL_H_VERSION__ < __REQUIRED_RPCSAL_H_VERSION__ )
|
||||
#error incorrect <rpcsal.h> version. Use the header that matches with the MIDL compiler.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // #ifdef __cplusplus
|
||||
|
||||
#if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_)
|
||||
|
||||
|
||||
// [in]
|
||||
#define __RPC__in __pre __valid
|
||||
#define __RPC__in_string __RPC__in __pre __nullterminated
|
||||
#define __RPC__in_ecount(size) __RPC__in __pre __elem_readableTo(size)
|
||||
#define __RPC__in_ecount_full(size) __RPC__in_ecount(size)
|
||||
#define __RPC__in_ecount_full_string(size) __RPC__in_ecount_full(size) __pre __nullterminated
|
||||
#define __RPC__in_ecount_part(size, length) __RPC__in_ecount(length) __pre __elem_writableTo(size)
|
||||
#define __RPC__in_ecount_full_opt(size) __RPC__in_ecount_full(size) __pre __exceptthat __maybenull
|
||||
#define __RPC__in_ecount_full_opt_string(size) __RPC__in_ecount_full_opt(size) __pre __nullterminated
|
||||
#define __RPC__in_ecount_part_opt(size, length) __RPC__in_ecount_part(size, length) __pre __exceptthat __maybenull
|
||||
#define __RPC__in_xcount(size) __RPC__in __pre __elem_readableTo(size)
|
||||
#define __RPC__in_xcount_full(size) __RPC__in_ecount(size)
|
||||
#define __RPC__in_xcount_full_string(size) __RPC__in_ecount_full(size) __pre __nullterminated
|
||||
#define __RPC__in_xcount_part(size, length) __RPC__in_ecount(length) __pre __elem_writableTo(size)
|
||||
#define __RPC__in_xcount_full_opt(size) __RPC__in_ecount_full(size) __pre __exceptthat __maybenull
|
||||
#define __RPC__in_xcount_full_opt_string(size) __RPC__in_ecount_full_opt(size) __pre __nullterminated
|
||||
#define __RPC__in_xcount_part_opt(size, length) __RPC__in_ecount_part(size, length) __pre __exceptthat __maybenull
|
||||
|
||||
|
||||
#define __RPC__deref_in __RPC__in __deref __notnull
|
||||
#define __RPC__deref_in_string __RPC__in __pre __deref __nullterminated
|
||||
#define __RPC__deref_in_opt __RPC__deref_in __deref __exceptthat __maybenull
|
||||
#define __RPC__deref_in_opt_string __RPC__deref_in_opt __pre __deref __nullterminated
|
||||
#define __RPC__deref_opt_in __RPC__in __exceptthat __maybenull
|
||||
#define __RPC__deref_opt_in_string __RPC__deref_opt_in __pre __deref __nullterminated
|
||||
#define __RPC__deref_opt_in_opt __RPC__deref_opt_in __pre __deref __exceptthat __maybenull
|
||||
#define __RPC__deref_opt_in_opt_string __RPC__deref_opt_in_opt __pre __deref __nullterminated
|
||||
#define __RPC__deref_in_ecount(size) __RPC__in __pre __deref __elem_readableTo(size)
|
||||
#define __RPC__deref_in_ecount_part(size, length) __RPC__deref_in_ecount(size) __pre __deref __elem_readableTo(length)
|
||||
#define __RPC__deref_in_ecount_full(size) __RPC__deref_in_ecount_part(size, size)
|
||||
#define __RPC__deref_in_ecount_full_opt(size) __RPC__deref_in_ecount_full(size) __pre __deref __exceptthat __maybenull
|
||||
#define __RPC__deref_in_ecount_full_opt_string(size) __RPC__deref_in_ecount_full_opt(size) __pre __deref __nullterminated
|
||||
#define __RPC__deref_in_ecount_full_string(size) __RPC__deref_in_ecount_full(size) __pre __deref __nullterminated
|
||||
#define __RPC__deref_in_ecount_opt(size) __RPC__deref_in_ecount(size) __pre __deref __exceptthat __maybenull
|
||||
#define __RPC__deref_in_ecount_opt_string(size) __RPC__deref_in_ecount_opt(size) __pre __deref __nullterminated
|
||||
#define __RPC__deref_in_ecount_part_opt(size, length) __RPC__deref_in_ecount_opt(size) __pre __deref __elem_readableTo(length)
|
||||
#define __RPC__deref_in_xcount(size) __RPC__in __pre __deref __elem_readableTo(size)
|
||||
#define __RPC__deref_in_xcount_part(size, length) __RPC__deref_in_ecount(size) __pre __deref __elem_readableTo(length)
|
||||
#define __RPC__deref_in_xcount_full(size) __RPC__deref_in_ecount_part(size, size)
|
||||
#define __RPC__deref_in_xcount_full_opt(size) __RPC__deref_in_ecount_full(size) __pre __deref __exceptthat __maybenull
|
||||
#define __RPC__deref_in_xcount_full_opt_string(size) __RPC__deref_in_ecount_full_opt(size) __pre __deref __nullterminated
|
||||
#define __RPC__deref_in_xcount_full_string(size) __RPC__deref_in_ecount_full(size) __pre __deref __nullterminated
|
||||
#define __RPC__deref_in_xcount_opt(size) __RPC__deref_in_ecount(size) __pre __deref __exceptthat __maybenull
|
||||
#define __RPC__deref_in_xcount_opt_string(size) __RPC__deref_in_ecount_opt(size) __pre __deref __nullterminated
|
||||
#define __RPC__deref_in_xcount_part_opt(size, length) __RPC__deref_in_ecount_opt(size) __pre __deref __elem_readableTo(length)
|
||||
|
||||
// [out]
|
||||
#define __RPC__out __out
|
||||
#define __RPC__out_ecount(size) __out_ecount(size) __post __elem_writableTo(size)
|
||||
#define __RPC__out_ecount_string(size) __RPC__out_ecount(size) __post __nullterminated
|
||||
#define __RPC__out_ecount_part(size, length) __RPC__out_ecount(size) __post __elem_readableTo(length)
|
||||
#define __RPC__out_ecount_full(size) __RPC__out_ecount_part(size, size)
|
||||
#define __RPC__out_ecount_full_string(size) __RPC__out_ecount_full(size) __post __nullterminated
|
||||
#define __RPC__out_xcount(size) __out
|
||||
#define __RPC__out_xcount_string(size) __RPC__out __post __nullterminated
|
||||
#define __RPC__out_xcount_part(size, length) __RPC__out
|
||||
#define __RPC__out_xcount_full(size) __RPC__out
|
||||
#define __RPC__out_xcount_full_string(size) __RPC__out __post __nullterminated
|
||||
|
||||
// [in,out]
|
||||
#define __RPC__inout __inout
|
||||
#define __RPC__inout_string __RPC__inout __pre __nullterminated __post __nullterminated
|
||||
#define __RPC__inout_ecount(size) __inout_ecount(size)
|
||||
#define __RPC__inout_ecount_part(size, length) __inout_ecount_part(size, length)
|
||||
#define __RPC__inout_ecount_full(size) __RPC__inout_ecount_part(size, size)
|
||||
#define __RPC__inout_ecount_full_string(size) __RPC__inout_ecount_full(size) __pre __nullterminated __post __nullterminated
|
||||
#define __RPC__inout_xcount(size) __inout
|
||||
#define __RPC__inout_xcount_part(size, length) __inout
|
||||
#define __RPC__inout_xcount_full(size) __RPC__inout
|
||||
#define __RPC__inout_xcount_full_string(size) __RPC__inout __pre __nullterminated __post __nullterminated
|
||||
|
||||
// [in,unique]
|
||||
#define __RPC__in_opt __RPC__in __pre __exceptthat __maybenull
|
||||
#define __RPC__in_opt_string __RPC__in_opt __pre __nullterminated
|
||||
#define __RPC__in_ecount_opt(size) __RPC__in_ecount(size) __pre __exceptthat __maybenull
|
||||
#define __RPC__in_ecount_opt_string(size) __RPC__in_ecount_opt(size) __pre __nullterminated
|
||||
#define __RPC__in_xcount_opt(size) __RPC__in_ecount(size) __pre __exceptthat __maybenull
|
||||
#define __RPC__in_xcount_opt_string(size) __RPC__in_ecount_opt(size) __pre __nullterminated
|
||||
|
||||
// [in,out,unique]
|
||||
#define __RPC__inout_opt __inout_opt
|
||||
#define __RPC__inout_opt_string __RPC__inout_opt __pre __nullterminated
|
||||
#define __RPC__inout_ecount_opt(size) __inout_ecount_opt(size)
|
||||
#define __RPC__inout_ecount_part_opt(size, length) __inout_ecount_part_opt(size, length)
|
||||
#define __RPC__inout_ecount_full_opt(size) __RPC__inout_ecount_part_opt(size, size)
|
||||
#define __RPC__inout_ecount_full_opt_string(size) __RPC__inout_ecount_full_opt(size) __pre __nullterminated __post __nullterminated
|
||||
#define __RPC__inout_xcount_opt(size) __inout_opt
|
||||
#define __RPC__inout_xcount_part_opt(size, length) __inout_opt
|
||||
#define __RPC__inout_xcount_full_opt(size) __RPC__inout_opt
|
||||
#define __RPC__inout_xcount_full_opt_string(size) __RPC__inout_opt __pre __nullterminated __post __nullterminated
|
||||
|
||||
// [out] **
|
||||
#define __RPC__deref_out __deref_out
|
||||
#define __RPC__deref_out_string __RPC__deref_out __post __deref __nullterminated
|
||||
// Removed "__post __deref __exceptthat __maybenull" so return values from QueryInterface and the like can be trusted without an explicit NULL check.
|
||||
// This is a temporary fix until midl.exe can be rev'd to produce more accurate annotations.
|
||||
#define __RPC__deref_out_opt __RPC__deref_out
|
||||
#define __RPC__deref_out_opt_string __RPC__deref_out_opt __post __deref __nullterminated __pre __deref __null
|
||||
#define __RPC__deref_out_ecount(size) __deref_out_ecount(size) __post __deref __elem_writableTo(size)
|
||||
#define __RPC__deref_out_ecount_part(size, length) __RPC__deref_out_ecount(size) __post __deref __elem_readableTo(length)
|
||||
#define __RPC__deref_out_ecount_full(size) __RPC__deref_out_ecount_part(size,size)
|
||||
#define __RPC__deref_out_ecount_full_string(size) __RPC__deref_out_ecount_full(size) __post __deref __nullterminated
|
||||
#define __RPC__deref_out_xcount(size) __deref_out __post __deref
|
||||
#define __RPC__deref_out_xcount_part(size, length) __RPC__deref_out __post __deref
|
||||
#define __RPC__deref_out_xcount_full(size) __RPC__deref_out
|
||||
#define __RPC__deref_out_xcount_full_string(size) __RPC__deref_out __post __deref __nullterminated
|
||||
|
||||
// [in,out] **, second pointer decoration.
|
||||
#define __RPC__deref_inout __deref_inout
|
||||
#define __RPC__deref_inout_string __RPC__deref_inout __pre __deref __nullterminated __post __deref __nullterminated
|
||||
#define __RPC__deref_inout_opt __deref_inout_opt
|
||||
#define __RPC__deref_inout_opt_string __RPC__deref_inout_opt __deref __nullterminated
|
||||
#define __RPC__deref_inout_ecount_opt(size) __deref_inout_ecount_opt(size)
|
||||
#define __RPC__deref_inout_ecount_part_opt(size, length) __deref_inout_ecount_part_opt(size , length)
|
||||
#define __RPC__deref_inout_ecount_full_opt(size) __RPC__deref_inout_ecount_part_opt(size, size)
|
||||
#define __RPC__deref_inout_ecount_full(size) __deref_inout_ecount_full(size)
|
||||
#define __RPC__deref_inout_ecount_full_string(size) __RPC__deref_inout_ecount_full(size) __post __deref __nullterminated
|
||||
#define __RPC__deref_inout_ecount_full_opt_string(size) __RPC__deref_inout_ecount_full_opt(size) __pre __deref __nullterminated __post __deref __nullterminated
|
||||
#define __RPC__deref_inout_xcount_opt(size) __deref_inout_opt
|
||||
#define __RPC__deref_inout_xcount_part_opt(size, length) __deref_inout_opt
|
||||
#define __RPC__deref_inout_xcount_full_opt(size) __RPC__deref_inout_opt
|
||||
#define __RPC__deref_inout_xcount_full(size) __deref_inout
|
||||
#define __RPC__deref_inout_xcount_full_string(size) __RPC__deref_inout __post __deref __nullterminated
|
||||
#define __RPC__deref_inout_xcount_full_opt_string(size) __RPC__deref_inout_opt __pre __deref __nullterminated __post __deref __nullterminated
|
||||
|
||||
|
||||
// #define __RPC_out_opt out_opt is not allowed in rpc
|
||||
|
||||
// [in,out,unique]
|
||||
#define __RPC__deref_opt_inout __deref_opt_inout
|
||||
#define __RPC__deref_opt_inout_ecount(size) __deref_opt_inout_ecount(size)
|
||||
#define __RPC__deref_opt_inout_string __RPC__deref_opt_inout __pre __deref __nullterminated __post __deref __nullterminated
|
||||
#define __RPC__deref_opt_inout_ecount_part(size, length) __deref_opt_inout_ecount_part(size, length)
|
||||
#define __RPC__deref_opt_inout_ecount_full(size) __deref_opt_inout_ecount_full(size)
|
||||
#define __RPC__deref_opt_inout_ecount_full_string(size) __RPC__deref_opt_inout_ecount_full(size) __pre __deref __nullterminated __post __deref __nullterminated
|
||||
#define __RPC__deref_opt_inout_xcount_part(size, length) __deref_opt_inout
|
||||
#define __RPC__deref_opt_inout_xcount_full(size) __deref_opt_inout
|
||||
#define __RPC__deref_opt_inout_xcount_full_string(size) __RPC__deref_opt_inout __pre __deref __nullterminated __post __deref __nullterminated
|
||||
|
||||
|
||||
// We don't need to specify __pre __deref __exceptthat __maybenull : this is default behavior. While this might not hold in SAL 1.1 syntax, SAL team
|
||||
// believes it's OK. We can revisit if SAL 1.1 can survive.
|
||||
#define __RPC__deref_out_ecount_opt(size) __RPC__out_ecount(size) __post __deref __exceptthat __maybenull __pre __deref __null
|
||||
#define __RPC__deref_out_ecount_part_opt(size, length) __RPC__deref_out_ecount_part(size, length) __post __deref __exceptthat __maybenull __pre __deref __null
|
||||
#define __RPC__deref_out_ecount_full_opt(size) __RPC__deref_out_ecount_part_opt(size, size) __pre __deref __null
|
||||
#define __RPC__deref_out_ecount_full_opt_string(size) __RPC__deref_out_ecount_part_opt(size, size) __post __deref __nullterminated __pre __deref __null
|
||||
#define __RPC__deref_out_xcount_opt(size) __RPC__out __post __deref __exceptthat __maybenull __pre __deref __null
|
||||
#define __RPC__deref_out_xcount_part_opt(size, length) __RPC__deref_out __post __deref __exceptthat __maybenull __pre __deref __null
|
||||
#define __RPC__deref_out_xcount_full_opt(size) __RPC__deref_out_opt __pre __deref __null
|
||||
#define __RPC__deref_out_xcount_full_opt_string(size) __RPC__deref_out_opt __post __deref __nullterminated __pre __deref __null
|
||||
|
||||
#define __RPC__deref_opt_inout_opt __deref_opt_inout_opt
|
||||
#define __RPC__deref_opt_inout_opt_string __RPC__deref_opt_inout_opt __pre __deref __nullterminated __post __deref __nullterminated
|
||||
#define __RPC__deref_opt_inout_ecount_opt(size) __deref_opt_inout_ecount_opt(size)
|
||||
#define __RPC__deref_opt_inout_ecount_part_opt(size, length) __deref_opt_inout_ecount_part_opt(size, length)
|
||||
#define __RPC__deref_opt_inout_ecount_full_opt(size) __RPC__deref_opt_inout_ecount_part_opt(size, size)
|
||||
#define __RPC__deref_opt_inout_ecount_full_opt_string(size) __RPC__deref_opt_inout_ecount_full_opt(size) __pre __deref __nullterminated __post __deref __nullterminated
|
||||
#define __RPC__deref_opt_inout_xcount_opt(size) __deref_opt_inout_opt
|
||||
#define __RPC__deref_opt_inout_xcount_part_opt(size, length) __deref_opt_inout_opt
|
||||
#define __RPC__deref_opt_inout_xcount_full_opt(size) __RPC__deref_opt_inout_opt
|
||||
#define __RPC__deref_opt_inout_xcount_full_opt_string(size) __RPC__deref_opt_inout_opt __pre __deref __nullterminated __post __deref __nullterminated
|
||||
|
||||
#define __RPC_full_pointer __maybenull
|
||||
#define __RPC_unique_pointer __maybenull
|
||||
#define __RPC_ref_pointer __notnull
|
||||
#define __RPC_string __nullterminated
|
||||
|
||||
#define __RPC__range(min,max) __range(min,max)
|
||||
#define __RPC__in_range(min,max) __in_range(min,max)
|
||||
|
||||
#else // not prefast
|
||||
|
||||
#define __RPC__range(min,max)
|
||||
#define __RPC__in_range(min,max)
|
||||
|
||||
#define __RPC__in
|
||||
#define __RPC__in_string
|
||||
#define __RPC__in_opt_string
|
||||
#define __RPC__in_ecount(size)
|
||||
#define __RPC__in_ecount_full(size)
|
||||
#define __RPC__in_ecount_full_string(size)
|
||||
#define __RPC__in_ecount_part(size, length)
|
||||
#define __RPC__in_ecount_full_opt(size)
|
||||
#define __RPC__in_ecount_full_opt_string(size)
|
||||
#define __RPC__inout_ecount_full_opt_string(size)
|
||||
#define __RPC__in_ecount_part_opt(size, length)
|
||||
#define __RPC__in_xcount(size)
|
||||
#define __RPC__in_xcount_full(size)
|
||||
#define __RPC__in_xcount_full_string(size)
|
||||
#define __RPC__in_xcount_part(size, length)
|
||||
#define __RPC__in_xcount_full_opt(size)
|
||||
#define __RPC__in_xcount_full_opt_string(size)
|
||||
#define __RPC__inout_xcount_full_opt_string(size)
|
||||
#define __RPC__in_xcount_part_opt(size, length)
|
||||
|
||||
#define __RPC__deref_in
|
||||
#define __RPC__deref_in_string
|
||||
#define __RPC__deref_in_opt
|
||||
#define __RPC__deref_in_opt_string
|
||||
#define __RPC__deref_opt_in
|
||||
#define __RPC__deref_opt_in_string
|
||||
#define __RPC__deref_opt_in_opt
|
||||
#define __RPC__deref_opt_in_opt_string
|
||||
#define __RPC__deref_in_ecount(size)
|
||||
#define __RPC__deref_in_ecount_part(size, length)
|
||||
#define __RPC__deref_in_ecount_full(size)
|
||||
#define __RPC__deref_in_ecount_full_opt(size)
|
||||
#define __RPC__deref_in_ecount_full_string(size)
|
||||
#define __RPC__deref_in_ecount_full_opt_string(size)
|
||||
#define __RPC__deref_in_ecount_opt(size)
|
||||
#define __RPC__deref_in_ecount_opt_string(size)
|
||||
#define __RPC__deref_in_ecount_part_opt(size, length)
|
||||
#define __RPC__deref_in_xcount(size)
|
||||
#define __RPC__deref_in_xcount_part(size, length)
|
||||
#define __RPC__deref_in_xcount_full(size)
|
||||
#define __RPC__deref_in_xcount_full_opt(size)
|
||||
#define __RPC__deref_in_xcount_full_string(size)
|
||||
#define __RPC__deref_in_xcount_full_opt_string(size)
|
||||
#define __RPC__deref_in_xcount_opt(size)
|
||||
#define __RPC__deref_in_xcount_opt_string(size)
|
||||
#define __RPC__deref_in_xcount_part_opt(size, length)
|
||||
|
||||
// [out]
|
||||
#define __RPC__out
|
||||
#define __RPC__out_ecount(size)
|
||||
#define __RPC__out_ecount_part(size, length)
|
||||
#define __RPC__out_ecount_full(size)
|
||||
#define __RPC__out_ecount_full_string(size)
|
||||
#define __RPC__out_xcount(size)
|
||||
#define __RPC__out_xcount_part(size, length)
|
||||
#define __RPC__out_xcount_full(size)
|
||||
#define __RPC__out_xcount_full_string(size)
|
||||
|
||||
// [in,out]
|
||||
#define __RPC__inout
|
||||
#define __RPC__inout_string
|
||||
#define __RPC__opt_inout
|
||||
#define __RPC__inout_ecount(size)
|
||||
#define __RPC__inout_ecount_part(size, length)
|
||||
#define __RPC__inout_ecount_full(size)
|
||||
#define __RPC__inout_ecount_full_string(size)
|
||||
#define __RPC__inout_xcount(size)
|
||||
#define __RPC__inout_xcount_part(size, length)
|
||||
#define __RPC__inout_xcount_full(size)
|
||||
#define __RPC__inout_xcount_full_string(size)
|
||||
|
||||
// [in,unique]
|
||||
#define __RPC__in_opt
|
||||
#define __RPC__in_ecount_opt(size)
|
||||
#define __RPC__in_xcount_opt(size)
|
||||
|
||||
|
||||
// [in,out,unique]
|
||||
#define __RPC__inout_opt
|
||||
#define __RPC__inout_opt_string
|
||||
#define __RPC__inout_ecount_opt(size)
|
||||
#define __RPC__inout_ecount_part_opt(size, length)
|
||||
#define __RPC__inout_ecount_full_opt(size)
|
||||
#define __RPC__inout_ecount_full_string(size)
|
||||
#define __RPC__inout_xcount_opt(size)
|
||||
#define __RPC__inout_xcount_part_opt(size, length)
|
||||
#define __RPC__inout_xcount_full_opt(size)
|
||||
#define __RPC__inout_xcount_full_string(size)
|
||||
|
||||
// [out] **
|
||||
#define __RPC__deref_out
|
||||
#define __RPC__deref_out_string
|
||||
#define __RPC__deref_out_opt
|
||||
#define __RPC__deref_out_opt_string
|
||||
#define __RPC__deref_out_ecount(size)
|
||||
#define __RPC__deref_out_ecount_part(size, length)
|
||||
#define __RPC__deref_out_ecount_full(size)
|
||||
#define __RPC__deref_out_ecount_full_string(size)
|
||||
#define __RPC__deref_out_xcount(size)
|
||||
#define __RPC__deref_out_xcount_part(size, length)
|
||||
#define __RPC__deref_out_xcount_full(size)
|
||||
#define __RPC__deref_out_xcount_full_string(size)
|
||||
|
||||
|
||||
// [in,out] **, second pointer decoration.
|
||||
#define __RPC__deref_inout
|
||||
#define __RPC__deref_inout_string
|
||||
#define __RPC__deref_inout_opt
|
||||
#define __RPC__deref_inout_opt_string
|
||||
#define __RPC__deref_inout_ecount_full(size)
|
||||
#define __RPC__deref_inout_ecount_full_string(size)
|
||||
#define __RPC__deref_inout_ecount_opt(size)
|
||||
#define __RPC__deref_inout_ecount_part_opt(size, length)
|
||||
#define __RPC__deref_inout_ecount_full_opt(size)
|
||||
#define __RPC__deref_inout_ecount_full_opt_string(size)
|
||||
#define __RPC__deref_inout_xcount_full(size)
|
||||
#define __RPC__deref_inout_xcount_full_string(size)
|
||||
#define __RPC__deref_inout_xcount_opt(size)
|
||||
#define __RPC__deref_inout_xcount_part_opt(size, length)
|
||||
#define __RPC__deref_inout_xcount_full_opt(size)
|
||||
#define __RPC__deref_inout_xcount_full_opt_string(size)
|
||||
|
||||
// #define __RPC_out_opt out_opt is not allowed in rpc
|
||||
|
||||
// [in,out,unique]
|
||||
#define __RPC__deref_opt_inout
|
||||
#define __RPC__deref_opt_inout_string
|
||||
#define __RPC__deref_opt_inout_ecount(size)
|
||||
#define __RPC__deref_opt_inout_ecount_part(size, length)
|
||||
#define __RPC__deref_opt_inout_ecount_full(size)
|
||||
#define __RPC__deref_opt_inout_ecount_full_string(size)
|
||||
#define __RPC__deref_opt_inout_xcount(size)
|
||||
#define __RPC__deref_opt_inout_xcount_part(size, length)
|
||||
#define __RPC__deref_opt_inout_xcount_full(size)
|
||||
#define __RPC__deref_opt_inout_xcount_full_string(size)
|
||||
|
||||
#define __RPC__deref_out_ecount_opt(size)
|
||||
#define __RPC__deref_out_ecount_part_opt(size, length)
|
||||
#define __RPC__deref_out_ecount_full_opt(size)
|
||||
#define __RPC__deref_out_ecount_full_opt_string(size)
|
||||
#define __RPC__deref_out_xcount_opt(size)
|
||||
#define __RPC__deref_out_xcount_part_opt(size, length)
|
||||
#define __RPC__deref_out_xcount_full_opt(size)
|
||||
#define __RPC__deref_out_xcount_full_opt_string(size)
|
||||
|
||||
#define __RPC__deref_opt_inout_opt
|
||||
#define __RPC__deref_opt_inout_opt_string
|
||||
#define __RPC__deref_opt_inout_ecount_opt(size)
|
||||
#define __RPC__deref_opt_inout_ecount_part_opt(size, length)
|
||||
#define __RPC__deref_opt_inout_ecount_full_opt(size)
|
||||
#define __RPC__deref_opt_inout_ecount_full_opt_string(size)
|
||||
#define __RPC__deref_opt_inout_xcount_opt(size)
|
||||
#define __RPC__deref_opt_inout_xcount_part_opt(size, length)
|
||||
#define __RPC__deref_opt_inout_xcount_full_opt(size)
|
||||
#define __RPC__deref_opt_inout_xcount_full_opt_string(size)
|
||||
|
||||
#define __RPC_full_pointer
|
||||
#define __RPC_unique_pointer
|
||||
#define __RPC_ref_pointer
|
||||
#define __RPC_string
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
1551
SDK/Include/xact3.h
Normal file
1551
SDK/Include/xact3.h
Normal file
File diff suppressed because it is too large
Load Diff
275
SDK/Include/xact3d3.h
Normal file
275
SDK/Include/xact3d3.h
Normal file
@ -0,0 +1,275 @@
|
||||
/*-========================================================================-_
|
||||
| - XACT3D3 - |
|
||||
| Copyright (c) Microsoft Corporation. All rights reserved. |
|
||||
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|
||||
|VERSION: 0.1 MODEL: Unmanaged User-mode |
|
||||
|CONTRACT: N / A EXCEPT: No Exceptions |
|
||||
|PARENT: N / A MINREQ: Win2000, Xbox360 |
|
||||
|PROJECT: XACT3D DIALECT: MS Visual C++ 7.0 |
|
||||
|>------------------------------------------------------------------------<|
|
||||
| DUTY: XACT 3D support |
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
|
||||
NOTES:
|
||||
1. See X3DAudio.h for information regarding X3DAudio types. */
|
||||
|
||||
|
||||
#ifndef __XACT3D3_H__
|
||||
#define __XACT3D3_H__
|
||||
|
||||
//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
|
||||
#include <x3daudio.h>
|
||||
#include <xact3.h>
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4701) // disable "local variable may be used without having been initialized" compile warning
|
||||
|
||||
// Supported speaker positions, represented as azimuth angles.
|
||||
//
|
||||
// Here's a picture of the azimuth angles for the 8 cardinal points,
|
||||
// seen from above. The emitter's base position is at the origin 0.
|
||||
//
|
||||
// FRONT
|
||||
// | 0 <-- azimuth
|
||||
// |
|
||||
// 7pi/4 \ | / pi/4
|
||||
// \ | /
|
||||
// LEFT \|/ RIGHT
|
||||
// 3pi/2-------0-------pi/2
|
||||
// /|\
|
||||
// / | \
|
||||
// 5pi/4 / | \ 3pi/4
|
||||
// |
|
||||
// | pi
|
||||
// BACK
|
||||
//
|
||||
#define LEFT_AZIMUTH (3*X3DAUDIO_PI/2)
|
||||
#define RIGHT_AZIMUTH (X3DAUDIO_PI/2)
|
||||
#define FRONT_LEFT_AZIMUTH (7*X3DAUDIO_PI/4)
|
||||
#define FRONT_RIGHT_AZIMUTH (X3DAUDIO_PI/4)
|
||||
#define FRONT_CENTER_AZIMUTH 0.0f
|
||||
#define LOW_FREQUENCY_AZIMUTH X3DAUDIO_2PI
|
||||
#define BACK_LEFT_AZIMUTH (5*X3DAUDIO_PI/4)
|
||||
#define BACK_RIGHT_AZIMUTH (3*X3DAUDIO_PI/4)
|
||||
#define BACK_CENTER_AZIMUTH X3DAUDIO_PI
|
||||
#define FRONT_LEFT_OF_CENTER_AZIMUTH (15*X3DAUDIO_PI/8)
|
||||
#define FRONT_RIGHT_OF_CENTER_AZIMUTH (X3DAUDIO_PI/8)
|
||||
|
||||
|
||||
//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
|
||||
// Supported emitter channel layouts:
|
||||
static const float aStereoLayout[] =
|
||||
{
|
||||
LEFT_AZIMUTH,
|
||||
RIGHT_AZIMUTH
|
||||
};
|
||||
static const float a2Point1Layout[] =
|
||||
{
|
||||
LEFT_AZIMUTH,
|
||||
RIGHT_AZIMUTH,
|
||||
LOW_FREQUENCY_AZIMUTH
|
||||
};
|
||||
static const float aQuadLayout[] =
|
||||
{
|
||||
FRONT_LEFT_AZIMUTH,
|
||||
FRONT_RIGHT_AZIMUTH,
|
||||
BACK_LEFT_AZIMUTH,
|
||||
BACK_RIGHT_AZIMUTH
|
||||
};
|
||||
static const float a4Point1Layout[] =
|
||||
{
|
||||
FRONT_LEFT_AZIMUTH,
|
||||
FRONT_RIGHT_AZIMUTH,
|
||||
LOW_FREQUENCY_AZIMUTH,
|
||||
BACK_LEFT_AZIMUTH,
|
||||
BACK_RIGHT_AZIMUTH
|
||||
};
|
||||
static const float a5Point1Layout[] =
|
||||
{
|
||||
FRONT_LEFT_AZIMUTH,
|
||||
FRONT_RIGHT_AZIMUTH,
|
||||
FRONT_CENTER_AZIMUTH,
|
||||
LOW_FREQUENCY_AZIMUTH,
|
||||
BACK_LEFT_AZIMUTH,
|
||||
BACK_RIGHT_AZIMUTH
|
||||
};
|
||||
static const float a7Point1Layout[] =
|
||||
{
|
||||
FRONT_LEFT_AZIMUTH,
|
||||
FRONT_RIGHT_AZIMUTH,
|
||||
FRONT_CENTER_AZIMUTH,
|
||||
LOW_FREQUENCY_AZIMUTH,
|
||||
BACK_LEFT_AZIMUTH,
|
||||
BACK_RIGHT_AZIMUTH,
|
||||
LEFT_AZIMUTH,
|
||||
RIGHT_AZIMUTH
|
||||
};
|
||||
|
||||
|
||||
//--------------<F-U-N-C-T-I-O-N-S>-----------------------------------------//
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Initializes the 3D API's:
|
||||
//
|
||||
// REMARKS:
|
||||
// This method only needs to be called once.
|
||||
// X3DAudio will be initialized such that its speaker channel mask
|
||||
// matches the format of the given XACT engine's final mix.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pEngine - [in] XACT engine
|
||||
// X3DInstance - [out] X3DAudio instance handle
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// HResult error code
|
||||
////
|
||||
EXTERN_C HRESULT inline XACT3DInitialize (__in IXACT3Engine* pEngine, __in X3DAUDIO_HANDLE X3DInstance)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
if (pEngine == NULL) {
|
||||
hr = E_POINTER;
|
||||
}
|
||||
|
||||
XACTVARIABLEVALUE nSpeedOfSound;
|
||||
if (SUCCEEDED(hr)) {
|
||||
XACTVARIABLEINDEX xactSpeedOfSoundID = pEngine->GetGlobalVariableIndex("SpeedOfSound");
|
||||
hr = pEngine->GetGlobalVariable(xactSpeedOfSoundID, &nSpeedOfSound);
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
WAVEFORMATEXTENSIBLE wfxFinalMixFormat;
|
||||
hr = pEngine->GetFinalMixFormat(&wfxFinalMixFormat);
|
||||
if (SUCCEEDED(hr)) {
|
||||
X3DAudioInitialize(wfxFinalMixFormat.dwChannelMask, nSpeedOfSound, X3DInstance);
|
||||
}
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Calculates DSP settings with respect to 3D parameters:
|
||||
//
|
||||
// REMARKS:
|
||||
// Note the following flags are always specified for XACT3D calculation:
|
||||
// X3DAUDIO_CALCULATE_MATRIX | X3DAUDIO_CALCULATE_DOPPLER | X3DAUDIO_CALCULATE_EMITTER_ANGLE
|
||||
//
|
||||
// This means the caller must set at least the following fields:
|
||||
// X3DAUDIO_LISTENER.OrientFront
|
||||
// X3DAUDIO_LISTENER.OrientTop
|
||||
// X3DAUDIO_LISTENER.Position
|
||||
// X3DAUDIO_LISTENER.Velocity
|
||||
//
|
||||
// X3DAUDIO_EMITTER.OrientFront
|
||||
// X3DAUDIO_EMITTER.OrientTop, if emitter is multi-channel
|
||||
// X3DAUDIO_EMITTER.Position
|
||||
// X3DAUDIO_EMITTER.Velocity
|
||||
// X3DAUDIO_EMITTER.InnerRadius
|
||||
// X3DAUDIO_EMITTER.InnerRadiusAngle
|
||||
// X3DAUDIO_EMITTER.ChannelCount
|
||||
// X3DAUDIO_EMITTER.CurveDistanceScaler
|
||||
// X3DAUDIO_EMITTER.DopplerScaler
|
||||
//
|
||||
// X3DAUDIO_DSP_SETTINGS.pMatrixCoefficients, the caller need only allocate space for SrcChannelCount*DstChannelCount elements
|
||||
// X3DAUDIO_DSP_SETTINGS.SrcChannelCount
|
||||
// X3DAUDIO_DSP_SETTINGS.DstChannelCount
|
||||
//
|
||||
// If X3DAUDIO_EMITTER.pChannelAzimuths is left NULL for multi-channel emitters,
|
||||
// a default channel radius and channel azimuth array will be applied below.
|
||||
// Distance curves such as X3DAUDIO_EMITTER.pVolumeCurve should be
|
||||
// left NULL as XACT's native RPCs will be used to define DSP behaviour
|
||||
// with respect to normalized distance.
|
||||
//
|
||||
// See X3DAudio.h for information regarding X3DAudio types.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// X3DInstance - [in] X3DAudio instance handle, returned from XACT3DInitialize()
|
||||
// pListener - [in] point of 3D audio reception
|
||||
// pEmitter - [in] 3D audio source
|
||||
// pDSPSettings - [out] receives calculation results, applied to an XACT cue via XACT3DApply()
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// HResult error code
|
||||
////
|
||||
EXTERN_C HRESULT inline XACT3DCalculate (__in X3DAUDIO_HANDLE X3DInstance, __in const X3DAUDIO_LISTENER* pListener, __inout X3DAUDIO_EMITTER* pEmitter, __inout X3DAUDIO_DSP_SETTINGS* pDSPSettings)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
if (pListener == NULL || pEmitter == NULL || pDSPSettings == NULL) {
|
||||
hr = E_POINTER;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
if (pEmitter->ChannelCount > 1 && pEmitter->pChannelAzimuths == NULL) {
|
||||
pEmitter->ChannelRadius = 1.0f;
|
||||
|
||||
switch (pEmitter->ChannelCount) {
|
||||
case 2: pEmitter->pChannelAzimuths = (float*)&aStereoLayout[0]; break;
|
||||
case 3: pEmitter->pChannelAzimuths = (float*)&a2Point1Layout[0]; break;
|
||||
case 4: pEmitter->pChannelAzimuths = (float*)&aQuadLayout[0]; break;
|
||||
case 5: pEmitter->pChannelAzimuths = (float*)&a4Point1Layout[0]; break;
|
||||
case 6: pEmitter->pChannelAzimuths = (float*)&a5Point1Layout[0]; break;
|
||||
case 8: pEmitter->pChannelAzimuths = (float*)&a7Point1Layout[0]; break;
|
||||
default: hr = E_FAIL; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
static X3DAUDIO_DISTANCE_CURVE_POINT DefaultCurvePoints[2] = { 0.0f, 1.0f, 1.0f, 1.0f };
|
||||
static X3DAUDIO_DISTANCE_CURVE DefaultCurve = { (X3DAUDIO_DISTANCE_CURVE_POINT*)&DefaultCurvePoints[0], 2 };
|
||||
if (pEmitter->pVolumeCurve == NULL) {
|
||||
pEmitter->pVolumeCurve = &DefaultCurve;
|
||||
}
|
||||
if (pEmitter->pLFECurve == NULL) {
|
||||
pEmitter->pLFECurve = &DefaultCurve;
|
||||
}
|
||||
|
||||
X3DAudioCalculate(X3DInstance, pListener, pEmitter, (X3DAUDIO_CALCULATE_MATRIX | X3DAUDIO_CALCULATE_DOPPLER | X3DAUDIO_CALCULATE_EMITTER_ANGLE), pDSPSettings);
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
////
|
||||
// DESCRIPTION:
|
||||
// Applies results from a call to XACT3DCalculate() to a cue.
|
||||
//
|
||||
// PARAMETERS:
|
||||
// pDSPSettings - [in] calculation results generated by XACT3DCalculate()
|
||||
// pCue - [in] cue to which to apply pDSPSettings
|
||||
//
|
||||
// RETURN VALUE:
|
||||
// HResult error code
|
||||
////
|
||||
EXTERN_C HRESULT inline XACT3DApply (__in const X3DAUDIO_DSP_SETTINGS* pDSPSettings, __in IXACT3Cue* pCue)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
if (pDSPSettings == NULL || pCue == NULL) {
|
||||
hr = E_POINTER;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = pCue->SetMatrixCoefficients(pDSPSettings->SrcChannelCount, pDSPSettings->DstChannelCount, pDSPSettings->pMatrixCoefficients);
|
||||
}
|
||||
if (SUCCEEDED(hr)) {
|
||||
XACTVARIABLEINDEX xactDistanceID = pCue->GetVariableIndex("Distance");
|
||||
hr = pCue->SetVariable(xactDistanceID, pDSPSettings->EmitterToListenerDistance);
|
||||
}
|
||||
if (SUCCEEDED(hr)) {
|
||||
XACTVARIABLEINDEX xactDopplerID = pCue->GetVariableIndex("DopplerPitchScalar");
|
||||
hr = pCue->SetVariable(xactDopplerID, pDSPSettings->DopplerFactor);
|
||||
}
|
||||
if (SUCCEEDED(hr)) {
|
||||
XACTVARIABLEINDEX xactOrientationID = pCue->GetVariableIndex("OrientationAngle");
|
||||
hr = pCue->SetVariable(xactOrientationID, pDSPSettings->EmitterToListenerAngle * (180.0f / X3DAUDIO_PI));
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
#pragma warning(pop)
|
||||
|
||||
#endif // __XACT3D3_H__
|
||||
//---------------------------------<-EOF->----------------------------------//
|
598
SDK/Include/xact3wb.h
Normal file
598
SDK/Include/xact3wb.h
Normal file
@ -0,0 +1,598 @@
|
||||
/***************************************************************************
|
||||
*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
*
|
||||
* File: xact3wb.h
|
||||
* Content: XACT 3 wave bank definitions.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __XACT3WB_H__
|
||||
#define __XACT3WB_H__
|
||||
|
||||
#ifdef _XBOX
|
||||
# include <xtl.h>
|
||||
#else
|
||||
# include <math.h>
|
||||
#endif
|
||||
|
||||
#include <audiodefs.h>
|
||||
#include <xma2defs.h>
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4201)
|
||||
#pragma warning(disable:4214) // nonstandard extension used : bit field types other than int
|
||||
|
||||
#pragma pack(push, 1)
|
||||
#if !defined(_X86_)
|
||||
#define XACTUNALIGNED __unaligned
|
||||
#else
|
||||
#define XACTUNALIGNED
|
||||
#endif
|
||||
|
||||
#ifdef _M_PPCBE
|
||||
#pragma bitfield_order(push, lsb_to_msb)
|
||||
#endif
|
||||
|
||||
#define WAVEBANK_HEADER_SIGNATURE 'DNBW' // WaveBank RIFF chunk signature
|
||||
#define WAVEBANK_HEADER_VERSION 44 // Current wavebank file version
|
||||
|
||||
#define WAVEBANK_BANKNAME_LENGTH 64 // Wave bank friendly name length, in characters
|
||||
#define WAVEBANK_ENTRYNAME_LENGTH 64 // Wave bank entry friendly name length, in characters
|
||||
|
||||
#define WAVEBANK_MAX_DATA_SEGMENT_SIZE 0xFFFFFFFF // Maximum wave bank data segment size, in bytes
|
||||
#define WAVEBANK_MAX_COMPACT_DATA_SEGMENT_SIZE 0x001FFFFF // Maximum compact wave bank data segment size, in bytes
|
||||
|
||||
typedef DWORD WAVEBANKOFFSET;
|
||||
|
||||
//
|
||||
// Bank flags
|
||||
//
|
||||
|
||||
#define WAVEBANK_TYPE_BUFFER 0x00000000 // In-memory buffer
|
||||
#define WAVEBANK_TYPE_STREAMING 0x00000001 // Streaming
|
||||
#define WAVEBANK_TYPE_MASK 0x00000001
|
||||
|
||||
#define WAVEBANK_FLAGS_ENTRYNAMES 0x00010000 // Bank includes entry names
|
||||
#define WAVEBANK_FLAGS_COMPACT 0x00020000 // Bank uses compact format
|
||||
#define WAVEBANK_FLAGS_SYNC_DISABLED 0x00040000 // Bank is disabled for audition sync
|
||||
#define WAVEBANK_FLAGS_SEEKTABLES 0x00080000 // Bank includes seek tables.
|
||||
#define WAVEBANK_FLAGS_MASK 0x000F0000
|
||||
|
||||
//
|
||||
// Entry flags
|
||||
//
|
||||
|
||||
#define WAVEBANKENTRY_FLAGS_READAHEAD 0x00000001 // Enable stream read-ahead
|
||||
#define WAVEBANKENTRY_FLAGS_LOOPCACHE 0x00000002 // One or more looping sounds use this wave
|
||||
#define WAVEBANKENTRY_FLAGS_REMOVELOOPTAIL 0x00000004 // Remove data after the end of the loop region
|
||||
#define WAVEBANKENTRY_FLAGS_IGNORELOOP 0x00000008 // Used internally when the loop region can't be used
|
||||
#define WAVEBANKENTRY_FLAGS_MASK 0x00000008
|
||||
|
||||
//
|
||||
// Entry wave format identifiers
|
||||
//
|
||||
|
||||
#define WAVEBANKMINIFORMAT_TAG_PCM 0x0 // PCM data
|
||||
#define WAVEBANKMINIFORMAT_TAG_XMA 0x1 // XMA data
|
||||
#define WAVEBANKMINIFORMAT_TAG_ADPCM 0x2 // ADPCM data
|
||||
#define WAVEBANKMINIFORMAT_TAG_WMA 0x3 // WMA data
|
||||
|
||||
#define WAVEBANKMINIFORMAT_BITDEPTH_8 0x0 // 8-bit data (PCM only)
|
||||
#define WAVEBANKMINIFORMAT_BITDEPTH_16 0x1 // 16-bit data (PCM only)
|
||||
|
||||
//
|
||||
// Arbitrary fixed sizes
|
||||
//
|
||||
#define WAVEBANKENTRY_XMASTREAMS_MAX 3 // enough for 5.1 channel audio
|
||||
#define WAVEBANKENTRY_XMACHANNELS_MAX 6 // enough for 5.1 channel audio (cf. XAUDIOCHANNEL_SOURCEMAX)
|
||||
|
||||
//
|
||||
// DVD data sizes
|
||||
//
|
||||
|
||||
#define WAVEBANK_DVD_SECTOR_SIZE 2048
|
||||
#define WAVEBANK_DVD_BLOCK_SIZE (WAVEBANK_DVD_SECTOR_SIZE * 16)
|
||||
|
||||
//
|
||||
// Bank alignment presets
|
||||
//
|
||||
|
||||
#define WAVEBANK_ALIGNMENT_MIN 4 // Minimum alignment
|
||||
#define WAVEBANK_ALIGNMENT_DVD WAVEBANK_DVD_SECTOR_SIZE // DVD-optimized alignment
|
||||
|
||||
//
|
||||
// Wave bank segment identifiers
|
||||
//
|
||||
|
||||
typedef enum WAVEBANKSEGIDX
|
||||
{
|
||||
WAVEBANK_SEGIDX_BANKDATA = 0, // Bank data
|
||||
WAVEBANK_SEGIDX_ENTRYMETADATA, // Entry meta-data
|
||||
WAVEBANK_SEGIDX_SEEKTABLES, // Storage for seek tables for the encoded waves.
|
||||
WAVEBANK_SEGIDX_ENTRYNAMES, // Entry friendly names
|
||||
WAVEBANK_SEGIDX_ENTRYWAVEDATA, // Entry wave data
|
||||
WAVEBANK_SEGIDX_COUNT
|
||||
} WAVEBANKSEGIDX, *LPWAVEBANKSEGIDX;
|
||||
|
||||
typedef const WAVEBANKSEGIDX *LPCWAVEBANKSEGIDX;
|
||||
|
||||
//
|
||||
// Endianness
|
||||
//
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace XACTWaveBank
|
||||
{
|
||||
__inline void SwapBytes(XACTUNALIGNED DWORD &dw)
|
||||
{
|
||||
|
||||
#ifdef _X86_
|
||||
|
||||
__asm
|
||||
{
|
||||
mov edi, dw
|
||||
mov eax, [edi]
|
||||
bswap eax
|
||||
mov [edi], eax
|
||||
}
|
||||
|
||||
#else // _X86_
|
||||
|
||||
dw = _byteswap_ulong(dw);
|
||||
|
||||
#endif // _X86_
|
||||
|
||||
}
|
||||
|
||||
__inline void SwapBytes(XACTUNALIGNED WORD &w)
|
||||
{
|
||||
|
||||
#ifdef _X86_
|
||||
|
||||
__asm
|
||||
{
|
||||
mov edi, w
|
||||
mov ax, [edi]
|
||||
xchg ah, al
|
||||
mov [edi], ax
|
||||
}
|
||||
|
||||
#else // _X86_
|
||||
|
||||
w = _byteswap_ushort(w);
|
||||
|
||||
#endif // _X86_
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
//
|
||||
// Wave bank region in bytes.
|
||||
//
|
||||
|
||||
typedef struct WAVEBANKREGION
|
||||
{
|
||||
DWORD dwOffset; // Region offset, in bytes.
|
||||
DWORD dwLength; // Region length, in bytes.
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
void SwapBytes(void)
|
||||
{
|
||||
XACTWaveBank::SwapBytes(dwOffset);
|
||||
XACTWaveBank::SwapBytes(dwLength);
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
} WAVEBANKREGION, *LPWAVEBANKREGION;
|
||||
|
||||
typedef const WAVEBANKREGION *LPCWAVEBANKREGION;
|
||||
|
||||
|
||||
//
|
||||
// Wave bank region in samples.
|
||||
//
|
||||
|
||||
typedef struct WAVEBANKSAMPLEREGION
|
||||
{
|
||||
DWORD dwStartSample; // Start sample for the region.
|
||||
DWORD dwTotalSamples; // Region length in samples.
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
void SwapBytes(void)
|
||||
{
|
||||
XACTWaveBank::SwapBytes(dwStartSample);
|
||||
XACTWaveBank::SwapBytes(dwTotalSamples);
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
} WAVEBANKSAMPLEREGION, *LPWAVEBANKSAMPLEREGION;
|
||||
|
||||
typedef const WAVEBANKSAMPLEREGION *LPCWAVEBANKSAMPLEREGION;
|
||||
|
||||
|
||||
//
|
||||
// Wave bank file header
|
||||
//
|
||||
|
||||
typedef struct WAVEBANKHEADER
|
||||
{
|
||||
DWORD dwSignature; // File signature
|
||||
DWORD dwVersion; // Version of the tool that created the file
|
||||
DWORD dwHeaderVersion; // Version of the file format
|
||||
WAVEBANKREGION Segments[WAVEBANK_SEGIDX_COUNT]; // Segment lookup table
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
void SwapBytes(void)
|
||||
{
|
||||
XACTWaveBank::SwapBytes(dwSignature);
|
||||
XACTWaveBank::SwapBytes(dwVersion);
|
||||
XACTWaveBank::SwapBytes(dwHeaderVersion);
|
||||
|
||||
for(int i = 0; i < WAVEBANK_SEGIDX_COUNT; i++)
|
||||
{
|
||||
Segments[i].SwapBytes();
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
} WAVEBANKHEADER, *LPWAVEBANKHEADER;
|
||||
|
||||
typedef const WAVEBANKHEADER *LPCWAVEBANKHEADER;
|
||||
|
||||
//
|
||||
// Table for converting WMA Average Bytes per Second values to the WAVEBANKMINIWAVEFORMAT wBlockAlign field
|
||||
// NOTE: There can be a max of 8 values in the table.
|
||||
//
|
||||
|
||||
#define MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES 7
|
||||
|
||||
static const DWORD aWMAAvgBytesPerSec[] =
|
||||
{
|
||||
12000,
|
||||
24000,
|
||||
4000,
|
||||
6000,
|
||||
8000,
|
||||
20000,
|
||||
2500
|
||||
};
|
||||
// bitrate = entry * 8
|
||||
|
||||
//
|
||||
// Table for converting WMA Block Align values to the WAVEBANKMINIWAVEFORMAT wBlockAlign field
|
||||
// NOTE: There can be a max of 32 values in the table.
|
||||
//
|
||||
|
||||
#define MAX_WMA_BLOCK_ALIGN_ENTRIES 17
|
||||
|
||||
static const DWORD aWMABlockAlign[] =
|
||||
{
|
||||
929,
|
||||
1487,
|
||||
1280,
|
||||
2230,
|
||||
8917,
|
||||
8192,
|
||||
4459,
|
||||
5945,
|
||||
2304,
|
||||
1536,
|
||||
1485,
|
||||
1008,
|
||||
2731,
|
||||
4096,
|
||||
6827,
|
||||
5462,
|
||||
1280
|
||||
};
|
||||
|
||||
struct WAVEBANKENTRY;
|
||||
|
||||
//
|
||||
// Entry compressed data format
|
||||
//
|
||||
|
||||
typedef union WAVEBANKMINIWAVEFORMAT
|
||||
{
|
||||
struct
|
||||
{
|
||||
DWORD wFormatTag : 2; // Format tag
|
||||
DWORD nChannels : 3; // Channel count (1 - 6)
|
||||
DWORD nSamplesPerSec : 18; // Sampling rate
|
||||
DWORD wBlockAlign : 8; // Block alignment. For WMA, lower 6 bits block alignment index, upper 2 bits bytes-per-second index.
|
||||
DWORD wBitsPerSample : 1; // Bits per sample (8 vs. 16, PCM only); WMAudio2/WMAudio3 (for WMA)
|
||||
};
|
||||
|
||||
DWORD dwValue;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
void SwapBytes(void)
|
||||
{
|
||||
XACTWaveBank::SwapBytes(dwValue);
|
||||
}
|
||||
|
||||
WORD BitsPerSample() const
|
||||
{
|
||||
if (wFormatTag == WAVEBANKMINIFORMAT_TAG_XMA)
|
||||
return XMA_OUTPUT_SAMPLE_BITS; // First, because most common on Xbox 360
|
||||
if (wFormatTag == WAVEBANKMINIFORMAT_TAG_WMA)
|
||||
return 16;
|
||||
if (wFormatTag == WAVEBANKMINIFORMAT_TAG_ADPCM)
|
||||
return 4; // MSADPCM_BITS_PER_SAMPLE == 4
|
||||
|
||||
// wFormatTag must be WAVEBANKMINIFORMAT_TAG_PCM (2 bits can only represent 4 different values)
|
||||
return (wBitsPerSample == WAVEBANKMINIFORMAT_BITDEPTH_16) ? 16 : 8;
|
||||
}
|
||||
|
||||
#define ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET 22
|
||||
DWORD BlockAlign() const
|
||||
{
|
||||
DWORD dwReturn = 0;
|
||||
|
||||
switch (wFormatTag)
|
||||
{
|
||||
case WAVEBANKMINIFORMAT_TAG_PCM:
|
||||
dwReturn = wBlockAlign;
|
||||
break;
|
||||
|
||||
case WAVEBANKMINIFORMAT_TAG_XMA:
|
||||
dwReturn = nChannels * XMA_OUTPUT_SAMPLE_BITS / 8;
|
||||
break;
|
||||
|
||||
case WAVEBANKMINIFORMAT_TAG_ADPCM:
|
||||
dwReturn = (wBlockAlign + ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET) * nChannels;
|
||||
break;
|
||||
|
||||
case WAVEBANKMINIFORMAT_TAG_WMA:
|
||||
{
|
||||
DWORD dwBlockAlignIndex = wBlockAlign & 0x1F;
|
||||
if (dwBlockAlignIndex < MAX_WMA_BLOCK_ALIGN_ENTRIES)
|
||||
dwReturn = aWMABlockAlign[dwBlockAlignIndex];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return dwReturn;
|
||||
}
|
||||
|
||||
DWORD AvgBytesPerSec() const
|
||||
{
|
||||
DWORD dwReturn = 0;
|
||||
|
||||
switch (wFormatTag)
|
||||
{
|
||||
case WAVEBANKMINIFORMAT_TAG_PCM:
|
||||
case WAVEBANKMINIFORMAT_TAG_XMA:
|
||||
dwReturn = nSamplesPerSec * wBlockAlign;
|
||||
break;
|
||||
|
||||
case WAVEBANKMINIFORMAT_TAG_ADPCM:
|
||||
{
|
||||
DWORD blockAlign = BlockAlign();
|
||||
DWORD samplesPerAdpcmBlock = AdpcmSamplesPerBlock();
|
||||
dwReturn = blockAlign * nSamplesPerSec / samplesPerAdpcmBlock;
|
||||
}
|
||||
break;
|
||||
|
||||
case WAVEBANKMINIFORMAT_TAG_WMA:
|
||||
{
|
||||
DWORD dwBytesPerSecIndex = wBlockAlign >> 5;
|
||||
if (dwBytesPerSecIndex < MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES)
|
||||
dwReturn = aWMAAvgBytesPerSec[dwBytesPerSecIndex];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return dwReturn;
|
||||
}
|
||||
|
||||
DWORD EncodeWMABlockAlign(DWORD dwBlockAlign, DWORD dwAvgBytesPerSec) const
|
||||
{
|
||||
DWORD dwReturn = 0;
|
||||
DWORD dwBlockAlignIndex = 0;
|
||||
DWORD dwBytesPerSecIndex = 0;
|
||||
|
||||
for (; dwBlockAlignIndex < MAX_WMA_BLOCK_ALIGN_ENTRIES && dwBlockAlign != aWMABlockAlign[dwBlockAlignIndex]; dwBlockAlignIndex++);
|
||||
|
||||
if (dwBlockAlignIndex < MAX_WMA_BLOCK_ALIGN_ENTRIES)
|
||||
{
|
||||
for (; dwBytesPerSecIndex < MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES && dwAvgBytesPerSec != aWMAAvgBytesPerSec[dwBytesPerSecIndex]; dwBytesPerSecIndex++);
|
||||
|
||||
if (dwBytesPerSecIndex < MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES)
|
||||
{
|
||||
dwReturn = dwBlockAlignIndex | (dwBytesPerSecIndex << 5);
|
||||
}
|
||||
}
|
||||
|
||||
return dwReturn;
|
||||
}
|
||||
|
||||
|
||||
void XMA2FillFormatEx(XMA2WAVEFORMATEX *fmt, WORD blockCount, const struct WAVEBANKENTRY* entry) const;
|
||||
|
||||
DWORD AdpcmSamplesPerBlock() const
|
||||
{
|
||||
DWORD nBlockAlign = (wBlockAlign + ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET) * nChannels;
|
||||
return nBlockAlign * 2 / (DWORD)nChannels - 12;
|
||||
}
|
||||
|
||||
void AdpcmFillCoefficientTable(ADPCMWAVEFORMAT *fmt) const
|
||||
{
|
||||
// These are fixed since we are always using MS ADPCM
|
||||
fmt->wNumCoef = 7; /* MSADPCM_NUM_COEFFICIENTS */
|
||||
|
||||
static ADPCMCOEFSET aCoef[7] = { { 256, 0}, {512, -256}, {0,0}, {192,64}, {240,0}, {460, -208}, {392,-232} };
|
||||
memcpy( &fmt->aCoef, aCoef, sizeof(aCoef) );
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
} WAVEBANKMINIWAVEFORMAT, *LPWAVEBANKMINIWAVEFORMAT;
|
||||
|
||||
typedef const WAVEBANKMINIWAVEFORMAT *LPCWAVEBANKMINIWAVEFORMAT;
|
||||
|
||||
//
|
||||
// Entry meta-data
|
||||
//
|
||||
|
||||
typedef struct WAVEBANKENTRY
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
// Entry flags
|
||||
DWORD dwFlags : 4;
|
||||
|
||||
// Duration of the wave, in units of one sample.
|
||||
// For instance, a ten second long wave sampled
|
||||
// at 48KHz would have a duration of 480,000.
|
||||
// This value is not affected by the number of
|
||||
// channels, the number of bits per sample, or the
|
||||
// compression format of the wave.
|
||||
DWORD Duration : 28;
|
||||
};
|
||||
DWORD dwFlagsAndDuration;
|
||||
};
|
||||
|
||||
WAVEBANKMINIWAVEFORMAT Format; // Entry format.
|
||||
WAVEBANKREGION PlayRegion; // Region within the wave data segment that contains this entry.
|
||||
WAVEBANKSAMPLEREGION LoopRegion; // Region within the wave data (in samples) that should loop.
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
void SwapBytes(void)
|
||||
{
|
||||
XACTWaveBank::SwapBytes(dwFlagsAndDuration);
|
||||
Format.SwapBytes();
|
||||
PlayRegion.SwapBytes();
|
||||
LoopRegion.SwapBytes();
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
} WAVEBANKENTRY, *LPWAVEBANKENTRY;
|
||||
|
||||
typedef const WAVEBANKENTRY *LPCWAVEBANKENTRY;
|
||||
|
||||
//
|
||||
// Compact entry meta-data
|
||||
//
|
||||
|
||||
typedef struct WAVEBANKENTRYCOMPACT
|
||||
{
|
||||
DWORD dwOffset : 21; // Data offset, in sectors
|
||||
DWORD dwLengthDeviation : 11; // Data length deviation, in bytes
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
void SwapBytes(void)
|
||||
{
|
||||
XACTWaveBank::SwapBytes(*(LPDWORD)this);
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
} WAVEBANKENTRYCOMPACT, *LPWAVEBANKENTRYCOMPACT;
|
||||
|
||||
typedef const WAVEBANKENTRYCOMPACT *LPCWAVEBANKENTRYCOMPACT;
|
||||
|
||||
//
|
||||
// Bank data segment
|
||||
//
|
||||
|
||||
typedef struct WAVEBANKDATA
|
||||
{
|
||||
DWORD dwFlags; // Bank flags
|
||||
DWORD dwEntryCount; // Number of entries in the bank
|
||||
CHAR szBankName[WAVEBANK_BANKNAME_LENGTH]; // Bank friendly name
|
||||
DWORD dwEntryMetaDataElementSize; // Size of each entry meta-data element, in bytes
|
||||
DWORD dwEntryNameElementSize; // Size of each entry name element, in bytes
|
||||
DWORD dwAlignment; // Entry alignment, in bytes
|
||||
WAVEBANKMINIWAVEFORMAT CompactFormat; // Format data for compact bank
|
||||
FILETIME BuildTime; // Build timestamp
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
void SwapBytes(void)
|
||||
{
|
||||
XACTWaveBank::SwapBytes(dwFlags);
|
||||
XACTWaveBank::SwapBytes(dwEntryCount);
|
||||
XACTWaveBank::SwapBytes(dwEntryMetaDataElementSize);
|
||||
XACTWaveBank::SwapBytes(dwEntryNameElementSize);
|
||||
XACTWaveBank::SwapBytes(dwAlignment);
|
||||
CompactFormat.SwapBytes();
|
||||
XACTWaveBank::SwapBytes(BuildTime.dwLowDateTime);
|
||||
XACTWaveBank::SwapBytes(BuildTime.dwHighDateTime);
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
} WAVEBANKDATA, *LPWAVEBANKDATA;
|
||||
|
||||
typedef const WAVEBANKDATA *LPCWAVEBANKDATA;
|
||||
|
||||
inline void WAVEBANKMINIWAVEFORMAT::XMA2FillFormatEx(XMA2WAVEFORMATEX *fmt, WORD blockCount, const WAVEBANKENTRY* entry) const
|
||||
{
|
||||
// Note caller is responsbile for filling out fmt->wfx with other helper functions.
|
||||
|
||||
fmt->NumStreams = (WORD)( (nChannels + 1) / 2 );
|
||||
|
||||
switch (nChannels)
|
||||
{
|
||||
case 1: fmt->ChannelMask = SPEAKER_MONO; break;
|
||||
case 2: fmt->ChannelMask = SPEAKER_STEREO; break;
|
||||
case 3: fmt->ChannelMask = SPEAKER_2POINT1; break;
|
||||
case 4: fmt->ChannelMask = SPEAKER_QUAD; break;
|
||||
case 5: fmt->ChannelMask = SPEAKER_4POINT1; break;
|
||||
case 6: fmt->ChannelMask = SPEAKER_5POINT1; break;
|
||||
case 7: fmt->ChannelMask = SPEAKER_5POINT1 | SPEAKER_BACK_CENTER; break;
|
||||
case 8: fmt->ChannelMask = SPEAKER_7POINT1; break;
|
||||
default: fmt->ChannelMask = 0; break;
|
||||
}
|
||||
|
||||
fmt->SamplesEncoded = entry->Duration;
|
||||
fmt->BytesPerBlock = 65536; /* XACT_FIXED_XMA_BLOCK_SIZE */
|
||||
|
||||
fmt->PlayBegin = entry->PlayRegion.dwOffset;
|
||||
fmt->PlayLength = entry->PlayRegion.dwLength;
|
||||
|
||||
if (entry->LoopRegion.dwTotalSamples > 0)
|
||||
{
|
||||
fmt->LoopBegin = entry->LoopRegion.dwStartSample;
|
||||
fmt->LoopLength = entry->LoopRegion.dwTotalSamples;
|
||||
fmt->LoopCount = 0xff; /* XACTLOOPCOUNT_INFINITE */
|
||||
}
|
||||
else
|
||||
{
|
||||
fmt->LoopBegin = 0;
|
||||
fmt->LoopLength = 0;
|
||||
fmt->LoopCount = 0;
|
||||
}
|
||||
|
||||
fmt->EncoderVersion = 4; // XMAENCODER_VERSION_XMA2
|
||||
|
||||
fmt->BlockCount = blockCount;
|
||||
}
|
||||
|
||||
#ifdef _M_PPCBE
|
||||
#pragma bitfield_order(pop)
|
||||
#endif
|
||||
|
||||
#pragma warning(pop)
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif // __XACTWB_H__
|
||||
|
718
SDK/Include/xma2defs.h
Normal file
718
SDK/Include/xma2defs.h
Normal file
@ -0,0 +1,718 @@
|
||||
/***************************************************************************
|
||||
*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
*
|
||||
* File: xma2defs.h
|
||||
* Content: Constants, data types and functions for XMA2 compressed audio.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __XMA2DEFS_INCLUDED__
|
||||
#define __XMA2DEFS_INCLUDED__
|
||||
|
||||
#include <sal.h> // Markers for documenting API semantics
|
||||
#include <winerror.h> // For S_OK, E_FAIL
|
||||
#include <audiodefs.h> // Basic data types and constants for audio work
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* Overview
|
||||
***************************************************************************/
|
||||
|
||||
// A typical XMA2 file contains these RIFF chunks:
|
||||
//
|
||||
// 'fmt' or 'XMA2' chunk (or both): A description of the XMA data's structure
|
||||
// and characteristics (length, channels, sample rate, loops, block size, etc).
|
||||
//
|
||||
// 'seek' chunk: A seek table to help navigate the XMA data.
|
||||
//
|
||||
// 'data' chunk: The encoded XMA2 data.
|
||||
//
|
||||
// The encoded XMA2 data is structured as a set of BLOCKS, which contain PACKETS,
|
||||
// which contain FRAMES, which contain SUBFRAMES (roughly speaking). The frames
|
||||
// in a file may also be divided into several subsets, called STREAMS.
|
||||
//
|
||||
// FRAME: A variable-sized segment of XMA data that decodes to exactly 512 mono
|
||||
// or stereo PCM samples. This is the smallest unit of XMA data that can
|
||||
// be decoded in isolation. Frames are an arbitrary number of bits in
|
||||
// length, and need not be byte-aligned. See "XMA frame structure" below.
|
||||
//
|
||||
// SUBFRAME: A region of bits in an XMA frame that decodes to 128 mono or stereo
|
||||
// samples. The XMA decoder cannot decode a subframe in isolation; it needs
|
||||
// a whole frame to work with. However, it can begin emitting the frame's
|
||||
// decoded samples at any one of the four subframe boundaries. Subframes
|
||||
// can be addressed for seeking and looping purposes.
|
||||
//
|
||||
// PACKET: A 2Kb region containing a 32-bit header and some XMA frames. Frames
|
||||
// can (and usually do) span packets. A packet's header includes the offset
|
||||
// in bits of the first frame that begins within that packet. All of the
|
||||
// frames that begin in a given packet belong to the same "stream" (see the
|
||||
// Multichannel Audio section below).
|
||||
//
|
||||
// STREAM: A set of packets within an XMA file that all contain data for the
|
||||
// same mono or stereo component of a PCM file with more than two channels.
|
||||
// The packets comprising a given stream may be interleaved with each other
|
||||
// more or less arbitrarily; see Multichannel Audio.
|
||||
//
|
||||
// BLOCK: An array of XMA packets; or, to break it down differently, a series of
|
||||
// consecutive XMA frames, padded at the end with reserved data. A block
|
||||
// must contain at least one 2Kb packet per stream, and it can hold up to
|
||||
// 4095 packets (8190Kb), but its size is typically in the 32Kb-128Kb range.
|
||||
// (The size chosen involves a trade-off between memory use and efficiency
|
||||
// of reading from permanent storage.)
|
||||
//
|
||||
// XMA frames do not span blocks, so a block is guaranteed to begin with a
|
||||
// set of complete frames, one per stream. Also, a block in a multi-stream
|
||||
// XMA2 file always contains the same number of samples for each stream;
|
||||
// see Multichannel Audio.
|
||||
//
|
||||
// The 'data' chunk in an XMA2 file is an array of XMA2WAVEFORMAT.BlockCount XMA
|
||||
// blocks, all the same size (as specified in XMA2WAVEFORMAT.BlockSizeInBytes)
|
||||
// except for the last one, which may be shorter.
|
||||
|
||||
|
||||
// MULTICHANNEL AUDIO: the XMA decoder can only decode raw XMA data into either
|
||||
// mono or stereo PCM data. In order to encode a 6-channel file (say), the file
|
||||
// must be deinterleaved into 3 stereo streams that are encoded independently,
|
||||
// producing 3 encoded XMA data streams. Then the packets in these 3 streams
|
||||
// are interleaved to produce a single XMA2 file, and some information is added
|
||||
// to the file so that the original 6-channel audio can be reconstructed at
|
||||
// decode time. This works using the concept of an XMA stream (see above).
|
||||
//
|
||||
// The frames for all the streams in an XMA file are interleaved in an arbitrary
|
||||
// order. To locate a frame that belongs to a given stream in a given XMA block,
|
||||
// you must examine the first few packets in the block. Here (and only here) the
|
||||
// packets are guaranteed to be presented in stream order, so that all frames
|
||||
// beginning in packet 0 belong to stream 0 (the first stereo pair), etc.
|
||||
//
|
||||
// (This means that when decoding multi-stream XMA files, only entire XMA blocks
|
||||
// should be submitted to the decoder; otherwise it cannot know which frames
|
||||
// belong to which stream.)
|
||||
//
|
||||
// Once you have one frame that belongs to a given stream, you can find the next
|
||||
// one by looking at the frame's 'NextFrameOffsetBits' value (which is stored in
|
||||
// its first 15 bits; see XMAFRAME below). The GetXmaFrameBitPosition function
|
||||
// uses this technique.
|
||||
|
||||
|
||||
// SEEKING IN XMA2 FILES: Here is some pseudocode to find the byte position and
|
||||
// subframe in an XMA2 file which will contain sample S when decoded.
|
||||
//
|
||||
// 1. Traverse the seek table to find the XMA2 block containing sample S. The
|
||||
// seek table is an array of big-endian DWORDs, one per block in the file.
|
||||
// The Nth DWORD is the total number of PCM samples that would be obtained
|
||||
// by decoding the entire XMA file up to the end of block N. Hence, the
|
||||
// block we want is the first one whose seek table entry is greater than S.
|
||||
// (See the GetXmaBlockContainingSample helper function.)
|
||||
//
|
||||
// 2. Calculate which frame F within the block found above contains sample S.
|
||||
// Since each frame decodes to 512 samples, this is straightforward. The
|
||||
// first frame in the block produces samples X to X + 512, where X is the
|
||||
// seek table entry for the prior block. So F is (S - X) / 512.
|
||||
//
|
||||
// 3. Find the bit offset within the block where frame F starts. Since frames
|
||||
// are variable-sized, this can only be done by traversing all the frames in
|
||||
// the block until we reach frame F. (See GetXmaFrameBitPosition.)
|
||||
//
|
||||
// 4. Frame F has four 128-sample subframes. To find the subframe containing S,
|
||||
// we can use the formula (S % 512) / 128.
|
||||
//
|
||||
// In the case of multi-stream XMA files, sample S is a multichannel sample with
|
||||
// parts coming from several frames, one per stream. To find all these frames,
|
||||
// steps 2-4 need to be repeated for each stream N, using the knowledge that the
|
||||
// first packets in a block are presented in stream order. The frame traversal
|
||||
// in step 3 must be started at the first frame in the Nth packet of the block,
|
||||
// which will be the first frame for stream N. (And the packet header will tell
|
||||
// you the first frame's start position within the packet.)
|
||||
//
|
||||
// Step 1 can be performed using the GetXmaBlockContainingSample function below,
|
||||
// and steps 2-4 by calling GetXmaDecodePositionForSample once for each stream.
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* XMA constants
|
||||
***************************************************************************/
|
||||
|
||||
// Size of the PCM samples produced by the XMA decoder
|
||||
#define XMA_OUTPUT_SAMPLE_BYTES 2u
|
||||
#define XMA_OUTPUT_SAMPLE_BITS (XMA_OUTPUT_SAMPLE_BYTES * 8u)
|
||||
|
||||
// Size of an XMA packet
|
||||
#define XMA_BYTES_PER_PACKET 2048u
|
||||
#define XMA_BITS_PER_PACKET (XMA_BYTES_PER_PACKET * 8u)
|
||||
|
||||
// Size of an XMA packet header
|
||||
#define XMA_PACKET_HEADER_BYTES 4u
|
||||
#define XMA_PACKET_HEADER_BITS (XMA_PACKET_HEADER_BYTES * 8u)
|
||||
|
||||
// Sample blocks in a decoded XMA frame
|
||||
#define XMA_SAMPLES_PER_FRAME 512u
|
||||
|
||||
// Sample blocks in a decoded XMA subframe
|
||||
#define XMA_SAMPLES_PER_SUBFRAME 128u
|
||||
|
||||
// Maximum encoded data that can be submitted to the XMA decoder at a time
|
||||
#define XMA_READBUFFER_MAX_PACKETS 4095u
|
||||
#define XMA_READBUFFER_MAX_BYTES (XMA_READBUFFER_MAX_PACKETS * XMA_BYTES_PER_PACKET)
|
||||
|
||||
// Maximum size allowed for the XMA decoder's output buffers
|
||||
#define XMA_WRITEBUFFER_MAX_BYTES (31u * 256u)
|
||||
|
||||
// Required byte alignment of the XMA decoder's output buffers
|
||||
#define XMA_WRITEBUFFER_BYTE_ALIGNMENT 256u
|
||||
|
||||
// Decode chunk sizes for the XMA_PLAYBACK_INIT.subframesToDecode field
|
||||
#define XMA_MIN_SUBFRAMES_TO_DECODE 1u
|
||||
#define XMA_MAX_SUBFRAMES_TO_DECODE 8u
|
||||
#define XMA_OPTIMAL_SUBFRAMES_TO_DECODE 4u
|
||||
|
||||
// LoopCount<255 means finite repetitions; LoopCount=255 means infinite looping
|
||||
#define XMA_MAX_LOOPCOUNT 254u
|
||||
#define XMA_INFINITE_LOOP 255u
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* XMA format structures
|
||||
***************************************************************************/
|
||||
|
||||
// The currently recommended way to express format information for XMA2 files
|
||||
// is the XMA2WAVEFORMATEX structure. This structure is fully compliant with
|
||||
// the WAVEFORMATEX standard and contains all the information needed to parse
|
||||
// and manage XMA2 files in a compact way.
|
||||
|
||||
#define WAVE_FORMAT_XMA2 0x166
|
||||
|
||||
typedef struct XMA2WAVEFORMATEX
|
||||
{
|
||||
WAVEFORMATEX wfx;
|
||||
// Meaning of the WAVEFORMATEX fields here:
|
||||
// wFormatTag; // Audio format type; always WAVE_FORMAT_XMA2
|
||||
// nChannels; // Channel count of the decoded audio
|
||||
// nSamplesPerSec; // Sample rate of the decoded audio
|
||||
// nAvgBytesPerSec; // Used internally by the XMA encoder
|
||||
// nBlockAlign; // Decoded sample size; channels * wBitsPerSample / 8
|
||||
// wBitsPerSample; // Bits per decoded mono sample; always 16 for XMA
|
||||
// cbSize; // Size in bytes of the rest of this structure (34)
|
||||
|
||||
WORD NumStreams; // Number of audio streams (1 or 2 channels each)
|
||||
DWORD ChannelMask; // Spatial positions of the channels in this file,
|
||||
// stored as SPEAKER_xxx values (see audiodefs.h)
|
||||
DWORD SamplesEncoded; // Total number of PCM samples the file decodes to
|
||||
DWORD BytesPerBlock; // XMA block size (but the last one may be shorter)
|
||||
DWORD PlayBegin; // First valid sample in the decoded audio
|
||||
DWORD PlayLength; // Length of the valid part of the decoded audio
|
||||
DWORD LoopBegin; // Beginning of the loop region in decoded sample terms
|
||||
DWORD LoopLength; // Length of the loop region in decoded sample terms
|
||||
BYTE LoopCount; // Number of loop repetitions; 255 = infinite
|
||||
BYTE EncoderVersion; // Version of XMA encoder that generated the file
|
||||
WORD BlockCount; // XMA blocks in file (and entries in its seek table)
|
||||
} XMA2WAVEFORMATEX, *PXMA2WAVEFORMATEX;
|
||||
|
||||
|
||||
// The legacy XMA format structures are described here for reference, but they
|
||||
// should not be used in new content. XMAWAVEFORMAT was the structure used in
|
||||
// XMA version 1 files. XMA2WAVEFORMAT was used in early XMA2 files; it is not
|
||||
// placed in the usual 'fmt' RIFF chunk but in its own 'XMA2' chunk.
|
||||
|
||||
#ifndef WAVE_FORMAT_XMA
|
||||
#define WAVE_FORMAT_XMA 0x0165
|
||||
|
||||
// Values used in the ChannelMask fields below. Similar to the SPEAKER_xxx
|
||||
// values defined in audiodefs.h, but modified to fit in a single byte.
|
||||
#ifndef XMA_SPEAKER_LEFT
|
||||
#define XMA_SPEAKER_LEFT 0x01
|
||||
#define XMA_SPEAKER_RIGHT 0x02
|
||||
#define XMA_SPEAKER_CENTER 0x04
|
||||
#define XMA_SPEAKER_LFE 0x08
|
||||
#define XMA_SPEAKER_LEFT_SURROUND 0x10
|
||||
#define XMA_SPEAKER_RIGHT_SURROUND 0x20
|
||||
#define XMA_SPEAKER_LEFT_BACK 0x40
|
||||
#define XMA_SPEAKER_RIGHT_BACK 0x80
|
||||
#endif
|
||||
|
||||
|
||||
// Used in XMAWAVEFORMAT for per-stream data
|
||||
typedef struct XMASTREAMFORMAT
|
||||
{
|
||||
DWORD PsuedoBytesPerSec; // Used by the XMA encoder (typo preserved for legacy reasons)
|
||||
DWORD SampleRate; // The stream's decoded sample rate (in XMA2 files,
|
||||
// this is the same for all streams in the file).
|
||||
DWORD LoopStart; // Bit offset of the frame containing the loop start
|
||||
// point, relative to the beginning of the stream.
|
||||
DWORD LoopEnd; // Bit offset of the frame containing the loop end.
|
||||
BYTE SubframeData; // Two 4-bit numbers specifying the exact location of
|
||||
// the loop points within the frames that contain them.
|
||||
// SubframeEnd: Subframe of the loop end frame where
|
||||
// the loop ends. Ranges from 0 to 3.
|
||||
// SubframeSkip: Subframes to skip in the start frame to
|
||||
// reach the loop. Ranges from 0 to 4.
|
||||
BYTE Channels; // Number of channels in the stream (1 or 2)
|
||||
WORD ChannelMask; // Spatial positions of the channels in the stream
|
||||
} XMASTREAMFORMAT;
|
||||
|
||||
// Legacy XMA1 format structure
|
||||
typedef struct XMAWAVEFORMAT
|
||||
{
|
||||
WORD FormatTag; // Audio format type (always WAVE_FORMAT_XMA)
|
||||
WORD BitsPerSample; // Bit depth (currently required to be 16)
|
||||
WORD EncodeOptions; // Options for XMA encoder/decoder
|
||||
WORD LargestSkip; // Largest skip used in interleaving streams
|
||||
WORD NumStreams; // Number of interleaved audio streams
|
||||
BYTE LoopCount; // Number of loop repetitions; 255 = infinite
|
||||
BYTE Version; // XMA encoder version that generated the file.
|
||||
// Always 3 or higher for XMA2 files.
|
||||
XMASTREAMFORMAT XmaStreams[1]; // Per-stream format information; the actual
|
||||
// array length is in the NumStreams field.
|
||||
} XMAWAVEFORMAT;
|
||||
|
||||
|
||||
// Used in XMA2WAVEFORMAT for per-stream data
|
||||
typedef struct XMA2STREAMFORMAT
|
||||
{
|
||||
BYTE Channels; // Number of channels in the stream (1 or 2)
|
||||
BYTE RESERVED; // Reserved for future use
|
||||
WORD ChannelMask; // Spatial positions of the channels in the stream
|
||||
} XMA2STREAMFORMAT;
|
||||
|
||||
// Legacy XMA2 format structure (big-endian byte ordering)
|
||||
typedef struct XMA2WAVEFORMAT
|
||||
{
|
||||
BYTE Version; // XMA encoder version that generated the file.
|
||||
// Always 3 or higher for XMA2 files.
|
||||
BYTE NumStreams; // Number of interleaved audio streams
|
||||
BYTE RESERVED; // Reserved for future use
|
||||
BYTE LoopCount; // Number of loop repetitions; 255 = infinite
|
||||
DWORD LoopBegin; // Loop begin point, in samples
|
||||
DWORD LoopEnd; // Loop end point, in samples
|
||||
DWORD SampleRate; // The file's decoded sample rate
|
||||
DWORD EncodeOptions; // Options for the XMA encoder/decoder
|
||||
DWORD PsuedoBytesPerSec; // Used internally by the XMA encoder
|
||||
DWORD BlockSizeInBytes; // Size in bytes of this file's XMA blocks (except
|
||||
// possibly the last one). Always a multiple of
|
||||
// 2Kb, since XMA blocks are arrays of 2Kb packets.
|
||||
DWORD SamplesEncoded; // Total number of PCM samples encoded in this file
|
||||
DWORD SamplesInSource; // Actual number of PCM samples in the source
|
||||
// material used to generate this file
|
||||
DWORD BlockCount; // Number of XMA blocks in this file (and hence
|
||||
// also the number of entries in its seek table)
|
||||
XMA2STREAMFORMAT Streams[1]; // Per-stream format information; the actual
|
||||
// array length is in the NumStreams field.
|
||||
} XMA2WAVEFORMAT;
|
||||
|
||||
#endif // #ifndef WAVE_FORMAT_XMA
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* XMA packet structure (in big-endian form)
|
||||
***************************************************************************/
|
||||
|
||||
typedef struct XMA2PACKET
|
||||
{
|
||||
int FrameCount : 6; // Number of XMA frames that begin in this packet
|
||||
int FrameOffsetInBits : 15; // Bit of XmaData where the first complete frame begins
|
||||
int PacketMetaData : 3; // Metadata stored in the packet (always 1 for XMA2)
|
||||
int PacketSkipCount : 8; // How many packets belonging to other streams must be
|
||||
// skipped to find the next packet belonging to this one
|
||||
BYTE XmaData[XMA_BYTES_PER_PACKET - sizeof(DWORD)]; // XMA encoded data
|
||||
} XMA2PACKET;
|
||||
|
||||
// E.g. if the first DWORD of a packet is 0x30107902:
|
||||
//
|
||||
// 001100 000001000001111 001 00000010
|
||||
// | | | |____ Skip 2 packets to find the next one for this stream
|
||||
// | | |___________ XMA2 signature (always 001)
|
||||
// | |_____________________ First frame starts 527 bits into packet
|
||||
// |________________________________ Packet contains 12 frames
|
||||
|
||||
|
||||
// Helper functions to extract the fields above from an XMA packet. (Note that
|
||||
// the bitfields cannot be read directly on little-endian architectures such as
|
||||
// the Intel x86, as they are laid out in big-endian form.)
|
||||
|
||||
__inline DWORD GetXmaPacketFrameCount(__in_bcount(1) const BYTE* pPacket)
|
||||
{
|
||||
return (DWORD)(pPacket[0] >> 2);
|
||||
}
|
||||
|
||||
__inline DWORD GetXmaPacketFirstFrameOffsetInBits(__in_bcount(3) const BYTE* pPacket)
|
||||
{
|
||||
return ((DWORD)(pPacket[0] & 0x3) << 13) |
|
||||
((DWORD)(pPacket[1]) << 5) |
|
||||
((DWORD)(pPacket[2]) >> 3);
|
||||
}
|
||||
|
||||
__inline DWORD GetXmaPacketMetadata(__in_bcount(3) const BYTE* pPacket)
|
||||
{
|
||||
return (DWORD)(pPacket[2] & 0x7);
|
||||
}
|
||||
|
||||
__inline DWORD GetXmaPacketSkipCount(__in_bcount(4) const BYTE* pPacket)
|
||||
{
|
||||
return (DWORD)(pPacket[3]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* XMA frame structure
|
||||
***************************************************************************/
|
||||
|
||||
// There is no way to represent the XMA frame as a C struct, since it is a
|
||||
// variable-sized string of bits that need not be stored at a byte-aligned
|
||||
// position in memory. This is the layout:
|
||||
//
|
||||
// XMAFRAME
|
||||
// {
|
||||
// LengthInBits: A 15-bit number representing the length of this frame.
|
||||
// XmaData: Encoded XMA data; its size in bits is (LengthInBits - 15).
|
||||
// }
|
||||
|
||||
// Size in bits of the frame's initial LengthInBits field
|
||||
#define XMA_BITS_IN_FRAME_LENGTH_FIELD 15
|
||||
|
||||
// Special LengthInBits value that marks an invalid final frame
|
||||
#define XMA_FINAL_FRAME_MARKER 0x7FFF
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* XMA helper functions
|
||||
***************************************************************************/
|
||||
|
||||
// We define a local ASSERT macro to equal the global one if it exists.
|
||||
// You can define XMA2DEFS_ASSERT in advance to override this default.
|
||||
#ifndef XMA2DEFS_ASSERT
|
||||
#ifdef ASSERT
|
||||
#define XMA2DEFS_ASSERT ASSERT
|
||||
#else
|
||||
#define XMA2DEFS_ASSERT(a) /* No-op by default */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// GetXmaBlockContainingSample: Use a given seek table to find the XMA block
|
||||
// containing a given decoded sample. Note that the seek table entries in an
|
||||
// XMA file are stored in big-endian form and may need to be converted prior
|
||||
// to calling this function.
|
||||
|
||||
__inline HRESULT GetXmaBlockContainingSample
|
||||
(
|
||||
DWORD nBlockCount, // Blocks in the file (= seek table entries)
|
||||
__in_ecount(nBlockCount) const DWORD* pSeekTable, // Pointer to the seek table data
|
||||
DWORD nDesiredSample, // Decoded sample to locate
|
||||
__out DWORD* pnBlockContainingSample, // Index of the block containing the sample
|
||||
__out DWORD* pnSampleOffsetWithinBlock // Position of the sample in this block
|
||||
)
|
||||
{
|
||||
DWORD nPreviousTotalSamples = 0;
|
||||
DWORD nBlock;
|
||||
DWORD nTotalSamplesSoFar;
|
||||
|
||||
XMA2DEFS_ASSERT(pSeekTable);
|
||||
XMA2DEFS_ASSERT(pnBlockContainingSample);
|
||||
XMA2DEFS_ASSERT(pnSampleOffsetWithinBlock);
|
||||
|
||||
for (nBlock = 0; nBlock < nBlockCount; ++nBlock)
|
||||
{
|
||||
nTotalSamplesSoFar = pSeekTable[nBlock];
|
||||
if (nTotalSamplesSoFar > nDesiredSample)
|
||||
{
|
||||
*pnBlockContainingSample = nBlock;
|
||||
*pnSampleOffsetWithinBlock = nDesiredSample - nPreviousTotalSamples;
|
||||
return S_OK;
|
||||
}
|
||||
nPreviousTotalSamples = nTotalSamplesSoFar;
|
||||
}
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
// GetXmaFrameLengthInBits: Reads a given frame's LengthInBits field.
|
||||
|
||||
__inline DWORD GetXmaFrameLengthInBits
|
||||
(
|
||||
__in_bcount(nBitPosition / 8 + 3)
|
||||
__in const BYTE* pPacket, // Pointer to XMA packet[s] containing the frame
|
||||
DWORD nBitPosition // Bit offset of the frame within this packet
|
||||
)
|
||||
{
|
||||
DWORD nRegion;
|
||||
DWORD nBytePosition = nBitPosition / 8;
|
||||
DWORD nBitOffset = nBitPosition % 8;
|
||||
|
||||
if (nBitOffset < 2) // Only need to read 2 bytes (and might not be safe to read more)
|
||||
{
|
||||
nRegion = (DWORD)(pPacket[nBytePosition+0]) << 8 |
|
||||
(DWORD)(pPacket[nBytePosition+1]);
|
||||
return (nRegion >> (1 - nBitOffset)) & 0x7FFF; // Last 15 bits
|
||||
}
|
||||
else // Need to read 3 bytes
|
||||
{
|
||||
nRegion = (DWORD)(pPacket[nBytePosition+0]) << 16 |
|
||||
(DWORD)(pPacket[nBytePosition+1]) << 8 |
|
||||
(DWORD)(pPacket[nBytePosition+2]);
|
||||
return (nRegion >> (9 - nBitOffset)) & 0x7FFF; // Last 15 bits
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// GetXmaFrameBitPosition: Calculates the bit offset of a given frame within
|
||||
// an XMA block or set of blocks. Returns 0 on failure.
|
||||
|
||||
__inline DWORD GetXmaFrameBitPosition
|
||||
(
|
||||
__in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s]
|
||||
DWORD nXmaDataBytes, // Size of pXmaData in bytes
|
||||
DWORD nStreamIndex, // Stream within which to seek
|
||||
DWORD nDesiredFrame // Frame sought
|
||||
)
|
||||
{
|
||||
const BYTE* pCurrentPacket;
|
||||
DWORD nPacketsExamined = 0;
|
||||
DWORD nFrameCountSoFar = 0;
|
||||
DWORD nFramesToSkip;
|
||||
DWORD nFrameBitOffset;
|
||||
|
||||
XMA2DEFS_ASSERT(pXmaData);
|
||||
XMA2DEFS_ASSERT(nXmaDataBytes % XMA_BYTES_PER_PACKET == 0);
|
||||
|
||||
// Get the first XMA packet belonging to the desired stream, relying on the
|
||||
// fact that the first packets for each stream are in consecutive order at
|
||||
// the beginning of an XMA block.
|
||||
|
||||
pCurrentPacket = pXmaData + nStreamIndex * XMA_BYTES_PER_PACKET;
|
||||
for (;;)
|
||||
{
|
||||
// If we have exceeded the size of the XMA data, return failure
|
||||
if (pCurrentPacket + XMA_BYTES_PER_PACKET > pXmaData + nXmaDataBytes)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// If the current packet contains the frame we are looking for...
|
||||
if (nFrameCountSoFar + GetXmaPacketFrameCount(pCurrentPacket) > nDesiredFrame)
|
||||
{
|
||||
// See how many frames in this packet we need to skip to get to it
|
||||
XMA2DEFS_ASSERT(nDesiredFrame >= nFrameCountSoFar);
|
||||
nFramesToSkip = nDesiredFrame - nFrameCountSoFar;
|
||||
|
||||
// Get the bit offset of the first frame in this packet
|
||||
nFrameBitOffset = XMA_PACKET_HEADER_BITS + GetXmaPacketFirstFrameOffsetInBits(pCurrentPacket);
|
||||
|
||||
// Advance nFrameBitOffset to the frame of interest
|
||||
while (nFramesToSkip--)
|
||||
{
|
||||
nFrameBitOffset += GetXmaFrameLengthInBits(pCurrentPacket, nFrameBitOffset);
|
||||
}
|
||||
|
||||
// The bit offset to return is the number of bits from pXmaData to
|
||||
// pCurrentPacket plus the bit offset of the frame of interest
|
||||
return (DWORD)(pCurrentPacket - pXmaData) * 8 + nFrameBitOffset;
|
||||
}
|
||||
|
||||
// If we haven't found the right packet yet, advance our counters
|
||||
++nPacketsExamined;
|
||||
nFrameCountSoFar += GetXmaPacketFrameCount(pCurrentPacket);
|
||||
|
||||
// And skip to the next packet belonging to the same stream
|
||||
pCurrentPacket += XMA_BYTES_PER_PACKET * (GetXmaPacketSkipCount(pCurrentPacket) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// GetLastXmaFrameBitPosition: Calculates the bit offset of the last complete
|
||||
// frame in an XMA block or set of blocks.
|
||||
|
||||
__inline DWORD GetLastXmaFrameBitPosition
|
||||
(
|
||||
__in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s]
|
||||
DWORD nXmaDataBytes, // Size of pXmaData in bytes
|
||||
DWORD nStreamIndex // Stream within which to seek
|
||||
)
|
||||
{
|
||||
const BYTE* pLastPacket;
|
||||
DWORD nBytesToNextPacket;
|
||||
DWORD nFrameBitOffset;
|
||||
DWORD nFramesInLastPacket;
|
||||
|
||||
XMA2DEFS_ASSERT(pXmaData);
|
||||
XMA2DEFS_ASSERT(nXmaDataBytes % XMA_BYTES_PER_PACKET == 0);
|
||||
XMA2DEFS_ASSERT(nXmaDataBytes >= XMA_BYTES_PER_PACKET * (nStreamIndex + 1));
|
||||
|
||||
// Get the first XMA packet belonging to the desired stream, relying on the
|
||||
// fact that the first packets for each stream are in consecutive order at
|
||||
// the beginning of an XMA block.
|
||||
pLastPacket = pXmaData + nStreamIndex * XMA_BYTES_PER_PACKET;
|
||||
|
||||
// Search for the last packet belonging to the desired stream
|
||||
for (;;)
|
||||
{
|
||||
nBytesToNextPacket = XMA_BYTES_PER_PACKET * (GetXmaPacketSkipCount(pLastPacket) + 1);
|
||||
XMA2DEFS_ASSERT(nBytesToNextPacket);
|
||||
if (pLastPacket + nBytesToNextPacket + XMA_BYTES_PER_PACKET > pXmaData + nXmaDataBytes)
|
||||
{
|
||||
break; // The next packet would extend beyond the end of pXmaData
|
||||
}
|
||||
pLastPacket += nBytesToNextPacket;
|
||||
}
|
||||
|
||||
// The last packet can sometimes have no seekable frames, in which case we
|
||||
// have to use the previous one
|
||||
if (GetXmaPacketFrameCount(pLastPacket) == 0)
|
||||
{
|
||||
pLastPacket -= nBytesToNextPacket;
|
||||
}
|
||||
|
||||
// Found the last packet. Get the bit offset of its first frame.
|
||||
nFrameBitOffset = XMA_PACKET_HEADER_BITS + GetXmaPacketFirstFrameOffsetInBits(pLastPacket);
|
||||
|
||||
// Traverse frames until we reach the last one
|
||||
nFramesInLastPacket = GetXmaPacketFrameCount(pLastPacket);
|
||||
while (--nFramesInLastPacket)
|
||||
{
|
||||
nFrameBitOffset += GetXmaFrameLengthInBits(pLastPacket, nFrameBitOffset);
|
||||
}
|
||||
|
||||
// The bit offset to return is the number of bits from pXmaData to
|
||||
// pLastPacket plus the offset of the last frame in this packet.
|
||||
return (DWORD)(pLastPacket - pXmaData) * 8 + nFrameBitOffset;
|
||||
}
|
||||
|
||||
|
||||
// GetXmaDecodePositionForSample: Obtains the information needed to make the
|
||||
// decoder generate audio starting at a given sample position relative to the
|
||||
// beginning of the given XMA block: the bit offset of the appropriate frame,
|
||||
// and the right subframe within that frame. This data can be passed directly
|
||||
// to the XMAPlaybackSetDecodePosition function.
|
||||
|
||||
__inline HRESULT GetXmaDecodePositionForSample
|
||||
(
|
||||
__in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s]
|
||||
DWORD nXmaDataBytes, // Size of pXmaData in bytes
|
||||
DWORD nStreamIndex, // Stream within which to seek
|
||||
DWORD nDesiredSample, // Sample sought
|
||||
__out DWORD* pnBitOffset, // Returns the bit offset within pXmaData of
|
||||
// the frame containing the sample sought
|
||||
__out DWORD* pnSubFrame // Returns the subframe containing the sample
|
||||
)
|
||||
{
|
||||
DWORD nDesiredFrame = nDesiredSample / XMA_SAMPLES_PER_FRAME;
|
||||
DWORD nSubFrame = (nDesiredSample % XMA_SAMPLES_PER_FRAME) / XMA_SAMPLES_PER_SUBFRAME;
|
||||
DWORD nBitOffset = GetXmaFrameBitPosition(pXmaData, nXmaDataBytes, nStreamIndex, nDesiredFrame);
|
||||
|
||||
XMA2DEFS_ASSERT(pnBitOffset);
|
||||
XMA2DEFS_ASSERT(pnSubFrame);
|
||||
|
||||
if (nBitOffset)
|
||||
{
|
||||
*pnBitOffset = nBitOffset;
|
||||
*pnSubFrame = nSubFrame;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// GetXmaSampleRate: Obtains the legal XMA sample rate (24, 32, 44.1 or 48Khz)
|
||||
// corresponding to a generic sample rate.
|
||||
|
||||
__inline DWORD GetXmaSampleRate(DWORD dwGeneralRate)
|
||||
{
|
||||
DWORD dwXmaRate = 48000; // Default XMA rate for all rates above 44100Hz
|
||||
|
||||
if (dwGeneralRate <= 24000) dwXmaRate = 24000;
|
||||
else if (dwGeneralRate <= 32000) dwXmaRate = 32000;
|
||||
else if (dwGeneralRate <= 44100) dwXmaRate = 44100;
|
||||
|
||||
return dwXmaRate;
|
||||
}
|
||||
|
||||
|
||||
// Functions to convert between WAVEFORMATEXTENSIBLE channel masks (combinations
|
||||
// of the SPEAKER_xxx flags defined in audiodefs.h) and XMA channel masks (which
|
||||
// are limited to eight possible speaker positions: left, right, center, low
|
||||
// frequency, side left, side right, back left and back right).
|
||||
|
||||
__inline DWORD GetStandardChannelMaskFromXmaMask(BYTE bXmaMask)
|
||||
{
|
||||
DWORD dwStandardMask = 0;
|
||||
|
||||
if (bXmaMask & XMA_SPEAKER_LEFT) dwStandardMask |= SPEAKER_FRONT_LEFT;
|
||||
if (bXmaMask & XMA_SPEAKER_RIGHT) dwStandardMask |= SPEAKER_FRONT_RIGHT;
|
||||
if (bXmaMask & XMA_SPEAKER_CENTER) dwStandardMask |= SPEAKER_FRONT_CENTER;
|
||||
if (bXmaMask & XMA_SPEAKER_LFE) dwStandardMask |= SPEAKER_LOW_FREQUENCY;
|
||||
if (bXmaMask & XMA_SPEAKER_LEFT_SURROUND) dwStandardMask |= SPEAKER_SIDE_LEFT;
|
||||
if (bXmaMask & XMA_SPEAKER_RIGHT_SURROUND) dwStandardMask |= SPEAKER_SIDE_RIGHT;
|
||||
if (bXmaMask & XMA_SPEAKER_LEFT_BACK) dwStandardMask |= SPEAKER_BACK_LEFT;
|
||||
if (bXmaMask & XMA_SPEAKER_RIGHT_BACK) dwStandardMask |= SPEAKER_BACK_RIGHT;
|
||||
|
||||
return dwStandardMask;
|
||||
}
|
||||
|
||||
__inline BYTE GetXmaChannelMaskFromStandardMask(DWORD dwStandardMask)
|
||||
{
|
||||
BYTE bXmaMask = 0;
|
||||
|
||||
if (dwStandardMask & SPEAKER_FRONT_LEFT) bXmaMask |= XMA_SPEAKER_LEFT;
|
||||
if (dwStandardMask & SPEAKER_FRONT_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT;
|
||||
if (dwStandardMask & SPEAKER_FRONT_CENTER) bXmaMask |= XMA_SPEAKER_CENTER;
|
||||
if (dwStandardMask & SPEAKER_LOW_FREQUENCY) bXmaMask |= XMA_SPEAKER_LFE;
|
||||
if (dwStandardMask & SPEAKER_SIDE_LEFT) bXmaMask |= XMA_SPEAKER_LEFT_SURROUND;
|
||||
if (dwStandardMask & SPEAKER_SIDE_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT_SURROUND;
|
||||
if (dwStandardMask & SPEAKER_BACK_LEFT) bXmaMask |= XMA_SPEAKER_LEFT_BACK;
|
||||
if (dwStandardMask & SPEAKER_BACK_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT_BACK;
|
||||
|
||||
return bXmaMask;
|
||||
}
|
||||
|
||||
|
||||
// LocalizeXma2Format: Modifies a XMA2WAVEFORMATEX structure in place to comply
|
||||
// with the current platform's byte-ordering rules (little- or big-endian).
|
||||
|
||||
__inline HRESULT LocalizeXma2Format(__inout XMA2WAVEFORMATEX* pXma2Format)
|
||||
{
|
||||
#define XMASWAP2BYTES(n) ((WORD)(((n) >> 8) | (((n) & 0xff) << 8)))
|
||||
#define XMASWAP4BYTES(n) ((DWORD)((n) >> 24 | (n) << 24 | ((n) & 0xff00) << 8 | ((n) & 0xff0000) >> 8))
|
||||
|
||||
if (pXma2Format->wfx.wFormatTag == WAVE_FORMAT_XMA2)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
else if (XMASWAP2BYTES(pXma2Format->wfx.wFormatTag) == WAVE_FORMAT_XMA2)
|
||||
{
|
||||
pXma2Format->wfx.wFormatTag = XMASWAP2BYTES(pXma2Format->wfx.wFormatTag);
|
||||
pXma2Format->wfx.nChannels = XMASWAP2BYTES(pXma2Format->wfx.nChannels);
|
||||
pXma2Format->wfx.nSamplesPerSec = XMASWAP4BYTES(pXma2Format->wfx.nSamplesPerSec);
|
||||
pXma2Format->wfx.nAvgBytesPerSec = XMASWAP4BYTES(pXma2Format->wfx.nAvgBytesPerSec);
|
||||
pXma2Format->wfx.nBlockAlign = XMASWAP2BYTES(pXma2Format->wfx.nBlockAlign);
|
||||
pXma2Format->wfx.wBitsPerSample = XMASWAP2BYTES(pXma2Format->wfx.wBitsPerSample);
|
||||
pXma2Format->wfx.cbSize = XMASWAP2BYTES(pXma2Format->wfx.cbSize);
|
||||
pXma2Format->NumStreams = XMASWAP2BYTES(pXma2Format->NumStreams);
|
||||
pXma2Format->ChannelMask = XMASWAP4BYTES(pXma2Format->ChannelMask);
|
||||
pXma2Format->SamplesEncoded = XMASWAP4BYTES(pXma2Format->SamplesEncoded);
|
||||
pXma2Format->BytesPerBlock = XMASWAP4BYTES(pXma2Format->BytesPerBlock);
|
||||
pXma2Format->PlayBegin = XMASWAP4BYTES(pXma2Format->PlayBegin);
|
||||
pXma2Format->PlayLength = XMASWAP4BYTES(pXma2Format->PlayLength);
|
||||
pXma2Format->LoopBegin = XMASWAP4BYTES(pXma2Format->LoopBegin);
|
||||
pXma2Format->LoopLength = XMASWAP4BYTES(pXma2Format->LoopLength);
|
||||
pXma2Format->BlockCount = XMASWAP2BYTES(pXma2Format->BlockCount);
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return E_FAIL; // Not a recognizable XMA2 format
|
||||
}
|
||||
|
||||
#undef XMASWAP2BYTES
|
||||
#undef XMASWAP4BYTES
|
||||
}
|
||||
|
||||
|
||||
#endif // #ifndef __XMA2DEFS_INCLUDED__
|
2938
SDK/Include/xnamath.h
Normal file
2938
SDK/Include/xnamath.h
Normal file
File diff suppressed because it is too large
Load Diff
5785
SDK/Include/xnamathconvert.inl
Normal file
5785
SDK/Include/xnamathconvert.inl
Normal file
File diff suppressed because it is too large
Load Diff
3254
SDK/Include/xnamathmatrix.inl
Normal file
3254
SDK/Include/xnamathmatrix.inl
Normal file
File diff suppressed because it is too large
Load Diff
2464
SDK/Include/xnamathmisc.inl
Normal file
2464
SDK/Include/xnamathmisc.inl
Normal file
File diff suppressed because it is too large
Load Diff
13279
SDK/Include/xnamathvector.inl
Normal file
13279
SDK/Include/xnamathvector.inl
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user