ReactOS  0.4.13-dev-464-g6b95727
font.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008 Tony Wasserka
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  *
18  */
19 
20 #include "config.h"
21 #include "wine/port.h"
22 
23 #include "d3dx9_private.h"
24 #include "wine/unicode.h"
25 
27 
28 struct d3dx_font
29 {
32 
33  IDirect3DDevice9 *device;
35 
38 
41  IDirect3DTexture9 *texture;
44 };
45 
46 /* Returns the smallest power of 2 which is greater than or equal to num */
48 {
49  UINT result = 1;
50 
51  /* In the unlikely event somebody passes a large value, make sure we don't enter an infinite loop */
52  if (num >= 0x80000000)
53  return 0x80000000;
54 
55  while (result < num)
56  result <<= 1;
57 
58  return result;
59 }
60 
61 static inline struct d3dx_font *impl_from_ID3DXFont(ID3DXFont *iface)
62 {
63  return CONTAINING_RECORD(iface, struct d3dx_font, ID3DXFont_iface);
64 }
65 
67 {
68  TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
69 
70  if (IsEqualGUID(riid, &IID_ID3DXFont)
72  {
73  IUnknown_AddRef(iface);
74  *out = iface;
75  return S_OK;
76  }
77 
78  WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
79 
80  *out = NULL;
81  return E_NOINTERFACE;
82 }
83 
85 {
86  struct d3dx_font *This = impl_from_ID3DXFont(iface);
88 
89  TRACE("%p increasing refcount to %u\n", iface, ref);
90 
91  return ref;
92 }
93 
95 {
96  struct d3dx_font *This = impl_from_ID3DXFont(iface);
98 
99  TRACE("%p decreasing refcount to %u\n", iface, ref);
100 
101  if (!ref)
102  {
103  if (This->texture)
104  {
106  DeleteObject(This->bitmap);
107  }
108  DeleteObject(This->hfont);
109  DeleteDC(This->hdc);
112  }
113  return ref;
114 }
115 
116 static HRESULT WINAPI ID3DXFontImpl_GetDevice(ID3DXFont *iface, IDirect3DDevice9 **device)
117 {
118  struct d3dx_font *This = impl_from_ID3DXFont(iface);
119 
120  TRACE("iface %p, device %p\n", iface, device);
121 
122  if( !device ) return D3DERR_INVALIDCALL;
123  *device = This->device;
124  IDirect3DDevice9_AddRef(This->device);
125 
126  return D3D_OK;
127 }
128 
130 {
131  struct d3dx_font *This = impl_from_ID3DXFont(iface);
132 
133  TRACE("iface %p, desc %p\n", iface, desc);
134 
135  if( !desc ) return D3DERR_INVALIDCALL;
136  memcpy(desc, &This->desc, FIELD_OFFSET(D3DXFONT_DESCA, FaceName));
137  WideCharToMultiByte(CP_ACP, 0, This->desc.FaceName, -1, desc->FaceName, ARRAY_SIZE(desc->FaceName), NULL, NULL);
138 
139  return D3D_OK;
140 }
141 
143 {
144  struct d3dx_font *This = impl_from_ID3DXFont(iface);
145 
146  TRACE("iface %p, desc %p\n", iface, desc);
147 
148  if( !desc ) return D3DERR_INVALIDCALL;
149  *desc = This->desc;
150 
151  return D3D_OK;
152 }
153 
155 {
156  struct d3dx_font *This = impl_from_ID3DXFont(iface);
157  TRACE("iface %p, metrics %p\n", iface, metrics);
158  return GetTextMetricsA(This->hdc, metrics);
159 }
160 
162 {
163  struct d3dx_font *This = impl_from_ID3DXFont(iface);
164  TRACE("iface %p, metrics %p\n", iface, metrics);
165  return GetTextMetricsW(This->hdc, metrics);
166 }
167 
169 {
170  struct d3dx_font *This = impl_from_ID3DXFont(iface);
171  TRACE("iface %p\n", iface);
172  return This->hdc;
173 }
174 
176  IDirect3DTexture9 **texture, RECT *blackbox, POINT *cellinc)
177 {
178  FIXME("iface %p, glyph %#x, texture %p, blackbox %p, cellinc %p stub!\n",
179  iface, glyph, texture, blackbox, cellinc);
180  return E_NOTIMPL;
181 }
182 
184 {
185  FIXME("iface %p, first %u, last %u stub!\n", iface, first, last);
186  return S_OK;
187 }
188 
190 {
191  FIXME("iface %p, first %u, last %u stub!\n", iface, first, last);
192  return E_NOTIMPL;
193 }
194 
195 static HRESULT WINAPI ID3DXFontImpl_PreloadTextA(ID3DXFont *iface, const char *string, INT count)
196 {
197  FIXME("iface %p, string %s, count %d stub!\n", iface, debugstr_a(string), count);
198  return E_NOTIMPL;
199 }
200 
202 {
203  FIXME("iface %p, string %s, count %d stub!\n", iface, debugstr_w(string), count);
204  return E_NOTIMPL;
205 }
206 
207 static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
208  const char *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
209 {
210  LPWSTR stringW;
211  INT countW, ret = 0;
212 
213  TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
214  iface, sprite, debugstr_a(string), count, wine_dbgstr_rect(rect), format, color);
215 
216  if (!string || count == 0)
217  return 0;
218 
219  if (count < 0)
220  count = -1;
221 
222  countW = MultiByteToWideChar(CP_ACP, 0, string, count, NULL, 0);
223  stringW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR));
224  if (stringW)
225  {
226  MultiByteToWideChar(CP_ACP, 0, string, count, stringW, countW);
227  ret = ID3DXFont_DrawTextW(iface, sprite, stringW, countW, rect, format, color);
229  }
230 
231  return ret;
232 }
233 
234 static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
235  const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
236 {
237  struct d3dx_font *This = impl_from_ID3DXFont(iface);
238  RECT calc_rect;
239  INT height;
240 
241  TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
242  iface, sprite, debugstr_w(string), count, wine_dbgstr_rect(rect), format, color);
243 
244  if (!string || count == 0)
245  return 0;
246 
247  if (count < 0)
248  count = lstrlenW(string);
249 
250  /* Strip terminating NULL characters */
251  while (count > 0 && !string[count-1])
252  count--;
253 
254  if (rect)
255  calc_rect = *rect;
256 
257  height = DrawTextW(This->hdc, string, count, &calc_rect, format | DT_CALCRECT);
258 
259  if (format & DT_CALCRECT)
260  {
261  if (rect)
262  *rect = calc_rect;
263  return height;
264  }
265 
266  if (format & DT_CENTER)
267  {
268  UINT new_width = calc_rect.right - calc_rect.left;
269  calc_rect.left = (rect->right + rect->left - new_width) / 2;
270  calc_rect.right = calc_rect.left + new_width;
271  }
272 
273  if (height && (calc_rect.left < calc_rect.right))
274  {
275  D3DLOCKED_RECT locked_rect;
276  D3DXVECTOR3 position;
277  UINT text_width, text_height;
278  RECT text_rect;
279  ID3DXSprite *target = sprite;
280  HRESULT hr;
281  int i, j;
282 
283  /* Get rect position and dimensions */
284  position.x = calc_rect.left;
285  position.y = calc_rect.top;
286  position.z = 0;
287  text_width = calc_rect.right - calc_rect.left;
288  text_height = calc_rect.bottom - calc_rect.top;
289  text_rect.left = 0;
290  text_rect.top = 0;
291  text_rect.right = text_width;
292  text_rect.bottom = text_height;
293 
294  /* We need to flush as it seems all draws in the begin/end sequence use only the latest updated texture */
295  if (sprite)
297 
298  /* Extend texture and DIB section to contain text */
299  if ((text_width > This->tex_width) || (text_height > This->tex_height))
300  {
302 
303  if (text_width > This->tex_width)
304  This->tex_width = make_pow2(text_width);
305  if (text_height > This->tex_height)
306  This->tex_height = make_pow2(text_height);
307 
308  if (This->texture)
309  {
311  DeleteObject(This->bitmap);
312  }
313 
314  hr = D3DXCreateTexture(This->device, This->tex_width, This->tex_height, 1, 0,
315  D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &This->texture);
316  if (FAILED(hr))
317  {
318  This->texture = NULL;
319  return 0;
320  }
321 
322  header.biSize = sizeof(header);
323  header.biWidth = This->tex_width;
324  header.biHeight = -This->tex_height;
325  header.biPlanes = 1;
326  header.biBitCount = 32;
327  header.biCompression = BI_RGB;
328  header.biSizeImage = sizeof(DWORD) * This->tex_width * This->tex_height;
329  header.biXPelsPerMeter = 0;
330  header.biYPelsPerMeter = 0;
331  header.biClrUsed = 0;
332  header.biClrImportant = 0;
333 
334  This->bitmap = CreateDIBSection(This->hdc, (const BITMAPINFO*)&header,
335  DIB_RGB_COLORS, (void**)&This->bits, NULL, 0);
336  if (!This->bitmap)
337  {
339  This->texture = NULL;
340  return 0;
341  }
342 
343  SelectObject(This->hdc, This->bitmap);
344  }
345 
346  if (FAILED(IDirect3DTexture9_LockRect(This->texture, 0, &locked_rect, &text_rect, D3DLOCK_DISCARD)))
347  return 0;
348 
349  /* Clear rect */
350  for (i = 0; i < text_height; i++)
351  memset(This->bits + i * This->tex_width * sizeof(DWORD), 0,
352  text_width * sizeof(DWORD));
353 
354  DrawTextW(This->hdc, string, count, &text_rect, format);
355 
356  /* All RGB components are equal so take one as alpha and set RGB
357  * color to white, so it can be modulated with color parameter */
358  for (i = 0; i < text_height; i++)
359  {
360  DWORD *src = (DWORD *)This->bits + i * This->tex_width;
361  DWORD *dst = (DWORD *)((BYTE *)locked_rect.pBits + i * locked_rect.Pitch);
362  for (j = 0; j < text_width; j++)
363  {
364  *dst++ = (*src++ << 24) | 0xFFFFFF;
365  }
366  }
367 
368  IDirect3DTexture9_UnlockRect(This->texture, 0);
369 
370  if (!sprite)
371  {
372  hr = D3DXCreateSprite(This->device, &target);
373  if (FAILED(hr))
374  return 0;
376  }
377 
378  hr = target->lpVtbl->Draw(target, This->texture, &text_rect, NULL, &position, color);
379 
380  if (!sprite)
381  {
384  }
385 
386  if (FAILED(hr))
387  return 0;
388  }
389 
390  return height;
391 }
392 
394 {
395  FIXME("iface %p stub!\n", iface);
396  return D3D_OK;
397 }
398 
400 {
401  FIXME("iface %p stub\n", iface);
402  return D3D_OK;
403 }
404 
405 static const ID3DXFontVtbl D3DXFont_Vtbl =
406 {
407  /*** IUnknown methods ***/
411  /*** ID3DXFont methods ***/
427 };
428 
430  UINT weight, UINT miplevels, BOOL italic, DWORD charset, DWORD precision, DWORD quality,
431  DWORD pitchandfamily, const char *facename, struct ID3DXFont **font)
432 {
434 
435  if( !device || !font ) return D3DERR_INVALIDCALL;
436 
437  desc.Height=height;
438  desc.Width=width;
439  desc.Weight=weight;
440  desc.MipLevels=miplevels;
441  desc.Italic=italic;
442  desc.CharSet=charset;
443  desc.OutputPrecision=precision;
444  desc.Quality=quality;
445  desc.PitchAndFamily=pitchandfamily;
446  if(facename != NULL) lstrcpyA(desc.FaceName, facename);
447  else desc.FaceName[0] = '\0';
448 
450 }
451 
453  DWORD precision, DWORD quality, DWORD pitchandfamily, const WCHAR *facename, ID3DXFont **font)
454 {
456 
457  if( !device || !font ) return D3DERR_INVALIDCALL;
458 
459  desc.Height=height;
460  desc.Width=width;
461  desc.Weight=weight;
462  desc.MipLevels=miplevels;
463  desc.Italic=italic;
464  desc.CharSet=charset;
465  desc.OutputPrecision=precision;
466  desc.Quality=quality;
467  desc.PitchAndFamily=pitchandfamily;
468  if(facename != NULL) strcpyW(desc.FaceName, facename);
469  else desc.FaceName[0] = '\0';
470 
472 }
473 
474 /***********************************************************************
475  * D3DXCreateFontIndirectA (D3DX9_36.@)
476  */
478 {
479  D3DXFONT_DESCW widedesc;
480 
481  if( !device || !desc || !font ) return D3DERR_INVALIDCALL;
482 
483  /* Copy everything but the last structure member. This requires the
484  two D3DXFONT_DESC structures to be equal until the FaceName member */
485  memcpy(&widedesc, desc, FIELD_OFFSET(D3DXFONT_DESCA, FaceName));
486  MultiByteToWideChar(CP_ACP, 0, desc->FaceName, -1, widedesc.FaceName, ARRAY_SIZE(widedesc.FaceName));
487  return D3DXCreateFontIndirectW(device, &widedesc, font);
488 }
489 
490 /***********************************************************************
491  * D3DXCreateFontIndirectW (D3DX9_36.@)
492  */
494 {
497  struct d3dx_font *object;
498  IDirect3D9 *d3d;
499  HRESULT hr;
500 
501  TRACE("(%p, %p, %p)\n", device, desc, font);
502 
503  if (!device || !desc || !font) return D3DERR_INVALIDCALL;
504 
505  TRACE("desc: %d %d %d %d %d %d %d %d %d %s\n", desc->Height, desc->Width, desc->Weight, desc->MipLevels, desc->Italic,
506  desc->CharSet, desc->OutputPrecision, desc->Quality, desc->PitchAndFamily, debugstr_w(desc->FaceName));
507 
508  /* The device MUST support D3DFMT_A8R8G8B8 */
513  if (FAILED(hr))
514  {
515  IDirect3D9_Release(d3d);
516  return D3DXERR_INVALIDDATA;
517  }
518  IDirect3D9_Release(d3d);
519 
520  object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct d3dx_font));
521  if (!object)
522  {
523  *font = NULL;
524  return E_OUTOFMEMORY;
525  }
526  object->ID3DXFont_iface.lpVtbl = &D3DXFont_Vtbl;
527  object->ref = 1;
528  object->device = device;
529  object->desc = *desc;
530 
531  object->hdc = CreateCompatibleDC(NULL);
532  if (!object->hdc)
533  {
534  HeapFree(GetProcessHeap(), 0, object);
535  return D3DXERR_INVALIDDATA;
536  }
537 
538  object->hfont = CreateFontW(desc->Height, desc->Width, 0, 0, desc->Weight, desc->Italic, FALSE, FALSE, desc->CharSet,
539  desc->OutputPrecision, CLIP_DEFAULT_PRECIS, desc->Quality, desc->PitchAndFamily, desc->FaceName);
540  if (!object->hfont)
541  {
542  DeleteDC(object->hdc);
543  HeapFree(GetProcessHeap(), 0, object);
544  return D3DXERR_INVALIDDATA;
545  }
546  SelectObject(object->hdc, object->hfont);
547  SetTextColor(object->hdc, 0x00ffffff);
548  SetBkColor(object->hdc, 0x00000000);
549 
551  *font = &object->ID3DXFont_iface;
552 
553  return D3D_OK;
554 }
IDirect3DTexture9 * texture
Definition: font.c:41
static HRESULT WINAPI ID3DXFontImpl_OnLostDevice(ID3DXFont *iface)
Definition: font.c:393
#define IDirect3DTexture9_UnlockRect(p, a)
Definition: d3d9.h:1035
LONG ref
Definition: font.c:31
#define IDirect3D9_CheckDeviceFormat(p, a, b, c, d, e, f)
Definition: d3d9.h:229
UINT tex_height
Definition: font.c:40
GLint GLint GLsizei width
Definition: gl.h:1546
static HRESULT WINAPI ID3DXFontImpl_PreloadGlyphs(ID3DXFont *iface, UINT first, UINT last)
Definition: font.c:189
D3DXFONT_DESCW desc
Definition: font.c:34
static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite, const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
Definition: font.c:234
#define REFIID
Definition: guiddef.h:113
#define E_NOINTERFACE
Definition: winerror.h:2364
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
CFF_Charset charset
Definition: cffcmap.c:138
#define WideCharToMultiByte
Definition: compat.h:101
HRESULT hr
Definition: shlfolder.c:183
HBITMAP bitmap
Definition: font.c:42
#define IDirect3DDevice9_GetCreationParameters(p, a)
Definition: d3d9.h:1516
static HRESULT WINAPI ID3DXFontImpl_PreloadCharacters(ID3DXFont *iface, UINT first, UINT last)
Definition: font.c:183
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
Definition: glext.h:11745
Definition: mk_font.cpp:20
static ULONG WINAPI ID3DXFontImpl_AddRef(ID3DXFont *iface)
Definition: font.c:84
REFIID riid
Definition: precomp.h:44
#define CP_ACP
Definition: compat.h:99
GLuint GLuint GLsizei count
Definition: gl.h:1545
const GLint * first
Definition: glext.h:5794
#define WARN(fmt,...)
Definition: debug.h:111
static BOOL WINAPI ID3DXFontImpl_GetTextMetricsW(ID3DXFont *iface, TEXTMETRICW *metrics)
Definition: font.c:161
#define IDirect3DTexture9_Release(p)
Definition: d3d9.h:1014
static HDC
Definition: imagelist.c:92
static HRESULT WINAPI ID3DXFontImpl_OnResetDevice(ID3DXFont *iface)
Definition: font.c:399
LONG top
Definition: windef.h:292
#define D3DLOCK_DISCARD
Definition: d3d8types.h:72
#define D3DERR_INVALIDCALL
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
Definition: font.c:28
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
static UINT UINT last
Definition: font.c:45
LONG left
Definition: windef.h:291
static struct d3dx_font * impl_from_ID3DXFont(ID3DXFont *iface)
Definition: font.c:61
LONG right
Definition: windef.h:293
#define lstrlenW
Definition: compat.h:407
BYTE * bits
Definition: font.c:43
static HDC WINAPI ID3DXFontImpl_GetDC(ID3DXFont *iface)
Definition: font.c:168
HRESULT WINAPI D3DXCreateFontW(IDirect3DDevice9 *device, INT height, UINT width, UINT weight, UINT miplevels, BOOL italic, DWORD charset, DWORD precision, DWORD quality, DWORD pitchandfamily, const WCHAR *facename, ID3DXFont **font)
Definition: font.c:452
int32_t INT
Definition: typedefs.h:56
Definition: send.c:47
& rect
Definition: startmenu.cpp:1413
static const WCHAR stringW[]
Definition: engine.c:36
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLuint GLuint GLfloat weight
Definition: glext.h:11719
WINE_DEFAULT_DEBUG_CHANNEL(d3dx)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:975
#define IDirect3D9_Release(p)
Definition: d3d9.h:220
HFONT hfont
Definition: font.c:37
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
HDC hdc
Definition: font.c:36
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define DT_CALCRECT
Definition: winuser.h:526
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: font.c:353
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
GLuint color
Definition: glext.h:6243
Definition: devices.h:37
#define debugstr_w
Definition: kernel32.h:32
GLenum GLint ref
Definition: glext.h:6028
#define CLIP_DEFAULT_PRECIS
Definition: wingdi.h:425
#define FIXME(fmt,...)
Definition: debug.h:110
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
#define IDirect3DDevice9_Release(p)
Definition: d3d9.h:1508
IDirect3DDevice9 * device
Definition: font.c:33
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI D3DXCreateFontIndirectW(IDirect3DDevice9 *device, const D3DXFONT_DESCW *desc, ID3DXFont **font)
Definition: font.c:493
HRESULT WINAPI D3DXCreateFontIndirectA(IDirect3DDevice9 *device, const D3DXFONT_DESCA *desc, ID3DXFont **font)
Definition: font.c:477
static LPTEXTMETRICW LONG * height
Definition: font.c:42
static ULONG WINAPI ID3DXFontImpl_Release(ID3DXFont *iface)
Definition: font.c:94
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
#define debugstr_guid
Definition: kernel32.h:35
#define IDirect3DDevice9_GetDisplayMode(p, a, b)
Definition: d3d9.h:1515
GLenum GLint GLint * precision
Definition: glext.h:7539
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
UINT tex_width
Definition: font.c:39
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 GLint GLint j
Definition: glfuncs.h:250
#define IDirect3DDevice9_GetDirect3D(p, a)
Definition: d3d9.h:1513
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define ID3DXSprite_Flush(p)
Definition: d3dx9core.h:451
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
GLenum GLuint texture
Definition: glext.h:6295
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:8
const char * wine_dbgstr_rect(const RECT *rect)
#define ID3DXSprite_End(p)
Definition: d3dx9core.h:452
static FILE * out
Definition: regtests2xml.c:44
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint num
Definition: glext.h:9618
int quality
Definition: jpeglib.h:991
struct ID3DXFont ID3DXFont
Definition: d3dx8core.h:53
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1507
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
static HRESULT WINAPI ID3DXFontImpl_GetGlyphData(ID3DXFont *iface, UINT glyph, IDirect3DTexture9 **texture, RECT *blackbox, POINT *cellinc)
Definition: font.c:175
static const ID3DXFontVtbl D3DXFont_Vtbl
Definition: font.c:405
int ret
#define ID3DXSprite_Release(p)
Definition: d3dx9core.h:442
#define InterlockedDecrement
Definition: armddk.h:52
#define ID3DXSprite_Begin(p, a)
Definition: d3dx9core.h:449
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
static HRESULT WINAPI ID3DXFontImpl_QueryInterface(ID3DXFont *iface, REFIID riid, void **out)
Definition: font.c:66
GLenum src
Definition: glext.h:6340
GLenum mode
Definition: glext.h:6217
#define ID3DXFont_DrawTextW(p, a, b, c, d, e, f)
Definition: d3dx9core.h:180
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
WCHAR FaceName[LF_FACESIZE]
Definition: d3dx9core.h:122
Definition: sprite.c:37
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:886
#define S_OK
Definition: intsafe.h:59
#define D3D_OK
Definition: d3d.h:106
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define InterlockedIncrement
Definition: armddk.h:53
BOOL WINAPI DeleteDC(_In_ HDC)
#define ARRAY_SIZE(a)
Definition: main.h:24
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
Definition: bitmap.c:197
#define E_NOTIMPL
Definition: ddrawi.h:99
GLenum GLenum dst
Definition: glext.h:6340
static HRESULT WINAPI ID3DXFontImpl_PreloadTextW(ID3DXFont *iface, const WCHAR *string, INT count)
Definition: font.c:201
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define MultiByteToWideChar
Definition: compat.h:100
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HRESULT WINAPI D3DXCreateSprite(struct IDirect3DDevice9 *device, struct ID3DXSprite **sprite)
Definition: sprite.c:557
static BOOL WINAPI ID3DXFontImpl_GetTextMetricsA(ID3DXFont *iface, TEXTMETRICA *metrics)
Definition: font.c:154
static HRESULT WINAPI ID3DXFontImpl_GetDevice(ID3DXFont *iface, IDirect3DDevice9 **device)
Definition: font.c:116
#define IDirect3DTexture9_LockRect(p, a, b, c, d)
Definition: d3d9.h:1034
unsigned int ULONG
Definition: retypes.h:1
GLenum target
Definition: glext.h:7315
RECT text_rect
Definition: sndrec32.cpp:77
LONG bottom
Definition: windef.h:294
static UINT make_pow2(UINT num)
Definition: font.c:47
#define DT_CENTER
Definition: winuser.h:527
ID3DXFont ID3DXFont_iface
Definition: font.c:30
static HRESULT WINAPI ID3DXFontImpl_PreloadTextA(ID3DXFont *iface, const char *string, INT count)
Definition: font.c:195
static HBITMAP
Definition: button.c:44
HRESULT WINAPI D3DXCreateFontA(struct IDirect3DDevice9 *device, INT height, UINT width, UINT weight, UINT miplevels, BOOL italic, DWORD charset, DWORD precision, DWORD quality, DWORD pitchandfamily, const char *facename, struct ID3DXFont **font)
Definition: font.c:429
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define DIB_RGB_COLORS
Definition: wingdi.h:366
HRESULT WINAPI D3DXCreateTexture(struct IDirect3DDevice9 *device, UINT width, UINT height, UINT miplevels, DWORD usage, D3DFORMAT format, D3DPOOL pool, struct IDirect3DTexture9 **texture)
Definition: texture.c:526
static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite, const char *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
Definition: font.c:207
GLuint64EXT * result
Definition: glext.h:11304
#define memset(x, y, z)
Definition: compat.h:39
static HRESULT WINAPI ID3DXFontImpl_GetDescW(ID3DXFont *iface, D3DXFONT_DESCW *desc)
Definition: font.c:142
#define BI_RGB
Definition: precomp.h:35
#define HeapFree(x, y, z)
Definition: compat.h:394
struct CFHEADER header
Definition: fdi.c:109
void * object
Definition: jmemsys.h:48
HFONT WINAPI CreateFontW(int nHeight, int nWidth, int nEscapement, int nOrientation, int nWeight, DWORD fnItalic, DWORD fdwUnderline, DWORD fdwStrikeOut, DWORD fdwCharSet, DWORD fdwOutputPrecision, DWORD fdwClipPrecision, DWORD fdwQuality, DWORD fdwPitchAndFamily, LPCWSTR lpszFace)
Definition: font.c:1894
static HRESULT WINAPI ID3DXFontImpl_GetDescA(ID3DXFont *iface, D3DXFONT_DESCA *desc)
Definition: font.c:129
static DWORD
Definition: font.c:57