ReactOS  0.4.13-dev-92-gf251225
wined3d_main.c
Go to the documentation of this file.
1 /*
2  * Direct3D wine internal interface main
3  *
4  * Copyright 2002-2003 The wine-d3d team
5  * Copyright 2002-2003 Raphael Junqueira
6  * Copyright 2004 Jason Edmeades
7  * Copyright 2007-2008 Stefan Dösinger for CodeWeavers
8  * Copyright 2009 Henri Verbeet for CodeWeavers
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include "config.h"
26 #include "wine/port.h"
27 
28 #include "initguid.h"
29 #include "wined3d_private.h"
30 
33 
35 {
40 };
41 
43 {
45  unsigned int count;
47 };
48 
50 
53 {
54  0, 0, &wined3d_cs,
57  0, 0, {(DWORD_PTR)(__FILE__ ": wined3d_cs")}
58 };
59 static CRITICAL_SECTION wined3d_cs = {&wined3d_cs_debug, -1, 0, 0, 0, 0};
60 
63 {
64  0, 0, &wined3d_wndproc_cs,
67  0, 0, {(DWORD_PTR)(__FILE__ ": wined3d_wndproc_cs")}
68 };
70 
71 /* When updating default value here, make sure to update winecfg as well,
72  * where appropriate. */
74 {
75  TRUE, /* Multithreaded CS by default. */
76  FALSE, /* explicit_gl_version */
77  MAKEDWORD_VERSION(4, 4), /* Default to OpenGL 4.4 */
78  TRUE, /* Use of GLSL enabled by default */
79  ORM_FBO, /* Use FBOs to do offscreen rendering */
80  PCI_VENDOR_NONE,/* PCI Vendor ID */
81  PCI_DEVICE_NONE,/* PCI Device ID */
82  0, /* The default of memory is set in init_driver_info */
83  NULL, /* No wine logo by default */
84  TRUE, /* Prefer multisample textures to multisample renderbuffers. */
85  ~0u, /* Don't force a specific sample count by default. */
86  FALSE, /* Don't range check relative addressing indices in float constants. */
87  ~0U, /* No VS shader model limit by default. */
88  ~0U, /* No HS shader model limit by default. */
89  ~0U, /* No DS shader model limit by default. */
90  ~0U, /* No GS shader model limit by default. */
91  ~0U, /* No PS shader model limit by default. */
92  ~0u, /* No CS shader model limit by default. */
93  FALSE, /* 3D support enabled by default. */
94 };
95 
97 {
98  struct wined3d *object;
99  HRESULT hr;
100 
101  if (!(object = heap_alloc_zero(FIELD_OFFSET(struct wined3d, adapters[1]))))
102  {
103  ERR("Failed to allocate wined3d object memory.\n");
104  return NULL;
105  }
106 
108  flags |= WINED3D_NO3D;
109 
110  hr = wined3d_init(object, flags);
111  if (FAILED(hr))
112  {
113  WARN("Failed to initialize wined3d object, hr %#x.\n", hr);
114  heap_free(object);
115  return NULL;
116  }
117 
118  TRACE("Created wined3d object %p.\n", object);
119 
120  return object;
121 }
122 
123 static DWORD get_config_key(HKEY defkey, HKEY appkey, const char *name, char *buffer, DWORD size)
124 {
125  if (appkey && !RegQueryValueExA(appkey, name, 0, NULL, (BYTE *)buffer, &size)) return 0;
126  if (defkey && !RegQueryValueExA(defkey, name, 0, NULL, (BYTE *)buffer, &size)) return 0;
127  return ERROR_FILE_NOT_FOUND;
128 }
129 
130 static DWORD get_config_key_dword(HKEY defkey, HKEY appkey, const char *name, DWORD *value)
131 {
132  DWORD type, data, size;
133 
134  size = sizeof(data);
135  if (appkey && !RegQueryValueExA(appkey, name, 0, &type, (BYTE *)&data, &size) && type == REG_DWORD) goto success;
136  size = sizeof(data);
137  if (defkey && !RegQueryValueExA(defkey, name, 0, &type, (BYTE *)&data, &size) && type == REG_DWORD) goto success;
138 
139  return ERROR_FILE_NOT_FOUND;
140 
141 success:
142  *value = data;
143  return 0;
144 }
145 
147 {
149  char buffer[MAX_PATH+10];
150  DWORD size = sizeof(buffer);
151  HKEY hkey = 0;
152  HKEY appkey = 0;
153  DWORD len, tmpvalue;
154  WNDCLASSA wc;
155 
158  {
159  DWORD err = GetLastError();
160  ERR("Failed to allocate context TLS index, err %#x.\n", err);
161  return FALSE;
162  }
164 
165  /* We need our own window class for a fake window which we use to retrieve GL capabilities */
166  /* We might need CS_OWNDC in the future if we notice strange things on Windows.
167  * Various articles/posts about OpenGL problems on Windows recommend this. */
168  wc.style = CS_HREDRAW | CS_VREDRAW;
170  wc.cbClsExtra = 0;
171  wc.cbWndExtra = 0;
172  wc.hInstance = hInstDLL;
173  wc.hIcon = LoadIconA(NULL, (const char *)IDI_WINLOGO);
174  wc.hCursor = LoadCursorA(NULL, (const char *)IDC_ARROW);
175  wc.hbrBackground = NULL;
176  wc.lpszMenuName = NULL;
178 
179  if (!RegisterClassA(&wc))
180  {
181  ERR("Failed to register window class 'WineD3D_OpenGL'!\n");
183  {
184  DWORD err = GetLastError();
185  ERR("Failed to free context TLS index, err %#x.\n", err);
186  }
187  return FALSE;
188  }
189 
190  DisableThreadLibraryCalls(hInstDLL);
191 
192  /* @@ Wine registry key: HKCU\Software\Wine\Direct3D */
193  if ( RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Direct3D", &hkey ) ) hkey = 0;
194 
196  if (len && len < MAX_PATH)
197  {
198  HKEY tmpkey;
199  /* @@ Wine registry key: HKCU\Software\Wine\AppDefaults\app.exe\Direct3D */
200  if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\AppDefaults", &tmpkey ))
201  {
202  char *p, *appname = buffer;
203  if ((p = strrchr( appname, '/' ))) appname = p + 1;
204  if ((p = strrchr( appname, '\\' ))) appname = p + 1;
205  strcat( appname, "\\Direct3D" );
206  TRACE("appname = [%s]\n", appname);
207  if (RegOpenKeyA( tmpkey, appname, &appkey )) appkey = 0;
208  RegCloseKey( tmpkey );
209  }
210  }
211 
212  if (hkey || appkey)
213  {
214  if (!get_config_key_dword(hkey, appkey, "csmt", &wined3d_settings.cs_multithreaded))
215  ERR_(winediag)("Setting multithreaded command stream to %#x.\n", wined3d_settings.cs_multithreaded);
216  if (!get_config_key_dword(hkey, appkey, "MaxVersionGL", &tmpvalue))
217  {
218  ERR_(winediag)("Setting maximum allowed wined3d GL version to %u.%u.\n",
219  tmpvalue >> 16, tmpvalue & 0xffff);
221  wined3d_settings.max_gl_version = tmpvalue;
222  }
223  if ( !get_config_key( hkey, appkey, "UseGLSL", buffer, size) )
224  {
225  if (!strcmp(buffer,"disabled"))
226  {
227  ERR_(winediag)("The GLSL shader backend has been disabled. You get to keep all the pieces if it breaks.\n");
228  TRACE("Use of GL Shading Language disabled\n");
230  }
231  }
232  if (!get_config_key(hkey, appkey, "OffscreenRenderingMode", buffer, size)
233  && !strcmp(buffer,"backbuffer"))
235  if ( !get_config_key_dword( hkey, appkey, "VideoPciDeviceID", &tmpvalue) )
236  {
237  int pci_device_id = tmpvalue;
238 
239  /* A pci device id is 16-bit */
240  if(pci_device_id > 0xffff)
241  {
242  ERR("Invalid value for VideoPciDeviceID. The value should be smaller or equal to 65535 or 0xffff\n");
243  }
244  else
245  {
246  TRACE("Using PCI Device ID %04x\n", pci_device_id);
247  wined3d_settings.pci_device_id = pci_device_id;
248  }
249  }
250  if ( !get_config_key_dword( hkey, appkey, "VideoPciVendorID", &tmpvalue) )
251  {
252  int pci_vendor_id = tmpvalue;
253 
254  /* A pci device id is 16-bit */
255  if(pci_vendor_id > 0xffff)
256  {
257  ERR("Invalid value for VideoPciVendorID. The value should be smaller or equal to 65535 or 0xffff\n");
258  }
259  else
260  {
261  TRACE("Using PCI Vendor ID %04x\n", pci_vendor_id);
262  wined3d_settings.pci_vendor_id = pci_vendor_id;
263  }
264  }
265  if ( !get_config_key( hkey, appkey, "VideoMemorySize", buffer, size) )
266  {
267  int TmpVideoMemorySize = atoi(buffer);
268  if(TmpVideoMemorySize > 0)
269  {
270  wined3d_settings.emulated_textureram = (UINT64)TmpVideoMemorySize *1024*1024;
271  TRACE("Use %iMiB = 0x%s bytes for emulated_textureram\n",
272  TmpVideoMemorySize,
274  }
275  else
276  ERR("VideoMemorySize is %i but must be >0\n", TmpVideoMemorySize);
277  }
278  if ( !get_config_key( hkey, appkey, "WineLogo", buffer, size) )
279  {
280  size_t len = strlen(buffer) + 1;
281 
283  ERR("Failed to allocate logo path memory.\n");
284  else
286  }
287  if (!get_config_key_dword(hkey, appkey, "MultisampleTextures", &wined3d_settings.multisample_textures))
288  ERR_(winediag)("Setting multisample textures to %#x.\n", wined3d_settings.multisample_textures);
289  if (!get_config_key_dword(hkey, appkey, "SampleCount", &wined3d_settings.sample_count))
290  ERR_(winediag)("Forcing sample count to %u. This may not be compatible with all applications.\n",
292  if (!get_config_key(hkey, appkey, "CheckFloatConstants", buffer, size)
293  && !strcmp(buffer, "enabled"))
294  {
295  TRACE("Checking relative addressing indices in float constants.\n");
297  }
298  if (!get_config_key_dword(hkey, appkey, "MaxShaderModelVS", &wined3d_settings.max_sm_vs))
299  TRACE("Limiting VS shader model to %u.\n", wined3d_settings.max_sm_vs);
300  if (!get_config_key_dword(hkey, appkey, "MaxShaderModelHS", &wined3d_settings.max_sm_hs))
301  TRACE("Limiting HS shader model to %u.\n", wined3d_settings.max_sm_hs);
302  if (!get_config_key_dword(hkey, appkey, "MaxShaderModelDS", &wined3d_settings.max_sm_ds))
303  TRACE("Limiting DS shader model to %u.\n", wined3d_settings.max_sm_ds);
304  if (!get_config_key_dword(hkey, appkey, "MaxShaderModelGS", &wined3d_settings.max_sm_gs))
305  TRACE("Limiting GS shader model to %u.\n", wined3d_settings.max_sm_gs);
306  if (!get_config_key_dword(hkey, appkey, "MaxShaderModelPS", &wined3d_settings.max_sm_ps))
307  TRACE("Limiting PS shader model to %u.\n", wined3d_settings.max_sm_ps);
308  if (!get_config_key_dword(hkey, appkey, "MaxShaderModelCS", &wined3d_settings.max_sm_cs))
309  TRACE("Limiting CS shader model to %u.\n", wined3d_settings.max_sm_cs);
310  if (!get_config_key(hkey, appkey, "DirectDrawRenderer", buffer, size)
311  && !strcmp(buffer, "gdi"))
312  {
313  TRACE("Disabling 3D support.\n");
315  }
316  }
317 
318  if (appkey) RegCloseKey( appkey );
319  if (hkey) RegCloseKey( hkey );
320 
322 
323  return TRUE;
324 }
325 
327 {
329  unsigned int i;
330 
332  {
333  DWORD err = GetLastError();
334  ERR("Failed to free context TLS index, err %#x.\n", err);
335  }
336 
337  for (i = 0; i < wndproc_table.count; ++i)
338  {
339  /* Trying to unregister these would be futile. These entries can only
340  * exist if either we skipped them in wined3d_unregister_window() due
341  * to the application replacing the wndproc after the entry was
342  * registered, or if the application still has an active wined3d
343  * device. In the latter case the application has bigger problems than
344  * these entries. */
345  WARN("Leftover wndproc table entry %p.\n", &wndproc_table.entries[i]);
346  }
347  heap_free(wndproc_table.entries);
348 
351 
354 
356 
357  return TRUE;
358 }
359 
361 {
363 }
364 
366 {
368 }
369 
370 static void wined3d_wndproc_mutex_lock(void)
371 {
373 }
374 
376 {
378 }
379 
381 {
382  unsigned int i;
383 
384  for (i = 0; i < wndproc_table.count; ++i)
385  {
386  if (wndproc_table.entries[i].window == window)
387  {
388  return &wndproc_table.entries[i];
389  }
390  }
391 
392  return NULL;
393 }
394 
396 {
397  struct wined3d_wndproc *entry;
398  struct wined3d_device *device;
399  BOOL unicode;
400  WNDPROC proc;
401 
404 
405  if (!entry)
406  {
408  ERR("Window %p is not registered with wined3d.\n", window);
410  }
411 
412  device = entry->device;
413  unicode = entry->unicode;
414  proc = entry->proc;
416 
417  if (device)
419  if (unicode)
422 }
423 
425 {
426  struct wined3d_wndproc *entry;
427 
429 
431  {
433  WARN("Window %p is already registered with wined3d.\n", window);
434  return TRUE;
435  }
436 
437  if (!wined3d_array_reserve((void **)&wndproc_table.entries, &wndproc_table.size,
438  wndproc_table.count + 1, sizeof(*entry)))
439  {
441  ERR("Failed to grow table.\n");
442  return FALSE;
443  }
444 
445  entry = &wndproc_table.entries[wndproc_table.count++];
446  entry->window = window;
447  entry->unicode = IsWindowUnicode(window);
448  /* Set a window proc that matches the window. Some applications (e.g. NoX)
449  * replace the window proc after we've set ours, and expect to be able to
450  * call the previous one (ours) directly, without using CallWindowProc(). */
451  if (entry->unicode)
453  else
455  entry->device = device;
456 
458 
459  return TRUE;
460 }
461 
463 {
464  struct wined3d_wndproc *entry, *last;
465  LONG_PTR proc;
466 
468 
470  {
472  ERR("Window %p is not registered with wined3d.\n", window);
473  return;
474  }
475 
476  if (entry->unicode)
477  {
479  if (proc != (LONG_PTR)wined3d_wndproc)
480  {
481  entry->device = NULL;
483  WARN("Not unregistering window %p, window proc %#lx doesn't match wined3d window proc %p.\n",
485  return;
486  }
487 
489  }
490  else
491  {
493  if (proc != (LONG_PTR)wined3d_wndproc)
494  {
495  entry->device = NULL;
497  WARN("Not unregistering window %p, window proc %#lx doesn't match wined3d window proc %p.\n",
499  return;
500  }
501 
503  }
504 
505  last = &wndproc_table.entries[--wndproc_table.count];
506  if (entry != last) *entry = *last;
507 
509 }
510 
511 /* At process attach */
513 {
514  switch (reason)
515  {
516  case DLL_PROCESS_ATTACH:
517  return wined3d_dll_init(inst);
518 
519  case DLL_PROCESS_DETACH:
520  if (!reserved)
521  return wined3d_dll_destroy(inst);
522  break;
523 
524  case DLL_THREAD_DETACH:
526  {
527  ERR("Failed to clear current context.\n");
528  }
529  return TRUE;
530  }
531  return TRUE;
532 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define ORM_FBO
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3272
static LRESULT CALLBACK wined3d_wndproc(HWND window, UINT message, WPARAM wparam, LPARAM lparam)
Definition: wined3d_main.c:395
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4041
Definition: tftpd.h:59
unsigned int count
Definition: wined3d_main.c:45
#define TRUE
Definition: types.h:120
struct wined3d_adapter adapters[1]
#define DWORD_PTR
Definition: treelist.c:76
HRESULT hr
Definition: shlfolder.c:183
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
POINT last
Definition: font.c:46
#define HKEY_CURRENT_USER
Definition: winreg.h:11
BOOL wined3d_dxtn_init(void)
Definition: dxtn.c:461
unsigned int sample_count
uint8_t entry
Definition: isohybrid.c:63
#define WARN(fmt,...)
Definition: debug.h:111
#define U(x)
Definition: wordpad.c:44
#define ERR_(ch,...)
Definition: debug.h:156
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:360
#define CALLBACK
Definition: compat.h:27
void context_set_tls_idx(DWORD idx)
Definition: context.c:1490
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
int cbClsExtra
Definition: winuser.h:3118
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define CS_HREDRAW
Definition: winuser.h:648
LPCSTR lpszMenuName
Definition: winuser.h:3124
GLuint buffer
Definition: glext.h:5915
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
UINT_PTR WPARAM
Definition: windef.h:207
HBRUSH hbrBackground
Definition: winuser.h:3123
static HANDLE proc()
Definition: pdb.c:32
#define GetWindowLongPtrW
Definition: winuser.h:4698
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved)
Definition: wined3d_main.c:512
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
struct wined3d_device * device
Definition: wined3d_main.c:39
unsigned int max_sm_hs
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:546
#define DLL_THREAD_DETACH
Definition: compat.h:122
HICON WINAPI LoadIconA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2029
static BOOL wined3d_dll_destroy(HINSTANCE hInstDLL)
Definition: wined3d_main.c:326
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static CRITICAL_SECTION_DEBUG wined3d_cs_debug
Definition: wined3d_main.c:52
struct wined3d *CDECL wined3d_create(DWORD flags)
Definition: wined3d_main.c:96
static struct wined3d_wndproc_table wndproc_table
Definition: wined3d_main.c:49
WINE_DECLARE_DEBUG_CHANNEL(winediag)
int cbWndExtra
Definition: winuser.h:3119
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static CRITICAL_SECTION_DEBUG wined3d_wndproc_cs_debug
Definition: wined3d_main.c:62
#define WINED3D_OPENGL_WINDOW_CLASS_NAME
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define PCI_DEVICE_NONE
void wined3d_unregister_window(HWND window)
Definition: wined3d_main.c:462
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: devices.h:37
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
r reserved
Definition: btrfs.c:2655
HCURSOR hCursor
Definition: winuser.h:3122
#define ORM_BACKBUFFER
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
static DWORD get_config_key_dword(HKEY defkey, HKEY appkey, const char *name, DWORD *value)
Definition: wined3d_main.c:130
BOOL WINAPI IsWindowUnicode(_In_ HWND)
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
unsigned int max_sm_gs
#define DLL_PROCESS_DETACH
Definition: compat.h:119
#define GetWindowLongPtrA
Definition: winuser.h:4697
#define CS_VREDRAW
Definition: winuser.h:653
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1089
static struct wined3d_wndproc * wined3d_find_wndproc(HWND window)
Definition: wined3d_main.c:380
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
unsigned int cs_multithreaded
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
#define WINAPI
Definition: msvc.h:8
BOOL wined3d_array_reserve(void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size)
Definition: utils.c:6436
#define IDI_WINLOGO
Definition: winuser.h:704
unsigned short pci_vendor_id
unsigned long DWORD
Definition: ntddk_ex.h:95
#define success(from, fromstr, to, tostr)
static DWORD wined3d_context_tls_idx
Definition: context.c:48
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static CRITICAL_SECTION wined3d_cs
Definition: wined3d_main.c:51
GLbitfield flags
Definition: glext.h:7161
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
static void wined3d_wndproc_mutex_lock(void)
Definition: wined3d_main.c:370
BOOL wined3d_register_window(HWND window, struct wined3d_device *device)
Definition: wined3d_main.c:424
#define MAKEDWORD_VERSION(maj, min)
#define PCI_VENDOR_NONE
struct wined3d_wndproc * entries
Definition: wined3d_main.c:44
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define SetWindowLongPtrA
Definition: winuser.h:5214
unsigned char BYTE
Definition: mem.h:68
unsigned short pci_device_id
DWORD WINAPI TlsAlloc(VOID)
Definition: thread.c:1023
#define TLS_OUT_OF_INDEXES
Definition: winbase.h:530
#define err(...)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static IHTMLWindow2 * window
Definition: events.c:77
LPCSTR lpszClassName
Definition: winuser.h:3125
LIST_ENTRY ProcessLocksList
Definition: winbase.h:848
HRESULT wined3d_init(struct wined3d *wined3d, DWORD flags)
Definition: directx.c:6786
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
#define GWLP_WNDPROC
Definition: treelist.c:66
static CRITICAL_SECTION wined3d_wndproc_cs
Definition: wined3d_main.c:61
unsigned int max_sm_ps
UINT style
Definition: winuser.h:3116
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
#define ERR(fmt,...)
Definition: debug.h:109
ULONG_PTR SIZE_T
Definition: typedefs.h:78
WINE_DEFAULT_DEBUG_CHANNEL(d3d)
BOOL context_set_current(struct wined3d_context *ctx)
Definition: context.c:1500
#define CDECL
Definition: compat.h:21
HINSTANCE hInstance
Definition: winuser.h:3120
unsigned int multisample_textures
static DWORD get_config_key(HKEY defkey, HKEY appkey, const char *name, char *buffer, DWORD size)
Definition: wined3d_main.c:123
void wined3d_dxtn_free(void)
Definition: dxtn.c:515
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
static BOOL wined3d_dll_init(HINSTANCE hInstDLL)
Definition: wined3d_main.c:146
DWORD context_get_tls_idx(void)
Definition: context.c:1485
WNDPROC lpfnWndProc
Definition: winuser.h:3117
#define IDC_ARROW
Definition: winuser.h:682
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
Definition: name.c:36
static void wined3d_wndproc_mutex_unlock(void)
Definition: wined3d_main.c:375
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned int max_sm_ds
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
unsigned int max_sm_cs
#define SetWindowLongPtrW
Definition: winuser.h:5215
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
unsigned long long UINT64
GLfloat GLfloat p
Definition: glext.h:8902
LONG_PTR LRESULT
Definition: windef.h:209
unsigned int max_sm_vs
#define WINED3D_NO3D
Definition: wined3d.h:1318
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:365
LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL unicode, UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc)
Definition: device.c:5322
#define REG_DWORD
Definition: sdbapi.c:596
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
void * object
Definition: jmemsys.h:48
static UINT WPARAM wparam
Definition: combo.c:716
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
HICON hIcon
Definition: winuser.h:3121