PAINTSTRUCT ps;
HDC hdc;
hdc=GetDC(hWnd);
TCHAR cMessage[100];
lstrcpy( cMessage, _T("Arial") );
SetTextColor(hdc,RGB(0,0,0));
SetBkColor(hdc,RGB(255,255,255));
SetBkMode(hdc,TRANSPARENT);
hdc = BeginPaint (hWnd, &ps);
TextOut(hdc,400,300,cMessage,strlen(cMessage));
EndPaint( hWnd, &ps );
It works, but directx overwrites the text. How can i get it to stay on top?
And is there a tutorial how to use the directx drawtext methods?
Its hard to get started with it.
Thank you!
Text Out
Hi again!
I want to display text for debugging purposes, so the speed doesnt matter and since im a newbie, i would like to keep it simple.
This is what i use:
If you are using DX8, use the CD3DFont class found in the SDK.
The reason your code doesn''t work is that DX overrides the "normal" DC. I *strongly* urge you to use CD3DFont because the sooner you get into the mindset of not using GDI, the better.
The reason your code doesn''t work is that DX overrides the "normal" DC. I *strongly* urge you to use CD3DFont because the sooner you get into the mindset of not using GDI, the better.
I would also like to know how to fix this problem, and i have no reference to CD3DFont in my libraries.
G''day!
CD3DFont ships with the SDK, it''s part of the helper code they include. Technically it''s unsupported by Microsoft, but a lot of people use it without any issues. I can''t recall a single mention of a bug from anyone, so it''s pretty stable.
Another alternate is my text library. You have to create a bitmap font (there''s a link to a utility to do it for you) and it uses that rather than generating the font at run-time. It''s not feature-laden, but it looks good and it''s darn fast.
http://www.drunkenhyena.com/docs/dhFastFont.phtml
Stay Casual,
Ken
Drunken Hyena
CD3DFont ships with the SDK, it''s part of the helper code they include. Technically it''s unsupported by Microsoft, but a lot of people use it without any issues. I can''t recall a single mention of a bug from anyone, so it''s pretty stable.
Another alternate is my text library. You have to create a bitmap font (there''s a link to a utility to do it for you) and it uses that rather than generating the font at run-time. It''s not feature-laden, but it looks good and it''s darn fast.
http://www.drunkenhyena.com/docs/dhFastFont.phtml
Stay Casual,
Ken
Drunken Hyena
The problem is:
i know about CD3DFont but from the example text3d that is shipped with DX, its hard to learn.
im just too new at this to know why they used which specific command.
Did anyone of you use CD3dfont and can offer an example that implements it?
Thanks!
i know about CD3DFont but from the example text3d that is shipped with DX, its hard to learn.
im just too new at this to know why they used which specific command.
Did anyone of you use CD3dfont and can offer an example that implements it?
Thanks!
G''day!
I don''t have any code examples for CD3DFont (because I haven''t used it yet). In the next couple of days I''ll have one on ID3DXFont up on my site. If you need something now check out my fast font library (URL listed in my last post). It has nice simple examples of how it works and it''s very easy to use.
Stay Casual,
Ken
Drunken Hyena
I don''t have any code examples for CD3DFont (because I haven''t used it yet). In the next couple of days I''ll have one on ID3DXFont up on my site. If you need something now check out my fast font library (URL listed in my last post). It has nice simple examples of how it works and it''s very easy to use.
Stay Casual,
Ken
Drunken Hyena
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement