vb Code:
Dim Dx As DirectX8
Dim D3d As Direct3D8
Dim D As D3DX8
Dim D3DDevice As Direct3DDevice8
Dim MainFont As D3DXFont
Dim MainFontDesc As IFont
Dim TextRect As RECT
Dim fnt As New StdFont
Dim TextToDraw As String
Public Sub DrawText(Text As String, X As Long, Y As Long)
fnt.Name = "Verdana"
fnt.Size = 18
fnt.Bold = True
Set MainFontDesc = fnt
'Error Set MainFont = D.CreateFont(D3DDevice, MainFontDesc.hFont)
TextRect.Top = 1
TextRect.Left = 1
TextRect.Bottom = Y
TextRect.Right = X
D3DDevice.BeginScene
D.DrawText MainFont, &HFFCCCCFF, Text, TextRect, DT_TOP Or DT_CENTER
D3DDevice.EndScene
D3DDevice.Present ByVal 0, ByVal 0, 0, ByVal 0
End Sub
Public Sub Init()
Dim DispMode As D3DDISPLAYMODE
Dim D3DWindow As D3DPRESENT_PARAMETERS
Set Dx = New DirectX8
Set D3d = Dx.Direct3DCreate()
D3d.GetAdapterDisplayMode D3DADAPTER_DEFAULT, DispMode
D3DWindow.Windowed = 1
D3DWindow.SwapEffect = D3DSWAPEFFECT_COPY_VSYNC
D3DWindow.BackBufferFormat = DispMode.Format
Set D3DDevice = D3d.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, Client.hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DWindow)
End Sub