2 * Direct3D wine internal interface main
4 * Copyright 2002-2003 The wine-d3d team
5 * Copyright 2002-2003 Raphael Junqueira
6 * Copyright 2004 Jason Edmeades
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "wined3d_private.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(wine_d3d
);
30 void (*wine_tsx11_lock_ptr
)(void) = NULL
;
31 void (*wine_tsx11_unlock_ptr
)(void) = NULL
;
32 int vs_mode
= VS_HW
; /* Hardware by default */
33 int ps_mode
= PS_NONE
; /* Disabled by default */
35 IWineD3D
* WINAPI
WineDirect3DCreate(UINT SDKVersion
, UINT dxVersion
) {
36 IWineD3DImpl
* object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IWineD3DImpl
));
37 object
->lpVtbl
= &IWineD3D_Vtbl
;
38 object
->dxVersion
= dxVersion
;
41 TRACE("Created WineD3D object @ %p for d3d%d support\n", object
, dxVersion
);
43 return (IWineD3D
*)object
;
46 /* At process attach */
47 BOOL WINAPI
DllMain(HINSTANCE hInstDLL
, DWORD fdwReason
, LPVOID lpv
)
49 TRACE("WineD3D DLLMain Reason=%ld\n", fdwReason
);
50 if (fdwReason
== DLL_PROCESS_ATTACH
)
54 DWORD size
= sizeof(buffer
);
57 DisableThreadLibraryCalls(hInstDLL
);
59 mod
= GetModuleHandleA( "x11drv.dll" );
62 wine_tsx11_lock_ptr
= (void *)GetProcAddress( mod
, "wine_tsx11_lock" );
63 wine_tsx11_unlock_ptr
= (void *)GetProcAddress( mod
, "wine_tsx11_unlock" );
65 if ( !RegOpenKeyA( HKEY_LOCAL_MACHINE
, "Software\\Wine\\Direct3D", &hkey
) )
67 if ( !RegQueryValueExA( hkey
, "VertexShaderMode", 0, NULL
, buffer
, &size
) )
69 if (!strcmp(buffer
,"none"))
71 TRACE("Disable vertex shaders\n");
74 else if (!strcmp(buffer
,"emulation"))
76 TRACE("Force SW vertex shaders\n");
80 if ( !RegQueryValueExA( hkey
, "PixelShaderMode", 0, NULL
, buffer
, &size
) )
82 if (!strcmp(buffer
,"enabled"))
84 TRACE("Allow pixel shaders\n");
90 TRACE("Allow HW vertex shaders\n");
91 if (ps_mode
== PS_NONE
)
92 TRACE("Disable pixel shaders\n");