VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/d3d9_main.c@ 39605

最後變更 在這個檔案從39605是 39570,由 vboxsync 提交於 13 年 前

wine: IDirect3D9Impl_QueryInterface fix, getd3dcaps9 fix, debug tooling

  • 屬性 svn:eol-style 設為 native
檔案大小: 5.2 KB
 
1/*
2 * Direct3D 9
3 *
4 * Copyright 2002-2003 Jason Edmeades
5 * Copyright 2002-2003 Raphael Junqueira
6 * Copyright 2005 Oliver Stieber
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 *
22 */
23
24/*
25 * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
26 * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
27 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
28 * a choice of LGPL license versions is made available with the language indicating
29 * that LGPLv2 or any later version may be used, or where a choice of which version
30 * of the LGPL is applied is otherwise unspecified.
31 */
32#define VBOX_WINE_DEBUG_DEFINES
33
34#include "config.h"
35#include "initguid.h"
36#include "d3d9_private.h"
37
38WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
39
40static int D3DPERF_event_level = 0;
41
42void WINAPI DebugSetMute(void) {
43 /* nothing to do */
44}
45
46IDirect3D9* WINAPI DECLSPEC_HOTPATCH Direct3DCreate9(UINT SDKVersion) {
47 IDirect3D9Impl* object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D9Impl));
48
49 object->lpVtbl = &Direct3D9_Vtbl;
50 object->ref = 1;
51
52 wined3d_mutex_lock();
53 object->WineD3D = WineDirect3DCreate(9, (IUnknown *)object);
54 wined3d_mutex_unlock();
55
56 TRACE("SDKVersion = %x, Created Direct3D object @ %p, WineObj @ %p\n", SDKVersion, object, object->WineD3D);
57
58 if (!object->WineD3D)
59 {
60 HeapFree( GetProcessHeap(), 0, object );
61 object = NULL;
62 }
63 return (IDirect3D9*) object;
64}
65
66HRESULT WINAPI DECLSPEC_HOTPATCH Direct3DCreate9Ex(UINT SDKVersion, IDirect3D9Ex **direct3d9ex) {
67#ifndef VBOX_WITH_WDDM
68 /* real D3D lib does not allow 9Ex creation if no WDDM driver is installed,
69 * the Direct3DCreate9Ex should return D3DERR_NOTAVAILABLE in that case.
70 * do it that way for our XPWM case */
71 return D3DERR_NOTAVAILABLE;
72#else
73 IDirect3D9 *ret;
74 IDirect3D9Impl* object;
75 TRACE("Calling Direct3DCreate9\n");
76 ret = Direct3DCreate9(SDKVersion);
77 if(!ret) {
78 *direct3d9ex = NULL;
79 return D3DERR_NOTAVAILABLE;
80 }
81
82 object = (IDirect3D9Impl *) ret;
83 object->extended = TRUE; /* Enables QI for extended interfaces */
84 *direct3d9ex = (IDirect3D9Ex *) object;
85 return D3D_OK;
86#endif
87}
88
89/*******************************************************************
90 * Direct3DShaderValidatorCreate9 (D3D9.@)
91 *
92 * No documentation available for this function.
93 * SDK only says it is internal and shouldn't be used.
94 */
95void* WINAPI Direct3DShaderValidatorCreate9(void)
96{
97 static int once;
98
99 if (!once++) FIXME("stub\n");
100 return NULL;
101}
102
103/*******************************************************************
104 * DllMain
105 */
106BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
107{
108 /* At process attach */
109 TRACE("fdwReason=%d\n", fdwReason);
110 if (fdwReason == DLL_PROCESS_ATTACH)
111 DisableThreadLibraryCalls(hInstDLL);
112
113 return TRUE;
114}
115
116/***********************************************************************
117 * D3DPERF_BeginEvent (D3D9.@)
118 */
119int WINAPI D3DPERF_BeginEvent(D3DCOLOR color, LPCWSTR name) {
120 TRACE("(color %#x, name %s) : stub\n", color, debugstr_w(name));
121
122 return D3DPERF_event_level++;
123}
124
125/***********************************************************************
126 * D3DPERF_EndEvent (D3D9.@)
127 */
128int WINAPI D3DPERF_EndEvent(void) {
129 TRACE("(void) : stub\n");
130
131 return --D3DPERF_event_level;
132}
133
134/***********************************************************************
135 * D3DPERF_GetStatus (D3D9.@)
136 */
137DWORD WINAPI D3DPERF_GetStatus(void) {
138 FIXME("(void) : stub\n");
139
140 return 0;
141}
142
143/***********************************************************************
144 * D3DPERF_SetOptions (D3D9.@)
145 *
146 */
147void WINAPI D3DPERF_SetOptions(DWORD options)
148{
149 FIXME("(%#x) : stub\n", options);
150}
151
152/***********************************************************************
153 * D3DPERF_QueryRepeatFrame (D3D9.@)
154 */
155BOOL WINAPI D3DPERF_QueryRepeatFrame(void) {
156 FIXME("(void) : stub\n");
157
158 return FALSE;
159}
160
161/***********************************************************************
162 * D3DPERF_SetMarker (D3D9.@)
163 */
164void WINAPI D3DPERF_SetMarker(D3DCOLOR color, LPCWSTR name) {
165 FIXME("(color %#x, name %s) : stub\n", color, debugstr_w(name));
166}
167
168/***********************************************************************
169 * D3DPERF_SetRegion (D3D9.@)
170 */
171void WINAPI D3DPERF_SetRegion(D3DCOLOR color, LPCWSTR name) {
172 FIXME("(color %#x, name %s) : stub\n", color, debugstr_w(name));
173}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette