Code for same effect in dx:
Dim bRunning As Boolean
Dim D3DX As D3DX8
'#########
'## FONTS ##
'#########
Dim MainFont As D3DXFont
Dim MainFontDesc As IFont
Dim TextRect As RECT
Dim fnt As New StdFont
'####FPS#######
Private Declare Function GetTickCount Lib "kernel32" () As Long
Dim FPS_LastCheck As Long
Dim FPS_Count As Long
Dim FPS_Current As Integer
Public Dx As DirectX8
Public D3D As Direct3D8
Public D3DDevice As Direct3DDevice8
Public Function Initialise() As Boolean
On Error GoTo ErrHandler:
Dim DispMode As D3DDISPLAYMODE
Dim D3DWindow As D3DPRESENT_PARAMETERS
Set Dx = New DirectX8
Set D3D = Dx.Direct3DCreate()
Set D3DX = New D3DX8
D3D.GetAdapterDisplayMode D3DADAPTER_DEFAULT, DispMode
D3DWindow.SwapEffect = D3DSWAPEFFECT_COPY
D3DWindow.BackBufferFormat = DispMode.Format
D3DWindow.BackBufferWidth = 1024
D3DWindow.BackBufferHeight = 768
D3DWindow.hDeviceWindow = frmMain.hWnd
D3DWindow.Windowed = 1
Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frmMain.hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DWindow)
Initialise = True
Exit Function
ErrHandler:
Initialise = False
End Function
Public Sub Render()
D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, 0, 1#, 0
D3DX.DrawText MainFont, D3DColorRGBA(255, 255, 255, 255), CStr(FPS_Current) & "fps", TextRect, DT_TOP Or DT_LEFT
D3DDevice.Present ByVal 0, ByVal 0, 0, ByVal 0
End Sub
Private Sub Form_Click()
bRunning = False
End Sub
Private Sub Form_Load()
Me.Show
Me.Left = 0
Me.Top = 0
bRunning = Initialise()
InitFont
TextRect.Top = 0
TextRect.bottom = 200
TextRect.Right = 500
Do While bRunning
Render
If GetTickCount() - FPS_LastCheck >= 1000 Then
FPS_Current = FPS_Count
FPS_Count = 0
FPS_LastCheck = GetTickCount()
End If
FPS_Count = FPS_Count + 1
DoEvents
Loop
On Error Resume Next
Set D3DDevice = Nothing
Set D3D = Nothing
Set Dx = Nothing
Unload Me
End
End Sub
Sub InitFont()
fnt.Name = "Arial"
fnt.Size = 12
Set MainFontDesc = fnt
Set MainFont = D3DX.CreateFont(D3DDevice, MainFontDesc.hFont)
End Sub
The D3DX.DrawText is very well known for being slow as well, i'm sure tv3d uses something better for rendering the fps out, yet the frames are horrible in tv3d on a blank screen.
Dx code: around 800fps
Tv3d: < 70 fps (both 6.5 and the previous 6.2)
My graphics card is an older 128mb Radeon 9200se agp 8x, on a 1.8ghz amd64 cpu.
On many 3d games I still get 80-200fps.
The problem seems to be with when the mouse is on the form. Tv3d does too much work just with the mouse on the render screen or something.
A lot of my community (customers if you will) don't have any better than the graphics card I have, therefore if that's the max fps I actually get, then I have a problem. Maybe i'll test a couple other engines out there and see the frame rate.
Thanks for taking the time.