Added missing register defines for Linux/PPC.
[wine] / dlls / d3d8 / d3d8_main.c
1 /* Direct3D 8
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16  *
17  */
18
19 #include "config.h"
20
21 #include "windef.h"
22 #include "winbase.h"
23 #include "wingdi.h"
24 #include "winuser.h"
25 #include "wine/debug.h"
26
27 #include "d3d8.h"
28 #include "d3d8_private.h"
29
30 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
31
32 int num_lock = 0;
33 void (*wine_tsx11_lock_ptr)(void) = NULL;
34 void (*wine_tsx11_unlock_ptr)(void) = NULL;
35
36 HRESULT WINAPI D3D8GetSWInfo(void)
37 {
38     FIXME("(void): stub\n");
39     return 0;
40 }
41
42 void DebugSetMute(void)
43 {
44     /* nothing to do */
45 }
46
47 IDirect3D8* WINAPI Direct3DCreate8(UINT SDKVersion)
48 {
49
50     IDirect3D8Impl *object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D8Impl));
51
52     object->lpVtbl = &Direct3D8_Vtbl;
53     object->ref = 1;
54
55     TRACE("SDKVersion = %x, Created Direct3D object at %p\n", SDKVersion, object);
56
57     return (IDirect3D8 *)object;
58 }
59
60 /* At process attach */
61 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
62 {
63     TRACE("fdwReason=%ld\n", fdwReason);
64        if (fdwReason == DLL_PROCESS_ATTACH)
65        {
66            HMODULE mod;
67
68            DisableThreadLibraryCalls(hInstDLL);
69
70            mod = GetModuleHandleA( "x11drv.dll" );
71            if (mod)
72            {
73                wine_tsx11_lock_ptr   = (void *)GetProcAddress( mod, "wine_tsx11_lock" );
74                wine_tsx11_unlock_ptr = (void *)GetProcAddress( mod, "wine_tsx11_unlock" );
75            }
76        }
77     return TRUE;
78 }