wined3d: Disable the scissor test for depth blits.
[wine] / dlls / d3d8 / d3d8_main.c
1 /*
2  * Direct3D 8
3  *
4  * Copyright 2005 Oliver Stieber
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  *
20  */
21
22 #include "config.h"
23 #include "initguid.h"
24 #include "d3d8_private.h"
25 #include "wine/debug.h"
26
27 WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
28
29 HRESULT WINAPI D3D8GetSWInfo(void) {
30     FIXME("(void): stub\n");
31     return 0;
32 }
33
34 void WINAPI DebugSetMute(void) {
35     /* nothing to do */
36 }
37
38 IDirect3D8* WINAPI Direct3DCreate8(UINT SDKVersion) {
39     IDirect3D8Impl* object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D8Impl));
40
41     object->lpVtbl = &Direct3D8_Vtbl;
42     object->ref = 1;
43     object->WineD3D = WineDirect3DCreate(SDKVersion, 8, (IUnknown *)object);
44
45     TRACE("SDKVersion = %x, Created Direct3D object @ %p, WineObj @ %p\n", SDKVersion, object, object->WineD3D);
46
47     return (IDirect3D8*) object;
48 }
49
50 /* At process attach */
51 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
52 {
53     TRACE("fdwReason=%d\n", fdwReason);
54     if (fdwReason == DLL_PROCESS_ATTACH)
55         DisableThreadLibraryCalls(hInstDLL);
56
57     return TRUE;
58 }
59
60 /***********************************************************************
61  *              ValidateVertexShader (D3D8.@)
62  *
63  * I've seen reserved1 and reserved2 always passed as 0's
64  * bool seems always passed as 0 or 1, but other values work as well.... 
65  * toto       result?
66  */
67 HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, int bool, DWORD* toto)
68
69   HRESULT ret;
70   FIXME("(%p %p %p %d %p): stub\n", vertexshader, reserved1, reserved2, bool, toto);
71
72   if (!vertexshader)
73       return E_FAIL;
74
75   if (reserved1 || reserved2)
76       return E_FAIL;
77
78   switch(*vertexshader) {
79         case 0xFFFE0101:
80         case 0xFFFE0100: 
81             ret=S_OK;
82             break;
83         default:
84             ERR("vertexshader version mismatch\n");
85             ret=E_FAIL;
86         }
87
88   return ret;
89 }
90
91 /***********************************************************************
92  *              ValidatePixelShader (D3D8.@)
93  *
94  * PARAMS
95  * toto       result?
96  */
97 HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, int bool, DWORD* toto)
98 {
99   HRESULT ret;
100   FIXME("(%p %p %d %p): stub\n", pixelshader, reserved1, bool, toto);
101   
102   if (!pixelshader)
103       return E_FAIL;
104
105   if (reserved1)
106       return E_FAIL;   
107
108   switch(*pixelshader) {
109         case 0xFFFF0100:
110         case 0xFFFF0101:
111         case 0xFFFF0102:
112         case 0xFFFF0103:
113         case 0xFFFF0104:
114             ret=S_OK;
115             break;
116         default:
117             ERR("pixelshader version mismatch\n");
118             ret=E_FAIL;
119         }
120   return ret;
121 }