PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Perfomance issues with DirectX8 and Text-VBForums
Results 1 to 3 of 3

Thread: Perfomance issues with DirectX8 and Text

  1. #1

    Thread Starter
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    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:
    1. Dim ListText as string
    2.  
    3. ListText = ""
    4.  
    5. For i = 0 To NoOfShips
    6. ListText = ListText & i & ") HP: " & E(i).Hp & " X: " & E(i).obj.X & " Y:" & E(i).obj.Y & Chr(13)
    7. Next i
    8.  
    9. DrawText 600, 10, ListText, 6, &HFF999999

    The DrawText function:

    vb Code:
    1. Public Function DrawText(X As Single, Y As Single, text As String, size As Long, ColourWithAlpha As Long)
    2. Dim Reccy As RECT
    3.  
    4. If size > 20 Or size < 1 Then Dread_Support.MsgBx "You must enter a valid text size (between 1 and 20)", True
    5.  
    6. Reccy.Left = X
    7. Reccy.Top = Y
    8. Reccy.bottom = Y + 500
    9. Reccy.Right = X + 500
    10.  
    11. Helper.DrawText Fonty(size), ColourWithAlpha, text, Reccy, DT_TOP Or DT_LEFT
    12. End Function
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

  2. #2
    Junior Member
    Join Date
    Mar 2007
    Location
    New Jersey
    Posts
    30

    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.
    Final Fantasy Tactics Online
    Blank Engine (3D, Opensource, VB Engine)(Under construction but does have a download)

  3. #3

    Thread Starter
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    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
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width