├── SH2Proxy ├── SH2Proxy.def ├── SH2Proxy.h ├── stdafx.cpp ├── targetver.h ├── stdafx.h ├── SH2Patcher.h ├── myIDirect3D8.h ├── SH2Proxy.vcxproj.filters ├── SH2Proxy.cpp ├── myIDirect3D8.cpp ├── SH2Proxy.vcxproj ├── myIDirect3DDevice8.h ├── SH2Patcher.cpp ├── myIDirect3DDevice8.cpp └── d3d8.h ├── SH2Proxy.sln ├── wine_osx_affinity.patch ├── .gitignore └── README.md /SH2Proxy/SH2Proxy.def: -------------------------------------------------------------------------------- 1 | LIBRARY "d3d8" 2 | 3 | EXPORTS 4 | Direct3DCreate8 @1 5 | -------------------------------------------------------------------------------- /SH2Proxy/SH2Proxy.h: -------------------------------------------------------------------------------- 1 | // proxydll.h 2 | #pragma once 3 | 4 | // Exported function 5 | IDirect3D8* WINAPI Direct3DCreate8(UINT SDKVersion); 6 | 7 | // regular functions 8 | void InitInstance(HANDLE hModule); 9 | void ExitInstance(void); 10 | void LoadOriginalDll(void); -------------------------------------------------------------------------------- /SH2Proxy/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SH2Proxy.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /SH2Proxy/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /SH2Proxy/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | #include "d3d8.h" 15 | #include "myIDirect3D8.h" 16 | #include "myIDirect3DDevice8.h" 17 | 18 | 19 | // TODO: reference additional headers your program requires here 20 | -------------------------------------------------------------------------------- /SH2Proxy/SH2Patcher.h: -------------------------------------------------------------------------------- 1 | #ifndef SH2PATCHER_H_ 2 | #define SH2PATCHER_H_ 3 | #include "stdafx.h" 4 | 5 | class SH2Patcher 6 | { 7 | private: 8 | HANDLE handle; 9 | DWORD_PTR baseAddr; 10 | 11 | int dwVideoWidth; 12 | int dwVideoHeight; 13 | bool bVideoWindowed; 14 | 15 | bool bWindowBorderless; 16 | bool bForceWindowBorderless; 17 | 18 | int dwWindowX; 19 | int dwWindowY; 20 | 21 | bool bPatchSingleCore; 22 | bool bPatchDisableSafeMode; 23 | bool bPatchFastTransitions; 24 | int wTransitionWidth; 25 | int wTransitionHeight; 26 | 27 | bool bExtraCreateLocalFix; 28 | 29 | public: 30 | bool Init(); 31 | bool IsSH2(); 32 | 33 | bool PatchResolution(D3DPRESENT_PARAMETERS* pPresentationParameters); 34 | bool PatchCode(); 35 | }; 36 | 37 | #endif -------------------------------------------------------------------------------- /SH2Proxy.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SH2Proxy", "SH2Proxy\SH2Proxy.vcxproj", "{BED3E5F4-A64D-4FA1-A34B-AE617F411EA0}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {BED3E5F4-A64D-4FA1-A34B-AE617F411EA0}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {BED3E5F4-A64D-4FA1-A34B-AE617F411EA0}.Debug|Win32.Build.0 = Debug|Win32 16 | {BED3E5F4-A64D-4FA1-A34B-AE617F411EA0}.Release|Win32.ActiveCfg = Release|Win32 17 | {BED3E5F4-A64D-4FA1-A34B-AE617F411EA0}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /SH2Proxy/myIDirect3D8.h: -------------------------------------------------------------------------------- 1 | // myIDirect3D8.h 2 | #pragma once 3 | 4 | class myIDirect3D8 : public IDirect3D8 5 | { 6 | public: 7 | 8 | myIDirect3D8(IDirect3D8 *pOriginal); 9 | virtual ~myIDirect3D8(); 10 | 11 | // START: The original DX8.1a function definitions 12 | HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj); 13 | ULONG __stdcall AddRef(void); 14 | ULONG __stdcall Release(void); 15 | HRESULT __stdcall RegisterSoftwareDevice(void* pInitializeFunction); 16 | UINT __stdcall GetAdapterCount(void); 17 | HRESULT __stdcall GetAdapterIdentifier(UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER8* pIdentifier); 18 | UINT __stdcall GetAdapterModeCount(UINT Adapter); 19 | HRESULT __stdcall EnumAdapterModes(UINT Adapter, UINT Mode, D3DDISPLAYMODE* pMode); 20 | HRESULT __stdcall GetAdapterDisplayMode(UINT Adapter, D3DDISPLAYMODE* pMode); 21 | HRESULT __stdcall CheckDeviceType(UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL Windowed); 22 | HRESULT __stdcall CheckDeviceFormat(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat); 23 | HRESULT __stdcall CheckDeviceMultiSampleType(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType); 24 | HRESULT __stdcall CheckDepthStencilMatch(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat); 25 | HRESULT __stdcall GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS8* pCaps); 26 | HMONITOR __stdcall GetAdapterMonitor(UINT Adapter); 27 | HRESULT __stdcall CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice8** ppReturnedDeviceInterface); 28 | // END: The original DX8,1a functions definitions 29 | 30 | private: 31 | 32 | IDirect3D8 * m_pIDirect3D8; 33 | }; 34 | 35 | -------------------------------------------------------------------------------- /SH2Proxy/SH2Proxy.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | Header Files 38 | 39 | 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | 58 | 59 | Source Files 60 | 61 | 62 | -------------------------------------------------------------------------------- /wine_osx_affinity.patch: -------------------------------------------------------------------------------- 1 | *** /tmp/wine-wine-1.9.11/server/thread.c 2016-05-27 16:40:02.000000000 +0200 2 | --- ../server/thread.c 2016-06-13 04:30:48.000000000 +0200 3 | *************** 4 | *** 38,43 **** 5 | --- 38,52 ---- 6 | #ifdef HAVE_SCHED_H 7 | #include 8 | #endif 9 | + #if defined(__APPLE__) 10 | + #include 11 | + #include 12 | + #include 13 | + #include 14 | + #include 15 | + #include 16 | + #include 17 | + #endif 18 | 19 | #include "ntstatus.h" 20 | #define WIN32_NO_STATUS 21 | *************** 22 | *** 449,454 **** 23 | --- 458,496 ---- 24 | 25 | ret = sched_setaffinity( thread->unix_tid, sizeof(set), &set ); 26 | } 27 | + #elif defined(__APPLE__) 28 | + if (thread->unix_tid != -1 && __builtin_popcount(affinity) == 1) { 29 | + mach_port_t proc_port = thread->process->trace_data; 30 | + if (task_suspend(proc_port) != KERN_SUCCESS) { 31 | + fprintf(stderr, "Failed to suspend task %d\n", proc_port); 32 | + } 33 | + 34 | + static io_connect_t conn; 35 | + static io_service_t service; 36 | + 37 | + mach_port_t thread_port; 38 | + mach_msg_type_name_t type; 39 | + if (mach_port_extract_right(proc_port, thread->unix_tid, MACH_MSG_TYPE_COPY_SEND, &thread_port, &type)) 40 | + fprintf(stderr, "Failed to obtain thread port for %d\n", thread->unix_tid); 41 | + 42 | + if (!service) 43 | + service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("ThreadBinder")); 44 | + if (!conn) 45 | + if (IOServiceOpen(service, mach_task_self(), 0, &conn) != KERN_SUCCESS) 46 | + fprintf(stderr, "Failed to open ThreadBinder IOService\n"); 47 | + 48 | + uint64_t input[] = {thread_port, affinity > 0 ? affinity - 1 : affinity}; 49 | + uint64_t res = 0; 50 | + uint32_t outCnt = 0; 51 | + 52 | + kern_return_t kret = IOConnectCallScalarMethod(conn, 0, input, 2, &res, &outCnt); 53 | + if (kret != KERN_SUCCESS) 54 | + ret = EINVAL; 55 | + // fprintf(stderr, "binding 0x%x; kret: 0x%x\n", thread_port, kret); 56 | + 57 | + task_resume(proc_port); 58 | + mach_port_deallocate(proc_port, thread_port); 59 | + } 60 | #endif 61 | if (!ret) thread->affinity = affinity; 62 | return ret; 63 | -------------------------------------------------------------------------------- /SH2Proxy/SH2Proxy.cpp: -------------------------------------------------------------------------------- 1 | // proxydll.cpp 2 | #include "stdafx.h" 3 | #include "SH2Proxy.h" 4 | #include "SH2Patcher.h" 5 | 6 | // global variables 7 | #pragma data_seg (".d3d8_shared") 8 | myIDirect3DDevice8* gl_pmyIDirect3DDevice8; 9 | myIDirect3D8* gl_pmyIDirect3D8; 10 | HINSTANCE gl_hOriginalDll; 11 | HINSTANCE gl_hThisInstance; 12 | SH2Patcher gl_patcher; 13 | #pragma data_seg () 14 | 15 | BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) 16 | { 17 | // to avoid compiler lvl4 warnings 18 | LPVOID lpDummy = lpReserved; 19 | lpDummy = NULL; 20 | 21 | switch (ul_reason_for_call) 22 | { 23 | case DLL_PROCESS_ATTACH: InitInstance(hModule); break; 24 | case DLL_PROCESS_DETACH: ExitInstance(); break; 25 | 26 | case DLL_THREAD_ATTACH: break; 27 | case DLL_THREAD_DETACH: break; 28 | } 29 | return TRUE; 30 | } 31 | 32 | // Exported function (faking d3d8.dll's one-and-only export) 33 | IDirect3D8* WINAPI Direct3DCreate8(UINT SDKVersion) 34 | { 35 | if (!gl_hOriginalDll) LoadOriginalDll(); // looking for the "right d3d8.dll" 36 | 37 | // Hooking IDirect3D Object from Original Library 38 | typedef IDirect3D8 *(WINAPI* D3D8_Type)(UINT SDKVersion); 39 | D3D8_Type D3DCreate8_fn = (D3D8_Type)GetProcAddress(gl_hOriginalDll, "Direct3DCreate8"); 40 | 41 | // Debug 42 | if (!D3DCreate8_fn) 43 | { 44 | OutputDebugString("PROXYDLL: Pointer to original D3DCreate8 function not received ERROR ****\r\n"); 45 | ::ExitProcess(0); // exit the hard way 46 | } 47 | 48 | // Request pointer from Original Dll. 49 | IDirect3D8 *pIDirect3D8_orig = D3DCreate8_fn(SDKVersion); 50 | 51 | // Create my IDirect3D8 object and store pointer to original object there. 52 | // note: the object will delete itself once Ref count is zero (similar to COM objects) 53 | gl_pmyIDirect3D8 = new myIDirect3D8(pIDirect3D8_orig); 54 | 55 | gl_patcher.PatchResolution(NULL); 56 | // Return pointer to hooking Object instead of "real one" 57 | return (gl_pmyIDirect3D8); 58 | } 59 | 60 | void InitInstance(HANDLE hModule) 61 | { 62 | OutputDebugString("PROXYDLL: InitInstance called.\r\n"); 63 | 64 | // Initialisation 65 | gl_hOriginalDll = NULL; 66 | gl_hThisInstance = NULL; 67 | gl_pmyIDirect3D8 = NULL; 68 | gl_pmyIDirect3DDevice8 = NULL; 69 | 70 | // Storing Instance handle into global var 71 | gl_hThisInstance = (HINSTANCE)hModule; 72 | 73 | gl_patcher.Init(); 74 | } 75 | 76 | void LoadOriginalDll(void) 77 | { 78 | char buffer[MAX_PATH]; 79 | 80 | // Getting path to system dir and to d3d8.dll 81 | ::GetSystemDirectory(buffer, MAX_PATH); 82 | 83 | // Append dll name 84 | strcat_s(buffer, MAX_PATH, "\\d3d8.dll"); 85 | 86 | // try to load the system's d3d8.dll, if pointer empty 87 | if (!gl_hOriginalDll) gl_hOriginalDll = ::LoadLibrary(buffer); 88 | 89 | // Debug 90 | if (!gl_hOriginalDll) 91 | { 92 | OutputDebugString("PROXYDLL: Original d3d8.dll not loaded ERROR ****\r\n"); 93 | ::ExitProcess(0); // exit the hard way 94 | } 95 | } 96 | 97 | void ExitInstance() 98 | { 99 | OutputDebugString("PROXYDLL: ExitInstance called.\r\n"); 100 | 101 | // Release the system's d3d8.dll 102 | if (gl_hOriginalDll) 103 | { 104 | ::FreeLibrary(gl_hOriginalDll); 105 | gl_hOriginalDll = NULL; 106 | } 107 | } 108 | 109 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | [Dd]ebug/ 11 | [Dd]ebugPublic/ 12 | [Rr]elease/ 13 | x64/ 14 | build/ 15 | bld/ 16 | [Bb]in/ 17 | [Oo]bj/ 18 | 19 | # MSTest test Results 20 | [Tt]est[Rr]esult*/ 21 | [Bb]uild[Ll]og.* 22 | 23 | #NUNIT 24 | *.VisualState.xml 25 | TestResult.xml 26 | 27 | # Build Results of an ATL Project 28 | [Dd]ebugPS/ 29 | [Rr]eleasePS/ 30 | dlldata.c 31 | 32 | *_i.c 33 | *_p.c 34 | *_i.h 35 | *.ilk 36 | *.meta 37 | *.obj 38 | *.pch 39 | *.pdb 40 | *.pgc 41 | *.pgd 42 | *.rsp 43 | *.sbr 44 | *.tlb 45 | *.tli 46 | *.tlh 47 | *.tmp 48 | *.tmp_proj 49 | *.log 50 | *.vspscc 51 | *.vssscc 52 | .builds 53 | *.pidb 54 | *.svclog 55 | *.scc 56 | 57 | # Chutzpah Test files 58 | _Chutzpah* 59 | 60 | # Visual C++ cache files 61 | ipch/ 62 | *.aps 63 | *.ncb 64 | *.opensdf 65 | *.sdf 66 | *.cachefile 67 | 68 | # Visual Studio profiler 69 | *.psess 70 | *.vsp 71 | *.vspx 72 | 73 | # TFS 2012 Local Workspace 74 | $tf/ 75 | 76 | # Guidance Automation Toolkit 77 | *.gpState 78 | 79 | # ReSharper is a .NET coding add-in 80 | _ReSharper*/ 81 | *.[Rr]e[Ss]harper 82 | *.DotSettings.user 83 | 84 | # JustCode is a .NET coding addin-in 85 | .JustCode 86 | 87 | # TeamCity is a build add-in 88 | _TeamCity* 89 | 90 | # DotCover is a Code Coverage Tool 91 | *.dotCover 92 | 93 | # NCrunch 94 | *.ncrunch* 95 | _NCrunch_* 96 | .*crunch*.local.xml 97 | 98 | # MightyMoose 99 | *.mm.* 100 | AutoTest.Net/ 101 | 102 | # Web workbench (sass) 103 | .sass-cache/ 104 | 105 | # Installshield output folder 106 | [Ee]xpress/ 107 | 108 | # DocProject is a documentation generator add-in 109 | DocProject/buildhelp/ 110 | DocProject/Help/*.HxT 111 | DocProject/Help/*.HxC 112 | DocProject/Help/*.hhc 113 | DocProject/Help/*.hhk 114 | DocProject/Help/*.hhp 115 | DocProject/Help/Html2 116 | DocProject/Help/html 117 | 118 | # Click-Once directory 119 | publish/ 120 | 121 | # Publish Web Output 122 | *.[Pp]ublish.xml 123 | *.azurePubxml 124 | 125 | # NuGet Packages Directory 126 | packages/ 127 | ## TODO: If the tool you use requires repositories.config uncomment the next line 128 | #!packages/repositories.config 129 | 130 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 131 | # This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) 132 | !packages/build/ 133 | 134 | # Windows Azure Build Output 135 | csx/ 136 | *.build.csdef 137 | 138 | # Windows Store app package directory 139 | AppPackages/ 140 | 141 | # Others 142 | sql/ 143 | *.Cache 144 | ClientBin/ 145 | [Ss]tyle[Cc]op.* 146 | ~$* 147 | *~ 148 | *.dbmdl 149 | *.dbproj.schemaview 150 | *.pfx 151 | *.publishsettings 152 | node_modules/ 153 | 154 | # RIA/Silverlight projects 155 | Generated_Code/ 156 | 157 | # Backup & report files from converting an old project file to a newer 158 | # Visual Studio version. Backup files are not needed, because we have git ;-) 159 | _UpgradeReport_Files/ 160 | Backup*/ 161 | UpgradeLog*.XML 162 | UpgradeLog*.htm 163 | 164 | # SQL Server files 165 | *.mdf 166 | *.ldf 167 | 168 | # Business Intelligence projects 169 | *.rdl.data 170 | *.bim.layout 171 | *.bim_*.settings 172 | 173 | # Microsoft Fakes 174 | FakesAssemblies/ 175 | -------------------------------------------------------------------------------- /SH2Proxy/myIDirect3D8.cpp: -------------------------------------------------------------------------------- 1 | // myIDirect3D8.cpp 2 | #include "stdafx.h" 3 | #include "SH2Patcher.h" 4 | 5 | extern SH2Patcher patcher; 6 | 7 | myIDirect3D8::myIDirect3D8(IDirect3D8 *pOriginal) 8 | { 9 | m_pIDirect3D8 = pOriginal; // store the pointer to original object 10 | } 11 | 12 | myIDirect3D8::~myIDirect3D8() 13 | { 14 | 15 | } 16 | 17 | HRESULT __stdcall myIDirect3D8::QueryInterface(REFIID riid, void** ppvObj) 18 | { 19 | *ppvObj = NULL; 20 | 21 | // call this to increase AddRef at original object 22 | // and to check if such an interface is there 23 | 24 | HRESULT hRes = m_pIDirect3D8->QueryInterface(riid, ppvObj); 25 | 26 | if (hRes == NOERROR) // if OK, send our "fake" address 27 | { 28 | *ppvObj = this; 29 | } 30 | 31 | return hRes; 32 | } 33 | 34 | ULONG __stdcall myIDirect3D8::AddRef() 35 | { 36 | return(m_pIDirect3D8->AddRef()); 37 | } 38 | 39 | ULONG __stdcall myIDirect3D8::Release() 40 | { 41 | extern myIDirect3D8* gl_pmyIDirect3D8; 42 | 43 | // call original routine 44 | ULONG count = m_pIDirect3D8->Release(); 45 | 46 | // in case no further Ref is there, the Original Object has deleted itself 47 | // so do we here 48 | if (count == 0) 49 | { 50 | gl_pmyIDirect3D8 = NULL; 51 | delete(this); 52 | } 53 | 54 | return(count); 55 | } 56 | 57 | HRESULT __stdcall myIDirect3D8::RegisterSoftwareDevice(void* pInitializeFunction) 58 | { 59 | return(m_pIDirect3D8->RegisterSoftwareDevice(pInitializeFunction)); 60 | } 61 | 62 | UINT __stdcall myIDirect3D8::GetAdapterCount() 63 | { 64 | return(m_pIDirect3D8->GetAdapterCount()); 65 | } 66 | 67 | HRESULT __stdcall myIDirect3D8::GetAdapterIdentifier(UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER8* pIdentifier) 68 | { 69 | return(m_pIDirect3D8->GetAdapterIdentifier(Adapter, Flags, pIdentifier)); 70 | } 71 | 72 | UINT __stdcall myIDirect3D8::GetAdapterModeCount(UINT Adapter) 73 | { 74 | return(m_pIDirect3D8->GetAdapterModeCount(Adapter)); 75 | } 76 | 77 | HRESULT __stdcall myIDirect3D8::EnumAdapterModes(UINT Adapter, UINT Mode, D3DDISPLAYMODE* pMode) 78 | { 79 | return(m_pIDirect3D8->EnumAdapterModes(Adapter, Mode, pMode)); 80 | } 81 | 82 | HRESULT __stdcall myIDirect3D8::GetAdapterDisplayMode(UINT Adapter, D3DDISPLAYMODE* pMode) 83 | { 84 | return(m_pIDirect3D8->GetAdapterDisplayMode(Adapter, pMode)); 85 | } 86 | 87 | HRESULT __stdcall myIDirect3D8::CheckDeviceType(UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL Windowed) 88 | { 89 | return(m_pIDirect3D8->CheckDeviceType(Adapter, CheckType, DisplayFormat, BackBufferFormat, Windowed)); 90 | } 91 | 92 | HRESULT __stdcall myIDirect3D8::CheckDeviceFormat(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) 93 | { 94 | return(m_pIDirect3D8->CheckDeviceFormat(Adapter, DeviceType, AdapterFormat, Usage, RType, CheckFormat)); 95 | } 96 | 97 | HRESULT __stdcall myIDirect3D8::CheckDeviceMultiSampleType(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType) 98 | { 99 | return(m_pIDirect3D8->CheckDeviceMultiSampleType(Adapter, DeviceType, SurfaceFormat, Windowed, MultiSampleType)); 100 | } 101 | 102 | HRESULT __stdcall myIDirect3D8::CheckDepthStencilMatch(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) 103 | { 104 | return(m_pIDirect3D8->CheckDepthStencilMatch(Adapter, DeviceType, AdapterFormat, RenderTargetFormat, DepthStencilFormat)); 105 | } 106 | 107 | HRESULT __stdcall myIDirect3D8::GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS8* pCaps) 108 | { 109 | return(m_pIDirect3D8->GetDeviceCaps(Adapter, DeviceType, pCaps)); 110 | } 111 | 112 | HMONITOR __stdcall myIDirect3D8::GetAdapterMonitor(UINT Adapter) 113 | { 114 | return(m_pIDirect3D8->GetAdapterMonitor(Adapter)); 115 | } 116 | 117 | HRESULT __stdcall myIDirect3D8::CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice8** ppReturnedDeviceInterface) 118 | { 119 | // global var 120 | extern myIDirect3DDevice8* gl_pmyIDirect3DDevice8; 121 | extern SH2Patcher gl_patcher; 122 | 123 | gl_patcher.PatchResolution(pPresentationParameters); 124 | 125 | // we intercept this call and provide our own "fake" Device Object 126 | HRESULT hres = m_pIDirect3D8->CreateDevice(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, ppReturnedDeviceInterface); 127 | 128 | // Create our own Device object and strore it in global pointer 129 | // note: the object will delete itself once Ref count is zero (similar to COM objects) 130 | gl_pmyIDirect3DDevice8 = new myIDirect3DDevice8(*ppReturnedDeviceInterface); 131 | 132 | // store our pointer (the fake one) for returning it to the calling progam 133 | *ppReturnedDeviceInterface = gl_pmyIDirect3DDevice8; 134 | 135 | return(hres); 136 | } 137 | -------------------------------------------------------------------------------- /SH2Proxy/SH2Proxy.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {BED3E5F4-A64D-4FA1-A34B-AE617F411EA0} 15 | Win32Proj 16 | SH2Proxy 17 | 18 | 19 | 20 | DynamicLibrary 21 | true 22 | v120 23 | MultiByte 24 | 25 | 26 | DynamicLibrary 27 | false 28 | v120 29 | true 30 | MultiByte 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | d3d8 45 | 46 | 47 | false 48 | d3d8 49 | 50 | 51 | 52 | Use 53 | Level3 54 | Disabled 55 | WIN32;_DEBUG;_WINDOWS;_USRDLL;SH2PROXY_EXPORTS;%(PreprocessorDefinitions) 56 | 57 | 58 | Windows 59 | true 60 | SH2Proxy.def 61 | $(OutDir)$(TargetName)$(TargetExt) 62 | 63 | 64 | del K:\SilentHill\SH2\d3d8.* 65 | copy "$(OutDir)*" "K:\SilentHill\SH2\" 66 | 67 | 68 | 69 | 70 | Level3 71 | Use 72 | MaxSpeed 73 | true 74 | true 75 | WIN32;NDEBUG;_WINDOWS;_USRDLL;SH2PROXY_EXPORTS;%(PreprocessorDefinitions) 76 | 77 | 78 | Windows 79 | true 80 | true 81 | true 82 | SH2Proxy.def 83 | 84 | 85 | del K:\SilentHill\SH2\d3d8.* 86 | copy "$(OutDir)*" "K:\SilentHill\SH2\" 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | Create 105 | Create 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | sh2proxy 2 | ======== 3 | 4 | **sh2proxy is no longer under active development, I recommend you use ThirteenAG and Aero_'s Widescreen Fixes Pack instead (which includes the fixes from sh2proxy along with some others) as it's more actively supported:** https://thirteenag.github.io/wfp#sh2 5 | 6 | A simple D3D8 wrapper and SH2 (Directors Cut) patcher, with source code included. 7 | 8 | Thanks to Michael Koch for his open source DX8 wrapper 9 | (http://www.codeguru.com/cpp/g-m/directx/directx8/article.php/c11453/Intercept-Calls-to-DirectX-with-a-Proxy-DLL.htm) 10 | 11 | This repo contains code for the proxy, most users will want the download below. 12 | 13 | DOWNLOAD FROM THE RELEASES SECTION: https://github.com/emoose/sh2proxy/releases 14 | 15 | Experimental SweetFX version can be found at https://github.com/emoose/sh2proxy/issues/2#issuecomment-71128479 16 | 17 | Additional fix for white textures (credits to Sonne170, I'll add this into the next sh2proxy release, whenever that happens): https://github.com/emoose/sh2proxy/issues/4#issuecomment-76407335 18 | 19 | Install 20 | ------- 21 | 22 | Binary download is available in the releases section (https://github.com/emoose/sh2proxy/releases), includes sh2proxy.ini, precompiled d3d8.dll and a matching sh2pc.exe for sh2proxy. 23 | 24 | Visual C++ 2013 redistributable is required, download vcredist_x86.exe from 25 | 26 | http://www.microsoft.com/en-gb/download/details.aspx?id=40784 27 | 28 | 29 | 1. Backup your sh2pc.exe file 30 | 2. Remove/uninstall any other SH2 modern compatibility fixes 31 | 3. Copy contents of bin folder to your SH2 install 32 | 4. Make sure the new sh2pc.exe file is 6,123,520 bytes 33 | 5. Edit sh2proxy.ini with your own settings 34 | 6. Run sh2pc.exe and enjoy! 35 | 36 | Again, make sure any other compatibility fixes are removed to make sure they don't collide with this patcher! 37 | 38 | 39 | If you have problems with SH2 changing your screen resolution to 640x480 when it first opens try running the following as admin 40 | 41 | sdbinst -u -g {d2026473-6410-4150-9291-523b55495056} 42 | 43 | 44 | If you installed any other custom SDB compatibility files you should also remove them with 45 | 46 | sdbinst -u pathtoSDBfile 47 | 48 | 49 | Usage 50 | ------- 51 | Easy mode: edit the ini file to your settings and run sh2pc.exe 52 | 53 | 54 | Hard mode: You can now add parameters to the exe 55 | 56 | - -width=xxxx / -w=xxxx change screen width to xxxx 57 | - -height=xxxx / -h=xxxx change screen height to xxxx 58 | - -windowed / -window / -w force game to run in window 59 | - -fullscreen / -fs / -f force game to run fullscreen 60 | - -borderless / -bl force game to run borderless (only takes effect if game is windowed) 61 | - -borders / -b force game to run with borders (only takes effect if game is windowed) 62 | - -x=xxxx set window x position 63 | - -y=xxxx set window y position 64 | 65 | To use them just run sh2pc.exe with the parameters you want, e.g. 66 | 67 | sh2pc.exe -w=2560 -h=1440 -f 68 | 69 | To run the game in fullscreen 2560x1440 70 | 71 | 72 | If no ini is found it'll run the game as default with all the fixes listed below enabled, parameters will still work fine though 73 | 74 | 75 | Fixes 76 | ------- 77 | Allows: 78 | - Custom resolutions 79 | - Windowed mode 80 | - Borderless window 81 | - Window positioning 82 | - Executable Arguments/parameters 83 | 84 | Fixes: 85 | - Disables Safe Mode 86 | - Improve transition speed (opening up inventory/map/etc) 87 | - Automatically set processor affinity to only use a single core 88 | - Create local.fix AA fix file if doesn't exist (thanks to angular graphics for the fix!) 89 | 90 | All of the above can be configured in sh2proxy.ini 91 | 92 | OS X Support 93 | ------- 94 | OS X does not export any API for reliably controlling thread affinity. Nevertheless, there is a workaround: 95 | 1. Build and install [ThreadBinder](https://github.com/07151129/ThreadBinder) kernel extension. 96 | 2. Patch wine using `wine_osx_affinity.patch`. It was tested with version 1.9.11, but should work with any reasonable modern one. 97 | 98 | After this, the game's threads should be bound to a single processor. You can observe the result by looking at wine's CPU usage: 99 | it should never exceed 100%. 100 | 101 | Example INI 102 | ------- 103 |
104 | [Video]
105 | # width of screen buffer (default 1280)
106 | Width = 2560
107 | # height of screen buffer (default 720)
108 | Height = 1440
109 | # set to 1 to make the game run in a window (default 0)
110 | Windowed = 1
111 | 
112 | [Window]
113 | # set to 1 to make the window borderless (only takes effect if windowed is enabled)
114 | # borderless windows can't be moved normally, so set the position below
115 | # (default 0)
116 | Borderless = 1
117 | 
118 | # Force borderless even on fullscreen (Windows 10 Fix)
119 | ForceBorderless = 1
120 | 
121 | # works with bordered windows too
122 | # (default 0)
123 | PositionX = 0
124 | PositionY = 0
125 | 
126 | [Patches]
127 | # forces SH2 to use one core (default 1)
128 | SingleCoreAffinity = 1
129 | 
130 | # disable SH2 gfx safe mode (default 1)
131 | DisableSafeMode = 1
132 | 
133 | # improve speed of transitions (opening up inventory/map/etc) (default 1)
134 | FastTransitions = 1
135 | 
136 | # transition width/height (only used internally)
137 | # the game normally uses your screen res, which slows transitions a lot (3-4s transition time for no reason at all!)
138 | # if set to 0 it'll use half your screen res
139 | # in case you still experience transition lag try setting this to a sensible value, 1280x720 is a good choice
140 | # (default 0)
141 | FastTransitionWidth = 800
142 | FastTransitionHeight = 600
143 | 
144 | [Extra]
145 | # automatically create local.fix file with angular graphics local.fix file
146 | # should fix AA on most systems
147 | # (default 1)
148 | CreateLocalFix = 0
149 | 
150 | -------------------------------------------------------------------------------- /SH2Proxy/myIDirect3DDevice8.h: -------------------------------------------------------------------------------- 1 | // myIDirect3DDevice8.h 2 | #pragma once 3 | 4 | class myIDirect3DDevice8 : public IDirect3DDevice8 5 | { 6 | public: 7 | 8 | myIDirect3DDevice8(IDirect3DDevice8* pOriginal); 9 | virtual ~myIDirect3DDevice8(); 10 | 11 | // START: The original DX8.1a function definitions 12 | HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj); 13 | ULONG __stdcall AddRef(void); 14 | ULONG __stdcall Release(void); 15 | HRESULT __stdcall TestCooperativeLevel(void); 16 | UINT __stdcall GetAvailableTextureMem(void); 17 | HRESULT __stdcall ResourceManagerDiscardBytes(DWORD Bytes); 18 | HRESULT __stdcall GetDirect3D(IDirect3D8** ppD3D8); 19 | HRESULT __stdcall GetDeviceCaps(D3DCAPS8* pCaps); 20 | HRESULT __stdcall GetDisplayMode(D3DDISPLAYMODE* pMode); 21 | HRESULT __stdcall GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters); 22 | HRESULT __stdcall SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface8* pCursorBitmap); 23 | void __stdcall SetCursorPosition(UINT XScreenSpace, UINT YScreenSpace, DWORD Flags); 24 | BOOL __stdcall ShowCursor(BOOL bShow); 25 | HRESULT __stdcall CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain8** pSwapChain); 26 | HRESULT __stdcall Reset(D3DPRESENT_PARAMETERS* pPresentationParameters); 27 | HRESULT __stdcall Present(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion); 28 | HRESULT __stdcall GetBackBuffer(UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface8** ppBackBuffer); 29 | HRESULT __stdcall GetRasterStatus(D3DRASTER_STATUS* pRasterStatus); 30 | void __stdcall SetGammaRamp(DWORD Flags, CONST D3DGAMMARAMP* pRamp); 31 | void __stdcall GetGammaRamp(D3DGAMMARAMP* pRamp); 32 | HRESULT __stdcall CreateTexture(UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture8** ppTexture); 33 | HRESULT __stdcall CreateVolumeTexture(UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture8** ppVolumeTexture); 34 | HRESULT __stdcall CreateCubeTexture(UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture8** ppCubeTexture); 35 | HRESULT __stdcall CreateVertexBuffer(UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer8** ppVertexBuffer); 36 | HRESULT __stdcall CreateIndexBuffer(UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer8** ppIndexBuffer); 37 | HRESULT __stdcall CreateRenderTarget(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, BOOL Lockable, IDirect3DSurface8** ppSurface); 38 | HRESULT __stdcall CreateDepthStencilSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, IDirect3DSurface8** ppSurface); 39 | HRESULT __stdcall CreateImageSurface(UINT Width, UINT Height, D3DFORMAT Format, IDirect3DSurface8** ppSurface); 40 | HRESULT __stdcall CopyRects(IDirect3DSurface8* pSourceSurface, CONST RECT* pSourceRectsArray, UINT cRects, IDirect3DSurface8* pDestinationSurface, CONST POINT* pDestPointsArray); 41 | HRESULT __stdcall UpdateTexture(IDirect3DBaseTexture8* pSourceTexture, IDirect3DBaseTexture8* pDestinationTexture); 42 | HRESULT __stdcall GetFrontBuffer(IDirect3DSurface8* pDestSurface); 43 | HRESULT __stdcall SetRenderTarget(IDirect3DSurface8* pRenderTarget, IDirect3DSurface8* pNewZStencil); 44 | HRESULT __stdcall GetRenderTarget(IDirect3DSurface8** ppRenderTarget); 45 | HRESULT __stdcall GetDepthStencilSurface(IDirect3DSurface8** ppZStencilSurface); 46 | HRESULT __stdcall BeginScene(THIS); 47 | HRESULT __stdcall EndScene(THIS); 48 | HRESULT __stdcall Clear(DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil); 49 | HRESULT __stdcall SetTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix); 50 | HRESULT __stdcall GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix); 51 | HRESULT __stdcall MultiplyTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix); 52 | HRESULT __stdcall SetViewport(CONST D3DVIEWPORT8* pViewport); 53 | HRESULT __stdcall GetViewport(D3DVIEWPORT8* pViewport); 54 | HRESULT __stdcall SetMaterial(CONST D3DMATERIAL8* pMaterial); 55 | HRESULT __stdcall GetMaterial(D3DMATERIAL8* pMaterial); 56 | HRESULT __stdcall SetLight(DWORD Index, CONST D3DLIGHT8* pLight); 57 | HRESULT __stdcall GetLight(DWORD Index, D3DLIGHT8* pLight); 58 | HRESULT __stdcall LightEnable(DWORD Index, BOOL Enable); 59 | HRESULT __stdcall GetLightEnable(DWORD Index, BOOL* pEnable); 60 | HRESULT __stdcall SetClipPlane(DWORD Index, CONST float* pPlane); 61 | HRESULT __stdcall GetClipPlane(DWORD Index, float* pPlane); 62 | HRESULT __stdcall SetRenderState(D3DRENDERSTATETYPE State, DWORD Value); 63 | HRESULT __stdcall GetRenderState(D3DRENDERSTATETYPE State, DWORD* pValue); 64 | HRESULT __stdcall BeginStateBlock(THIS); 65 | HRESULT __stdcall EndStateBlock(DWORD* pToken); 66 | HRESULT __stdcall ApplyStateBlock(DWORD Token); 67 | HRESULT __stdcall CaptureStateBlock(DWORD Token); 68 | HRESULT __stdcall DeleteStateBlock(DWORD Token); 69 | HRESULT __stdcall CreateStateBlock(D3DSTATEBLOCKTYPE Type, DWORD* pToken); 70 | HRESULT __stdcall SetClipStatus(CONST D3DCLIPSTATUS8* pClipStatus); 71 | HRESULT __stdcall GetClipStatus(D3DCLIPSTATUS8* pClipStatus); 72 | HRESULT __stdcall GetTexture(DWORD Stage, IDirect3DBaseTexture8** ppTexture); 73 | HRESULT __stdcall SetTexture(DWORD Stage, IDirect3DBaseTexture8* pTexture); 74 | HRESULT __stdcall GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue); 75 | HRESULT __stdcall SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value); 76 | HRESULT __stdcall ValidateDevice(DWORD* pNumPasses); 77 | HRESULT __stdcall GetInfo(DWORD DevInfoID, void* pDevInfoStruct, DWORD DevInfoStructSize); 78 | HRESULT __stdcall SetPaletteEntries(UINT PaletteNumber, CONST PALETTEENTRY* pEntries); 79 | HRESULT __stdcall GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY* pEntries); 80 | HRESULT __stdcall SetCurrentTexturePalette(UINT PaletteNumber); 81 | HRESULT __stdcall GetCurrentTexturePalette(UINT *PaletteNumber); 82 | HRESULT __stdcall DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount); 83 | HRESULT __stdcall DrawIndexedPrimitive(D3DPRIMITIVETYPE Type, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount); 84 | HRESULT __stdcall DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride); 85 | HRESULT __stdcall DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertexIndices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride); 86 | HRESULT __stdcall ProcessVertices(UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer8* pDestBuffer, DWORD Flags); 87 | HRESULT __stdcall CreateVertexShader(CONST DWORD* pDeclaration, CONST DWORD* pFunction, DWORD* pHandle, DWORD Usage); 88 | HRESULT __stdcall SetVertexShader(DWORD Handle); 89 | HRESULT __stdcall GetVertexShader(DWORD* pHandle); 90 | HRESULT __stdcall DeleteVertexShader(DWORD Handle); 91 | HRESULT __stdcall SetVertexShaderConstant(DWORD Register, CONST void* pConstantData, DWORD ConstantCount); 92 | HRESULT __stdcall GetVertexShaderConstant(DWORD Register, void* pConstantData, DWORD ConstantCount); 93 | HRESULT __stdcall GetVertexShaderDeclaration(DWORD Handle, void* pData, DWORD* pSizeOfData); 94 | HRESULT __stdcall GetVertexShaderFunction(DWORD Handle, void* pData, DWORD* pSizeOfData); 95 | HRESULT __stdcall SetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer8* pStreamData, UINT Stride); 96 | HRESULT __stdcall GetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer8** ppStreamData, UINT* pStride); 97 | HRESULT __stdcall SetIndices(IDirect3DIndexBuffer8* pIndexData, UINT BaseVertexIndex); 98 | HRESULT __stdcall GetIndices(IDirect3DIndexBuffer8** ppIndexData, UINT* pBaseVertexIndex); 99 | HRESULT __stdcall CreatePixelShader(CONST DWORD* pFunction, DWORD* pHandle); 100 | HRESULT __stdcall SetPixelShader(DWORD Handle); 101 | HRESULT __stdcall GetPixelShader(DWORD* pHandle); 102 | HRESULT __stdcall DeletePixelShader(DWORD Handle); 103 | HRESULT __stdcall SetPixelShaderConstant(DWORD Register, CONST void* pConstantData, DWORD ConstantCount); 104 | HRESULT __stdcall GetPixelShaderConstant(DWORD Register, void* pConstantData, DWORD ConstantCount); 105 | HRESULT __stdcall GetPixelShaderFunction(DWORD Handle, void* pData, DWORD* pSizeOfData); 106 | HRESULT __stdcall DrawRectPatch(UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo); 107 | HRESULT __stdcall DrawTriPatch(UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo); 108 | HRESULT __stdcall DeletePatch(UINT Handle); 109 | // END: The original DX8.1a function definitions 110 | 111 | private: 112 | 113 | IDirect3DDevice8 *m_pIDirect3DDevice8; 114 | 115 | // This is our test function 116 | void ShowWeAreHere(void); 117 | 118 | }; 119 | 120 | -------------------------------------------------------------------------------- /SH2Proxy/SH2Patcher.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include 3 | #include 4 | #include "SH2Patcher.h" 5 | 6 | static char gameTitle[] = "Silent Hill 2"; 7 | 8 | PCHAR* 9 | CommandLineToArgvA( 10 | PCHAR CmdLine, 11 | int* _argc 12 | ) 13 | { 14 | PCHAR* argv; 15 | PCHAR _argv; 16 | ULONG len; 17 | ULONG argc; 18 | CHAR a; 19 | ULONG i, j; 20 | 21 | BOOLEAN in_QM; 22 | BOOLEAN in_TEXT; 23 | BOOLEAN in_SPACE; 24 | 25 | len = strlen(CmdLine); 26 | i = ((len + 2) / 2)*sizeof(PVOID)+sizeof(PVOID); 27 | 28 | argv = (PCHAR*)GlobalAlloc(GMEM_FIXED, 29 | i + (len + 2)*sizeof(CHAR)); 30 | 31 | _argv = (PCHAR)(((PUCHAR)argv) + i); 32 | 33 | argc = 0; 34 | argv[argc] = _argv; 35 | in_QM = FALSE; 36 | in_TEXT = FALSE; 37 | in_SPACE = TRUE; 38 | i = 0; 39 | j = 0; 40 | 41 | while (a = CmdLine[i]) { 42 | if (in_QM) { 43 | if (a == '\"') { 44 | in_QM = FALSE; 45 | } 46 | else { 47 | _argv[j] = a; 48 | j++; 49 | } 50 | } 51 | else { 52 | switch (a) { 53 | case '\"': 54 | in_QM = TRUE; 55 | in_TEXT = TRUE; 56 | if (in_SPACE) { 57 | argv[argc] = _argv + j; 58 | argc++; 59 | } 60 | in_SPACE = FALSE; 61 | break; 62 | case ' ': 63 | case '\t': 64 | case '\n': 65 | case '\r': 66 | if (in_TEXT) { 67 | _argv[j] = '\0'; 68 | j++; 69 | } 70 | in_TEXT = FALSE; 71 | in_SPACE = TRUE; 72 | break; 73 | default: 74 | in_TEXT = TRUE; 75 | if (in_SPACE) { 76 | argv[argc] = _argv + j; 77 | argc++; 78 | } 79 | _argv[j] = a; 80 | j++; 81 | in_SPACE = FALSE; 82 | break; 83 | } 84 | } 85 | i++; 86 | } 87 | _argv[j] = '\0'; 88 | argv[argc] = NULL; 89 | 90 | (*_argc) = argc; 91 | return argv; 92 | } 93 | 94 | BOOL FileExists(LPCTSTR szPath) 95 | { 96 | DWORD dwAttrib = GetFileAttributes(szPath); 97 | 98 | return (dwAttrib != INVALID_FILE_ATTRIBUTES && 99 | !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY)); 100 | } 101 | 102 | bool SH2Patcher::Init() 103 | { 104 | this->dwVideoWidth = (int)GetPrivateProfileInt("Video", "Width", 1280, ".\\sh2proxy.ini"); 105 | this->dwVideoHeight = (int)GetPrivateProfileInt("Video", "Height", 720, ".\\sh2proxy.ini"); 106 | this->bVideoWindowed = (GetPrivateProfileInt("Video", "Windowed", 0, ".\\sh2proxy.ini") == 1); 107 | 108 | this->bWindowBorderless = (GetPrivateProfileInt("Window", "Borderless", 0, ".\\sh2proxy.ini") == 1); 109 | this->bForceWindowBorderless = (GetPrivateProfileInt("Window", "ForceBorderless", 0, ".\\sh2proxy.ini") == 1); 110 | this->dwWindowX = GetPrivateProfileInt("Window", "PositionX", 0, ".\\sh2proxy.ini"); 111 | this->dwWindowY = GetPrivateProfileInt("Window", "PositionY", 0, ".\\sh2proxy.ini"); 112 | 113 | LPSTR *szArgList; 114 | int argCount; 115 | 116 | szArgList = CommandLineToArgvA(GetCommandLine(), &argCount); 117 | if (szArgList != NULL && argCount > 1) 118 | { 119 | for (int i = 1; i < argCount; i++) 120 | { 121 | char* pos = strstr(szArgList[i], "="); 122 | int intval = 0; 123 | if (pos != NULL) 124 | { 125 | pos += 1; 126 | intval = atoi(pos); 127 | } 128 | 129 | if (strstr(szArgList[i], "-width=") != NULL || strstr(szArgList[i], "-w=") != NULL) 130 | this->dwVideoWidth = intval; 131 | 132 | if (strstr(szArgList[i], "-height=") != NULL || strstr(szArgList[i], "-h=") != NULL) 133 | this->dwVideoHeight = intval; 134 | 135 | if (strcmp(szArgList[i], "-windowed") == 0 || strcmp(szArgList[i], "-window") == 0 || strcmp(szArgList[i], "-w") == 0) 136 | this->bVideoWindowed = true; 137 | 138 | if (strcmp(szArgList[i], "-fullscreen") == 0 || strcmp(szArgList[i], "-fs") == 0 || strcmp(szArgList[i], "-f") == 0) 139 | this->bVideoWindowed = false; 140 | 141 | if (strcmp(szArgList[i], "-borderless") == 0 || strcmp(szArgList[i], "-bl") == 0) 142 | this->bWindowBorderless = true; 143 | 144 | if (strcmp(szArgList[i], "-borders") == 0 || strcmp(szArgList[i], "-b") == 0) 145 | this->bWindowBorderless = false; 146 | 147 | if (strstr(szArgList[i], "-x=") != NULL) 148 | this->dwWindowX = intval; 149 | 150 | if (strstr(szArgList[i], "-y=") != NULL) 151 | this->dwWindowY = intval; 152 | } 153 | } 154 | 155 | this->bPatchSingleCore = (GetPrivateProfileInt("Patches", "SingleCoreAffinity", 1, ".\\sh2proxy.ini") == 1); 156 | this->bPatchDisableSafeMode = (GetPrivateProfileInt("Patches", "DisableSafeMode", 1, ".\\sh2proxy.ini") == 1); 157 | this->bPatchFastTransitions = (GetPrivateProfileInt("Patches", "FastTransitions", 1, ".\\sh2proxy.ini") == 1); 158 | 159 | this->wTransitionWidth = (int)GetPrivateProfileInt("Patches", "FastTransitionWidth", 0, ".\\sh2proxy.ini"); 160 | this->wTransitionHeight = (int)GetPrivateProfileInt("Patches", "FastTransitionHeight", 0, ".\\sh2proxy.ini"); 161 | 162 | this->bExtraCreateLocalFix = (GetPrivateProfileInt("Extra", "CreateLocalFix", 1, ".\\sh2proxy.ini") == 1); 163 | 164 | this->handle = GetCurrentProcess(); 165 | this->baseAddr = (DWORD_PTR)GetModuleHandle("sh2pc.exe"); 166 | 167 | if (this->IsSH2()) 168 | { 169 | this->PatchCode(); 170 | 171 | if (this->bExtraCreateLocalFix) 172 | { 173 | if (FileExists("local.fix")) 174 | return true; 175 | 176 | std::ofstream myfile; 177 | myfile.open("local.fix"); 178 | myfile << "HACK DX_CONFIG_DRIVER_AA_NOT_BROKEN 1"; 179 | myfile.close(); 180 | } 181 | } 182 | 183 | return true; 184 | } 185 | 186 | bool SH2Patcher::IsSH2() 187 | { 188 | byte test[0x15]; 189 | char* compare = "Silent_Hill_2_unique"; 190 | bool isSH2 = true; 191 | if (this->baseAddr != (DWORD_PTR)0x400000) 192 | return false; 193 | 194 | // read a location that we know contains this string 195 | ReadProcessMemory(this->handle, (LPVOID)0x62E074, test, 0x15, NULL); 196 | for (int i = 0; i < 0x14; i++) 197 | { 198 | if (test[i] == compare[i]) 199 | continue; 200 | isSH2 = false; 201 | break; 202 | } 203 | 204 | return isSH2; 205 | } 206 | 207 | bool SH2Patcher::PatchCode() 208 | { 209 | byte nop = 0x90; 210 | byte null = 0x0; 211 | 212 | // patches create window code to allow for custom height, x/y positions, window style and window title 213 | BYTE windowedPatch[] = { 0x68, 214 | 215 | // 0x1 - Window height 216 | 0x00, 0x00, 0x00, 0x00, 217 | 0x68, 218 | 219 | // 0x6 - Window width (default 0x80000000) 220 | 0x00, 0x00, 0x00, 0x80, 221 | 0x68, 222 | 223 | // 0xB - Window y pos 224 | 0x00, 0x00, 0x00, 0x00, 225 | 0x68, 226 | 227 | // 0x10 - Window x pos 228 | 0x00, 0x00, 0x00, 0x00, 229 | 0x68, 230 | 231 | // 0x15 - Window style, last byte to 0x80 for borderless 232 | 0x00, 0x00, 0x00, 0x00, 233 | 0x68, 234 | 235 | // 0x1A - Window title offset 236 | 0x4C, 0xE0, 0x62, 0x00, 237 | 0x68, 238 | 239 | // 0x1F - Window class offset 240 | 0x3C, 0xE0, 0x62, 0x00, 241 | 242 | 0x6A, 0x00, 0xFF, 0x15, 0xE4, 0x9A, 0x4A, 0x02, 0x85, 0xC0, 0xA3, 0x6C, 0x4D, 0x93, 0x00, 0x74, 243 | 0x21, 0x8B, 0x0D, 0xA4, 0x4D, 0x93, 0x00, 0x6A, 0x00, 0x68, 0xA8, 0x4D, 0x93, 0x00, 0x68, 0x18, 244 | 0x5E, 0x63, 0x00, 0x68, 0x00, 0x08, 0x00, 0x00, 0x51, 0xE8, 245 | 246 | // next byte needs updating if above size changed! 247 | 0x0E, 248 | 249 | 0x71, 0x03, 0x00, 0x85, 0xC0, 0x7D, 0x03, 0x33, 0xC0, 0xC3, 0x8B, 250 | 0x54, 0x24, 0x08, 0xA1, 0x6C, 0x4D, 0x93, 0x00, 0x52, 0x50, 0xFF, 0x15, 0xE0, 0x9A, 0x4A, 0x02, 251 | 0x8B, 0x0D, 0x6C, 0x4D, 0x93, 0x00, 0x51, 0xFF, 0x15, 0xDC, 0x9A, 0x4A, 0x02, 0xB8, 0x01, 0x00, 252 | 0x00, 0x00, 0xC3, 0x90, 0x90 }; 253 | 254 | // patches some code that afaik creates a snapshot of the game for use in eg. inventory status screen 255 | // it gets run every transition though (map/movie/etc) instead of just the inventory, and snapshotting 1080p+ can take a while 256 | // patch makes it use a static number instead of reading the current screen resolution from memory, allowing us to change it later on as needed 257 | BYTE transitionPatch[] = { 0x6A, 0x15, 0x68, 0x20, 0x03, 0x00, 0x00, 0x90, 0x90, 0x68, 0x58, 0x02, 0x00, 0x00, 0x90, 0x90 }; 258 | 259 | 260 | if (!this->IsSH2()) 261 | return false; 262 | 263 | if (this->bPatchSingleCore) 264 | { 265 | // set affinity to one core, fixes sound issues 266 | DWORD_PTR processAffinityMask = 1; 267 | SetProcessAffinityMask(this->handle, processAffinityMask); 268 | } 269 | 270 | if (this->bPatchDisableSafeMode) 271 | { 272 | // nop out the call to the safe mode function 273 | for (int i = 0; i < 5; i++) 274 | WriteProcessMemory(this->handle, (LPVOID)(0x4F6DC0 + i), &nop, 1, NULL); 275 | } 276 | 277 | if (this->bPatchFastTransitions) 278 | { 279 | // use ini height/width values if set, otherwise just use half the screen resolution 280 | int height = this->wTransitionHeight; 281 | if (height > this->dwVideoHeight) height = 0; 282 | if (height == 0) height = this->dwVideoHeight / 2; 283 | 284 | int width = this->wTransitionWidth; 285 | if (width > this->dwVideoWidth) height = 0; 286 | if (width == 0) width = this->dwVideoWidth / 2; 287 | 288 | memcpy(transitionPatch + 3, &height, 4); 289 | memcpy(transitionPatch + 10, &width, 4); 290 | 291 | WriteProcessMemory(this->handle, (LPVOID)(0x477518), &transitionPatch, sizeof(transitionPatch) / sizeof(BYTE), NULL); 292 | } 293 | 294 | // change the window code height and width 295 | memcpy(windowedPatch + 1, &this->dwVideoHeight, 4); 296 | memcpy(windowedPatch + 6, &this->dwVideoWidth, 4); 297 | 298 | // change window code x/y position 299 | memcpy(windowedPatch + 0xB, &this->dwWindowY, 4); 300 | memcpy(windowedPatch + 0x10, &this->dwWindowX, 4); 301 | 302 | if ((this->bVideoWindowed && this->bWindowBorderless) || this->bForceWindowBorderless ) // set CreateWindowExA exStyle param to 0x80000000 (WS_POPUP) 303 | windowedPatch[0x18] = 0x80; 304 | 305 | // patch window code to show gameTitle above as window title 306 | int gameTitleOffset = (int)&gameTitle; 307 | memcpy(windowedPatch + 0x1A, &gameTitleOffset, 4); 308 | 309 | WriteProcessMemory(this->handle, (LPVOID)(0x4063CB), &windowedPatch, sizeof(windowedPatch) / sizeof(BYTE), NULL); 310 | return true; 311 | } 312 | 313 | bool SH2Patcher::PatchResolution(D3DPRESENT_PARAMETERS* pPresentationParameters) 314 | { 315 | int safeMode = 0; 316 | int selectedRes = 1; 317 | int resCount = 5; 318 | 319 | // first offset in these arrays is the address of the main screen res choices (480p, 600p, etc) 320 | // code will loop on the first offset and fill in each of the screen resolutions (5 of them afaik) to be the same 321 | int widthPatch[3] = { 0x8A1474, 0xA35498, 0xA36080 }; 322 | int heightPatch[3] = { 0x8A1478, 0xA3549C, 0xA36084 }; 323 | 324 | if (pPresentationParameters) 325 | { 326 | // update the CreateDevice params 327 | pPresentationParameters->BackBufferWidth = this->dwVideoWidth; 328 | pPresentationParameters->BackBufferHeight = this->dwVideoHeight; 329 | pPresentationParameters->Windowed = this->bVideoWindowed; 330 | } 331 | 332 | if (!this->IsSH2()) 333 | return false; 334 | 335 | // disable safemode and selected resolution to 1, probably don't work but meh 336 | WriteProcessMemory(this->handle, (LPVOID)(0xA36024), &safeMode, 4, NULL); 337 | WriteProcessMemory(this->handle, (LPVOID)(0xA36028), &selectedRes, 4, NULL); 338 | 339 | // patch static + loaded widths and heights 340 | for (int i = 0; i < 3; i++) 341 | { 342 | int offWidth = widthPatch[i]; 343 | int offHeight = heightPatch[i]; 344 | 345 | int count = 1; 346 | if (i == 0) count = resCount; // if we're on the first set of patches (which are pointers to the first in the res selection) 347 | // then we'll patch all the resolutions on the selection 348 | 349 | for (int y = 0; y < count; y++) 350 | { 351 | WriteProcessMemory(this->handle, (LPVOID)(offWidth), &this->dwVideoWidth, 4, NULL); 352 | WriteProcessMemory(this->handle, (LPVOID)(offHeight), &this->dwVideoHeight, 4, NULL); 353 | offWidth += 8; 354 | offHeight += 8; 355 | } 356 | } 357 | 358 | return true; 359 | } -------------------------------------------------------------------------------- /SH2Proxy/myIDirect3DDevice8.cpp: -------------------------------------------------------------------------------- 1 | // myIDirect3DDevice8.cpp 2 | #include "stdafx.h" 3 | 4 | myIDirect3DDevice8::myIDirect3DDevice8(IDirect3DDevice8* pOriginal) 5 | { 6 | m_pIDirect3DDevice8 = pOriginal; // store the pointer to original object 7 | } 8 | 9 | myIDirect3DDevice8::~myIDirect3DDevice8() 10 | { 11 | 12 | } 13 | 14 | HRESULT __stdcall myIDirect3DDevice8::QueryInterface(REFIID riid, void** ppvObj) 15 | { 16 | // check if original dll can provide an interface. then send *our* address 17 | *ppvObj = NULL; 18 | 19 | HRESULT hRes = m_pIDirect3DDevice8->QueryInterface(riid, ppvObj); 20 | 21 | if (hRes == NOERROR) 22 | { 23 | *ppvObj = this; 24 | } 25 | 26 | return hRes; 27 | } 28 | 29 | ULONG __stdcall myIDirect3DDevice8::AddRef(void) 30 | { 31 | return (m_pIDirect3DDevice8->AddRef()); 32 | } 33 | 34 | ULONG __stdcall myIDirect3DDevice8::Release(void) 35 | { 36 | // ATTENTION: This is a booby-trap ! Watch out ! 37 | // If we create our own sprites, surfaces, etc. (thus increasing the ref counter 38 | // by external action), we need to delete that objects before calling the original 39 | // Release function 40 | 41 | // global var 42 | extern myIDirect3DDevice8* gl_pmyIDirect3DDevice8; 43 | 44 | // release/delete own objects 45 | // ... here if any ... 46 | 47 | // Calling original function now 48 | ULONG count = m_pIDirect3DDevice8->Release(); 49 | 50 | // now, the Original Object has deleted itself, so do we here 51 | gl_pmyIDirect3DDevice8 = NULL; 52 | delete(this); // destructor will be called automatically 53 | 54 | return (count); 55 | } 56 | 57 | HRESULT __stdcall myIDirect3DDevice8::TestCooperativeLevel(void) 58 | { 59 | return (m_pIDirect3DDevice8->TestCooperativeLevel()); 60 | } 61 | 62 | UINT __stdcall myIDirect3DDevice8::GetAvailableTextureMem(void) 63 | { 64 | return (m_pIDirect3DDevice8->GetAvailableTextureMem()); 65 | } 66 | 67 | HRESULT __stdcall myIDirect3DDevice8::ResourceManagerDiscardBytes(DWORD Bytes) 68 | { 69 | return (m_pIDirect3DDevice8->ResourceManagerDiscardBytes(Bytes)); 70 | } 71 | 72 | HRESULT __stdcall myIDirect3DDevice8::GetDirect3D(IDirect3D8** ppD3D8) 73 | { 74 | return (m_pIDirect3DDevice8->GetDirect3D(ppD3D8)); 75 | } 76 | 77 | HRESULT __stdcall myIDirect3DDevice8::GetDeviceCaps(D3DCAPS8* pCaps) 78 | { 79 | return (m_pIDirect3DDevice8->GetDeviceCaps(pCaps)); 80 | } 81 | 82 | HRESULT __stdcall myIDirect3DDevice8::GetDisplayMode(D3DDISPLAYMODE* pMode) 83 | { 84 | return (m_pIDirect3DDevice8->GetDisplayMode(pMode)); 85 | } 86 | 87 | HRESULT __stdcall myIDirect3DDevice8::GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters) 88 | { 89 | return (m_pIDirect3DDevice8->GetCreationParameters(pParameters)); 90 | } 91 | 92 | HRESULT __stdcall myIDirect3DDevice8::SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface8* pCursorBitmap) 93 | { 94 | return (m_pIDirect3DDevice8->SetCursorProperties(XHotSpot, YHotSpot, pCursorBitmap)); 95 | } 96 | 97 | void __stdcall myIDirect3DDevice8::SetCursorPosition(UINT XScreenSpace, UINT YScreenSpace, DWORD Flags) 98 | { 99 | m_pIDirect3DDevice8->SetCursorPosition(XScreenSpace, YScreenSpace, Flags); 100 | } 101 | 102 | BOOL __stdcall myIDirect3DDevice8::ShowCursor(BOOL bShow) 103 | { 104 | return (m_pIDirect3DDevice8->ShowCursor(bShow)); 105 | } 106 | 107 | HRESULT __stdcall myIDirect3DDevice8::CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain8** pSwapChain) 108 | { 109 | return (m_pIDirect3DDevice8->CreateAdditionalSwapChain(pPresentationParameters, pSwapChain)); 110 | } 111 | 112 | HRESULT __stdcall myIDirect3DDevice8::Reset(D3DPRESENT_PARAMETERS* pPresentationParameters) 113 | { 114 | return (m_pIDirect3DDevice8->Reset(pPresentationParameters)); 115 | } 116 | 117 | HRESULT __stdcall myIDirect3DDevice8::Present(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion) 118 | { 119 | // we may want to draw own things here before flipping surfaces 120 | // ... draw own stuff ... 121 | this->ShowWeAreHere(); 122 | 123 | // call original routine 124 | HRESULT hres = m_pIDirect3DDevice8->Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion); 125 | 126 | return (hres); 127 | } 128 | 129 | HRESULT __stdcall myIDirect3DDevice8::GetBackBuffer(UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface8** ppBackBuffer) 130 | { 131 | return (m_pIDirect3DDevice8->GetBackBuffer(BackBuffer, Type, ppBackBuffer)); 132 | } 133 | 134 | HRESULT __stdcall myIDirect3DDevice8::GetRasterStatus(D3DRASTER_STATUS* pRasterStatus) 135 | { 136 | return (m_pIDirect3DDevice8->GetRasterStatus(pRasterStatus)); 137 | } 138 | 139 | void __stdcall myIDirect3DDevice8::SetGammaRamp(DWORD Flags, CONST D3DGAMMARAMP* pRamp) 140 | { 141 | m_pIDirect3DDevice8->SetGammaRamp(Flags, pRamp); 142 | } 143 | 144 | void __stdcall myIDirect3DDevice8::GetGammaRamp(D3DGAMMARAMP* pRamp) 145 | { 146 | m_pIDirect3DDevice8->GetGammaRamp(pRamp); 147 | } 148 | 149 | HRESULT __stdcall myIDirect3DDevice8::CreateTexture(UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture8** ppTexture) 150 | { 151 | return (m_pIDirect3DDevice8->CreateTexture(Width, Height, Levels, Usage, Format, Pool, ppTexture)); 152 | } 153 | 154 | HRESULT __stdcall myIDirect3DDevice8::CreateVolumeTexture(UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture8** ppVolumeTexture) 155 | { 156 | return (m_pIDirect3DDevice8->CreateVolumeTexture(Width, Height, Depth, Levels, Usage, Format, Pool, ppVolumeTexture)); 157 | } 158 | 159 | HRESULT __stdcall myIDirect3DDevice8::CreateCubeTexture(UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture8** ppCubeTexture) 160 | { 161 | return (m_pIDirect3DDevice8->CreateCubeTexture(EdgeLength, Levels, Usage, Format, Pool, ppCubeTexture)); 162 | } 163 | 164 | HRESULT __stdcall myIDirect3DDevice8::CreateVertexBuffer(UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer8** ppVertexBuffer) 165 | { 166 | return (m_pIDirect3DDevice8->CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer)); 167 | } 168 | 169 | HRESULT __stdcall myIDirect3DDevice8::CreateIndexBuffer(UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer8** ppIndexBuffer) 170 | { 171 | return (m_pIDirect3DDevice8->CreateIndexBuffer(Length, Usage, Format, Pool, ppIndexBuffer)); 172 | } 173 | 174 | HRESULT __stdcall myIDirect3DDevice8::CreateRenderTarget(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, BOOL Lockable, IDirect3DSurface8** ppSurface) 175 | { 176 | return (m_pIDirect3DDevice8->CreateRenderTarget(Width, Height, Format, MultiSample, Lockable, ppSurface)); 177 | } 178 | 179 | HRESULT __stdcall myIDirect3DDevice8::CreateDepthStencilSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, IDirect3DSurface8** ppSurface) 180 | { 181 | return (m_pIDirect3DDevice8->CreateDepthStencilSurface(Width, Height, Format, MultiSample, ppSurface)); 182 | } 183 | 184 | HRESULT __stdcall myIDirect3DDevice8::CreateImageSurface(UINT Width, UINT Height, D3DFORMAT Format, IDirect3DSurface8** ppSurface) 185 | { 186 | return (m_pIDirect3DDevice8->CreateImageSurface(Width, Height, Format, ppSurface)); 187 | } 188 | 189 | HRESULT __stdcall myIDirect3DDevice8::CopyRects(IDirect3DSurface8* pSourceSurface, CONST RECT* pSourceRectsArray, UINT cRects, IDirect3DSurface8* pDestinationSurface, CONST POINT* pDestPointsArray) 190 | { 191 | return (m_pIDirect3DDevice8->CopyRects(pSourceSurface, pSourceRectsArray, cRects, pDestinationSurface, pDestPointsArray)); 192 | } 193 | 194 | HRESULT __stdcall myIDirect3DDevice8::UpdateTexture(IDirect3DBaseTexture8* pSourceTexture, IDirect3DBaseTexture8* pDestinationTexture) 195 | { 196 | return (m_pIDirect3DDevice8->UpdateTexture(pSourceTexture, pDestinationTexture)); 197 | } 198 | 199 | HRESULT __stdcall myIDirect3DDevice8::GetFrontBuffer(IDirect3DSurface8* pDestSurface) 200 | { 201 | return (m_pIDirect3DDevice8->GetFrontBuffer(pDestSurface)); 202 | } 203 | 204 | HRESULT __stdcall myIDirect3DDevice8::SetRenderTarget(IDirect3DSurface8* pRenderTarget, IDirect3DSurface8* pNewZStencil) 205 | { 206 | return (m_pIDirect3DDevice8->SetRenderTarget(pRenderTarget, pNewZStencil)); 207 | } 208 | 209 | HRESULT __stdcall myIDirect3DDevice8::GetRenderTarget(IDirect3DSurface8** ppRenderTarget) 210 | { 211 | return (m_pIDirect3DDevice8->GetRenderTarget(ppRenderTarget)); 212 | } 213 | 214 | HRESULT __stdcall myIDirect3DDevice8::GetDepthStencilSurface(IDirect3DSurface8** ppZStencilSurface) 215 | { 216 | return (m_pIDirect3DDevice8->GetDepthStencilSurface(ppZStencilSurface)); 217 | } 218 | 219 | HRESULT __stdcall myIDirect3DDevice8::BeginScene(void) 220 | { 221 | return (m_pIDirect3DDevice8->BeginScene()); 222 | } 223 | 224 | HRESULT __stdcall myIDirect3DDevice8::EndScene(void) 225 | { 226 | return (m_pIDirect3DDevice8->EndScene()); 227 | } 228 | 229 | HRESULT __stdcall myIDirect3DDevice8::Clear(DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) 230 | { 231 | return (m_pIDirect3DDevice8->Clear(Count, pRects, Flags, Color, Z, Stencil)); 232 | } 233 | 234 | HRESULT __stdcall myIDirect3DDevice8::SetTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) 235 | { 236 | return (m_pIDirect3DDevice8->SetTransform(State, pMatrix)); 237 | } 238 | 239 | HRESULT __stdcall myIDirect3DDevice8::GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) 240 | { 241 | return (m_pIDirect3DDevice8->GetTransform(State, pMatrix)); 242 | } 243 | 244 | HRESULT __stdcall myIDirect3DDevice8::MultiplyTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) 245 | { 246 | return (m_pIDirect3DDevice8->MultiplyTransform(State, pMatrix)); 247 | } 248 | 249 | HRESULT __stdcall myIDirect3DDevice8::SetViewport(CONST D3DVIEWPORT8* pViewport) 250 | { 251 | return (m_pIDirect3DDevice8->SetViewport(pViewport)); 252 | } 253 | 254 | HRESULT __stdcall myIDirect3DDevice8::GetViewport(D3DVIEWPORT8* pViewport) 255 | { 256 | return (m_pIDirect3DDevice8->GetViewport(pViewport)); 257 | } 258 | 259 | HRESULT __stdcall myIDirect3DDevice8::SetMaterial(CONST D3DMATERIAL8* pMaterial) 260 | { 261 | return (m_pIDirect3DDevice8->SetMaterial(pMaterial)); 262 | } 263 | 264 | HRESULT __stdcall myIDirect3DDevice8::GetMaterial(D3DMATERIAL8* pMaterial) 265 | { 266 | return (m_pIDirect3DDevice8->GetMaterial(pMaterial)); 267 | } 268 | 269 | HRESULT __stdcall myIDirect3DDevice8::SetLight(DWORD Index, CONST D3DLIGHT8* pLight) 270 | { 271 | return (m_pIDirect3DDevice8->SetLight(Index, pLight)); 272 | } 273 | 274 | HRESULT __stdcall myIDirect3DDevice8::GetLight(DWORD Index, D3DLIGHT8* pLight) 275 | { 276 | return (m_pIDirect3DDevice8->GetLight(Index, pLight)); 277 | } 278 | 279 | HRESULT __stdcall myIDirect3DDevice8::LightEnable(DWORD Index, BOOL Enable) 280 | { 281 | return (m_pIDirect3DDevice8->LightEnable(Index, Enable)); 282 | } 283 | 284 | HRESULT __stdcall myIDirect3DDevice8::GetLightEnable(DWORD Index, BOOL* pEnable) 285 | { 286 | return (m_pIDirect3DDevice8->GetLightEnable(Index, pEnable)); 287 | } 288 | 289 | HRESULT __stdcall myIDirect3DDevice8::SetClipPlane(DWORD Index, CONST float* pPlane) 290 | { 291 | return (m_pIDirect3DDevice8->SetClipPlane(Index, pPlane)); 292 | } 293 | 294 | HRESULT __stdcall myIDirect3DDevice8::GetClipPlane(DWORD Index, float* pPlane) 295 | { 296 | return (m_pIDirect3DDevice8->GetClipPlane(Index, pPlane)); 297 | } 298 | 299 | HRESULT __stdcall myIDirect3DDevice8::SetRenderState(D3DRENDERSTATETYPE State, DWORD Value) 300 | { 301 | return (m_pIDirect3DDevice8->SetRenderState(State, Value)); 302 | } 303 | 304 | HRESULT __stdcall myIDirect3DDevice8::GetRenderState(D3DRENDERSTATETYPE State, DWORD* pValue) 305 | { 306 | return (m_pIDirect3DDevice8->GetRenderState(State, pValue)); 307 | } 308 | 309 | HRESULT __stdcall myIDirect3DDevice8::BeginStateBlock(void) 310 | { 311 | return (m_pIDirect3DDevice8->BeginStateBlock()); 312 | } 313 | 314 | HRESULT __stdcall myIDirect3DDevice8::EndStateBlock(DWORD* pToken) 315 | { 316 | return (m_pIDirect3DDevice8->EndStateBlock(pToken)); 317 | } 318 | 319 | HRESULT __stdcall myIDirect3DDevice8::ApplyStateBlock(DWORD Token) 320 | { 321 | return (m_pIDirect3DDevice8->ApplyStateBlock(Token)); 322 | } 323 | 324 | HRESULT __stdcall myIDirect3DDevice8::CaptureStateBlock(DWORD Token) 325 | { 326 | return (m_pIDirect3DDevice8->CaptureStateBlock(Token)); 327 | } 328 | 329 | HRESULT __stdcall myIDirect3DDevice8::DeleteStateBlock(DWORD Token) 330 | { 331 | return (m_pIDirect3DDevice8->DeleteStateBlock(Token)); 332 | } 333 | 334 | HRESULT __stdcall myIDirect3DDevice8::CreateStateBlock(D3DSTATEBLOCKTYPE Type, DWORD* pToken) 335 | { 336 | return (m_pIDirect3DDevice8->CreateStateBlock(Type, pToken)); 337 | } 338 | 339 | HRESULT __stdcall myIDirect3DDevice8::SetClipStatus(CONST D3DCLIPSTATUS8* pClipStatus) 340 | { 341 | return (m_pIDirect3DDevice8->SetClipStatus(pClipStatus)); 342 | } 343 | 344 | HRESULT __stdcall myIDirect3DDevice8::GetClipStatus(D3DCLIPSTATUS8* pClipStatus) 345 | { 346 | return (m_pIDirect3DDevice8->GetClipStatus(pClipStatus)); 347 | } 348 | 349 | HRESULT __stdcall myIDirect3DDevice8::GetTexture(DWORD Stage, IDirect3DBaseTexture8** ppTexture) 350 | { 351 | return (m_pIDirect3DDevice8->GetTexture(Stage, ppTexture)); 352 | } 353 | 354 | HRESULT __stdcall myIDirect3DDevice8::SetTexture(DWORD Stage, IDirect3DBaseTexture8* pTexture) 355 | { 356 | return (m_pIDirect3DDevice8->SetTexture(Stage, pTexture)); 357 | } 358 | 359 | HRESULT __stdcall myIDirect3DDevice8::GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) 360 | { 361 | return (m_pIDirect3DDevice8->GetTextureStageState(Stage, Type, pValue)); 362 | } 363 | 364 | HRESULT __stdcall myIDirect3DDevice8::SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) 365 | { 366 | return (m_pIDirect3DDevice8->SetTextureStageState(Stage, Type, Value)); 367 | } 368 | 369 | HRESULT __stdcall myIDirect3DDevice8::ValidateDevice(DWORD* pNumPasses) 370 | { 371 | return (m_pIDirect3DDevice8->ValidateDevice(pNumPasses)); 372 | } 373 | 374 | HRESULT __stdcall myIDirect3DDevice8::GetInfo(DWORD DevInfoID, void* pDevInfoStruct, DWORD DevInfoStructSize) 375 | { 376 | return (m_pIDirect3DDevice8->GetInfo(DevInfoID, pDevInfoStruct, DevInfoStructSize)); 377 | } 378 | 379 | HRESULT __stdcall myIDirect3DDevice8::SetPaletteEntries(UINT PaletteNumber, CONST PALETTEENTRY* pEntries) 380 | { 381 | return (m_pIDirect3DDevice8->SetPaletteEntries(PaletteNumber, pEntries)); 382 | } 383 | 384 | HRESULT __stdcall myIDirect3DDevice8::GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY* pEntries) 385 | { 386 | return (m_pIDirect3DDevice8->GetPaletteEntries(PaletteNumber, pEntries)); 387 | } 388 | 389 | HRESULT __stdcall myIDirect3DDevice8::SetCurrentTexturePalette(UINT PaletteNumber) 390 | { 391 | return (m_pIDirect3DDevice8->SetCurrentTexturePalette(PaletteNumber)); 392 | } 393 | 394 | HRESULT __stdcall myIDirect3DDevice8::GetCurrentTexturePalette(UINT *PaletteNumber) 395 | { 396 | return (m_pIDirect3DDevice8->GetCurrentTexturePalette(PaletteNumber)); 397 | } 398 | 399 | HRESULT __stdcall myIDirect3DDevice8::DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) 400 | { 401 | return (m_pIDirect3DDevice8->DrawPrimitive(PrimitiveType, StartVertex, PrimitiveCount)); 402 | } 403 | 404 | HRESULT __stdcall myIDirect3DDevice8::DrawIndexedPrimitive(D3DPRIMITIVETYPE Type, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount) 405 | { 406 | return (m_pIDirect3DDevice8->DrawIndexedPrimitive(Type, minIndex, NumVertices, startIndex, primCount)); 407 | } 408 | 409 | HRESULT __stdcall myIDirect3DDevice8::DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) 410 | { 411 | return (m_pIDirect3DDevice8->DrawPrimitiveUP(PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride)); 412 | } 413 | 414 | HRESULT __stdcall myIDirect3DDevice8::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertexIndices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) 415 | { 416 | return (m_pIDirect3DDevice8->DrawIndexedPrimitiveUP(PrimitiveType, MinVertexIndex, NumVertexIndices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride)); 417 | } 418 | 419 | HRESULT __stdcall myIDirect3DDevice8::ProcessVertices(UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer8* pDestBuffer, DWORD Flags) 420 | { 421 | return (m_pIDirect3DDevice8->ProcessVertices(SrcStartIndex, DestIndex, VertexCount, pDestBuffer, Flags)); 422 | } 423 | 424 | HRESULT __stdcall myIDirect3DDevice8::CreateVertexShader(CONST DWORD* pDeclaration, CONST DWORD* pFunction, DWORD* pHandle, DWORD Usage) 425 | { 426 | return (m_pIDirect3DDevice8->CreateVertexShader(pDeclaration, pFunction, pHandle, Usage)); 427 | } 428 | 429 | HRESULT __stdcall myIDirect3DDevice8::SetVertexShader(DWORD Handle) 430 | { 431 | return (m_pIDirect3DDevice8->SetVertexShader(Handle)); 432 | } 433 | 434 | HRESULT __stdcall myIDirect3DDevice8::GetVertexShader(DWORD* pHandle) 435 | { 436 | return (m_pIDirect3DDevice8->GetVertexShader(pHandle)); 437 | } 438 | 439 | HRESULT __stdcall myIDirect3DDevice8::DeleteVertexShader(DWORD Handle) 440 | { 441 | return (m_pIDirect3DDevice8->DeleteVertexShader(Handle)); 442 | } 443 | 444 | HRESULT __stdcall myIDirect3DDevice8::SetVertexShaderConstant(DWORD Register, CONST void* pConstantData, DWORD ConstantCount) 445 | { 446 | return (m_pIDirect3DDevice8->SetVertexShaderConstant(Register, pConstantData, ConstantCount)); 447 | } 448 | 449 | HRESULT __stdcall myIDirect3DDevice8::GetVertexShaderConstant(DWORD Register, void* pConstantData, DWORD ConstantCount) 450 | { 451 | return (m_pIDirect3DDevice8->GetVertexShaderConstant(Register, pConstantData, ConstantCount)); 452 | } 453 | 454 | HRESULT __stdcall myIDirect3DDevice8::GetVertexShaderDeclaration(DWORD Handle, void* pData, DWORD* pSizeOfData) 455 | { 456 | return (m_pIDirect3DDevice8->GetVertexShaderDeclaration(Handle, pData, pSizeOfData)); 457 | } 458 | 459 | HRESULT __stdcall myIDirect3DDevice8::GetVertexShaderFunction(DWORD Handle, void* pData, DWORD* pSizeOfData) 460 | { 461 | return (m_pIDirect3DDevice8->GetVertexShaderFunction(Handle, pData, pSizeOfData)); 462 | } 463 | 464 | HRESULT __stdcall myIDirect3DDevice8::SetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer8* pStreamData, UINT Stride) 465 | { 466 | return (m_pIDirect3DDevice8->SetStreamSource(StreamNumber, pStreamData, Stride)); 467 | } 468 | 469 | HRESULT __stdcall myIDirect3DDevice8::GetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer8** ppStreamData, UINT* pStride) 470 | { 471 | return (m_pIDirect3DDevice8->GetStreamSource(StreamNumber, ppStreamData, pStride)); 472 | } 473 | 474 | HRESULT __stdcall myIDirect3DDevice8::SetIndices(IDirect3DIndexBuffer8* pIndexData, UINT BaseVertexIndex) 475 | { 476 | return (m_pIDirect3DDevice8->SetIndices(pIndexData, BaseVertexIndex)); 477 | } 478 | 479 | HRESULT __stdcall myIDirect3DDevice8::GetIndices(IDirect3DIndexBuffer8** ppIndexData, UINT* pBaseVertexIndex) 480 | { 481 | return (m_pIDirect3DDevice8->GetIndices(ppIndexData, pBaseVertexIndex)); 482 | } 483 | 484 | HRESULT __stdcall myIDirect3DDevice8::CreatePixelShader(CONST DWORD* pFunction, DWORD* pHandle) 485 | { 486 | return (m_pIDirect3DDevice8->CreatePixelShader(pFunction, pHandle)); 487 | } 488 | 489 | HRESULT __stdcall myIDirect3DDevice8::SetPixelShader(DWORD Handle) 490 | { 491 | return (m_pIDirect3DDevice8->SetPixelShader(Handle)); 492 | } 493 | 494 | HRESULT __stdcall myIDirect3DDevice8::GetPixelShader(DWORD* pHandle) 495 | { 496 | return (m_pIDirect3DDevice8->GetPixelShader(pHandle)); 497 | } 498 | 499 | HRESULT __stdcall myIDirect3DDevice8::DeletePixelShader(DWORD Handle) 500 | { 501 | return (m_pIDirect3DDevice8->DeletePixelShader(Handle)); 502 | } 503 | 504 | HRESULT __stdcall myIDirect3DDevice8::SetPixelShaderConstant(DWORD Register, CONST void* pConstantData, DWORD ConstantCount) 505 | { 506 | return (m_pIDirect3DDevice8->SetPixelShaderConstant(Register, pConstantData, ConstantCount)); 507 | } 508 | 509 | HRESULT __stdcall myIDirect3DDevice8::GetPixelShaderConstant(DWORD Register, void* pConstantData, DWORD ConstantCount) 510 | { 511 | return (m_pIDirect3DDevice8->GetPixelShaderConstant(Register, pConstantData, ConstantCount)); 512 | } 513 | 514 | HRESULT __stdcall myIDirect3DDevice8::GetPixelShaderFunction(DWORD Handle, void* pData, DWORD* pSizeOfData) 515 | { 516 | return (m_pIDirect3DDevice8->GetPixelShaderFunction(Handle, pData, pSizeOfData)); 517 | } 518 | 519 | HRESULT __stdcall myIDirect3DDevice8::DrawRectPatch(UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) 520 | { 521 | return (m_pIDirect3DDevice8->DrawRectPatch(Handle, pNumSegs, pRectPatchInfo)); 522 | } 523 | 524 | HRESULT __stdcall myIDirect3DDevice8::DrawTriPatch(UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo) 525 | { 526 | return (m_pIDirect3DDevice8->DrawTriPatch(Handle, pNumSegs, pTriPatchInfo)); 527 | } 528 | 529 | HRESULT __stdcall myIDirect3DDevice8::DeletePatch(UINT Handle) 530 | { 531 | return (m_pIDirect3DDevice8->DeletePatch(Handle)); 532 | } 533 | 534 | 535 | // This is our test function 536 | void myIDirect3DDevice8::ShowWeAreHere(void) 537 | { 538 | //D3DRECT rec = { 1, 1, 50, 50 }; 539 | //m_pIDirect3DDevice8->Clear(1, &rec, D3DCLEAR_TARGET, D3DCOLOR_ARGB(255, 255, 255, 0), 0, 0); 540 | } 541 | -------------------------------------------------------------------------------- /SH2Proxy/d3d8.h: -------------------------------------------------------------------------------- 1 | /*==========================================================================; 2 | * 3 | * Copyright (C) Microsoft Corporation. All Rights Reserved. 4 | * 5 | * File: d3d8.h 6 | * Content: Direct3D include file 7 | * 8 | ****************************************************************************/ 9 | 10 | #ifndef _D3D8_H_ 11 | #define _D3D8_H_ 12 | 13 | #ifndef DIRECT3D_VERSION 14 | #define DIRECT3D_VERSION 0x0800 15 | #endif //DIRECT3D_VERSION 16 | 17 | // include this file content only if compiling for DX8 interfaces 18 | #if(DIRECT3D_VERSION >= 0x0800) 19 | 20 | 21 | /* This identifier is passed to Direct3DCreate8 in order to ensure that an 22 | * application was built against the correct header files. This number is 23 | * incremented whenever a header (or other) change would require applications 24 | * to be rebuilt. If the version doesn't match, Direct3DCreate8 will fail. 25 | * (The number itself has no meaning.)*/ 26 | 27 | #define D3D_SDK_VERSION 220 28 | 29 | #include 30 | 31 | #define COM_NO_WINDOWS_H 32 | #include 33 | 34 | #include 35 | 36 | #if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500) 37 | #define HMONITOR_DECLARED 38 | DECLARE_HANDLE(HMONITOR); 39 | #endif 40 | 41 | #define D3DAPI WINAPI 42 | 43 | /* 44 | * Interface IID's 45 | */ 46 | #if defined( _WIN32 ) && !defined( _NO_COM) 47 | 48 | /* IID_IDirect3D8 */ 49 | /* {1DD9E8DA-1C77-4d40-B0CF-98FEFDFF9512} */ 50 | DEFINE_GUID(IID_IDirect3D8, 0x1dd9e8da, 0x1c77, 0x4d40, 0xb0, 0xcf, 0x98, 0xfe, 0xfd, 0xff, 0x95, 0x12); 51 | 52 | /* IID_IDirect3DDevice8 */ 53 | /* {7385E5DF-8FE8-41D5-86B6-D7B48547B6CF} */ 54 | DEFINE_GUID(IID_IDirect3DDevice8, 0x7385e5df, 0x8fe8, 0x41d5, 0x86, 0xb6, 0xd7, 0xb4, 0x85, 0x47, 0xb6, 0xcf); 55 | 56 | /* IID_IDirect3DResource8 */ 57 | /* {1B36BB7B-09B7-410a-B445-7D1430D7B33F} */ 58 | DEFINE_GUID(IID_IDirect3DResource8, 0x1b36bb7b, 0x9b7, 0x410a, 0xb4, 0x45, 0x7d, 0x14, 0x30, 0xd7, 0xb3, 0x3f); 59 | 60 | /* IID_IDirect3DBaseTexture8 */ 61 | /* {B4211CFA-51B9-4a9f-AB78-DB99B2BB678E} */ 62 | DEFINE_GUID(IID_IDirect3DBaseTexture8, 0xb4211cfa, 0x51b9, 0x4a9f, 0xab, 0x78, 0xdb, 0x99, 0xb2, 0xbb, 0x67, 0x8e); 63 | 64 | /* IID_IDirect3DTexture8 */ 65 | /* {E4CDD575-2866-4f01-B12E-7EECE1EC9358} */ 66 | DEFINE_GUID(IID_IDirect3DTexture8, 0xe4cdd575, 0x2866, 0x4f01, 0xb1, 0x2e, 0x7e, 0xec, 0xe1, 0xec, 0x93, 0x58); 67 | 68 | /* IID_IDirect3DCubeTexture8 */ 69 | /* {3EE5B968-2ACA-4c34-8BB5-7E0C3D19B750} */ 70 | DEFINE_GUID(IID_IDirect3DCubeTexture8, 0x3ee5b968, 0x2aca, 0x4c34, 0x8b, 0xb5, 0x7e, 0x0c, 0x3d, 0x19, 0xb7, 0x50); 71 | 72 | /* IID_IDirect3DVolumeTexture8 */ 73 | /* {4B8AAAFA-140F-42ba-9131-597EAFAA2EAD} */ 74 | DEFINE_GUID(IID_IDirect3DVolumeTexture8, 0x4b8aaafa, 0x140f, 0x42ba, 0x91, 0x31, 0x59, 0x7e, 0xaf, 0xaa, 0x2e, 0xad); 75 | 76 | /* IID_IDirect3DVertexBuffer8 */ 77 | /* {8AEEEAC7-05F9-44d4-B591-000B0DF1CB95} */ 78 | DEFINE_GUID(IID_IDirect3DVertexBuffer8, 0x8aeeeac7, 0x05f9, 0x44d4, 0xb5, 0x91, 0x00, 0x0b, 0x0d, 0xf1, 0xcb, 0x95); 79 | 80 | /* IID_IDirect3DIndexBuffer8 */ 81 | /* {0E689C9A-053D-44a0-9D92-DB0E3D750F86} */ 82 | DEFINE_GUID(IID_IDirect3DIndexBuffer8, 0x0e689c9a, 0x053d, 0x44a0, 0x9d, 0x92, 0xdb, 0x0e, 0x3d, 0x75, 0x0f, 0x86); 83 | 84 | /* IID_IDirect3DSurface8 */ 85 | /* {B96EEBCA-B326-4ea5-882F-2FF5BAE021DD} */ 86 | DEFINE_GUID(IID_IDirect3DSurface8, 0xb96eebca, 0xb326, 0x4ea5, 0x88, 0x2f, 0x2f, 0xf5, 0xba, 0xe0, 0x21, 0xdd); 87 | 88 | /* IID_IDirect3DVolume8 */ 89 | /* {BD7349F5-14F1-42e4-9C79-972380DB40C0} */ 90 | DEFINE_GUID(IID_IDirect3DVolume8, 0xbd7349f5, 0x14f1, 0x42e4, 0x9c, 0x79, 0x97, 0x23, 0x80, 0xdb, 0x40, 0xc0); 91 | 92 | /* IID_IDirect3DSwapChain8 */ 93 | /* {928C088B-76B9-4C6B-A536-A590853876CD} */ 94 | DEFINE_GUID(IID_IDirect3DSwapChain8, 0x928c088b, 0x76b9, 0x4c6b, 0xa5, 0x36, 0xa5, 0x90, 0x85, 0x38, 0x76, 0xcd); 95 | 96 | #endif 97 | 98 | #ifdef __cplusplus 99 | 100 | interface IDirect3D8; 101 | interface IDirect3DDevice8; 102 | 103 | interface IDirect3DResource8; 104 | interface IDirect3DBaseTexture8; 105 | interface IDirect3DTexture8; 106 | interface IDirect3DVolumeTexture8; 107 | interface IDirect3DCubeTexture8; 108 | 109 | interface IDirect3DVertexBuffer8; 110 | interface IDirect3DIndexBuffer8; 111 | 112 | interface IDirect3DSurface8; 113 | interface IDirect3DVolume8; 114 | 115 | interface IDirect3DSwapChain8; 116 | 117 | #endif 118 | 119 | 120 | typedef interface IDirect3D8 IDirect3D8; 121 | typedef interface IDirect3DDevice8 IDirect3DDevice8; 122 | typedef interface IDirect3DResource8 IDirect3DResource8; 123 | typedef interface IDirect3DBaseTexture8 IDirect3DBaseTexture8; 124 | typedef interface IDirect3DTexture8 IDirect3DTexture8; 125 | typedef interface IDirect3DVolumeTexture8 IDirect3DVolumeTexture8; 126 | typedef interface IDirect3DCubeTexture8 IDirect3DCubeTexture8; 127 | typedef interface IDirect3DVertexBuffer8 IDirect3DVertexBuffer8; 128 | typedef interface IDirect3DIndexBuffer8 IDirect3DIndexBuffer8; 129 | typedef interface IDirect3DSurface8 IDirect3DSurface8; 130 | typedef interface IDirect3DVolume8 IDirect3DVolume8; 131 | typedef interface IDirect3DSwapChain8 IDirect3DSwapChain8; 132 | 133 | #include "d3d8types.h" 134 | #include "d3d8caps.h" 135 | 136 | 137 | #ifdef __cplusplus 138 | extern "C" { 139 | #endif 140 | 141 | /* 142 | * DLL Function for creating a Direct3D8 object. This object supports 143 | * enumeration and allows the creation of Direct3DDevice8 objects. 144 | * Pass the value of the constant D3D_SDK_VERSION to this function, so 145 | * that the run-time can validate that your application was compiled 146 | * against the right headers. 147 | */ 148 | 149 | IDirect3D8 * WINAPI Direct3DCreate8(UINT SDKVersion); 150 | 151 | 152 | /* 153 | * Direct3D interfaces 154 | */ 155 | 156 | 157 | 158 | 159 | 160 | 161 | #undef INTERFACE 162 | #define INTERFACE IDirect3D8 163 | 164 | DECLARE_INTERFACE_(IDirect3D8, IUnknown) 165 | { 166 | /*** IUnknown methods ***/ 167 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 168 | STDMETHOD_(ULONG, AddRef)(THIS)PURE; 169 | STDMETHOD_(ULONG, Release)(THIS)PURE; 170 | 171 | /*** IDirect3D8 methods ***/ 172 | STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE; 173 | STDMETHOD_(UINT, GetAdapterCount)(THIS)PURE; 174 | STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER8* pIdentifier) PURE; 175 | STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter) PURE; 176 | STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter, UINT Mode, D3DDISPLAYMODE* pMode) PURE; 177 | STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter, D3DDISPLAYMODE* pMode) PURE; 178 | STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL Windowed) PURE; 179 | STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) PURE; 180 | STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType) PURE; 181 | STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) PURE; 182 | STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS8* pCaps) PURE; 183 | STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE; 184 | STDMETHOD(CreateDevice)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice8** ppReturnedDeviceInterface) PURE; 185 | }; 186 | 187 | typedef struct IDirect3D8 *LPDIRECT3D8, *PDIRECT3D8; 188 | 189 | #if !defined(__cplusplus) || defined(CINTERFACE) 190 | #define IDirect3D8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 191 | #define IDirect3D8_AddRef(p) (p)->lpVtbl->AddRef(p) 192 | #define IDirect3D8_Release(p) (p)->lpVtbl->Release(p) 193 | #define IDirect3D8_RegisterSoftwareDevice(p,a) (p)->lpVtbl->RegisterSoftwareDevice(p,a) 194 | #define IDirect3D8_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p) 195 | #define IDirect3D8_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c) 196 | #define IDirect3D8_GetAdapterModeCount(p,a) (p)->lpVtbl->GetAdapterModeCount(p,a) 197 | #define IDirect3D8_EnumAdapterModes(p,a,b,c) (p)->lpVtbl->EnumAdapterModes(p,a,b,c) 198 | #define IDirect3D8_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b) 199 | #define IDirect3D8_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e) 200 | #define IDirect3D8_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f) 201 | #define IDirect3D8_CheckDeviceMultiSampleType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e) 202 | #define IDirect3D8_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e) 203 | #define IDirect3D8_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c) 204 | #define IDirect3D8_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a) 205 | #define IDirect3D8_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f) 206 | #else 207 | #define IDirect3D8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 208 | #define IDirect3D8_AddRef(p) (p)->AddRef() 209 | #define IDirect3D8_Release(p) (p)->Release() 210 | #define IDirect3D8_RegisterSoftwareDevice(p,a) (p)->RegisterSoftwareDevice(a) 211 | #define IDirect3D8_GetAdapterCount(p) (p)->GetAdapterCount() 212 | #define IDirect3D8_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c) 213 | #define IDirect3D8_GetAdapterModeCount(p,a) (p)->GetAdapterModeCount(a) 214 | #define IDirect3D8_EnumAdapterModes(p,a,b,c) (p)->EnumAdapterModes(a,b,c) 215 | #define IDirect3D8_GetAdapterDisplayMode(p,a,b) (p)->GetAdapterDisplayMode(a,b) 216 | #define IDirect3D8_CheckDeviceType(p,a,b,c,d,e) (p)->CheckDeviceType(a,b,c,d,e) 217 | #define IDirect3D8_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->CheckDeviceFormat(a,b,c,d,e,f) 218 | #define IDirect3D8_CheckDeviceMultiSampleType(p,a,b,c,d,e) (p)->CheckDeviceMultiSampleType(a,b,c,d,e) 219 | #define IDirect3D8_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->CheckDepthStencilMatch(a,b,c,d,e) 220 | #define IDirect3D8_GetDeviceCaps(p,a,b,c) (p)->GetDeviceCaps(a,b,c) 221 | #define IDirect3D8_GetAdapterMonitor(p,a) (p)->GetAdapterMonitor(a) 222 | #define IDirect3D8_CreateDevice(p,a,b,c,d,e,f) (p)->CreateDevice(a,b,c,d,e,f) 223 | #endif 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | #undef INTERFACE 244 | #define INTERFACE IDirect3DDevice8 245 | 246 | DECLARE_INTERFACE_(IDirect3DDevice8, IUnknown) 247 | { 248 | /*** IUnknown methods ***/ 249 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 250 | STDMETHOD_(ULONG, AddRef)(THIS)PURE; 251 | STDMETHOD_(ULONG, Release)(THIS)PURE; 252 | 253 | /*** IDirect3DDevice8 methods ***/ 254 | STDMETHOD(TestCooperativeLevel)(THIS)PURE; 255 | STDMETHOD_(UINT, GetAvailableTextureMem)(THIS)PURE; 256 | STDMETHOD(ResourceManagerDiscardBytes)(THIS_ DWORD Bytes) PURE; 257 | STDMETHOD(GetDirect3D)(THIS_ IDirect3D8** ppD3D8) PURE; 258 | STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS8* pCaps) PURE; 259 | STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE; 260 | STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE; 261 | STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot, UINT YHotSpot, IDirect3DSurface8* pCursorBitmap) PURE; 262 | STDMETHOD_(void, SetCursorPosition)(THIS_ UINT XScreenSpace, UINT YScreenSpace, DWORD Flags) PURE; 263 | STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE; 264 | STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain8** pSwapChain) PURE; 265 | STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; 266 | STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion) PURE; 267 | STDMETHOD(GetBackBuffer)(THIS_ UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface8** ppBackBuffer) PURE; 268 | STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE; 269 | STDMETHOD_(void, SetGammaRamp)(THIS_ DWORD Flags, CONST D3DGAMMARAMP* pRamp) PURE; 270 | STDMETHOD_(void, GetGammaRamp)(THIS_ D3DGAMMARAMP* pRamp) PURE; 271 | STDMETHOD(CreateTexture)(THIS_ UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture8** ppTexture) PURE; 272 | STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture8** ppVolumeTexture) PURE; 273 | STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture8** ppCubeTexture) PURE; 274 | STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer8** ppVertexBuffer) PURE; 275 | STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer8** ppIndexBuffer) PURE; 276 | STDMETHOD(CreateRenderTarget)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, BOOL Lockable, IDirect3DSurface8** ppSurface) PURE; 277 | STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, IDirect3DSurface8** ppSurface) PURE; 278 | STDMETHOD(CreateImageSurface)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, IDirect3DSurface8** ppSurface) PURE; 279 | STDMETHOD(CopyRects)(THIS_ IDirect3DSurface8* pSourceSurface, CONST RECT* pSourceRectsArray, UINT cRects, IDirect3DSurface8* pDestinationSurface, CONST POINT* pDestPointsArray) PURE; 280 | STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture8* pSourceTexture, IDirect3DBaseTexture8* pDestinationTexture) PURE; 281 | STDMETHOD(GetFrontBuffer)(THIS_ IDirect3DSurface8* pDestSurface) PURE; 282 | STDMETHOD(SetRenderTarget)(THIS_ IDirect3DSurface8* pRenderTarget, IDirect3DSurface8* pNewZStencil) PURE; 283 | STDMETHOD(GetRenderTarget)(THIS_ IDirect3DSurface8** ppRenderTarget) PURE; 284 | STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface8** ppZStencilSurface) PURE; 285 | STDMETHOD(BeginScene)(THIS)PURE; 286 | STDMETHOD(EndScene)(THIS)PURE; 287 | STDMETHOD(Clear)(THIS_ DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) PURE; 288 | STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) PURE; 289 | STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) PURE; 290 | STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE, CONST D3DMATRIX*) PURE; 291 | STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT8* pViewport) PURE; 292 | STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT8* pViewport) PURE; 293 | STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL8* pMaterial) PURE; 294 | STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL8* pMaterial) PURE; 295 | STDMETHOD(SetLight)(THIS_ DWORD Index, CONST D3DLIGHT8*) PURE; 296 | STDMETHOD(GetLight)(THIS_ DWORD Index, D3DLIGHT8*) PURE; 297 | STDMETHOD(LightEnable)(THIS_ DWORD Index, BOOL Enable) PURE; 298 | STDMETHOD(GetLightEnable)(THIS_ DWORD Index, BOOL* pEnable) PURE; 299 | STDMETHOD(SetClipPlane)(THIS_ DWORD Index, CONST float* pPlane) PURE; 300 | STDMETHOD(GetClipPlane)(THIS_ DWORD Index, float* pPlane) PURE; 301 | STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD Value) PURE; 302 | STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD* pValue) PURE; 303 | STDMETHOD(BeginStateBlock)(THIS)PURE; 304 | STDMETHOD(EndStateBlock)(THIS_ DWORD* pToken) PURE; 305 | STDMETHOD(ApplyStateBlock)(THIS_ DWORD Token) PURE; 306 | STDMETHOD(CaptureStateBlock)(THIS_ DWORD Token) PURE; 307 | STDMETHOD(DeleteStateBlock)(THIS_ DWORD Token) PURE; 308 | STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type, DWORD* pToken) PURE; 309 | STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS8* pClipStatus) PURE; 310 | STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS8* pClipStatus) PURE; 311 | STDMETHOD(GetTexture)(THIS_ DWORD Stage, IDirect3DBaseTexture8** ppTexture) PURE; 312 | STDMETHOD(SetTexture)(THIS_ DWORD Stage, IDirect3DBaseTexture8* pTexture) PURE; 313 | STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) PURE; 314 | STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) PURE; 315 | STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE; 316 | STDMETHOD(GetInfo)(THIS_ DWORD DevInfoID, void* pDevInfoStruct, DWORD DevInfoStructSize) PURE; 317 | STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber, CONST PALETTEENTRY* pEntries) PURE; 318 | STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber, PALETTEENTRY* pEntries) PURE; 319 | STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE; 320 | STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE; 321 | STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) PURE; 322 | STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount) PURE; 323 | STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) PURE; 324 | STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertexIndices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) PURE; 325 | STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer8* pDestBuffer, DWORD Flags) PURE; 326 | STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pDeclaration, CONST DWORD* pFunction, DWORD* pHandle, DWORD Usage) PURE; 327 | STDMETHOD(SetVertexShader)(THIS_ DWORD Handle) PURE; 328 | STDMETHOD(GetVertexShader)(THIS_ DWORD* pHandle) PURE; 329 | STDMETHOD(DeleteVertexShader)(THIS_ DWORD Handle) PURE; 330 | STDMETHOD(SetVertexShaderConstant)(THIS_ DWORD Register, CONST void* pConstantData, DWORD ConstantCount) PURE; 331 | STDMETHOD(GetVertexShaderConstant)(THIS_ DWORD Register, void* pConstantData, DWORD ConstantCount) PURE; 332 | STDMETHOD(GetVertexShaderDeclaration)(THIS_ DWORD Handle, void* pData, DWORD* pSizeOfData) PURE; 333 | STDMETHOD(GetVertexShaderFunction)(THIS_ DWORD Handle, void* pData, DWORD* pSizeOfData) PURE; 334 | STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber, IDirect3DVertexBuffer8* pStreamData, UINT Stride) PURE; 335 | STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber, IDirect3DVertexBuffer8** ppStreamData, UINT* pStride) PURE; 336 | STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer8* pIndexData, UINT BaseVertexIndex) PURE; 337 | STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer8** ppIndexData, UINT* pBaseVertexIndex) PURE; 338 | STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction, DWORD* pHandle) PURE; 339 | STDMETHOD(SetPixelShader)(THIS_ DWORD Handle) PURE; 340 | STDMETHOD(GetPixelShader)(THIS_ DWORD* pHandle) PURE; 341 | STDMETHOD(DeletePixelShader)(THIS_ DWORD Handle) PURE; 342 | STDMETHOD(SetPixelShaderConstant)(THIS_ DWORD Register, CONST void* pConstantData, DWORD ConstantCount) PURE; 343 | STDMETHOD(GetPixelShaderConstant)(THIS_ DWORD Register, void* pConstantData, DWORD ConstantCount) PURE; 344 | STDMETHOD(GetPixelShaderFunction)(THIS_ DWORD Handle, void* pData, DWORD* pSizeOfData) PURE; 345 | STDMETHOD(DrawRectPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE; 346 | STDMETHOD(DrawTriPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE; 347 | STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; 348 | }; 349 | 350 | typedef struct IDirect3DDevice8 *LPDIRECT3DDEVICE8, *PDIRECT3DDEVICE8; 351 | 352 | #if !defined(__cplusplus) || defined(CINTERFACE) 353 | #define IDirect3DDevice8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 354 | #define IDirect3DDevice8_AddRef(p) (p)->lpVtbl->AddRef(p) 355 | #define IDirect3DDevice8_Release(p) (p)->lpVtbl->Release(p) 356 | #define IDirect3DDevice8_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) 357 | #define IDirect3DDevice8_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p) 358 | #define IDirect3DDevice8_ResourceManagerDiscardBytes(p,a) (p)->lpVtbl->ResourceManagerDiscardBytes(p,a) 359 | #define IDirect3DDevice8_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) 360 | #define IDirect3DDevice8_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a) 361 | #define IDirect3DDevice8_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) 362 | #define IDirect3DDevice8_GetCreationParameters(p,a) (p)->lpVtbl->GetCreationParameters(p,a) 363 | #define IDirect3DDevice8_SetCursorProperties(p,a,b,c) (p)->lpVtbl->SetCursorProperties(p,a,b,c) 364 | #define IDirect3DDevice8_SetCursorPosition(p,a,b,c) (p)->lpVtbl->SetCursorPosition(p,a,b,c) 365 | #define IDirect3DDevice8_ShowCursor(p,a) (p)->lpVtbl->ShowCursor(p,a) 366 | #define IDirect3DDevice8_CreateAdditionalSwapChain(p,a,b) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b) 367 | #define IDirect3DDevice8_Reset(p,a) (p)->lpVtbl->Reset(p,a) 368 | #define IDirect3DDevice8_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) 369 | #define IDirect3DDevice8_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) 370 | #define IDirect3DDevice8_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) 371 | #define IDirect3DDevice8_SetGammaRamp(p,a,b) (p)->lpVtbl->SetGammaRamp(p,a,b) 372 | #define IDirect3DDevice8_GetGammaRamp(p,a) (p)->lpVtbl->GetGammaRamp(p,a) 373 | #define IDirect3DDevice8_CreateTexture(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g) 374 | #define IDirect3DDevice8_CreateVolumeTexture(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h) 375 | #define IDirect3DDevice8_CreateCubeTexture(p,a,b,c,d,e,f) (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f) 376 | #define IDirect3DDevice8_CreateVertexBuffer(p,a,b,c,d,e) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e) 377 | #define IDirect3DDevice8_CreateIndexBuffer(p,a,b,c,d,e) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e) 378 | #define IDirect3DDevice8_CreateRenderTarget(p,a,b,c,d,e,f) (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f) 379 | #define IDirect3DDevice8_CreateDepthStencilSurface(p,a,b,c,d,e) (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e) 380 | #define IDirect3DDevice8_CreateImageSurface(p,a,b,c,d) (p)->lpVtbl->CreateImageSurface(p,a,b,c,d) 381 | #define IDirect3DDevice8_CopyRects(p,a,b,c,d,e) (p)->lpVtbl->CopyRects(p,a,b,c,d,e) 382 | #define IDirect3DDevice8_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) 383 | #define IDirect3DDevice8_GetFrontBuffer(p,a) (p)->lpVtbl->GetFrontBuffer(p,a) 384 | #define IDirect3DDevice8_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) 385 | #define IDirect3DDevice8_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a) 386 | #define IDirect3DDevice8_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a) 387 | #define IDirect3DDevice8_BeginScene(p) (p)->lpVtbl->BeginScene(p) 388 | #define IDirect3DDevice8_EndScene(p) (p)->lpVtbl->EndScene(p) 389 | #define IDirect3DDevice8_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) 390 | #define IDirect3DDevice8_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) 391 | #define IDirect3DDevice8_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) 392 | #define IDirect3DDevice8_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) 393 | #define IDirect3DDevice8_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) 394 | #define IDirect3DDevice8_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) 395 | #define IDirect3DDevice8_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) 396 | #define IDirect3DDevice8_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) 397 | #define IDirect3DDevice8_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) 398 | #define IDirect3DDevice8_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) 399 | #define IDirect3DDevice8_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) 400 | #define IDirect3DDevice8_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) 401 | #define IDirect3DDevice8_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) 402 | #define IDirect3DDevice8_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) 403 | #define IDirect3DDevice8_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) 404 | #define IDirect3DDevice8_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) 405 | #define IDirect3DDevice8_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) 406 | #define IDirect3DDevice8_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) 407 | #define IDirect3DDevice8_ApplyStateBlock(p,a) (p)->lpVtbl->ApplyStateBlock(p,a) 408 | #define IDirect3DDevice8_CaptureStateBlock(p,a) (p)->lpVtbl->CaptureStateBlock(p,a) 409 | #define IDirect3DDevice8_DeleteStateBlock(p,a) (p)->lpVtbl->DeleteStateBlock(p,a) 410 | #define IDirect3DDevice8_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) 411 | #define IDirect3DDevice8_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) 412 | #define IDirect3DDevice8_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) 413 | #define IDirect3DDevice8_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) 414 | #define IDirect3DDevice8_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) 415 | #define IDirect3DDevice8_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) 416 | #define IDirect3DDevice8_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) 417 | #define IDirect3DDevice8_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) 418 | #define IDirect3DDevice8_GetInfo(p,a,b,c) (p)->lpVtbl->GetInfo(p,a,b,c) 419 | #define IDirect3DDevice8_SetPaletteEntries(p,a,b) (p)->lpVtbl->SetPaletteEntries(p,a,b) 420 | #define IDirect3DDevice8_GetPaletteEntries(p,a,b) (p)->lpVtbl->GetPaletteEntries(p,a,b) 421 | #define IDirect3DDevice8_SetCurrentTexturePalette(p,a) (p)->lpVtbl->SetCurrentTexturePalette(p,a) 422 | #define IDirect3DDevice8_GetCurrentTexturePalette(p,a) (p)->lpVtbl->GetCurrentTexturePalette(p,a) 423 | #define IDirect3DDevice8_DrawPrimitive(p,a,b,c) (p)->lpVtbl->DrawPrimitive(p,a,b,c) 424 | #define IDirect3DDevice8_DrawIndexedPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e) 425 | #define IDirect3DDevice8_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d) 426 | #define IDirect3DDevice8_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) 427 | #define IDirect3DDevice8_ProcessVertices(p,a,b,c,d,e) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e) 428 | #define IDirect3DDevice8_CreateVertexShader(p,a,b,c,d) (p)->lpVtbl->CreateVertexShader(p,a,b,c,d) 429 | #define IDirect3DDevice8_SetVertexShader(p,a) (p)->lpVtbl->SetVertexShader(p,a) 430 | #define IDirect3DDevice8_GetVertexShader(p,a) (p)->lpVtbl->GetVertexShader(p,a) 431 | #define IDirect3DDevice8_DeleteVertexShader(p,a) (p)->lpVtbl->DeleteVertexShader(p,a) 432 | #define IDirect3DDevice8_SetVertexShaderConstant(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstant(p,a,b,c) 433 | #define IDirect3DDevice8_GetVertexShaderConstant(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstant(p,a,b,c) 434 | #define IDirect3DDevice8_GetVertexShaderDeclaration(p,a,b,c) (p)->lpVtbl->GetVertexShaderDeclaration(p,a,b,c) 435 | #define IDirect3DDevice8_GetVertexShaderFunction(p,a,b,c) (p)->lpVtbl->GetVertexShaderFunction(p,a,b,c) 436 | #define IDirect3DDevice8_SetStreamSource(p,a,b,c) (p)->lpVtbl->SetStreamSource(p,a,b,c) 437 | #define IDirect3DDevice8_GetStreamSource(p,a,b,c) (p)->lpVtbl->GetStreamSource(p,a,b,c) 438 | #define IDirect3DDevice8_SetIndices(p,a,b) (p)->lpVtbl->SetIndices(p,a,b) 439 | #define IDirect3DDevice8_GetIndices(p,a,b) (p)->lpVtbl->GetIndices(p,a,b) 440 | #define IDirect3DDevice8_CreatePixelShader(p,a,b) (p)->lpVtbl->CreatePixelShader(p,a,b) 441 | #define IDirect3DDevice8_SetPixelShader(p,a) (p)->lpVtbl->SetPixelShader(p,a) 442 | #define IDirect3DDevice8_GetPixelShader(p,a) (p)->lpVtbl->GetPixelShader(p,a) 443 | #define IDirect3DDevice8_DeletePixelShader(p,a) (p)->lpVtbl->DeletePixelShader(p,a) 444 | #define IDirect3DDevice8_SetPixelShaderConstant(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstant(p,a,b,c) 445 | #define IDirect3DDevice8_GetPixelShaderConstant(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstant(p,a,b,c) 446 | #define IDirect3DDevice8_GetPixelShaderFunction(p,a,b,c) (p)->lpVtbl->GetPixelShaderFunction(p,a,b,c) 447 | #define IDirect3DDevice8_DrawRectPatch(p,a,b,c) (p)->lpVtbl->DrawRectPatch(p,a,b,c) 448 | #define IDirect3DDevice8_DrawTriPatch(p,a,b,c) (p)->lpVtbl->DrawTriPatch(p,a,b,c) 449 | #define IDirect3DDevice8_DeletePatch(p,a) (p)->lpVtbl->DeletePatch(p,a) 450 | #else 451 | #define IDirect3DDevice8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 452 | #define IDirect3DDevice8_AddRef(p) (p)->AddRef() 453 | #define IDirect3DDevice8_Release(p) (p)->Release() 454 | #define IDirect3DDevice8_TestCooperativeLevel(p) (p)->TestCooperativeLevel() 455 | #define IDirect3DDevice8_GetAvailableTextureMem(p) (p)->GetAvailableTextureMem() 456 | #define IDirect3DDevice8_ResourceManagerDiscardBytes(p,a) (p)->ResourceManagerDiscardBytes(a) 457 | #define IDirect3DDevice8_GetDirect3D(p,a) (p)->GetDirect3D(a) 458 | #define IDirect3DDevice8_GetDeviceCaps(p,a) (p)->GetDeviceCaps(a) 459 | #define IDirect3DDevice8_GetDisplayMode(p,a) (p)->GetDisplayMode(a) 460 | #define IDirect3DDevice8_GetCreationParameters(p,a) (p)->GetCreationParameters(a) 461 | #define IDirect3DDevice8_SetCursorProperties(p,a,b,c) (p)->SetCursorProperties(a,b,c) 462 | #define IDirect3DDevice8_SetCursorPosition(p,a,b,c) (p)->SetCursorPosition(a,b,c) 463 | #define IDirect3DDevice8_ShowCursor(p,a) (p)->ShowCursor(a) 464 | #define IDirect3DDevice8_CreateAdditionalSwapChain(p,a,b) (p)->CreateAdditionalSwapChain(a,b) 465 | #define IDirect3DDevice8_Reset(p,a) (p)->Reset(a) 466 | #define IDirect3DDevice8_Present(p,a,b,c,d) (p)->Present(a,b,c,d) 467 | #define IDirect3DDevice8_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) 468 | #define IDirect3DDevice8_GetRasterStatus(p,a) (p)->GetRasterStatus(a) 469 | #define IDirect3DDevice8_SetGammaRamp(p,a,b) (p)->SetGammaRamp(a,b) 470 | #define IDirect3DDevice8_GetGammaRamp(p,a) (p)->GetGammaRamp(a) 471 | #define IDirect3DDevice8_CreateTexture(p,a,b,c,d,e,f,g) (p)->CreateTexture(a,b,c,d,e,f,g) 472 | #define IDirect3DDevice8_CreateVolumeTexture(p,a,b,c,d,e,f,g,h) (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h) 473 | #define IDirect3DDevice8_CreateCubeTexture(p,a,b,c,d,e,f) (p)->CreateCubeTexture(a,b,c,d,e,f) 474 | #define IDirect3DDevice8_CreateVertexBuffer(p,a,b,c,d,e) (p)->CreateVertexBuffer(a,b,c,d,e) 475 | #define IDirect3DDevice8_CreateIndexBuffer(p,a,b,c,d,e) (p)->CreateIndexBuffer(a,b,c,d,e) 476 | #define IDirect3DDevice8_CreateRenderTarget(p,a,b,c,d,e,f) (p)->CreateRenderTarget(a,b,c,d,e,f) 477 | #define IDirect3DDevice8_CreateDepthStencilSurface(p,a,b,c,d,e) (p)->CreateDepthStencilSurface(a,b,c,d,e) 478 | #define IDirect3DDevice8_CreateImageSurface(p,a,b,c,d) (p)->CreateImageSurface(a,b,c,d) 479 | #define IDirect3DDevice8_CopyRects(p,a,b,c,d,e) (p)->CopyRects(a,b,c,d,e) 480 | #define IDirect3DDevice8_UpdateTexture(p,a,b) (p)->UpdateTexture(a,b) 481 | #define IDirect3DDevice8_GetFrontBuffer(p,a) (p)->GetFrontBuffer(a) 482 | #define IDirect3DDevice8_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) 483 | #define IDirect3DDevice8_GetRenderTarget(p,a) (p)->GetRenderTarget(a) 484 | #define IDirect3DDevice8_GetDepthStencilSurface(p,a) (p)->GetDepthStencilSurface(a) 485 | #define IDirect3DDevice8_BeginScene(p) (p)->BeginScene() 486 | #define IDirect3DDevice8_EndScene(p) (p)->EndScene() 487 | #define IDirect3DDevice8_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) 488 | #define IDirect3DDevice8_SetTransform(p,a,b) (p)->SetTransform(a,b) 489 | #define IDirect3DDevice8_GetTransform(p,a,b) (p)->GetTransform(a,b) 490 | #define IDirect3DDevice8_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) 491 | #define IDirect3DDevice8_SetViewport(p,a) (p)->SetViewport(a) 492 | #define IDirect3DDevice8_GetViewport(p,a) (p)->GetViewport(a) 493 | #define IDirect3DDevice8_SetMaterial(p,a) (p)->SetMaterial(a) 494 | #define IDirect3DDevice8_GetMaterial(p,a) (p)->GetMaterial(a) 495 | #define IDirect3DDevice8_SetLight(p,a,b) (p)->SetLight(a,b) 496 | #define IDirect3DDevice8_GetLight(p,a,b) (p)->GetLight(a,b) 497 | #define IDirect3DDevice8_LightEnable(p,a,b) (p)->LightEnable(a,b) 498 | #define IDirect3DDevice8_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) 499 | #define IDirect3DDevice8_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) 500 | #define IDirect3DDevice8_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) 501 | #define IDirect3DDevice8_SetRenderState(p,a,b) (p)->SetRenderState(a,b) 502 | #define IDirect3DDevice8_GetRenderState(p,a,b) (p)->GetRenderState(a,b) 503 | #define IDirect3DDevice8_BeginStateBlock(p) (p)->BeginStateBlock() 504 | #define IDirect3DDevice8_EndStateBlock(p,a) (p)->EndStateBlock(a) 505 | #define IDirect3DDevice8_ApplyStateBlock(p,a) (p)->ApplyStateBlock(a) 506 | #define IDirect3DDevice8_CaptureStateBlock(p,a) (p)->CaptureStateBlock(a) 507 | #define IDirect3DDevice8_DeleteStateBlock(p,a) (p)->DeleteStateBlock(a) 508 | #define IDirect3DDevice8_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) 509 | #define IDirect3DDevice8_SetClipStatus(p,a) (p)->SetClipStatus(a) 510 | #define IDirect3DDevice8_GetClipStatus(p,a) (p)->GetClipStatus(a) 511 | #define IDirect3DDevice8_GetTexture(p,a,b) (p)->GetTexture(a,b) 512 | #define IDirect3DDevice8_SetTexture(p,a,b) (p)->SetTexture(a,b) 513 | #define IDirect3DDevice8_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) 514 | #define IDirect3DDevice8_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) 515 | #define IDirect3DDevice8_ValidateDevice(p,a) (p)->ValidateDevice(a) 516 | #define IDirect3DDevice8_GetInfo(p,a,b,c) (p)->GetInfo(a,b,c) 517 | #define IDirect3DDevice8_SetPaletteEntries(p,a,b) (p)->SetPaletteEntries(a,b) 518 | #define IDirect3DDevice8_GetPaletteEntries(p,a,b) (p)->GetPaletteEntries(a,b) 519 | #define IDirect3DDevice8_SetCurrentTexturePalette(p,a) (p)->SetCurrentTexturePalette(a) 520 | #define IDirect3DDevice8_GetCurrentTexturePalette(p,a) (p)->GetCurrentTexturePalette(a) 521 | #define IDirect3DDevice8_DrawPrimitive(p,a,b,c) (p)->DrawPrimitive(a,b,c) 522 | #define IDirect3DDevice8_DrawIndexedPrimitive(p,a,b,c,d,e) (p)->DrawIndexedPrimitive(a,b,c,d,e) 523 | #define IDirect3DDevice8_DrawPrimitiveUP(p,a,b,c,d) (p)->DrawPrimitiveUP(a,b,c,d) 524 | #define IDirect3DDevice8_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h) 525 | #define IDirect3DDevice8_ProcessVertices(p,a,b,c,d,e) (p)->ProcessVertices(a,b,c,d,e) 526 | #define IDirect3DDevice8_CreateVertexShader(p,a,b,c,d) (p)->CreateVertexShader(a,b,c,d) 527 | #define IDirect3DDevice8_SetVertexShader(p,a) (p)->SetVertexShader(a) 528 | #define IDirect3DDevice8_GetVertexShader(p,a) (p)->GetVertexShader(a) 529 | #define IDirect3DDevice8_DeleteVertexShader(p,a) (p)->DeleteVertexShader(a) 530 | #define IDirect3DDevice8_SetVertexShaderConstant(p,a,b,c) (p)->SetVertexShaderConstant(a,b,c) 531 | #define IDirect3DDevice8_GetVertexShaderConstant(p,a,b,c) (p)->GetVertexShaderConstant(a,b,c) 532 | #define IDirect3DDevice8_GetVertexShaderDeclaration(p,a,b,c) (p)->GetVertexShaderDeclaration(a,b,c) 533 | #define IDirect3DDevice8_GetVertexShaderFunction(p,a,b,c) (p)->GetVertexShaderFunction(a,b,c) 534 | #define IDirect3DDevice8_SetStreamSource(p,a,b,c) (p)->SetStreamSource(a,b,c) 535 | #define IDirect3DDevice8_GetStreamSource(p,a,b,c) (p)->GetStreamSource(a,b,c) 536 | #define IDirect3DDevice8_SetIndices(p,a,b) (p)->SetIndices(a,b) 537 | #define IDirect3DDevice8_GetIndices(p,a,b) (p)->GetIndices(a,b) 538 | #define IDirect3DDevice8_CreatePixelShader(p,a,b) (p)->CreatePixelShader(a,b) 539 | #define IDirect3DDevice8_SetPixelShader(p,a) (p)->SetPixelShader(a) 540 | #define IDirect3DDevice8_GetPixelShader(p,a) (p)->GetPixelShader(a) 541 | #define IDirect3DDevice8_DeletePixelShader(p,a) (p)->DeletePixelShader(a) 542 | #define IDirect3DDevice8_SetPixelShaderConstant(p,a,b,c) (p)->SetPixelShaderConstant(a,b,c) 543 | #define IDirect3DDevice8_GetPixelShaderConstant(p,a,b,c) (p)->GetPixelShaderConstant(a,b,c) 544 | #define IDirect3DDevice8_GetPixelShaderFunction(p,a,b,c) (p)->GetPixelShaderFunction(a,b,c) 545 | #define IDirect3DDevice8_DrawRectPatch(p,a,b,c) (p)->DrawRectPatch(a,b,c) 546 | #define IDirect3DDevice8_DrawTriPatch(p,a,b,c) (p)->DrawTriPatch(a,b,c) 547 | #define IDirect3DDevice8_DeletePatch(p,a) (p)->DeletePatch(a) 548 | #endif 549 | 550 | 551 | 552 | #undef INTERFACE 553 | #define INTERFACE IDirect3DSwapChain8 554 | 555 | DECLARE_INTERFACE_(IDirect3DSwapChain8, IUnknown) 556 | { 557 | /*** IUnknown methods ***/ 558 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 559 | STDMETHOD_(ULONG, AddRef)(THIS)PURE; 560 | STDMETHOD_(ULONG, Release)(THIS)PURE; 561 | 562 | /*** IDirect3DSwapChain8 methods ***/ 563 | STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion) PURE; 564 | STDMETHOD(GetBackBuffer)(THIS_ UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface8** ppBackBuffer) PURE; 565 | }; 566 | 567 | typedef struct IDirect3DSwapChain8 *LPDIRECT3DSWAPCHAIN8, *PDIRECT3DSWAPCHAIN8; 568 | 569 | #if !defined(__cplusplus) || defined(CINTERFACE) 570 | #define IDirect3DSwapChain8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 571 | #define IDirect3DSwapChain8_AddRef(p) (p)->lpVtbl->AddRef(p) 572 | #define IDirect3DSwapChain8_Release(p) (p)->lpVtbl->Release(p) 573 | #define IDirect3DSwapChain8_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) 574 | #define IDirect3DSwapChain8_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) 575 | #else 576 | #define IDirect3DSwapChain8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 577 | #define IDirect3DSwapChain8_AddRef(p) (p)->AddRef() 578 | #define IDirect3DSwapChain8_Release(p) (p)->Release() 579 | #define IDirect3DSwapChain8_Present(p,a,b,c,d) (p)->Present(a,b,c,d) 580 | #define IDirect3DSwapChain8_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) 581 | #endif 582 | 583 | 584 | 585 | #undef INTERFACE 586 | #define INTERFACE IDirect3DResource8 587 | 588 | DECLARE_INTERFACE_(IDirect3DResource8, IUnknown) 589 | { 590 | /*** IUnknown methods ***/ 591 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 592 | STDMETHOD_(ULONG, AddRef)(THIS)PURE; 593 | STDMETHOD_(ULONG, Release)(THIS)PURE; 594 | 595 | /*** IDirect3DResource8 methods ***/ 596 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 597 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; 598 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; 599 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 600 | STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; 601 | STDMETHOD_(DWORD, GetPriority)(THIS)PURE; 602 | STDMETHOD_(void, PreLoad)(THIS)PURE; 603 | STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS)PURE; 604 | }; 605 | 606 | typedef struct IDirect3DResource8 *LPDIRECT3DRESOURCE8, *PDIRECT3DRESOURCE8; 607 | 608 | #if !defined(__cplusplus) || defined(CINTERFACE) 609 | #define IDirect3DResource8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 610 | #define IDirect3DResource8_AddRef(p) (p)->lpVtbl->AddRef(p) 611 | #define IDirect3DResource8_Release(p) (p)->lpVtbl->Release(p) 612 | #define IDirect3DResource8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 613 | #define IDirect3DResource8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 614 | #define IDirect3DResource8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 615 | #define IDirect3DResource8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 616 | #define IDirect3DResource8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) 617 | #define IDirect3DResource8_GetPriority(p) (p)->lpVtbl->GetPriority(p) 618 | #define IDirect3DResource8_PreLoad(p) (p)->lpVtbl->PreLoad(p) 619 | #define IDirect3DResource8_GetType(p) (p)->lpVtbl->GetType(p) 620 | #else 621 | #define IDirect3DResource8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 622 | #define IDirect3DResource8_AddRef(p) (p)->AddRef() 623 | #define IDirect3DResource8_Release(p) (p)->Release() 624 | #define IDirect3DResource8_GetDevice(p,a) (p)->GetDevice(a) 625 | #define IDirect3DResource8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 626 | #define IDirect3DResource8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 627 | #define IDirect3DResource8_FreePrivateData(p,a) (p)->FreePrivateData(a) 628 | #define IDirect3DResource8_SetPriority(p,a) (p)->SetPriority(a) 629 | #define IDirect3DResource8_GetPriority(p) (p)->GetPriority() 630 | #define IDirect3DResource8_PreLoad(p) (p)->PreLoad() 631 | #define IDirect3DResource8_GetType(p) (p)->GetType() 632 | #endif 633 | 634 | 635 | 636 | 637 | #undef INTERFACE 638 | #define INTERFACE IDirect3DBaseTexture8 639 | 640 | DECLARE_INTERFACE_(IDirect3DBaseTexture8, IDirect3DResource8) 641 | { 642 | /*** IUnknown methods ***/ 643 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 644 | STDMETHOD_(ULONG, AddRef)(THIS)PURE; 645 | STDMETHOD_(ULONG, Release)(THIS)PURE; 646 | 647 | /*** IDirect3DResource8 methods ***/ 648 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 649 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; 650 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; 651 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 652 | STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; 653 | STDMETHOD_(DWORD, GetPriority)(THIS)PURE; 654 | STDMETHOD_(void, PreLoad)(THIS)PURE; 655 | STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS)PURE; 656 | STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; 657 | STDMETHOD_(DWORD, GetLOD)(THIS)PURE; 658 | STDMETHOD_(DWORD, GetLevelCount)(THIS)PURE; 659 | }; 660 | 661 | typedef struct IDirect3DBaseTexture8 *LPDIRECT3DBASETEXTURE8, *PDIRECT3DBASETEXTURE8; 662 | 663 | #if !defined(__cplusplus) || defined(CINTERFACE) 664 | #define IDirect3DBaseTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 665 | #define IDirect3DBaseTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) 666 | #define IDirect3DBaseTexture8_Release(p) (p)->lpVtbl->Release(p) 667 | #define IDirect3DBaseTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 668 | #define IDirect3DBaseTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 669 | #define IDirect3DBaseTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 670 | #define IDirect3DBaseTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 671 | #define IDirect3DBaseTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) 672 | #define IDirect3DBaseTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) 673 | #define IDirect3DBaseTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) 674 | #define IDirect3DBaseTexture8_GetType(p) (p)->lpVtbl->GetType(p) 675 | #define IDirect3DBaseTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) 676 | #define IDirect3DBaseTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) 677 | #define IDirect3DBaseTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) 678 | #else 679 | #define IDirect3DBaseTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 680 | #define IDirect3DBaseTexture8_AddRef(p) (p)->AddRef() 681 | #define IDirect3DBaseTexture8_Release(p) (p)->Release() 682 | #define IDirect3DBaseTexture8_GetDevice(p,a) (p)->GetDevice(a) 683 | #define IDirect3DBaseTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 684 | #define IDirect3DBaseTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 685 | #define IDirect3DBaseTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) 686 | #define IDirect3DBaseTexture8_SetPriority(p,a) (p)->SetPriority(a) 687 | #define IDirect3DBaseTexture8_GetPriority(p) (p)->GetPriority() 688 | #define IDirect3DBaseTexture8_PreLoad(p) (p)->PreLoad() 689 | #define IDirect3DBaseTexture8_GetType(p) (p)->GetType() 690 | #define IDirect3DBaseTexture8_SetLOD(p,a) (p)->SetLOD(a) 691 | #define IDirect3DBaseTexture8_GetLOD(p) (p)->GetLOD() 692 | #define IDirect3DBaseTexture8_GetLevelCount(p) (p)->GetLevelCount() 693 | #endif 694 | 695 | 696 | 697 | 698 | 699 | #undef INTERFACE 700 | #define INTERFACE IDirect3DTexture8 701 | 702 | DECLARE_INTERFACE_(IDirect3DTexture8, IDirect3DBaseTexture8) 703 | { 704 | /*** IUnknown methods ***/ 705 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 706 | STDMETHOD_(ULONG, AddRef)(THIS)PURE; 707 | STDMETHOD_(ULONG, Release)(THIS)PURE; 708 | 709 | /*** IDirect3DBaseTexture8 methods ***/ 710 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 711 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; 712 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; 713 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 714 | STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; 715 | STDMETHOD_(DWORD, GetPriority)(THIS)PURE; 716 | STDMETHOD_(void, PreLoad)(THIS)PURE; 717 | STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS)PURE; 718 | STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; 719 | STDMETHOD_(DWORD, GetLOD)(THIS)PURE; 720 | STDMETHOD_(DWORD, GetLevelCount)(THIS)PURE; 721 | STDMETHOD(GetLevelDesc)(THIS_ UINT Level, D3DSURFACE_DESC *pDesc) PURE; 722 | STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level, IDirect3DSurface8** ppSurfaceLevel) PURE; 723 | STDMETHOD(LockRect)(THIS_ UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) PURE; 724 | STDMETHOD(UnlockRect)(THIS_ UINT Level) PURE; 725 | STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pDirtyRect) PURE; 726 | }; 727 | 728 | typedef struct IDirect3DTexture8 *LPDIRECT3DTEXTURE8, *PDIRECT3DTEXTURE8; 729 | 730 | #if !defined(__cplusplus) || defined(CINTERFACE) 731 | #define IDirect3DTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 732 | #define IDirect3DTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) 733 | #define IDirect3DTexture8_Release(p) (p)->lpVtbl->Release(p) 734 | #define IDirect3DTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 735 | #define IDirect3DTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 736 | #define IDirect3DTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 737 | #define IDirect3DTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 738 | #define IDirect3DTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) 739 | #define IDirect3DTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) 740 | #define IDirect3DTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) 741 | #define IDirect3DTexture8_GetType(p) (p)->lpVtbl->GetType(p) 742 | #define IDirect3DTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) 743 | #define IDirect3DTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) 744 | #define IDirect3DTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) 745 | #define IDirect3DTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) 746 | #define IDirect3DTexture8_GetSurfaceLevel(p,a,b) (p)->lpVtbl->GetSurfaceLevel(p,a,b) 747 | #define IDirect3DTexture8_LockRect(p,a,b,c,d) (p)->lpVtbl->LockRect(p,a,b,c,d) 748 | #define IDirect3DTexture8_UnlockRect(p,a) (p)->lpVtbl->UnlockRect(p,a) 749 | #define IDirect3DTexture8_AddDirtyRect(p,a) (p)->lpVtbl->AddDirtyRect(p,a) 750 | #else 751 | #define IDirect3DTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 752 | #define IDirect3DTexture8_AddRef(p) (p)->AddRef() 753 | #define IDirect3DTexture8_Release(p) (p)->Release() 754 | #define IDirect3DTexture8_GetDevice(p,a) (p)->GetDevice(a) 755 | #define IDirect3DTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 756 | #define IDirect3DTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 757 | #define IDirect3DTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) 758 | #define IDirect3DTexture8_SetPriority(p,a) (p)->SetPriority(a) 759 | #define IDirect3DTexture8_GetPriority(p) (p)->GetPriority() 760 | #define IDirect3DTexture8_PreLoad(p) (p)->PreLoad() 761 | #define IDirect3DTexture8_GetType(p) (p)->GetType() 762 | #define IDirect3DTexture8_SetLOD(p,a) (p)->SetLOD(a) 763 | #define IDirect3DTexture8_GetLOD(p) (p)->GetLOD() 764 | #define IDirect3DTexture8_GetLevelCount(p) (p)->GetLevelCount() 765 | #define IDirect3DTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) 766 | #define IDirect3DTexture8_GetSurfaceLevel(p,a,b) (p)->GetSurfaceLevel(a,b) 767 | #define IDirect3DTexture8_LockRect(p,a,b,c,d) (p)->LockRect(a,b,c,d) 768 | #define IDirect3DTexture8_UnlockRect(p,a) (p)->UnlockRect(a) 769 | #define IDirect3DTexture8_AddDirtyRect(p,a) (p)->AddDirtyRect(a) 770 | #endif 771 | 772 | 773 | 774 | 775 | 776 | #undef INTERFACE 777 | #define INTERFACE IDirect3DVolumeTexture8 778 | 779 | DECLARE_INTERFACE_(IDirect3DVolumeTexture8, IDirect3DBaseTexture8) 780 | { 781 | /*** IUnknown methods ***/ 782 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 783 | STDMETHOD_(ULONG, AddRef)(THIS)PURE; 784 | STDMETHOD_(ULONG, Release)(THIS)PURE; 785 | 786 | /*** IDirect3DBaseTexture8 methods ***/ 787 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 788 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; 789 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; 790 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 791 | STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; 792 | STDMETHOD_(DWORD, GetPriority)(THIS)PURE; 793 | STDMETHOD_(void, PreLoad)(THIS)PURE; 794 | STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS)PURE; 795 | STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; 796 | STDMETHOD_(DWORD, GetLOD)(THIS)PURE; 797 | STDMETHOD_(DWORD, GetLevelCount)(THIS)PURE; 798 | STDMETHOD(GetLevelDesc)(THIS_ UINT Level, D3DVOLUME_DESC *pDesc) PURE; 799 | STDMETHOD(GetVolumeLevel)(THIS_ UINT Level, IDirect3DVolume8** ppVolumeLevel) PURE; 800 | STDMETHOD(LockBox)(THIS_ UINT Level, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags) PURE; 801 | STDMETHOD(UnlockBox)(THIS_ UINT Level) PURE; 802 | STDMETHOD(AddDirtyBox)(THIS_ CONST D3DBOX* pDirtyBox) PURE; 803 | }; 804 | 805 | typedef struct IDirect3DVolumeTexture8 *LPDIRECT3DVOLUMETEXTURE8, *PDIRECT3DVOLUMETEXTURE8; 806 | 807 | #if !defined(__cplusplus) || defined(CINTERFACE) 808 | #define IDirect3DVolumeTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 809 | #define IDirect3DVolumeTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) 810 | #define IDirect3DVolumeTexture8_Release(p) (p)->lpVtbl->Release(p) 811 | #define IDirect3DVolumeTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 812 | #define IDirect3DVolumeTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 813 | #define IDirect3DVolumeTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 814 | #define IDirect3DVolumeTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 815 | #define IDirect3DVolumeTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) 816 | #define IDirect3DVolumeTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) 817 | #define IDirect3DVolumeTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) 818 | #define IDirect3DVolumeTexture8_GetType(p) (p)->lpVtbl->GetType(p) 819 | #define IDirect3DVolumeTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) 820 | #define IDirect3DVolumeTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) 821 | #define IDirect3DVolumeTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) 822 | #define IDirect3DVolumeTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) 823 | #define IDirect3DVolumeTexture8_GetVolumeLevel(p,a,b) (p)->lpVtbl->GetVolumeLevel(p,a,b) 824 | #define IDirect3DVolumeTexture8_LockBox(p,a,b,c,d) (p)->lpVtbl->LockBox(p,a,b,c,d) 825 | #define IDirect3DVolumeTexture8_UnlockBox(p,a) (p)->lpVtbl->UnlockBox(p,a) 826 | #define IDirect3DVolumeTexture8_AddDirtyBox(p,a) (p)->lpVtbl->AddDirtyBox(p,a) 827 | #else 828 | #define IDirect3DVolumeTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 829 | #define IDirect3DVolumeTexture8_AddRef(p) (p)->AddRef() 830 | #define IDirect3DVolumeTexture8_Release(p) (p)->Release() 831 | #define IDirect3DVolumeTexture8_GetDevice(p,a) (p)->GetDevice(a) 832 | #define IDirect3DVolumeTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 833 | #define IDirect3DVolumeTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 834 | #define IDirect3DVolumeTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) 835 | #define IDirect3DVolumeTexture8_SetPriority(p,a) (p)->SetPriority(a) 836 | #define IDirect3DVolumeTexture8_GetPriority(p) (p)->GetPriority() 837 | #define IDirect3DVolumeTexture8_PreLoad(p) (p)->PreLoad() 838 | #define IDirect3DVolumeTexture8_GetType(p) (p)->GetType() 839 | #define IDirect3DVolumeTexture8_SetLOD(p,a) (p)->SetLOD(a) 840 | #define IDirect3DVolumeTexture8_GetLOD(p) (p)->GetLOD() 841 | #define IDirect3DVolumeTexture8_GetLevelCount(p) (p)->GetLevelCount() 842 | #define IDirect3DVolumeTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) 843 | #define IDirect3DVolumeTexture8_GetVolumeLevel(p,a,b) (p)->GetVolumeLevel(a,b) 844 | #define IDirect3DVolumeTexture8_LockBox(p,a,b,c,d) (p)->LockBox(a,b,c,d) 845 | #define IDirect3DVolumeTexture8_UnlockBox(p,a) (p)->UnlockBox(a) 846 | #define IDirect3DVolumeTexture8_AddDirtyBox(p,a) (p)->AddDirtyBox(a) 847 | #endif 848 | 849 | 850 | 851 | 852 | 853 | #undef INTERFACE 854 | #define INTERFACE IDirect3DCubeTexture8 855 | 856 | DECLARE_INTERFACE_(IDirect3DCubeTexture8, IDirect3DBaseTexture8) 857 | { 858 | /*** IUnknown methods ***/ 859 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 860 | STDMETHOD_(ULONG, AddRef)(THIS)PURE; 861 | STDMETHOD_(ULONG, Release)(THIS)PURE; 862 | 863 | /*** IDirect3DBaseTexture8 methods ***/ 864 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 865 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; 866 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; 867 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 868 | STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; 869 | STDMETHOD_(DWORD, GetPriority)(THIS)PURE; 870 | STDMETHOD_(void, PreLoad)(THIS)PURE; 871 | STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS)PURE; 872 | STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; 873 | STDMETHOD_(DWORD, GetLOD)(THIS)PURE; 874 | STDMETHOD_(DWORD, GetLevelCount)(THIS)PURE; 875 | STDMETHOD(GetLevelDesc)(THIS_ UINT Level, D3DSURFACE_DESC *pDesc) PURE; 876 | STDMETHOD(GetCubeMapSurface)(THIS_ D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface8** ppCubeMapSurface) PURE; 877 | STDMETHOD(LockRect)(THIS_ D3DCUBEMAP_FACES FaceType, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) PURE; 878 | STDMETHOD(UnlockRect)(THIS_ D3DCUBEMAP_FACES FaceType, UINT Level) PURE; 879 | STDMETHOD(AddDirtyRect)(THIS_ D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect) PURE; 880 | }; 881 | 882 | typedef struct IDirect3DCubeTexture8 *LPDIRECT3DCUBETEXTURE8, *PDIRECT3DCUBETEXTURE8; 883 | 884 | #if !defined(__cplusplus) || defined(CINTERFACE) 885 | #define IDirect3DCubeTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 886 | #define IDirect3DCubeTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) 887 | #define IDirect3DCubeTexture8_Release(p) (p)->lpVtbl->Release(p) 888 | #define IDirect3DCubeTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 889 | #define IDirect3DCubeTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 890 | #define IDirect3DCubeTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 891 | #define IDirect3DCubeTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 892 | #define IDirect3DCubeTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) 893 | #define IDirect3DCubeTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) 894 | #define IDirect3DCubeTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) 895 | #define IDirect3DCubeTexture8_GetType(p) (p)->lpVtbl->GetType(p) 896 | #define IDirect3DCubeTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) 897 | #define IDirect3DCubeTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) 898 | #define IDirect3DCubeTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) 899 | #define IDirect3DCubeTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) 900 | #define IDirect3DCubeTexture8_GetCubeMapSurface(p,a,b,c) (p)->lpVtbl->GetCubeMapSurface(p,a,b,c) 901 | #define IDirect3DCubeTexture8_LockRect(p,a,b,c,d,e) (p)->lpVtbl->LockRect(p,a,b,c,d,e) 902 | #define IDirect3DCubeTexture8_UnlockRect(p,a,b) (p)->lpVtbl->UnlockRect(p,a,b) 903 | #define IDirect3DCubeTexture8_AddDirtyRect(p,a,b) (p)->lpVtbl->AddDirtyRect(p,a,b) 904 | #else 905 | #define IDirect3DCubeTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 906 | #define IDirect3DCubeTexture8_AddRef(p) (p)->AddRef() 907 | #define IDirect3DCubeTexture8_Release(p) (p)->Release() 908 | #define IDirect3DCubeTexture8_GetDevice(p,a) (p)->GetDevice(a) 909 | #define IDirect3DCubeTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 910 | #define IDirect3DCubeTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 911 | #define IDirect3DCubeTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) 912 | #define IDirect3DCubeTexture8_SetPriority(p,a) (p)->SetPriority(a) 913 | #define IDirect3DCubeTexture8_GetPriority(p) (p)->GetPriority() 914 | #define IDirect3DCubeTexture8_PreLoad(p) (p)->PreLoad() 915 | #define IDirect3DCubeTexture8_GetType(p) (p)->GetType() 916 | #define IDirect3DCubeTexture8_SetLOD(p,a) (p)->SetLOD(a) 917 | #define IDirect3DCubeTexture8_GetLOD(p) (p)->GetLOD() 918 | #define IDirect3DCubeTexture8_GetLevelCount(p) (p)->GetLevelCount() 919 | #define IDirect3DCubeTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) 920 | #define IDirect3DCubeTexture8_GetCubeMapSurface(p,a,b,c) (p)->GetCubeMapSurface(a,b,c) 921 | #define IDirect3DCubeTexture8_LockRect(p,a,b,c,d,e) (p)->LockRect(a,b,c,d,e) 922 | #define IDirect3DCubeTexture8_UnlockRect(p,a,b) (p)->UnlockRect(a,b) 923 | #define IDirect3DCubeTexture8_AddDirtyRect(p,a,b) (p)->AddDirtyRect(a,b) 924 | #endif 925 | 926 | 927 | 928 | 929 | #undef INTERFACE 930 | #define INTERFACE IDirect3DVertexBuffer8 931 | 932 | DECLARE_INTERFACE_(IDirect3DVertexBuffer8, IDirect3DResource8) 933 | { 934 | /*** IUnknown methods ***/ 935 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 936 | STDMETHOD_(ULONG, AddRef)(THIS)PURE; 937 | STDMETHOD_(ULONG, Release)(THIS)PURE; 938 | 939 | /*** IDirect3DResource8 methods ***/ 940 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 941 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; 942 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; 943 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 944 | STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; 945 | STDMETHOD_(DWORD, GetPriority)(THIS)PURE; 946 | STDMETHOD_(void, PreLoad)(THIS)PURE; 947 | STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS)PURE; 948 | STDMETHOD(Lock)(THIS_ UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags) PURE; 949 | STDMETHOD(Unlock)(THIS)PURE; 950 | STDMETHOD(GetDesc)(THIS_ D3DVERTEXBUFFER_DESC *pDesc) PURE; 951 | }; 952 | 953 | typedef struct IDirect3DVertexBuffer8 *LPDIRECT3DVERTEXBUFFER8, *PDIRECT3DVERTEXBUFFER8; 954 | 955 | #if !defined(__cplusplus) || defined(CINTERFACE) 956 | #define IDirect3DVertexBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 957 | #define IDirect3DVertexBuffer8_AddRef(p) (p)->lpVtbl->AddRef(p) 958 | #define IDirect3DVertexBuffer8_Release(p) (p)->lpVtbl->Release(p) 959 | #define IDirect3DVertexBuffer8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 960 | #define IDirect3DVertexBuffer8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 961 | #define IDirect3DVertexBuffer8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 962 | #define IDirect3DVertexBuffer8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 963 | #define IDirect3DVertexBuffer8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) 964 | #define IDirect3DVertexBuffer8_GetPriority(p) (p)->lpVtbl->GetPriority(p) 965 | #define IDirect3DVertexBuffer8_PreLoad(p) (p)->lpVtbl->PreLoad(p) 966 | #define IDirect3DVertexBuffer8_GetType(p) (p)->lpVtbl->GetType(p) 967 | #define IDirect3DVertexBuffer8_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) 968 | #define IDirect3DVertexBuffer8_Unlock(p) (p)->lpVtbl->Unlock(p) 969 | #define IDirect3DVertexBuffer8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) 970 | #else 971 | #define IDirect3DVertexBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 972 | #define IDirect3DVertexBuffer8_AddRef(p) (p)->AddRef() 973 | #define IDirect3DVertexBuffer8_Release(p) (p)->Release() 974 | #define IDirect3DVertexBuffer8_GetDevice(p,a) (p)->GetDevice(a) 975 | #define IDirect3DVertexBuffer8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 976 | #define IDirect3DVertexBuffer8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 977 | #define IDirect3DVertexBuffer8_FreePrivateData(p,a) (p)->FreePrivateData(a) 978 | #define IDirect3DVertexBuffer8_SetPriority(p,a) (p)->SetPriority(a) 979 | #define IDirect3DVertexBuffer8_GetPriority(p) (p)->GetPriority() 980 | #define IDirect3DVertexBuffer8_PreLoad(p) (p)->PreLoad() 981 | #define IDirect3DVertexBuffer8_GetType(p) (p)->GetType() 982 | #define IDirect3DVertexBuffer8_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) 983 | #define IDirect3DVertexBuffer8_Unlock(p) (p)->Unlock() 984 | #define IDirect3DVertexBuffer8_GetDesc(p,a) (p)->GetDesc(a) 985 | #endif 986 | 987 | 988 | 989 | 990 | #undef INTERFACE 991 | #define INTERFACE IDirect3DIndexBuffer8 992 | 993 | DECLARE_INTERFACE_(IDirect3DIndexBuffer8, IDirect3DResource8) 994 | { 995 | /*** IUnknown methods ***/ 996 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 997 | STDMETHOD_(ULONG, AddRef)(THIS)PURE; 998 | STDMETHOD_(ULONG, Release)(THIS)PURE; 999 | 1000 | /*** IDirect3DResource8 methods ***/ 1001 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 1002 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; 1003 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; 1004 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 1005 | STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; 1006 | STDMETHOD_(DWORD, GetPriority)(THIS)PURE; 1007 | STDMETHOD_(void, PreLoad)(THIS)PURE; 1008 | STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS)PURE; 1009 | STDMETHOD(Lock)(THIS_ UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags) PURE; 1010 | STDMETHOD(Unlock)(THIS)PURE; 1011 | STDMETHOD(GetDesc)(THIS_ D3DINDEXBUFFER_DESC *pDesc) PURE; 1012 | }; 1013 | 1014 | typedef struct IDirect3DIndexBuffer8 *LPDIRECT3DINDEXBUFFER8, *PDIRECT3DINDEXBUFFER8; 1015 | 1016 | #if !defined(__cplusplus) || defined(CINTERFACE) 1017 | #define IDirect3DIndexBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 1018 | #define IDirect3DIndexBuffer8_AddRef(p) (p)->lpVtbl->AddRef(p) 1019 | #define IDirect3DIndexBuffer8_Release(p) (p)->lpVtbl->Release(p) 1020 | #define IDirect3DIndexBuffer8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 1021 | #define IDirect3DIndexBuffer8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 1022 | #define IDirect3DIndexBuffer8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 1023 | #define IDirect3DIndexBuffer8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 1024 | #define IDirect3DIndexBuffer8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) 1025 | #define IDirect3DIndexBuffer8_GetPriority(p) (p)->lpVtbl->GetPriority(p) 1026 | #define IDirect3DIndexBuffer8_PreLoad(p) (p)->lpVtbl->PreLoad(p) 1027 | #define IDirect3DIndexBuffer8_GetType(p) (p)->lpVtbl->GetType(p) 1028 | #define IDirect3DIndexBuffer8_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) 1029 | #define IDirect3DIndexBuffer8_Unlock(p) (p)->lpVtbl->Unlock(p) 1030 | #define IDirect3DIndexBuffer8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) 1031 | #else 1032 | #define IDirect3DIndexBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 1033 | #define IDirect3DIndexBuffer8_AddRef(p) (p)->AddRef() 1034 | #define IDirect3DIndexBuffer8_Release(p) (p)->Release() 1035 | #define IDirect3DIndexBuffer8_GetDevice(p,a) (p)->GetDevice(a) 1036 | #define IDirect3DIndexBuffer8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 1037 | #define IDirect3DIndexBuffer8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 1038 | #define IDirect3DIndexBuffer8_FreePrivateData(p,a) (p)->FreePrivateData(a) 1039 | #define IDirect3DIndexBuffer8_SetPriority(p,a) (p)->SetPriority(a) 1040 | #define IDirect3DIndexBuffer8_GetPriority(p) (p)->GetPriority() 1041 | #define IDirect3DIndexBuffer8_PreLoad(p) (p)->PreLoad() 1042 | #define IDirect3DIndexBuffer8_GetType(p) (p)->GetType() 1043 | #define IDirect3DIndexBuffer8_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) 1044 | #define IDirect3DIndexBuffer8_Unlock(p) (p)->Unlock() 1045 | #define IDirect3DIndexBuffer8_GetDesc(p,a) (p)->GetDesc(a) 1046 | #endif 1047 | 1048 | 1049 | 1050 | 1051 | #undef INTERFACE 1052 | #define INTERFACE IDirect3DSurface8 1053 | 1054 | DECLARE_INTERFACE_(IDirect3DSurface8, IUnknown) 1055 | { 1056 | /*** IUnknown methods ***/ 1057 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 1058 | STDMETHOD_(ULONG, AddRef)(THIS)PURE; 1059 | STDMETHOD_(ULONG, Release)(THIS)PURE; 1060 | 1061 | /*** IDirect3DSurface8 methods ***/ 1062 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 1063 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; 1064 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; 1065 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 1066 | STDMETHOD(GetContainer)(THIS_ REFIID riid, void** ppContainer) PURE; 1067 | STDMETHOD(GetDesc)(THIS_ D3DSURFACE_DESC *pDesc) PURE; 1068 | STDMETHOD(LockRect)(THIS_ D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) PURE; 1069 | STDMETHOD(UnlockRect)(THIS)PURE; 1070 | }; 1071 | 1072 | typedef struct IDirect3DSurface8 *LPDIRECT3DSURFACE8, *PDIRECT3DSURFACE8; 1073 | 1074 | #if !defined(__cplusplus) || defined(CINTERFACE) 1075 | #define IDirect3DSurface8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 1076 | #define IDirect3DSurface8_AddRef(p) (p)->lpVtbl->AddRef(p) 1077 | #define IDirect3DSurface8_Release(p) (p)->lpVtbl->Release(p) 1078 | #define IDirect3DSurface8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 1079 | #define IDirect3DSurface8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 1080 | #define IDirect3DSurface8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 1081 | #define IDirect3DSurface8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 1082 | #define IDirect3DSurface8_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) 1083 | #define IDirect3DSurface8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) 1084 | #define IDirect3DSurface8_LockRect(p,a,b,c) (p)->lpVtbl->LockRect(p,a,b,c) 1085 | #define IDirect3DSurface8_UnlockRect(p) (p)->lpVtbl->UnlockRect(p) 1086 | #else 1087 | #define IDirect3DSurface8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 1088 | #define IDirect3DSurface8_AddRef(p) (p)->AddRef() 1089 | #define IDirect3DSurface8_Release(p) (p)->Release() 1090 | #define IDirect3DSurface8_GetDevice(p,a) (p)->GetDevice(a) 1091 | #define IDirect3DSurface8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 1092 | #define IDirect3DSurface8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 1093 | #define IDirect3DSurface8_FreePrivateData(p,a) (p)->FreePrivateData(a) 1094 | #define IDirect3DSurface8_GetContainer(p,a,b) (p)->GetContainer(a,b) 1095 | #define IDirect3DSurface8_GetDesc(p,a) (p)->GetDesc(a) 1096 | #define IDirect3DSurface8_LockRect(p,a,b,c) (p)->LockRect(a,b,c) 1097 | #define IDirect3DSurface8_UnlockRect(p) (p)->UnlockRect() 1098 | #endif 1099 | 1100 | 1101 | 1102 | 1103 | #undef INTERFACE 1104 | #define INTERFACE IDirect3DVolume8 1105 | 1106 | DECLARE_INTERFACE_(IDirect3DVolume8, IUnknown) 1107 | { 1108 | /*** IUnknown methods ***/ 1109 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; 1110 | STDMETHOD_(ULONG, AddRef)(THIS)PURE; 1111 | STDMETHOD_(ULONG, Release)(THIS)PURE; 1112 | 1113 | /*** IDirect3DVolume8 methods ***/ 1114 | STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; 1115 | STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; 1116 | STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; 1117 | STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; 1118 | STDMETHOD(GetContainer)(THIS_ REFIID riid, void** ppContainer) PURE; 1119 | STDMETHOD(GetDesc)(THIS_ D3DVOLUME_DESC *pDesc) PURE; 1120 | STDMETHOD(LockBox)(THIS_ D3DLOCKED_BOX * pLockedVolume, CONST D3DBOX* pBox, DWORD Flags) PURE; 1121 | STDMETHOD(UnlockBox)(THIS)PURE; 1122 | }; 1123 | 1124 | typedef struct IDirect3DVolume8 *LPDIRECT3DVOLUME8, *PDIRECT3DVOLUME8; 1125 | 1126 | #if !defined(__cplusplus) || defined(CINTERFACE) 1127 | #define IDirect3DVolume8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 1128 | #define IDirect3DVolume8_AddRef(p) (p)->lpVtbl->AddRef(p) 1129 | #define IDirect3DVolume8_Release(p) (p)->lpVtbl->Release(p) 1130 | #define IDirect3DVolume8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) 1131 | #define IDirect3DVolume8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) 1132 | #define IDirect3DVolume8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) 1133 | #define IDirect3DVolume8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) 1134 | #define IDirect3DVolume8_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) 1135 | #define IDirect3DVolume8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) 1136 | #define IDirect3DVolume8_LockBox(p,a,b,c) (p)->lpVtbl->LockBox(p,a,b,c) 1137 | #define IDirect3DVolume8_UnlockBox(p) (p)->lpVtbl->UnlockBox(p) 1138 | #else 1139 | #define IDirect3DVolume8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 1140 | #define IDirect3DVolume8_AddRef(p) (p)->AddRef() 1141 | #define IDirect3DVolume8_Release(p) (p)->Release() 1142 | #define IDirect3DVolume8_GetDevice(p,a) (p)->GetDevice(a) 1143 | #define IDirect3DVolume8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) 1144 | #define IDirect3DVolume8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) 1145 | #define IDirect3DVolume8_FreePrivateData(p,a) (p)->FreePrivateData(a) 1146 | #define IDirect3DVolume8_GetContainer(p,a,b) (p)->GetContainer(a,b) 1147 | #define IDirect3DVolume8_GetDesc(p,a) (p)->GetDesc(a) 1148 | #define IDirect3DVolume8_LockBox(p,a,b,c) (p)->LockBox(a,b,c) 1149 | #define IDirect3DVolume8_UnlockBox(p) (p)->UnlockBox() 1150 | #endif 1151 | 1152 | /**************************************************************************** 1153 | * Flags for SetPrivateData method on all D3D8 interfaces 1154 | * 1155 | * The passed pointer is an IUnknown ptr. The SizeOfData argument to SetPrivateData 1156 | * must be set to sizeof(IUnknown*). Direct3D will call AddRef through this 1157 | * pointer and Release when the private data is destroyed. The data will be 1158 | * destroyed when another SetPrivateData with the same GUID is set, when 1159 | * FreePrivateData is called, or when the D3D8 object is freed. 1160 | ****************************************************************************/ 1161 | #define D3DSPD_IUNKNOWN 0x00000001L 1162 | 1163 | /**************************************************************************** 1164 | * 1165 | * Parameter for IDirect3D8 Enum and GetCaps8 functions to get the info for 1166 | * the current mode only. 1167 | * 1168 | ****************************************************************************/ 1169 | 1170 | #define D3DCURRENT_DISPLAY_MODE 0x00EFFFFFL 1171 | 1172 | /**************************************************************************** 1173 | * 1174 | * Flags for IDirect3D8::CreateDevice's BehaviorFlags 1175 | * 1176 | ****************************************************************************/ 1177 | 1178 | #define D3DCREATE_FPU_PRESERVE 0x00000002L 1179 | #define D3DCREATE_MULTITHREADED 0x00000004L 1180 | 1181 | #define D3DCREATE_PUREDEVICE 0x00000010L 1182 | #define D3DCREATE_SOFTWARE_VERTEXPROCESSING 0x00000020L 1183 | #define D3DCREATE_HARDWARE_VERTEXPROCESSING 0x00000040L 1184 | #define D3DCREATE_MIXED_VERTEXPROCESSING 0x00000080L 1185 | 1186 | #define D3DCREATE_DISABLE_DRIVER_MANAGEMENT 0x00000100L 1187 | 1188 | 1189 | /**************************************************************************** 1190 | * 1191 | * Parameter for IDirect3D8::CreateDevice's iAdapter 1192 | * 1193 | ****************************************************************************/ 1194 | 1195 | #define D3DADAPTER_DEFAULT 0 1196 | 1197 | /**************************************************************************** 1198 | * 1199 | * Flags for IDirect3D8::EnumAdapters 1200 | * 1201 | ****************************************************************************/ 1202 | 1203 | #define D3DENUM_NO_WHQL_LEVEL 0x00000002L 1204 | 1205 | /**************************************************************************** 1206 | * 1207 | * Maximum number of back-buffers supported in DX8 1208 | * 1209 | ****************************************************************************/ 1210 | 1211 | #define D3DPRESENT_BACK_BUFFERS_MAX 3L 1212 | 1213 | /**************************************************************************** 1214 | * 1215 | * Flags for IDirect3DDevice8::SetGammaRamp 1216 | * 1217 | ****************************************************************************/ 1218 | 1219 | #define D3DSGR_NO_CALIBRATION 0x00000000L 1220 | #define D3DSGR_CALIBRATE 0x00000001L 1221 | 1222 | /**************************************************************************** 1223 | * 1224 | * Flags for IDirect3DDevice8::SetCursorPosition 1225 | * 1226 | ****************************************************************************/ 1227 | 1228 | #define D3DCURSOR_IMMEDIATE_UPDATE 0x00000001L 1229 | 1230 | /**************************************************************************** 1231 | * 1232 | * Flags for DrawPrimitive/DrawIndexedPrimitive 1233 | * Also valid for Begin/BeginIndexed 1234 | * Also valid for VertexBuffer::CreateVertexBuffer 1235 | ****************************************************************************/ 1236 | 1237 | 1238 | /* 1239 | * DirectDraw error codes 1240 | */ 1241 | #define _FACD3D 0x876 1242 | #define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) 1243 | 1244 | /* 1245 | * Direct3D Errors 1246 | */ 1247 | #define D3D_OK S_OK 1248 | 1249 | #define D3DERR_WRONGTEXTUREFORMAT MAKE_D3DHRESULT(2072) 1250 | #define D3DERR_UNSUPPORTEDCOLOROPERATION MAKE_D3DHRESULT(2073) 1251 | #define D3DERR_UNSUPPORTEDCOLORARG MAKE_D3DHRESULT(2074) 1252 | #define D3DERR_UNSUPPORTEDALPHAOPERATION MAKE_D3DHRESULT(2075) 1253 | #define D3DERR_UNSUPPORTEDALPHAARG MAKE_D3DHRESULT(2076) 1254 | #define D3DERR_TOOMANYOPERATIONS MAKE_D3DHRESULT(2077) 1255 | #define D3DERR_CONFLICTINGTEXTUREFILTER MAKE_D3DHRESULT(2078) 1256 | #define D3DERR_UNSUPPORTEDFACTORVALUE MAKE_D3DHRESULT(2079) 1257 | #define D3DERR_CONFLICTINGRENDERSTATE MAKE_D3DHRESULT(2081) 1258 | #define D3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_D3DHRESULT(2082) 1259 | #define D3DERR_CONFLICTINGTEXTUREPALETTE MAKE_D3DHRESULT(2086) 1260 | #define D3DERR_DRIVERINTERNALERROR MAKE_D3DHRESULT(2087) 1261 | 1262 | #define D3DERR_NOTFOUND MAKE_D3DHRESULT(2150) 1263 | #define D3DERR_MOREDATA MAKE_D3DHRESULT(2151) 1264 | #define D3DERR_DEVICELOST MAKE_D3DHRESULT(2152) 1265 | #define D3DERR_DEVICENOTRESET MAKE_D3DHRESULT(2153) 1266 | #define D3DERR_NOTAVAILABLE MAKE_D3DHRESULT(2154) 1267 | #define D3DERR_OUTOFVIDEOMEMORY MAKE_D3DHRESULT(380) 1268 | #define D3DERR_INVALIDDEVICE MAKE_D3DHRESULT(2155) 1269 | #define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) 1270 | #define D3DERR_DRIVERINVALIDCALL MAKE_D3DHRESULT(2157) 1271 | 1272 | #ifdef __cplusplus 1273 | }; 1274 | #endif 1275 | 1276 | #endif /* (DIRECT3D_VERSION >= 0x0800) */ 1277 | #endif /* _D3D_H_ */ 1278 | 1279 | --------------------------------------------------------------------------------