feat(gx): refresh CGxDevice studies

This commit is contained in:
phaneron 2025-04-29 16:26:36 -04:00
parent abcd88b4c1
commit 6a6d154b0a
63 changed files with 2685 additions and 549 deletions

View file

@ -2,20 +2,11 @@
#define D3D9_CAPS_H
#include "system/types.h"
#include "external/d3d9/devtype.h"
typedef enum D3DDEVTYPE D3DDEVTYPE;
typedef struct D3DVSHADERCAPS2_0 D3DVSHADERCAPS2_0;
typedef struct D3DPSHADERCAPS2_0 D3DPSHADERCAPS2_0;
typedef struct D3DCAPS9 D3DCAPS9;
enum D3DDEVTYPE {
D3DDEVTYPE_HAL = 1,
D3DDEVTYPE_REF = 2,
D3DDEVTYPE_SW = 3,
D3DDEVTYPE_NULLREF = 4,
D3DDEVTYPE_FORCE_uint32_t = 0xffffffff
};
DECLARE_STRUCT(D3DVSHADERCAPS2_0);
DECLARE_STRUCT(D3DPSHADERCAPS2_0);
DECLARE_STRUCT(D3DCAPS9);
struct D3DVSHADERCAPS2_0 {
uint32_t Caps;

View file

@ -0,0 +1,13 @@
#ifndef D3D9_COLORVALUE_H
#define D3D9_COLORVALUE_H
DECLARE_STRUCT(D3DCOLORVALUE);
struct D3DCOLORVALUE {
float r;
float g;
float b;
float a;
};
#endif

View file

@ -0,0 +1,17 @@
#ifndef D3D9_CUBEMAPFACES_H
#define D3D9_CUBEMAPFACES_H
DECLARE_ENUM(D3DCUBEMAP_FACES);
enum D3DCUBEMAP_FACES {
D3DCUBEMAP_FACE_POSITIVE_X = 0,
D3DCUBEMAP_FACE_NEGATIVE_X = 1,
D3DCUBEMAP_FACE_POSITIVE_Y = 2,
D3DCUBEMAP_FACE_NEGATIVE_Y = 3,
D3DCUBEMAP_FACE_POSITIVE_Z = 4,
D3DCUBEMAP_FACE_NEGATIVE_Z = 5,
D3DCUBEMAP_FACE_FORCE_DWORD = 0xffffffff
};
#endif

View file

@ -0,0 +1,42 @@
#ifndef D3D9_CUBETEXTURE_H
#define D3D9_CUBETEXTURE_H
DECLARE_STRUCT(IDirect3DCubeTexture9__v_table);
DECLARE_STRUCT(IDirect3DCubeTexture9);
struct IDirect3DCubeTexture9__v_table {
/*** IUnknown methods ***/
void* v_fn_0_QueryInterface;
void* v_fn_1_AddRef;
void* v_fn_2_Release;
/*** IDirect3DResource9 methods ***/
void* v_fn_3_GetDevice;
void* v_fn_4_SetPrivateData;
void* v_fn_5_GetPrivateData;
void* v_fn_6_FreePrivateData;
void* v_fn_7_SetPriority;
void* v_fn_8_GetPriority;
void* v_fn_9_PreLoad;
void* v_fn_10_GetType;
/*** IDirect3DBaseTexture9 methods ***/
void* v_fn_11_SetLOD;
void* v_fn_12_GetLOD;
void* v_fn_13_GetLevelCount;
void* v_fn_14_SetAutoGenFilterType;
void* v_fn_15_GetAutoGenFilterType;
void* v_fn_16_GenerateMipSubLevels;
/*** IDirect3DCubeTexture9 methods ***/
void* v_fn_17_GetLevelDesc;
void* v_fn_18_GetCubeMapSurface;
void* v_fn_19_LockRect;
void* v_fn_20_UnlockRect;
void* v_fn_21_AddDirtyRect;
};
struct IDirect3DCubeTexture9 {
IDirect3DCubeTexture9__v_table* v_table;
};
typedef IDirect3DCubeTexture9* LPDIRECT3DCUBETEXTURE9;
#endif

View file

@ -0,0 +1,30 @@
#include "external/d3d9/caps.h"
#include "external/d3d9/colorvalue.h"
#include "external/d3d9/cubemapfaces.h"
#include "external/d3d9/cubetexture.h"
#include "external/d3d9/declusage.h"
#include "external/d3d9/device.h"
#include "external/d3d9/devtype.h"
#include "external/d3d9/direct3d.h"
#include "external/d3d9/displaymode.h"
#include "external/d3d9/format.h"
#include "external/d3d9/indexbuffer.h"
#include "external/d3d9/light.h"
#include "external/d3d9/lighttype.h"
#include "external/d3d9/lockedrect.h"
#include "external/d3d9/pixelshader.h"
#include "external/d3d9/pool.h"
#include "external/d3d9/presentparameters.h"
#include "external/d3d9/primitivetype.h"
#include "external/d3d9/query.h"
#include "external/d3d9/renderstatetype.h"
#include "external/d3d9/resourcetype.h"
#include "external/d3d9/surface.h"
#include "external/d3d9/surfacedesc.h"
#include "external/d3d9/swapeffect.h"
#include "external/d3d9/texture.h"
#include "external/d3d9/vector.h"
#include "external/d3d9/vertexbuffer.h"
#include "external/d3d9/vertexdeclaration.h"
#include "external/d3d9/vertexelement.h"
#include "external/d3d9/vertexshader.h"

View file

@ -0,0 +1,23 @@
#ifndef D3D9_DECLUSAGE_H
#define D3D9_DECLUSAGE_H
DECLARE_ENUM(D3DDECLUSAGE);
enum D3DDECLUSAGE {
D3DDECLUSAGE_POSITION = 0,
D3DDECLUSAGE_BLENDWEIGHT = 1,
D3DDECLUSAGE_BLENDINDICES = 2,
D3DDECLUSAGE_NORMAL = 3,
D3DDECLUSAGE_PSIZE = 4,
D3DDECLUSAGE_TEXCOORD = 5,
D3DDECLUSAGE_TANGENT = 6,
D3DDECLUSAGE_BINORMAL = 7,
D3DDECLUSAGE_TESSFACTOR = 8,
D3DDECLUSAGE_POSITIONT = 9,
D3DDECLUSAGE_COLOR = 10,
D3DDECLUSAGE_FOG = 11,
D3DDECLUSAGE_DEPTH = 12,
D3DDECLUSAGE_SAMPLE = 13
};
#endif

View file

@ -3,60 +3,11 @@
#include "system/types.h"
#include "external/d3d9/caps.h"
typedef int32_t D3DFORMAT;
DECLARE_STRUCT(D3DDISPLAYMODE);
DECLARE_STRUCT(IDirect3D9_v_table);
DECLARE_STRUCT(IDirect3D9);
DECLARE_STRUCT(IDirect3DDevice9__v_table);
DECLARE_STRUCT(IDirect3DDevice9);
DECLARE_STRUCT(IDirect3DDevice9_v_table);
DECLARE_STRUCT(IDirect3DVertexDeclaration9);
DECLARE_STRUCT(IDirect3DSurface9__v_table);
DECLARE_STRUCT(IDirect3DSurface9);
DECLARE_STRUCT(IDirect3DIndexBuffer9);
DECLARE_STRUCT(IDirect3DVertexBuffer9);
DECLARE_STRUCT(IDirect3DTexture9);
DECLARE_STRUCT(IDirect3DVertexShader9__v_table);
DECLARE_STRUCT(IDirect3DVertexShader9);
DECLARE_STRUCT(IDirect3DPixelShader9__v_table);
DECLARE_STRUCT(IDirect3DPixelShader9);
DECLARE_STRUCT(D3DLOCKED_RECT);
struct D3DDISPLAYMODE {
uint32_t Width;
uint32_t Height;
uint32_t RefreshRate;
D3DFORMAT Format;
};
struct IDirect3D9_v_table {
void* v_fn_1_QueryInterface;
void* v_fn_2_AddRef;
void* v_fn_3_Release;
void* v_fn_4_RegisterSoftwareDevice;
void* v_fn_5_GetAdapterCount;
void* v_fn_6_GetAdapterIdentifier;
void* v_fn_7_GetAdapterModeCount;
void* v_fn_8_EnumAdapterModes;
void* v_fn_9_GetAdapterDisplayMode;
void* v_fn_10_CheckDeviceType;
void* v_fn_11_CheckDeviceFormat;
void* v_fn_12_CheckDeviceMultiSampleType;
void* v_fn_13_CheckDepthStencilMatch;
void* v_fn_14_CheckDeviceFormatConversion;
void* v_fn_15_GetDeviceCaps;
void* v_fn_16_GetAdapterMonitor;
void* v_fn_17_CreateDevice;
};
struct IDirect3D9 {
IDirect3D9_v_table* v_table;
};
struct IDirect3DDevice9_v_table {
struct IDirect3DDevice9__v_table {
/*** IUnknown methods ***/
void* v_fn_0_QueryInterface;
void* v_fn_1_AddRef;
void* v_fn_2_Release;
@ -180,79 +131,9 @@ struct IDirect3DDevice9_v_table {
};
struct IDirect3DDevice9 {
IDirect3DDevice9_v_table* v_table;
IDirect3DDevice9__v_table* v_table;
};
struct IDirect3DVertexDeclaration9 {
void** v_table;
};
struct IDirect3DSurface9__v_table {
/*** IUnknown methods ***/
void* v_fn_0_QueryInterface;
void* v_fn_1_AddRef;
void* v_fn_2_Release;
/*** IDirect3DResource9 methods ***/
void* v_fn_3_GetDevice;
void* v_fn_4_SetPrivateData;
void* v_fn_5_GetPrivateData;
void* v_fn_6_FreePrivateData;
void* v_fn_7_SetPriority;
void* v_fn_8_GetPriority;
void* v_fn_9_PreLoad;
void* v_fn_10_GetType;
/*** IDirect3DSurface9 methods ***/
void* v_fn_11_GetContainer;
void* v_fn_12_GetDesc;
void* v_fn_13_LockRect;
void* v_fn_14_UnlockRect;
void* v_fn_15_GetDC;
void* v_fn_16_ReleaseDC;
};
struct IDirect3DSurface9 {
IDirect3DSurface9__v_table* v_table;
};
struct IDirect3DIndexBuffer9 {
void** v_table;
};
struct IDirect3DVertexBuffer9 {
void** v_table;
};
struct IDirect3DTexture9 {
void** v_table;
};
struct D3DLOCKED_RECT {
int32_t Pitch;
void* pBits;
};
struct IDirect3DVertexShader9__v_table {
void* v_fn_0_QueryInterface;
void* v_fn_1_AddRef;
void* v_fn_2_Release;
void* v_fn_3_GetDevice;
void* v_fn_4_GetFunction;
};
struct IDirect3DVertexShader9 {
IDirect3DVertexShader9__v_table* v_table;
};
struct IDirect3DPixelShader9__v_table {
void* v_fn_0_QueryInterface;
void* v_fn_1_AddRef;
void* v_fn_2_Release;
void* v_fn_3_GetDevice;
void* v_fn_4_GetFunction;
};
struct IDirect3DPixelShader9 {
IDirect3DPixelShader9__v_table* v_v_table;
};
typedef IDirect3DDevice9* LPDIRECT3DDEVICE9;
#endif

View file

@ -0,0 +1,14 @@
#ifndef D3D9_DEVTYPE_H
#define D3D9_DEVTYPE_H
DECLARE_ENUM(D3DDEVTYPE);
enum D3DDEVTYPE {
D3DDEVTYPE_HAL = 1,
D3DDEVTYPE_REF = 2,
D3DDEVTYPE_SW = 3,
D3DDEVTYPE_FORCE_DWORD = 0xffffffff
};
#endif

View file

@ -0,0 +1,35 @@
#ifndef D3D9_DIRECT3D_H
#define D3D9_DIRECT3D_H
DECLARE_STRUCT(IDirect3D9__v_table);
DECLARE_STRUCT(IDirect3D9);
struct IDirect3D9__v_table {
/*** IUnknown methods ***/
void* v_fn_1_QueryInterface;
void* v_fn_2_AddRef;
void* v_fn_3_Release;
/*** IDirect3D9 methods ***/
void* v_fn_4_RegisterSoftwareDevice;
void* v_fn_5_GetAdapterCount;
void* v_fn_6_GetAdapterIdentifier;
void* v_fn_7_GetAdapterModeCount;
void* v_fn_8_EnumAdapterModes;
void* v_fn_9_GetAdapterDisplayMode;
void* v_fn_10_CheckDeviceType;
void* v_fn_11_CheckDeviceFormat;
void* v_fn_12_CheckDeviceMultiSampleType;
void* v_fn_13_CheckDepthStencilMatch;
void* v_fn_14_CheckDeviceFormatConversion;
void* v_fn_15_GetDeviceCaps;
void* v_fn_16_GetAdapterMonitor;
void* v_fn_17_CreateDevice;
};
struct IDirect3D9 {
IDirect3D9__v_table* v_table;
};
typedef IDirect3D9* LPDIRECT3D9;
#endif

View file

@ -0,0 +1,15 @@
#ifndef D3D9_DISPLAYMODE_H
#define D3D9_DISPLAYMODE_H
DECLARE_STRUCT(D3DDISPLAYMODE);
#include "external/d3d9/format.h"
struct D3DDISPLAYMODE {
uint32_t Width;
uint32_t Height;
uint32_t RefreshRate;
D3DFORMAT Format;
};
#endif

View file

@ -0,0 +1,94 @@
#ifndef D3D9_FORMAT_H
#define D3D9_FORMAT_H
DECLARE_ENUM(D3DFORMAT);
#ifndef MAKEFOURCC
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
#endif
enum D3DFORMAT {
D3DFMT_UNKNOWN = 0,
D3DFMT_R8G8B8 = 20,
D3DFMT_A8R8G8B8 = 21,
D3DFMT_X8R8G8B8 = 22,
D3DFMT_R5G6B5 = 23,
D3DFMT_X1R5G5B5 = 24,
D3DFMT_A1R5G5B5 = 25,
D3DFMT_A4R4G4B4 = 26,
D3DFMT_R3G3B2 = 27,
D3DFMT_A8 = 28,
D3DFMT_A8R3G3B2 = 29,
D3DFMT_X4R4G4B4 = 30,
D3DFMT_A2B10G10R10 = 31,
D3DFMT_A8B8G8R8 = 32,
D3DFMT_X8B8G8R8 = 33,
D3DFMT_G16R16 = 34,
D3DFMT_A2R10G10B10 = 35,
D3DFMT_A16B16G16R16 = 36,
D3DFMT_A8P8 = 40,
D3DFMT_P8 = 41,
D3DFMT_L8 = 50,
D3DFMT_A8L8 = 51,
D3DFMT_A4L4 = 52,
D3DFMT_V8U8 = 60,
D3DFMT_L6V5U5 = 61,
D3DFMT_X8L8V8U8 = 62,
D3DFMT_Q8W8V8U8 = 63,
D3DFMT_V16U16 = 64,
D3DFMT_A2W10V10U10 = 67,
// D3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'),
// D3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'),
// D3DFMT_DXT1 = MAKEFOURCC('D', 'X', 'T', '1'),
// D3DFMT_DXT2 = MAKEFOURCC('D', 'X', 'T', '2'),
// D3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'),
// D3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'),
// D3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'),
// D3DFMT_MULTI2_ARGB8 = MAKEFOURCC('M', 'E', 'T', '1'),
// D3DFMT_G8R8_G8B8 = MAKEFOURCC('G', 'R', 'G', 'B'),
// D3DFMT_R8G8_B8G8 = MAKEFOURCC('R', 'G', 'B', 'G'),
D3DFMT_D16_LOCKABLE = 70,
D3DFMT_D32 = 71,
D3DFMT_D15S1 = 73,
D3DFMT_D24S8 = 75,
D3DFMT_D24X8 = 77,
D3DFMT_D24X4S4 = 79,
D3DFMT_D16 = 80,
D3DFMT_L16 = 81,
D3DFMT_D32F_LOCKABLE = 82,
D3DFMT_D24FS8 = 83,
D3DFMT_D32_LOCKABLE = 84,
D3DFMT_S8_LOCKABLE = 85,
D3DFMT_VERTEXDATA = 100,
D3DFMT_INDEX16 = 101,
D3DFMT_INDEX32 = 102,
D3DFMT_Q16W16V16U16 = 110,
/* Floating point formats */
D3DFMT_R16F = 111,
D3DFMT_G16R16F = 112,
D3DFMT_A16B16G16R16F = 113,
/* IEEE formats */
D3DFMT_R32F = 114,
D3DFMT_G32R32F = 115,
D3DFMT_A32B32G32R32F = 116,
D3DFMT_CxV8U8 = 117,
D3DFMT_A1 = 118,
D3DFMT_A2B10G10R10_XR_BIAS = 119,
D3DFMT_BINARYBUFFER = 199,
D3DFMT_FORCE_DWORD = 0xFFFFFFFF
};
#endif

View file

@ -0,0 +1,33 @@
#ifndef D3D9_INDEX_BUFFER_H
#define D3D9_INDEX_BUFFER_H
DECLARE_STRUCT(IDirect3DIndexBuffer9__v_table);
DECLARE_STRUCT(IDirect3DIndexBuffer9);
struct IDirect3DIndexBuffer9__v_table {
/*** IUnknown methods ***/
void* v_fn_0_QueryInterface;
void* v_fn_1_AddRef;
void* v_fn_2_Release;
/*** IDirect3DResource9 methods ***/
void* v_fn_3_GetDevice;
void* v_fn_4_SetPrivateData;
void* v_fn_5_GetPrivateData;
void* v_fn_6_FreePrivateData;
void* v_fn_7_SetPriority;
void* v_fn_8_GetPriority;
void* v_fn_9_PreLoad;
void* v_fn_10_GetType;
/*** IDirect3DIndexBuffer9 methods ***/
void* v_fn_11_Lock;
void* v_fn_12_Unlock;
void* v_fn_13_GetDesc;
};
struct IDirect3DIndexBuffer9 {
IDirect3DIndexBuffer9__v_table* v_table;
};
typedef IDirect3DIndexBuffer9* LPDIRECT3DINDEXBUFFER9;
#endif

View file

@ -0,0 +1,26 @@
#ifndef D3D9_LIGHT_H
#define D3D9_LIGHT_H
DECLARE_STRUCT(D3DLIGHT9);
#include "external/d3d9/lighttype.h"
#include "external/d3d9/colorvalue.h"
#include "external/d3d9/vector.h"
struct D3DLIGHT9 {
D3DLIGHTTYPE Type;
D3DCOLORVALUE Diffuse;
D3DCOLORVALUE Specular;
D3DCOLORVALUE Ambient;
D3DVECTOR Position;
D3DVECTOR Direction;
float Range;
float Falloff;
float Attenuation0;
float Attenuation1;
float Attenuation2;
float Theta;
float Phi;
};
#endif

View file

@ -0,0 +1,14 @@
#ifndef D3D9_LIGHTTYPE_H
#define D3D9_LIGHTTYPE_H
DECLARE_ENUM(D3DLIGHTTYPE);
enum D3DLIGHTTYPE {
D3DLIGHT_POINT = 1,
D3DLIGHT_SPOT = 2,
D3DLIGHT_DIRECTIONAL = 3,
D3DLIGHT_FORCE_DWORD = 0x7fffffff
};
#endif

View file

@ -0,0 +1,11 @@
#ifndef D3D9_LOCKEDRECT_H
#define D3D9_LOCKEDRECT_H
DECLARE_STRUCT(D3DLOCKED_RECT);
struct D3DLOCKED_RECT {
int32_t Pitch;
void* pBits;
};
#endif

View file

@ -0,0 +1,28 @@
#ifndef D3D9_MULTISAMPLETYPE_H
#define D3D9_MULTISAMPLETYPE_H
DECLARE_ENUM(D3DMULTISAMPLE_TYPE);
enum D3DMULTISAMPLE_TYPE {
D3DMULTISAMPLE_NONE = 0,
D3DMULTISAMPLE_NONMASKABLE = 1,
D3DMULTISAMPLE_2_SAMPLES = 2,
D3DMULTISAMPLE_3_SAMPLES = 3,
D3DMULTISAMPLE_4_SAMPLES = 4,
D3DMULTISAMPLE_5_SAMPLES = 5,
D3DMULTISAMPLE_6_SAMPLES = 6,
D3DMULTISAMPLE_7_SAMPLES = 7,
D3DMULTISAMPLE_8_SAMPLES = 8,
D3DMULTISAMPLE_9_SAMPLES = 9,
D3DMULTISAMPLE_10_SAMPLES = 10,
D3DMULTISAMPLE_11_SAMPLES = 11,
D3DMULTISAMPLE_12_SAMPLES = 12,
D3DMULTISAMPLE_13_SAMPLES = 13,
D3DMULTISAMPLE_14_SAMPLES = 14,
D3DMULTISAMPLE_15_SAMPLES = 15,
D3DMULTISAMPLE_16_SAMPLES = 16,
D3DMULTISAMPLE_FORCE_DWORD = 0x7fffffff
};
#endif

View file

@ -0,0 +1,19 @@
#ifndef D3D9_PIXELSHADER_H
#define D3D9_PIXELSHADER_H
DECLARE_STRUCT(IDirect3DPixelShader9__v_table);
DECLARE_STRUCT(IDirect3DPixelShader9);
struct IDirect3DPixelShader9__v_table {
void* v_fn_0_QueryInterface;
void* v_fn_1_AddRef;
void* v_fn_2_Release;
void* v_fn_3_GetDevice;
void* v_fn_4_GetFunction;
};
struct IDirect3DPixelShader9 {
IDirect3DPixelShader9__v_table* v_v_table;
};
#endif

View file

@ -0,0 +1,15 @@
#ifndef D3D9_POOL_H
#define D3D9_POOL_H
DECLARE_ENUM(D3DPOOL);
enum D3DPOOL {
D3DPOOL_DEFAULT = 0,
D3DPOOL_MANAGED = 1,
D3DPOOL_SYSTEMMEM = 2,
D3DPOOL_SCRATCH = 3,
D3DPOOL_FORCE_DWORD = 0x7fffffff
};
#endif

View file

@ -0,0 +1,30 @@
#ifndef D3D9_PRESENTPARAMETERS_H
#define D3D9_PRESENTPARAMETERS_H
DECLARE_STRUCT(D3DPRESENT_PARAMETERS);
#include "external/d3d9/format.h"
#include "external/d3d9/multisampletype.h"
#include "external/d3d9/swapeffect.h"
struct D3DPRESENT_PARAMETERS {
uint32_t BackBufferWidth;
uint32_t BackBufferHeight;
D3DFORMAT BackBufferFormat;
uint32_t BackBufferCount;
D3DMULTISAMPLE_TYPE MultiSampleType;
uint32_t MultiSampleQuality;
D3DSWAPEFFECT SwapEffect;
void* hDeviceWindow;
int32_t Windowed;
int32_t EnableAutoDepthStencil;
D3DFORMAT AutoDepthStencilFormat;
uint32_t Flags;
uint32_t FullScreen_RefreshRateInHz;
uint32_t PresentationInterval;
};
#endif

View file

@ -0,0 +1,17 @@
#ifndef D3D9_PRIMITIVETYPE_H
#define D3D9_PRIMITIVETYPE_H
DECLARE_ENUM(D3DPRIMITIVETYPE);
enum D3DPRIMITIVETYPE {
D3DPT_POINTLIST = 1,
D3DPT_LINELIST = 2,
D3DPT_LINESTRIP = 3,
D3DPT_TRIANGLELIST = 4,
D3DPT_TRIANGLESTRIP = 5,
D3DPT_TRIANGLEFAN = 6,
D3DPT_FORCE_DWORD = 0x7fffffff
};
#endif

View file

@ -0,0 +1,24 @@
#ifndef D3D9_QUERY_H
#define D3D9_QUERY_H
DECLARE_STRUCT(IDirect3DQuery9__v_table);
DECLARE_STRUCT(IDirect3DQuery9);
struct IDirect3DQuery9__v_table {
void* v_fn_0_QueryInterface;
void* v_fn_1_AddRef;
void* v_fn_2_Release;
void* v_fn_3_GetDevice;
void* v_fn_4_GetType;
void* v_fn_5_GetDataSize;
void* v_fn_6_Issue;
void* v_fn_7_GetData;
};
struct IDirect3DQuery9 {
IDirect3DQuery9__v_table* v_table;
};
typedef IDirect3DQuery9* LPDIRECT3DQUERY9;
#endif

View file

@ -0,0 +1,114 @@
#ifndef D3D9_RENDERSTATETYPE_H
#define D3D9_RENDERSTATETYPE_H
DECLARE_ENUM(D3DRENDERSTATETYPE);
enum D3DRENDERSTATETYPE {
D3DRS_ZENABLE = 7,
D3DRS_FILLMODE = 8,
D3DRS_SHADEMODE = 9,
D3DRS_ZWRITEENABLE = 14,
D3DRS_ALPHATESTENABLE = 15,
D3DRS_LASTPIXEL = 16,
D3DRS_SRCBLEND = 19,
D3DRS_DESTBLEND = 20,
D3DRS_CULLMODE = 22,
D3DRS_ZFUNC = 23,
D3DRS_ALPHAREF = 24,
D3DRS_ALPHAFUNC = 25,
D3DRS_DITHERENABLE = 26,
D3DRS_ALPHABLENDENABLE = 27,
D3DRS_FOGENABLE = 28,
D3DRS_SPECULARENABLE = 29,
D3DRS_FOGCOLOR = 34,
D3DRS_FOGTABLEMODE = 35,
D3DRS_FOGSTART = 36,
D3DRS_FOGEND = 37,
D3DRS_FOGDENSITY = 38,
D3DRS_RANGEFOGENABLE = 48,
D3DRS_STENCILENABLE = 52,
D3DRS_STENCILFAIL = 53,
D3DRS_STENCILZFAIL = 54,
D3DRS_STENCILPASS = 55,
D3DRS_STENCILFUNC = 56,
D3DRS_STENCILREF = 57,
D3DRS_STENCILMASK = 58,
D3DRS_STENCILWRITEMASK = 59,
D3DRS_TEXTUREFACTOR = 60,
D3DRS_WRAP0 = 128,
D3DRS_WRAP1 = 129,
D3DRS_WRAP2 = 130,
D3DRS_WRAP3 = 131,
D3DRS_WRAP4 = 132,
D3DRS_WRAP5 = 133,
D3DRS_WRAP6 = 134,
D3DRS_WRAP7 = 135,
D3DRS_CLIPPING = 136,
D3DRS_LIGHTING = 137,
D3DRS_AMBIENT = 139,
D3DRS_FOGVERTEXMODE = 140,
D3DRS_COLORVERTEX = 141,
D3DRS_LOCALVIEWER = 142,
D3DRS_NORMALIZENORMALS = 143,
D3DRS_DIFFUSEMATERIALSOURCE = 145,
D3DRS_SPECULARMATERIALSOURCE = 146,
D3DRS_AMBIENTMATERIALSOURCE = 147,
D3DRS_EMISSIVEMATERIALSOURCE = 148,
D3DRS_VERTEXBLEND = 151,
D3DRS_CLIPPLANEENABLE = 152,
D3DRS_POINTSIZE = 154,
D3DRS_POINTSIZE_MIN = 155,
D3DRS_POINTSPRITEENABLE = 156,
D3DRS_POINTSCALEENABLE = 157,
D3DRS_POINTSCALE_A = 158,
D3DRS_POINTSCALE_B = 159,
D3DRS_POINTSCALE_C = 160,
D3DRS_MULTISAMPLEANTIALIAS = 161,
D3DRS_MULTISAMPLEMASK = 162,
D3DRS_PATCHEDGESTYLE = 163,
D3DRS_DEBUGMONITORTOKEN = 165,
D3DRS_POINTSIZE_MAX = 166,
D3DRS_INDEXEDVERTEXBLENDENABLE = 167,
D3DRS_COLORWRITEENABLE = 168,
D3DRS_TWEENFACTOR = 170,
D3DRS_BLENDOP = 171,
D3DRS_POSITIONDEGREE = 172,
D3DRS_NORMALDEGREE = 173,
D3DRS_SCISSORTESTENABLE = 174,
D3DRS_SLOPESCALEDEPTHBIAS = 175,
D3DRS_ANTIALIASEDLINEENABLE = 176,
D3DRS_MINTESSELLATIONLEVEL = 178,
D3DRS_MAXTESSELLATIONLEVEL = 179,
D3DRS_ADAPTIVETESS_X = 180,
D3DRS_ADAPTIVETESS_Y = 181,
D3DRS_ADAPTIVETESS_Z = 182,
D3DRS_ADAPTIVETESS_W = 183,
D3DRS_ENABLEADAPTIVETESSELLATION= 184,
D3DRS_TWOSIDEDSTENCILMODE = 185,
D3DRS_CCW_STENCILFAIL = 186,
D3DRS_CCW_STENCILZFAIL = 187,
D3DRS_CCW_STENCILPASS = 188,
D3DRS_CCW_STENCILFUNC = 189,
D3DRS_COLORWRITEENABLE1 = 190,
D3DRS_COLORWRITEENABLE2 = 191,
D3DRS_COLORWRITEENABLE3 = 192,
D3DRS_BLENDFACTOR = 193,
D3DRS_SRGBWRITEENABLE = 194,
D3DRS_DEPTHBIAS = 195,
D3DRS_WRAP8 = 198,
D3DRS_WRAP9 = 199,
D3DRS_WRAP10 = 200,
D3DRS_WRAP11 = 201,
D3DRS_WRAP12 = 202,
D3DRS_WRAP13 = 203,
D3DRS_WRAP14 = 204,
D3DRS_WRAP15 = 205,
D3DRS_SEPARATEALPHABLENDENABLE = 206,
D3DRS_SRCBLENDALPHA = 207,
D3DRS_DESTBLENDALPHA = 208,
D3DRS_BLENDOPALPHA = 209,
D3DRS_FORCE_DWORD = 0x7fffffff
};
#endif

View file

@ -0,0 +1,18 @@
#ifndef D3D9_RESOURCETYPE_H
#define D3D9_RESOURCETYPE_H
DECLARE_ENUM(D3DRESOURCETYPE);
enum D3DRESOURCETYPE {
D3DRTYPE_SURFACE = 1,
D3DRTYPE_VOLUME = 2,
D3DRTYPE_TEXTURE = 3,
D3DRTYPE_VOLUMETEXTURE = 4,
D3DRTYPE_CUBETEXTURE = 5,
D3DRTYPE_VERTEXBUFFER = 6,
D3DRTYPE_INDEXBUFFER = 7,
D3DRTYPE_FORCE_DWORD = 0x7fffffff
};
#endif

View file

@ -0,0 +1,36 @@
#ifndef D3D9_SURFACE_H
#define D3D9_SURFACE_H
DECLARE_STRUCT(IDirect3DSurface9__v_table);
DECLARE_STRUCT(IDirect3DSurface9);
struct IDirect3DSurface9__v_table {
/*** IUnknown methods ***/
void* v_fn_0_QueryInterface;
void* v_fn_1_AddRef;
void* v_fn_2_Release;
/*** IDirect3DResource9 methods ***/
void* v_fn_3_GetDevice;
void* v_fn_4_SetPrivateData;
void* v_fn_5_GetPrivateData;
void* v_fn_6_FreePrivateData;
void* v_fn_7_SetPriority;
void* v_fn_8_GetPriority;
void* v_fn_9_PreLoad;
void* v_fn_10_GetType;
/*** IDirect3DSurface9 methods ***/
void* v_fn_11_GetContainer;
void* v_fn_12_GetDesc;
void* v_fn_13_LockRect;
void* v_fn_14_UnlockRect;
void* v_fn_15_GetDC;
void* v_fn_16_ReleaseDC;
};
struct IDirect3DSurface9 {
IDirect3DSurface9__v_table* v_table;
};
typedef IDirect3DSurface9* LPDIRECT3DSURFACE9;
#endif

View file

@ -0,0 +1,22 @@
#ifndef D3D9_SURFACEDESC_H
#define D3D9_SURFACEDESC_H
DECLARE_STRUCT(D3DSURFACE_DESC);
#include "external/d3d9/format.h"
#include "external/d3d9/resourcetype.h"
#include "external/d3d9/pool.h"
#include "external/d3d9/multisampletype.h"
struct D3DSURFACE_DESC {
D3DFORMAT Format;
D3DRESOURCETYPE Type;
uint32_t Usage;
D3DPOOL Pool;
D3DMULTISAMPLE_TYPE MultiSampleType;
uint32_t MultiSampleQuality;
uint32_t Width;
uint32_t Height;
};
#endif

View file

@ -0,0 +1,15 @@
#ifndef D3D9_SWAPEFFECT_H
#define D3D9_SWAPEFFECT_H
DECLARE_ENUM(D3DSWAPEFFECT);
enum D3DSWAPEFFECT {
D3DSWAPEFFECT_DISCARD = 1,
D3DSWAPEFFECT_FLIP = 2,
D3DSWAPEFFECT_COPY = 3,
D3DSWAPEFFECT_OVERLAY = 4,
D3DSWAPEFFECT_FLIPEX = 5,
D3DSWAPEFFECT_FORCE_DWORD = 0xFFFFFFFF
};
#endif

View file

@ -0,0 +1,42 @@
#ifndef D3D9_TEXTURE_H
#define D3D9_TEXTURE_H
DECLARE_STRUCT(IDirect3DTexture9__v_table);
DECLARE_STRUCT(IDirect3DTexture9);
struct IDirect3DTexture9__v_table {
/*** IUnknown methods ***/
void* v_fn_0_QueryInterface;
void* v_fn_1_AddRef;
void* v_fn_2_Release;
/*** IDirect3DResource9 methods ***/
void* v_fn_3_GetDevice;
void* v_fn_4_SetPrivateData;
void* v_fn_5_GetPrivateData;
void* v_fn_6_FreePrivateData;
void* v_fn_7_SetPriority;
void* v_fn_8_GetPriority;
void* v_fn_9_PreLoad;
void* v_fn_10_GetType;
/*** IDirect3DBaseTexture9 methods ***/
void* v_fn_11_SetLOD;
void* v_fn_12_GetLOD;
void* v_fn_13_GetLevelCount;
void* v_fn_14_SetAutoGenFilterType;
void* v_fn_15_GetAutoGenFilterType;
void* v_fn_16_GenerateMipSubLevels;
/*** IDirect3DTexture9 methods ***/
void* v_fn_17_GetLevelDesc;
void* v_fn_18_GetSurfaceLevel;
void* v_fn_19_LockRect;
void* v_fn_20_UnlockRect;
void* v_fn_21_AddDirtyRect;
};
struct IDirect3DTexture9 {
IDirect3DTexture9__v_table* v_table;
};
typedef IDirect3DTexture9* LPDIRECT3DTEXTURE9;
#endif

View file

@ -0,0 +1,12 @@
#ifndef D3D9_VECTOR_H
#define D3D9_VECTOR_H
DECLARE_STRUCT(D3DVECTOR);
struct D3DVECTOR {
float x;
float y;
float z;
};
#endif

View file

@ -0,0 +1,32 @@
#ifndef D3D9_VERTEXBUFFER_H
DECLARE_STRUCT(IDirect3DVertexBuffer9__v_table);
DECLARE_STRUCT(IDirect3DVertexBuffer9);
struct IDirect3DVertexBuffer9__v_table {
/*** IUnknown methods ***/
void* v_fn_0_QueryInterface;
void* v_fn_1_AddRef;
void* v_fn_2_Release;
/*** IDirect3DResource9 methods ***/
void* v_fn_3_GetDevice;
void* v_fn_4_SetPrivateData;
void* v_fn_5_GetPrivateData;
void* v_fn_6_FreePrivateData;
void* v_fn_7_SetPriority;
void* v_fn_8_GetPriority;
void* v_fn_9_PreLoad;
void* v_fn_10_GetType;
/*** IDirect3DVertexBuffer9 methods ***/
void* v_fn_11_Lock;
void* v_fn_12_Unlock;
void* v_fn_13_GetDesc;
};
struct IDirect3DVertexBuffer9 {
IDirect3DVertexBuffer9__v_table* v_table;
};
typedef IDirect3DVertexBuffer9* LPDIRECT3DVERTEXBUFFER9;
#endif

View file

@ -0,0 +1,23 @@
#ifndef D3D9_VERTEXDECLARATION_H
#define D3D9_VERTEXDECLARATION_H
DECLARE_STRUCT(IDirect3DVertexDeclaration9__v_table);
DECLARE_STRUCT(IDirect3DVertexDeclaration9);
struct IDirect3DVertexDeclaration9__v_table {
/*** IUnknown methods ***/
void* v_fn_0_QueryInterface;
void* v_fn_1_AddRef;
void* v_fn_2_Release;
/*** IDirect3DVertexDeclaration9 methods ***/
void* v_fn_3_GetDevice;
void* v_fn_4_GetDeclaration;
};
struct IDirect3DVertexDeclaration9 {
IDirect3DVertexDeclaration9__v_table* v_table;
};
typedef IDirect3DVertexDeclaration9* LPDIRECT3DVERTEXDECLARATION9;
#endif

View file

@ -0,0 +1,15 @@
#ifndef D3D9_VERTEXELEMENT_H
#define D3D9_VERTEXELEMENT_H
DECLARE_STRUCT(D3DVERTEXELEMENT9);
struct D3DVERTEXELEMENT9 {
uint16_t Stream;
uint16_t Offset;
uint8_t Type;
uint8_t Method;
uint8_t Usage;
uint8_t UsageIndex;
};
#endif

View file

@ -0,0 +1,21 @@
#ifndef D3D9_VERTEXSHADER_H
#define D3D9_VERTEXSHADER_H
DECLARE_STRUCT(IDirect3DVertexShader9__v_table);
DECLARE_STRUCT(IDirect3DVertexShader9);
struct IDirect3DVertexShader9__v_table {
void* v_fn_0_QueryInterface;
void* v_fn_1_AddRef;
void* v_fn_2_Release;
void* v_fn_3_GetDevice;
void* v_fn_4_GetFunction;
};
struct IDirect3DVertexShader9 {
IDirect3DVertexShader9__v_table* v_table;
};
typedef IDirect3DVertexShader9* LPDIRECT3DVERTEXSHADER9;
#endif