wined3d_main.c revision 114410893548b9522c46fdcbd8f63385eb8bfb68
/*
* Direct3D wine internal interface main
*
* Copyright 2002-2003 The wine-d3d team
* Copyright 2002-2003 Raphael Junqueira
* Copyright 2004 Jason Edmeades
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Sun elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
#include "config.h"
#include "initguid.h"
#include "wined3d_private.h"
int num_lock = 0;
/* When updating default value here, make sure to update winecfg as well,
* where appropriate. */
{
VS_HW, /* Hardware by default */
PS_HW, /* Hardware by default */
VBO_HW, /* Hardware by default */
TRUE, /* Use of GLSL enabled by default */
ORM_FBO, /* Use FBOs to do offscreen rendering */
RTL_AUTO, /* Automatically determine best locking method */
PCI_VENDOR_NONE,/* PCI Vendor ID */
PCI_DEVICE_NONE,/* PCI Device ID */
0, /* The default of memory is set in FillGLCaps */
NULL, /* No wine logo by default */
FALSE /* Disable multisampling for now due to Nvidia driver bugs which happens for some users */
};
if (!InitAdapters(object))
{
WARN("Failed to initialize direct3d adapters, Direct3D will not be available\n");
if (dxVersion > 7)
{
return NULL;
}
}
}
static inline DWORD get_config_key(HKEY defkey, HKEY appkey, const char* name, char* buffer, DWORD size)
{
return ERROR_FILE_NOT_FOUND;
}
{
if (0 != appkey && !RegQueryValueExA( appkey, name, 0, &type, (LPBYTE) data, &size ) && (type == REG_DWORD)) return 0;
if (0 != defkey && !RegQueryValueExA( defkey, name, 0, &type, (LPBYTE) data, &size ) && (type == REG_DWORD)) return 0;
return ERROR_FILE_NOT_FOUND;
}
static void CDECL wined3d_do_nothing(void)
{
}
{
{
return FALSE;
}
/* We need our own window class for a fake window which we use to retrieve GL capabilities */
/* We might need CS_OWNDC in the future if we notice strange things on Windows.
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
if (!RegisterClassA(&wc))
{
ERR("Failed to register window class 'WineD3D_OpenGL'!\n");
if (!TlsFree(wined3d_context_tls_idx))
{
}
return FALSE;
}
if (mod)
{
}
else /* We are most likely on Windows */
{
}
/* @@ Wine registry key: HKCU\Software\Wine\Direct3D */
{
/* @@ Wine registry key: HKCU\Software\Wine\AppDefaults\app.exe\Direct3D */
{
RegCloseKey( tmpkey );
}
}
{
{
{
TRACE("Disable vertex shaders\n");
}
}
{
{
TRACE("Allow pixel shaders\n");
}
{
TRACE("Disable pixel shaders\n");
}
}
{
{
TRACE("Disable Vertex Buffer Hardware support\n");
}
{
TRACE("Allow Vertex Buffer Hardware support\n");
}
}
{
{
TRACE("Use of GL Shading Language disabled\n");
}
}
{
{
TRACE("Using the backbuffer for offscreen rendering\n");
}
{
TRACE("Using PBuffers for offscreen rendering\n");
}
{
TRACE("Using FBOs for offscreen rendering\n");
}
}
{
{
TRACE("Disabling render target locking\n");
}
{
TRACE("Using glReadPixels for render target reading and glDrawPixels for writing\n");
}
{
TRACE("Using glReadPixels for render target reading and textures for writing\n");
}
{
TRACE("Using textures for render target reading and glDrawPixels for writing\n");
}
{
TRACE("Reading render targets via textures and writing via textures\n");
}
}
{
int pci_device_id = tmpvalue;
/* A pci device id is 16-bit */
if(pci_device_id > 0xffff)
{
ERR("Invalid value for VideoPciDeviceID. The value should be smaller or equal to 65535 or 0xffff\n");
}
else
{
}
}
{
int pci_vendor_id = tmpvalue;
/* A pci device id is 16-bit */
if(pci_vendor_id > 0xffff)
{
ERR("Invalid value for VideoPciVendorID. The value should be smaller or equal to 65535 or 0xffff\n");
}
else
{
}
}
{
if(TmpVideoMemorySize > 0)
{
TRACE("Use %iMB = %d byte for emulated_textureram\n",
}
else
}
{
}
{
{
TRACE("Allow multisampling\n");
}
}
}
TRACE("Allow HW vertex shaders\n");
TRACE("Disable pixel shaders\n");
TRACE("Disable Vertex Buffer Hardware support\n");
TRACE("If supported by your system, GL Shading Language will be used\n");
return TRUE;
}
{
if (!TlsFree(wined3d_context_tls_idx))
{
}
return TRUE;
}
/* At process attach */
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
return wined3d_init(hInstDLL);
case DLL_PROCESS_DETACH:
return wined3d_destroy(hInstDLL);
case DLL_THREAD_DETACH:
{
if (!context_set_current(NULL))
{
ERR("Failed to clear current context.\n");
}
return TRUE;
}
default:
return TRUE;
}
}