游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1858|回复: 5

D3DXCreateFontIndirect

[复制链接]

17

主题

31

帖子

31

积分

注册会员

Rank: 2

积分
31
发表于 2004-9-24 08:37:00 | 显示全部楼层 |阅读模式
Dear all:
When i use the D3DXCreateFontIndirect or D3DXCreateFont
in WinMe system,it always fall.
Everyone know about it,Please tell me.
thanks
ps. i use the vs2003 and dx9.0b in winxp sp2 for develop and
test and the win me.

ttom

1

主题

8

帖子

8

积分

新手上路

Rank: 1

积分
8
发表于 2004-9-26 17:25:00 | 显示全部楼层

Re: D3DXCreateFontIndirect

LPD3DXFONT font;
HFONT hf;
hf=CreateFont(0,0,0,0,FW_DONTCARE,false,false,false,ANSI_CHARSET,0,0,0,0,"Arial");
D3DXCreateFont(dd,hf,&font);

//DrawText
RECT trect;
font->DrawTextA (str,strlen(str),&trect,DT_SINGLELINE,D3DCOLOR_XRGB(0,0,0));
Ok!!!!

17

主题

31

帖子

31

积分

注册会员

Rank: 2

积分
31
 楼主| 发表于 2004-9-29 16:01:00 | 显示全部楼层

Re: D3DXCreateFontIndirect

[em7]
thanks to replay the question.
but the problem is the same
ttom

1

主题

8

帖子

8

积分

新手上路

Rank: 1

积分
8
发表于 2004-9-30 20:50:00 | 显示全部楼层

Re: D3DXCreateFontIndirect

you try it again


LPDIRECT3DDEVICE9 dd;
LPD3DXFONT dFont=0;
//createfont
if(FAILED(D3DXCreateFont(dd,0,0,FW_DONTCARE,0,0,0,0,0,0,"Times New Roman",&dFont);
return 0;
//drawfont
RECT strRect={10,10,200,64};
dd->BeginScene();
dFont->DrawText(0,"Hello DirectX9",strlen("Hello DirectX9"),&strRect,DT_SINGLELINE,0xFFFFFF);
dd->EndScene();
//end

17

主题

31

帖子

31

积分

注册会员

Rank: 2

积分
31
 楼主| 发表于 2004-10-1 08:31:00 | 显示全部楼层

Re: D3DXCreateFontIndirect

Dear Seth:
  thanks u to replay this question.
but it is still can't show any thing.
When it create in win me, I debug it and show
"Erroe code D3DXERR_INVALIDDATA (0x88760b59)"
ttom

20

主题

134

帖子

134

积分

注册会员

Rank: 2

积分
134
发表于 2004-10-1 08:39:00 | 显示全部楼层

Re: D3DXCreateFontIndirect

Dear ttom:
This is the same problem as me...
I last deliver the text up,
I use the text file to output debug info
and picture to replace the text shown
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-8-18 20:26

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表