VirtualBox

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

Last change on this file since 48395 was 40986, checked in by vboxsync, 13 years ago

header fixes

  • Property svn:eol-style set to native
File size: 5.2 KB
Line 
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
33#define VBOX_WINE_DEBUG_DEFINES
34
35#include "config.h"
36#include "initguid.h"
37#include "d3d9_private.h"
38
39WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
40
41static int D3DPERF_event_level = 0;
42
43void WINAPI DebugSetMute(void) {
44 /* nothing to do */
45}
46
47IDirect3D9* WINAPI DECLSPEC_HOTPATCH Direct3DCreate9(UINT SDKVersion) {
48 IDirect3D9Impl* object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D9Impl));
49
50 object->lpVtbl = &Direct3D9_Vtbl;
51 object->ref = 1;
52
53 wined3d_mutex_lock();
54 object->WineD3D = WineDirect3DCreate(9, (IUnknown *)object);
55 wined3d_mutex_unlock();
56
57 TRACE("SDKVersion = %x, Created Direct3D object @ %p, WineObj @ %p\n", SDKVersion, object, object->WineD3D);
58
59 if (!object->WineD3D)
60 {
61 HeapFree( GetProcessHeap(), 0, object );
62 object = NULL;
63 }
64 return (IDirect3D9*) object;
65}
66
67HRESULT WINAPI DECLSPEC_HOTPATCH Direct3DCreate9Ex(UINT SDKVersion, IDirect3D9Ex **direct3d9ex) {
68#ifndef VBOX_WITH_WDDM
69 /* real D3D lib does not allow 9Ex creation if no WDDM driver is installed,
70 * the Direct3DCreate9Ex should return D3DERR_NOTAVAILABLE in that case.
71 * do it that way for our XPWM case */
72 return D3DERR_NOTAVAILABLE;
73#else
74 IDirect3D9 *ret;
75 IDirect3D9Impl* object;
76 TRACE("Calling Direct3DCreate9\n");
77 ret = Direct3DCreate9(SDKVersion);
78 if(!ret) {
79 *direct3d9ex = NULL;
80 return D3DERR_NOTAVAILABLE;
81 }
82
83 object = (IDirect3D9Impl *) ret;
84 object->extended = TRUE; /* Enables QI for extended interfaces */
85 *direct3d9ex = (IDirect3D9Ex *) object;
86 return D3D_OK;
87#endif
88}
89
90/*******************************************************************
91 * Direct3DShaderValidatorCreate9 (D3D9.@)
92 *
93 * No documentation available for this function.
94 * SDK only says it is internal and shouldn't be used.
95 */
96void* WINAPI Direct3DShaderValidatorCreate9(void)
97{
98 static int once;
99
100 if (!once++) FIXME("stub\n");
101 return NULL;
102}
103
104/*******************************************************************
105 * DllMain
106 */
107BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
108{
109 /* At process attach */
110 TRACE("fdwReason=%d\n", fdwReason);
111 if (fdwReason == DLL_PROCESS_ATTACH)
112 DisableThreadLibraryCalls(hInstDLL);
113
114 return TRUE;
115}
116
117/***********************************************************************
118 * D3DPERF_BeginEvent (D3D9.@)
119 */
120int WINAPI D3DPERF_BeginEvent(D3DCOLOR color, LPCWSTR name) {
121 TRACE("(color %#x, name %s) : stub\n", color, debugstr_w(name));
122
123 return D3DPERF_event_level++;
124}
125
126/***********************************************************************
127 * D3DPERF_EndEvent (D3D9.@)
128 */
129int WINAPI D3DPERF_EndEvent(void) {
130 TRACE("(void) : stub\n");
131
132 return --D3DPERF_event_level;
133}
134
135/***********************************************************************
136 * D3DPERF_GetStatus (D3D9.@)
137 */
138DWORD WINAPI D3DPERF_GetStatus(void) {
139 FIXME("(void) : stub\n");
140
141 return 0;
142}
143
144/***********************************************************************
145 * D3DPERF_SetOptions (D3D9.@)
146 *
147 */
148void WINAPI D3DPERF_SetOptions(DWORD options)
149{
150 FIXME("(%#x) : stub\n", options);
151}
152
153/***********************************************************************
154 * D3DPERF_QueryRepeatFrame (D3D9.@)
155 */
156BOOL WINAPI D3DPERF_QueryRepeatFrame(void) {
157 FIXME("(void) : stub\n");
158
159 return FALSE;
160}
161
162/***********************************************************************
163 * D3DPERF_SetMarker (D3D9.@)
164 */
165void WINAPI D3DPERF_SetMarker(D3DCOLOR color, LPCWSTR name) {
166 FIXME("(color %#x, name %s) : stub\n", color, debugstr_w(name));
167}
168
169/***********************************************************************
170 * D3DPERF_SetRegion (D3D9.@)
171 */
172void WINAPI D3DPERF_SetRegion(D3DCOLOR color, LPCWSTR name) {
173 FIXME("(color %#x, name %s) : stub\n", color, debugstr_w(name));
174}
Note: See TracBrowser for help on using the repository browser.

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