Perfomance issues with DirectX8 and Text
Is there an alternative to using DirectX8's slow Text Rendering?
OR
Is there a faster way of rendering text?
PS: By faster I mean performance in frames per second
In my main Form:
vb Code:
Dim ListText as string
ListText = ""
For i = 0 To NoOfShips
ListText = ListText & i & ") HP: " & E(i).Hp & " X: " & E(i).obj.X & " Y:" & E(i).obj.Y & Chr(13)
Next i
DrawText 600, 10, ListText, 6, &HFF999999
The DrawText function:
vb Code:
Public Function DrawText(X As Single, Y As Single, text As String, size As Long, ColourWithAlpha As Long)
Dim Reccy As RECT
If size > 20 Or size < 1 Then Dread_Support.MsgBx "You must enter a valid text size (between 1 and 20)", True
Reccy.Left = X
Reccy.Top = Y
Reccy.bottom = Y + 500
Reccy.Right = X + 500
Helper.DrawText Fonty(size), ColourWithAlpha, text, Reccy, DT_TOP Or DT_LEFT
End Function
Re: Perfomance issues with DirectX8 and Text
You could try doing a bitmap font, but I'm not really sure how much faster that would be.
Re: Perfomance issues with DirectX8 and Text
In fact doing a bitmap font e.g. drawing the text in myself had a considerable performance increase.
I played around with a tutorial from Directx4vb.vbgamer.com and tested:
Normal DirectX Text .... FPS: 30/40
Code:
For I = 0 To 100
Test.Top = I * 20
Test.Left = 1
Test.bottom = 480
Test.Right = 640
D3DX.DrawText MainFont, &HFFCCCCFF, "SlowSlowSlow", Test, DT_TOP Or DT_CENTER
Next I
Drawing my own letters (using jack hoaxley's) .... FPS: 60/70
Code:
For I = 0 To 100
RenderStringFromCustomFont_2D "FastFastFast", 1, I * 20, 16, 16
Next I