Results 1 to 2 of 2

Thread: VB: D3DX8; i cant draw text -[RESOLVED]-

  1. #1

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    Resolved VB: D3DX8; i cant draw text -[RESOLVED]-

    why wont it draw text?

    VB Code:
    1. Public Sub Draw()
    2.     Dim Frames As Long
    3.     Dim FTime As Long
    4.    
    5.     Do
    6.         If Events(QS_INPUT) Then
    7.             DoEvents
    8.            
    9.             If IsPressed(vbKeyEscape) Then
    10.                 Exit Do
    11.             End If
    12.         End If
    13.        
    14.         If Not D3DD.TestCooperativeLevel = D3D_OK Then
    15.             Do Until D3DD.TestCooperativeLevel = D3D_OK
    16.                 DoEvents
    17.             Loop
    18.         End If
    19.    
    20.         Call D3DD.Clear(0, ByVal 0, D3DCLEAR_TARGET, 0, 0, 0)
    21.         Call D3DD.BeginScene
    22.        
    23.             Call D3DX.DrawText(D3DXF, RGB(255, 255, 255), "FPS: " & CStr(Frames), rScreen, DT_LEFT Or DT_TOP)
    24.            
    25.         Call D3DD.EndScene
    26.         Call D3DD.Present(ByVal 0, ByVal 0, 0, ByVal 0)
    27.        
    28.         Let Frames = Frames + 1
    29.         If GetTickCount - FTime >= 1000 Then
    30.             Debug.Print Frames
    31.             Let Frames = 0
    32.             Let FTime = GetTickCount
    33.         End If
    34.     Loop
    35. End Sub
    36.  
    37. Private Sub LoadD3D()
    38.     Dim D3DPP As D3DPRESENT_PARAMETERS
    39.     Dim D3DF As IFont
    40.    
    41.     Set D3D = DX.Direct3DCreate
    42.     Set D3DX = New D3DX8
    43.    
    44.     Let D3DPP.BackBufferCount = 2
    45.     Let D3DPP.BackBufferFormat = D3DFMT_R5G6B5
    46.     Let D3DPP.BackBufferHeight = SCREEN_HEIGHT
    47.     Let D3DPP.BackBufferWidth = SCREEN_WIDTH
    48.     Let D3DPP.hDeviceWindow = Display.hWnd
    49.     Let D3DPP.SwapEffect = D3DSWAPEFFECT_FLIP
    50.     Set D3DD = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Display.hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DPP)
    51.    
    52.     Set D3DF = New StdFont
    53.     Let D3DF.Bold = Display.FontBold
    54.     Let D3DF.Italic = Display.FontItalic
    55.     Let D3DF.Name = Display.FontName
    56.     Let D3DF.Size = Display.FontSize
    57.     Let D3DF.Strikethrough = Display.FontStrikethru
    58.     Let D3DF.Underline = Display.FontUnderline
    59.     Set D3DXF = D3DX.CreateFont(D3DD, D3DF.hFont)
    60.        
    61.     Let rScreen.bottom = SCREEN_HEIGHT
    62.     Let rScreen.Right = SCREEN_WIDTH
    63.        
    64.     Let Display.ScaleHeight = SCREEN_HEIGHT
    65.     Let Display.ScaleWidth = SCREEN_WIDTH
    66.     Call Display.Refresh
    67.     Call Display.Show
    68. End Sub
    Last edited by Electroman; Jan 21st, 2005 at 11:32 PM. Reason: Added Resolved to title.

  2. #2

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    Re: VB: D3DX8; i cant draw text

    figured it out it was the color of the text

Posting Permissions

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



Click Here to Expand Forum to Full Width