gdiplus: Implemented GdipGetLineRect/GdipGetLineRectI.
[wine.git] / dlls / d3d9 / d3d9_main.c
blob69ad9c845dde449dcba4c979ed0dc92fa3c1aa6a
1 /*
2 * Direct3D 9
4 * Copyright 2002-2003 Jason Edmeades
5 * Copyright 2002-2003 Raphael Junqueira
6 * Copyright 2005 Oliver Stieber
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.
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.
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
24 #include "config.h"
25 #include "initguid.h"
26 #include "d3d9_private.h"
28 static CRITICAL_SECTION_DEBUG d3d9_cs_debug =
30 0, 0, &d3d9_cs,
31 { &d3d9_cs_debug.ProcessLocksList,
32 &d3d9_cs_debug.ProcessLocksList },
33 0, 0, { (DWORD_PTR)(__FILE__ ": d3d9_cs") }
35 CRITICAL_SECTION d3d9_cs = { &d3d9_cs_debug, -1, 0, 0, 0, 0 };
37 WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
39 static int D3DPERF_event_level = 0;
41 void WINAPI DebugSetMute(void) {
42 /* nothing to do */
45 IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion) {
46 IDirect3D9Impl* object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D9Impl));
48 object->lpVtbl = &Direct3D9_Vtbl;
49 object->ref = 1;
50 EnterCriticalSection(&d3d9_cs);
51 object->WineD3D = WineDirect3DCreate(SDKVersion, 9, (IUnknown *)object);
52 LeaveCriticalSection(&d3d9_cs);
54 TRACE("SDKVersion = %x, Created Direct3D object @ %p, WineObj @ %p\n", SDKVersion, object, object->WineD3D);
56 return (IDirect3D9*) object;
59 HRESULT WINAPI Direct3DCreate9Ex(UINT SDKVersion, IDirect3D9Ex **direct3d9ex) {
60 IDirect3D9 *ret;
61 IDirect3D9Impl* object;
63 TRACE("Calling Direct3DCreate9\n");
64 ret = Direct3DCreate9(SDKVersion);
65 if(!ret) {
66 *direct3d9ex = NULL;
67 return D3DERR_NOTAVAILABLE;
70 object = (IDirect3D9Impl *) ret;
71 object->extended = TRUE; /* Enables QI for extended interfaces */
72 *direct3d9ex = (IDirect3D9Ex *) object;
73 return D3D_OK;
76 /*******************************************************************
77 * Direct3DShaderValidatorCreate9 (D3D9.@)
79 * No documentation available for this function.
80 * SDK only says it is internal and shouldn't be used.
82 void* WINAPI Direct3DShaderValidatorCreate9(void)
84 FIXME("stub\n");
85 return NULL;
88 /* At process attach */
89 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
91 TRACE("fdwReason=%d\n", fdwReason);
92 if (fdwReason == DLL_PROCESS_ATTACH)
93 DisableThreadLibraryCalls(hInstDLL);
95 return TRUE;
98 /***********************************************************************
99 * D3DPERF_BeginEvent (D3D9.@)
101 int WINAPI D3DPERF_BeginEvent(D3DCOLOR color, LPCWSTR name) {
102 FIXME("(color %#x, name %s) : stub\n", color, debugstr_w(name));
104 return D3DPERF_event_level++;
107 /***********************************************************************
108 * D3DPERF_EndEvent (D3D9.@)
110 int WINAPI D3DPERF_EndEvent(void) {
111 FIXME("(void) : stub\n");
113 return --D3DPERF_event_level;
116 /***********************************************************************
117 * D3DPERF_GetStatus (D3D9.@)
119 DWORD WINAPI D3DPERF_GetStatus(void) {
120 FIXME("(void) : stub\n");
122 return 0;
125 /***********************************************************************
126 * D3DPERF_SetOptions (D3D9.@)
129 void WINAPI D3DPERF_SetOptions(DWORD options)
131 FIXME("(%#x) : stub\n", options);
134 /***********************************************************************
135 * D3DPERF_QueryRepeatFrame (D3D9.@)
137 BOOL WINAPI D3DPERF_QueryRepeatFrame(void) {
138 FIXME("(void) : stub\n");
140 return FALSE;
143 /***********************************************************************
144 * D3DPERF_SetMarker (D3D9.@)
146 void WINAPI D3DPERF_SetMarker(D3DCOLOR color, LPCWSTR name) {
147 FIXME("(color %#x, name %s) : stub\n", color, debugstr_w(name));
150 /***********************************************************************
151 * D3DPERF_SetRegion (D3D9.@)
153 void WINAPI D3DPERF_SetRegion(D3DCOLOR color, LPCWSTR name) {
154 FIXME("(color %#x, name %s) : stub\n", color, debugstr_w(name));