VB: D3DX8; i cant draw text -[RESOLVED]-
why wont it draw text?
VB Code:
Public Sub Draw()
Dim Frames As Long
Dim FTime As Long
Do
If Events(QS_INPUT) Then
DoEvents
If IsPressed(vbKeyEscape) Then
Exit Do
End If
End If
If Not D3DD.TestCooperativeLevel = D3D_OK Then
Do Until D3DD.TestCooperativeLevel = D3D_OK
DoEvents
Loop
End If
Call D3DD.Clear(0, ByVal 0, D3DCLEAR_TARGET, 0, 0, 0)
Call D3DD.BeginScene
Call D3DX.DrawText(D3DXF, RGB(255, 255, 255), "FPS: " & CStr(Frames), rScreen, DT_LEFT Or DT_TOP)
Call D3DD.EndScene
Call D3DD.Present(ByVal 0, ByVal 0, 0, ByVal 0)
Let Frames = Frames + 1
If GetTickCount - FTime >= 1000 Then
Debug.Print Frames
Let Frames = 0
Let FTime = GetTickCount
End If
Loop
End Sub
Private Sub LoadD3D()
Dim D3DPP As D3DPRESENT_PARAMETERS
Dim D3DF As IFont
Set D3D = DX.Direct3DCreate
Set D3DX = New D3DX8
Let D3DPP.BackBufferCount = 2
Let D3DPP.BackBufferFormat = D3DFMT_R5G6B5
Let D3DPP.BackBufferHeight = SCREEN_HEIGHT
Let D3DPP.BackBufferWidth = SCREEN_WIDTH
Let D3DPP.hDeviceWindow = Display.hWnd
Let D3DPP.SwapEffect = D3DSWAPEFFECT_FLIP
Set D3DD = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Display.hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DPP)
Set D3DF = New StdFont
Let D3DF.Bold = Display.FontBold
Let D3DF.Italic = Display.FontItalic
Let D3DF.Name = Display.FontName
Let D3DF.Size = Display.FontSize
Let D3DF.Strikethrough = Display.FontStrikethru
Let D3DF.Underline = Display.FontUnderline
Set D3DXF = D3DX.CreateFont(D3DD, D3DF.hFont)
Let rScreen.bottom = SCREEN_HEIGHT
Let rScreen.Right = SCREEN_WIDTH
Let Display.ScaleHeight = SCREEN_HEIGHT
Let Display.ScaleWidth = SCREEN_WIDTH
Call Display.Refresh
Call Display.Show
End Sub
Re: VB: D3DX8; i cant draw text
figured it out it was the color of the text