VirtualBox

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

Last change on this file since 33252 was 25949, checked in by vboxsync, 15 years ago

crOpenGL: update to wine 1.1.36 and disable unnecessary fbo state poll

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