Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygend3d8_main.c
Go to the documentation of this file.
00001 /* 00002 * Direct3D 8 00003 * 00004 * Copyright 2005 Oliver Stieber 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00019 * 00020 */ 00021 00022 #include "config.h" 00023 #include "initguid.h" 00024 #include "d3d8_private.h" 00025 #include "wine/debug.h" 00026 00027 WINE_DEFAULT_DEBUG_CHANNEL(d3d8); 00028 00029 HRESULT WINAPI D3D8GetSWInfo(void) { 00030 FIXME("(void): stub\n"); 00031 return 0; 00032 } 00033 00034 void WINAPI DebugSetMute(void) { 00035 /* nothing to do */ 00036 } 00037 00038 IDirect3D8* WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT SDKVersion) { 00039 IDirect3D8Impl* object; 00040 TRACE("SDKVersion = %x\n", SDKVersion); 00041 00042 wined3d_mutex_lock(); 00043 00044 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D8Impl)); 00045 00046 object->IDirect3D8_iface.lpVtbl = &Direct3D8_Vtbl; 00047 object->ref = 1; 00048 object->WineD3D = wined3d_create(8, WINED3D_LEGACY_DEPTH_BIAS, &object->IDirect3D8_iface); 00049 00050 TRACE("Created Direct3D object @ %p, WineObj @ %p\n", object, object->WineD3D); 00051 00052 wined3d_mutex_unlock(); 00053 00054 if (!object->WineD3D) 00055 { 00056 HeapFree( GetProcessHeap(), 0, object ); 00057 object = NULL; 00058 } 00059 return &object->IDirect3D8_iface; 00060 } 00061 00062 /* At process attach */ 00063 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) 00064 { 00065 TRACE("fdwReason=%d\n", fdwReason); 00066 if (fdwReason == DLL_PROCESS_ATTACH) 00067 DisableThreadLibraryCalls(hInstDLL); 00068 00069 return TRUE; 00070 } 00071 00072 /*********************************************************************** 00073 * ValidateVertexShader (D3D8.@) 00074 * 00075 * I've seen reserved1 and reserved2 always passed as 0's 00076 * bool seems always passed as 0 or 1, but other values work as well... 00077 * toto result? 00078 */ 00079 HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL bool, DWORD* toto) 00080 { 00081 HRESULT ret; 00082 static BOOL warned; 00083 00084 if (TRACE_ON(d3d8) || !warned) { 00085 FIXME("(%p %p %p %d %p): stub\n", vertexshader, reserved1, reserved2, bool, toto); 00086 warned = TRUE; 00087 } 00088 00089 if (!vertexshader) 00090 return E_FAIL; 00091 00092 if (reserved1 || reserved2) 00093 return E_FAIL; 00094 00095 switch(*vertexshader) { 00096 case 0xFFFE0101: 00097 case 0xFFFE0100: 00098 ret=S_OK; 00099 break; 00100 default: 00101 WARN("Invalid shader version token %#x.\n", *vertexshader); 00102 ret=E_FAIL; 00103 } 00104 00105 return ret; 00106 } 00107 00108 /*********************************************************************** 00109 * ValidatePixelShader (D3D8.@) 00110 * 00111 * PARAMS 00112 * toto result? 00113 */ 00114 HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL bool, DWORD* toto) 00115 { 00116 HRESULT ret; 00117 static BOOL warned; 00118 00119 if (TRACE_ON(d3d8) || !warned) { 00120 FIXME("(%p %p %d %p): stub\n", pixelshader, reserved1, bool, toto); 00121 warned = TRUE; 00122 } 00123 00124 if (!pixelshader) 00125 return E_FAIL; 00126 00127 if (reserved1) 00128 return E_FAIL; 00129 00130 switch(*pixelshader) { 00131 case 0xFFFF0100: 00132 case 0xFFFF0101: 00133 case 0xFFFF0102: 00134 case 0xFFFF0103: 00135 case 0xFFFF0104: 00136 ret=S_OK; 00137 break; 00138 default: 00139 WARN("Invalid shader version token %#x.\n", *pixelshader); 00140 ret=E_FAIL; 00141 } 00142 return ret; 00143 } Generated on Sun May 27 2012 04:22:01 for ReactOS by
1.7.6.1
|