Skip to main content
gamedev.net
🔒 Locked

Fast Text

Started by TechnoCore 8 replies 700+ views
Original Post
TechnoCore
TechnoCore
Hi ! I''ve recently started using directX, and was wondering 2 things: (I use directx 7 / ddraw) 1) Are there no support for textdrawing in directX ? I know I can use GDI to draw text in surfaces in directX, but it''s kinda slow. If I want faster textdrawing, do I have to make text-engine myself, using bitmaps as characters ? Or what shall I do ? 2) When I blit my "sprites" I use the bltfast function, and I clip my sprites from the source using the source_rect in the BlitFast function. Like so: lpDDSBack-> BltFast(xpos,ypos,back_surf,&source_rect,DDBLTFAST_WAIT) I do it like this since he does so in my book,"teach yourself directX 7 in 24 hours". Now I''ve seen people using the clipper instead, and not having to bother with calculating the cutting from the source-sprite. Is there any drawback using the clipper ? (It seems alot more easy to use it) =D //TechnoCore
//TechnoCore
Redline
Redline
1.)
You''ve pretty much nailed it (from what I know), if you want fast text drawing in DD7 then you are going to have to create a table of all the ASCII characters you need, and just calculate the areas you need to blie from according to the letter (this is what I did). This is however, of no hope if you want to do stuff with some Asian languages that have thousands of symbols Youd'' prolly just have to use GDI for that.

2.)
I never use dthe clipper when blitting from a surface, I always specified where to blit from. Not much help, but I really don''t know much about the other method.

Hope that is some help
Krisc
Krisc
There is text drawing in DirectDraw in DirectX9.DirectDraw

its like this

back.DrawText(strText,x,y)

I don''t know about Dx7, but you should give Dx9 a try! It is very nice!

<- Digital Explosions ->
"Discipline is my sword, faith is my shield
do not dive into uncertainty, and you may live to reap the rewards" - (Unreal Championship)
TechnoCore
TechnoCore
Thanks for your replys Redline and Krisc!

Im gonna stick to dx7 just for a while now... so im gonna make
a text-engine of myself

I''ll try dx9 soon though..
When using dx9 everything is 3d... i guess my clipping `question does not apply there then ?



//TechnoCore
//TechnoCore
lexor
lexor
quote:

When using dx9 everything is 3d



When using DX8 everything is 3d. DirectDraw (which is 100% 2D) is back in DX9.
_______ www.leXor.net
patindahat
patindahat
They brought it back! YAY, I was so sad to see it go in DX8. Thats good news... I just wish I could use DX9...... Anyone know were I could get a driver for a Voodoo3 (PCI)? I can''t even get my DX8 working even though the drivers I have are supposed to support it.

Pat
Borfaux
Borfaux
DX8 has DirectDraw. Its COM

How do you think you are still able to play DirectDraw built games?

Microsoft just did not include documentation.
patindahat
patindahat
You can still play DDraw games in DX8 because "DDraw games" use DX7 or older. Like you said its COM, so all of DX7 still exists. And DX7 doesn''t have the ''new'' features and emprovements that come with 8 or 9. From what I read about DX8, DDraw was havily intergrated into D3D, and you couldn''t access DDraw8 objects alone.

Pat

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.