ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

d3d9.c
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:       See COPYING in the top level directory
00003  * PROJECT:         ReactOS ReactX
00004  * FILE:            dll/directx/d3d9/d3d9.c
00005  * PURPOSE:         d3d9.dll implementation
00006  * PROGRAMERS:      Magnus Olsen <greatlrd (at) reactos (dot) org>
00007  *                  Gregor Brunmar <gregor (dot) brunmar (at) home (dot) se>
00008  */
00009 
00010 #include <d3d9.h>
00011 #include "d3d9_helpers.h"
00012 #include "d3d9_create.h"
00013 #include <debug.h>
00014 
00015 #define DEBUG_MESSAGE_BUFFER_SIZE   512
00016 
00017 typedef IDirect3D9* (WINAPI *LPDIRECT3DCREATE9)(UINT);
00018 
00019 static LPCSTR D3dError_WrongSdkVersion =
00020     "D3D ERROR: D3D header version mismatch.\n"
00021     "The application was compiled against and will only work with "
00022     "D3D_SDK_VERSION (%d), but the currently installed runtime is "
00023     "version (%d).\n"
00024     "Recompile the application against the appropriate SDK for the installed runtime.\n"
00025     "\n";
00026 
00027 HRESULT WINAPI Direct3DShaderValidatorCreate9(void)
00028 {
00029     UNIMPLEMENTED
00030     return 0;
00031 }
00032 
00033 HRESULT WINAPI PSGPError(void)
00034 {
00035     UNIMPLEMENTED
00036     return 0;
00037 }
00038 
00039 HRESULT WINAPI PSGPSampleTexture(void)
00040 {
00041     UNIMPLEMENTED
00042     return 0;
00043 }
00044 
00045 HRESULT WINAPI DebugSetLevel(void)
00046 {
00047     UNIMPLEMENTED
00048     return 0;
00049 }
00050 
00051 HRESULT WINAPI DebugSetMute(DWORD dw1)
00052 {
00053     UNIMPLEMENTED
00054     return 0;
00055 }
00056 
00057 IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion)
00058 {
00059     HINSTANCE hDebugDll;
00060     DWORD LoadDebugDll;
00061     DWORD LoadDebugDllSize;
00062     LPDIRECT3D9 D3D9Obj = 0;
00063     LPDIRECT3DCREATE9 DebugDirect3DCreate9 = 0;
00064     CHAR DebugMessageBuffer[DEBUG_MESSAGE_BUFFER_SIZE];
00065     UINT NoDebugSDKVersion = SDKVersion & ~DX_D3D9_DEBUG;
00066 
00067     LoadDebugDllSize = sizeof(LoadDebugDll);
00068     if (ReadRegistryValue(REG_DWORD, "LoadDebugRuntime", (LPBYTE)&LoadDebugDll, &LoadDebugDllSize))
00069     {
00070         if (0 != LoadDebugDll)
00071         {
00072             hDebugDll = LoadLibraryA("d3d9d.dll");
00073 
00074             if (0 != hDebugDll)
00075             {
00076                 DebugDirect3DCreate9 = (LPDIRECT3DCREATE9)GetProcAddress(hDebugDll, "Direct3DCreate9");
00077 
00078                 return DebugDirect3DCreate9(SDKVersion);
00079             }
00080         }
00081     }
00082 
00083     if (NoDebugSDKVersion != D3D_SDK_VERSION && NoDebugSDKVersion != D3D9b_SDK_VERSION)
00084     {
00085         if (SDKVersion & DX_D3D9_DEBUG)
00086         {
00087             HRESULT hResult;
00088             hResult = SafeFormatString(DebugMessageBuffer, DEBUG_MESSAGE_BUFFER_SIZE, D3dError_WrongSdkVersion, NoDebugSDKVersion, D3D_SDK_VERSION);
00089             if (SUCCEEDED(hResult))
00090                 OutputDebugStringA(DebugMessageBuffer);
00091         }
00092 
00093         return NULL;
00094     }
00095 
00096     CreateD3D9(&D3D9Obj, SDKVersion);
00097 
00098     return D3D9Obj;
00099 }
00100 
00101 BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
00102 {
00103     switch (ul_reason_for_call)
00104     {
00105         case DLL_PROCESS_ATTACH:
00106         case DLL_THREAD_ATTACH:
00107         case DLL_THREAD_DETACH:
00108         case DLL_PROCESS_DETACH:
00109             break;
00110     }
00111 
00112     return TRUE;
00113 }

Generated on Sun May 27 2012 04:21:13 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.