vbZombie
Apr 20th, 2000, 05:20 PM
Why oh why it's so slow to write simple text in DirectX (DirectDraw)? I have to write 100 names to screen, and no matter what I do, the program is slow ( <20 fps).
This is the code I use- about 150 fps without writing text :(
Public Sub DrawStars()
Dim xx As Integer, xy As Integer
Call g_d3dDevice.SetTexture(0, Stars(xi).texture)
TransculensyOn
For xi = 1 To Numstars
xx = Stars(xi).sRect.X1 + (Stars(xi).wdh / 2) - (TextWidth(Starnames(xi)) / 2)
xy = Stars(xi).sRect.Y2 + (Stars(xi).hgt / 2) - (TextHeight(Starnames(xi)) / 2)
Call DXOText(xx, xy, Starnames(xi), g_ddsBackBuffer)
Call g_d3dDevice.DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_TLVERTEX, Stars(xi).vertex(0), 4, 0)
Next
TransculensyOff
End Sub
This is the code I use- about 150 fps without writing text :(
Public Sub DrawStars()
Dim xx As Integer, xy As Integer
Call g_d3dDevice.SetTexture(0, Stars(xi).texture)
TransculensyOn
For xi = 1 To Numstars
xx = Stars(xi).sRect.X1 + (Stars(xi).wdh / 2) - (TextWidth(Starnames(xi)) / 2)
xy = Stars(xi).sRect.Y2 + (Stars(xi).hgt / 2) - (TextHeight(Starnames(xi)) / 2)
Call DXOText(xx, xy, Starnames(xi), g_ddsBackBuffer)
Call g_d3dDevice.DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_TLVERTEX, Stars(xi).vertex(0), 4, 0)
Next
TransculensyOff
End Sub