/*
* 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
* Copyright 2009 Henri Verbeet 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
*/
/*
* Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle 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"
#ifndef VBOX_WITH_WDDM
struct wined3d_wndproc
{
};
struct wined3d_wndproc_table
{
unsigned int count;
unsigned int size;
};
{
0, 0, &wined3d_cs,
};
{
0, 0, &wined3d_wndproc_cs,
};
#endif
/* When updating default value here, make sure to update winecfg as well,
* where appropriate. */
{
TRUE, /* Use of GLSL enabled by default */
ORM_FBO, /* Use FBOs to do offscreen rendering */
RTL_READTEX, /* Default render target locking method */
PCI_VENDOR_NONE,/* PCI Vendor ID */
PCI_DEVICE_NONE,/* PCI Device ID */
0, /* The default of memory is set in init_driver_info */
NULL, /* No wine logo by default */
TRUE, /* Multisampling enabled by default. */
FALSE, /* No strict draw ordering. */
TRUE, /* Don't try to render onscreen by default. */
~0U, /* No VS shader model limit by default. */
~0U, /* No GS shader model limit by default. */
~0U, /* No PS shader model limit by default. */
FALSE, /* 3D support enabled by default. */
};
/* Do not call while under the GL lock. */
{
#ifdef VBOX
hr = VBoxExtCheckInit();
{
return NULL;
}
#endif
if (!object)
{
ERR("Failed to allocate wined3d object memory.\n");
#ifdef VBOX
#endif
return NULL;
}
flags |= WINED3D_NO3D;
{
#ifdef VBOX
#endif
return NULL;
}
return object;
}
{
return ERROR_FILE_NOT_FOUND;
}
{
if (appkey && !RegQueryValueExA(appkey, name, 0, &type, (BYTE *)data, &size) && (type == REG_DWORD)) return 0;
if (defkey && !RegQueryValueExA(defkey, name, 0, &type, (BYTE *)data, &size) && (type == REG_DWORD)) return 0;
return ERROR_FILE_NOT_FOUND;
}
{
#ifdef VBOX
# ifndef VBOX_WITH_WDDM
# endif
#endif
{
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;
}
/* @@ Wine registry key: HKCU\Software\Wine\Direct3D */
{
/* @@ Wine registry key: HKCU\Software\Wine\AppDefaults\app.exe\Direct3D */
{
RegCloseKey( tmpkey );
}
}
{
{
{
ERR_(winediag)("The GLSL shader backend has been disabled. You get to keep all the pieces if it breaks.\n");
TRACE("Use of GL Shading Language disabled\n");
}
}
{
{
TRACE("Using the backbuffer for offscreen rendering\n");
}
{
TRACE("Using FBOs for offscreen rendering\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");
}
}
{
/* 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
{
}
}
{
/* 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("Multisampling disabled.\n");
}
}
{
TRACE("Enforcing strict draw ordering.\n");
}
{
TRACE("Not always rendering backbuffers offscreen.\n");
}
{
TRACE("Disabling 3D support.\n");
}
}
return TRUE;
}
{
#ifndef VBOX_WITH_WDDM
unsigned int i;
#endif
if (!TlsFree(wined3d_context_tls_idx))
{
}
#ifndef VBOX_WITH_WDDM
for (i = 0; i < wndproc_table.count; ++i)
{
/* Trying to unregister these would be futile. These entries can only
* exist if either we skipped them in wined3d_unregister_window() due
* to the application replacing the wndproc after the entry was
* registered, or if the application still has an active wined3d
* device. In the latter case the application has bigger problems than
* these entries. */
}
#endif
#ifndef VBOX_WITH_WDDM
#endif
return TRUE;
}
#ifndef VBOX_WITH_WDDM
{
}
{
}
static void wined3d_wndproc_mutex_lock(void)
{
}
static void wined3d_wndproc_mutex_unlock(void)
{
}
{
unsigned int i;
for (i = 0; i < wndproc_table.count; ++i)
{
{
return &wndproc_table.entries[i];
}
}
return NULL;
}
{
if (!entry)
{
}
if (device)
if (unicode)
}
{
if (wined3d_find_wndproc(window))
{
return TRUE;
}
{
if (!wndproc_table.entries) new_entries = HeapAlloc(GetProcessHeap(), 0, new_size * sizeof(*new_entries));
else new_entries = HeapReAlloc(GetProcessHeap(), 0, wndproc_table.entries, new_size * sizeof(*new_entries));
if (!new_entries)
{
ERR("Failed to grow table.\n");
return FALSE;
}
}
/* Set a window proc that matches the window. Some applications (e.g. NoX)
* replace the window proc after we've set ours, and expect to be able to
* call the previous one (ours) directly, without using CallWindowProc(). */
else
return TRUE;
}
{
{
return;
}
{
{
WARN("Not unregistering window %p, window proc %#lx doesn't match wined3d window proc %p.\n",
return;
}
}
else
{
{
WARN("Not unregistering window %p, window proc %#lx doesn't match wined3d window proc %p.\n",
return;
}
}
}
#endif
/* At process attach */
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
return wined3d_dll_init(hInstDLL);
case DLL_PROCESS_DETACH:
if (lpv) break;
return wined3d_dll_destroy(hInstDLL);
case DLL_THREAD_DETACH:
if (!context_set_current(NULL))
{
ERR("Failed to clear current context.\n");
}
return TRUE;
}
return TRUE;
}