D
DRads
Guest
I am getting 3 errors on this one form and i would love you guys if you could show me what i am doing wrong so i can learn and fix it.
Overload resolution failed because no accessible New accepts this number of arguments for: d3ddev
Overload resolution failed because no accessible New accepts this number of arguments for: drawfont
And
DrawText is ambiguous because multiple kinds of members with this name exist in class Microsoft.DirectX.Direct3D.Fo
nt
Appreciate any help at all
Imports Microsoft.DirectX
Imports Microsoft.DirectX.Direct3D
Imports Microsoft.DirectX.DirectInput
Imports System.Windows
Public Class Test1
Dim RunOnce As Boolean = True
Dim gamerun As Boolean = True
Dim bkcolor As Color = Color.Black
Dim d3ddev As New Direct3D.Device
Dim d3dpp As New PresentParameters
Dim drawfont As New Direct3D.Font
Dim x As Int32
Dim wait As Int32
Private Sub Test1_formClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
gamerun = False
End Sub
Private Sub Test1_KeyDown(ByVal Sender As Object, ByVal e As Forms.KeyEventArgs) Handles Me.KeyDown
If (e.KeyCode = Keys.Escape) Then
gamerun = False
Me.Close()
End If
End Sub
Private Sub Test1_Load(ByVal Sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim pos As Point
pos.X = 0
pos.Y = 0
Me.Location = pos
Me.Height = 1200
Me.Width = 1600
Me.Show()
End Sub
Private Sub Tes1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
If RunOnce Then
RunOnce = False
Init()
Run()
End If
End Sub
Private Sub Init()
d3dpp.DeviceWindow = Me .PictureBox1
Me.PictureBox1.Hide()
d3dpp.BackBufferCount = 1
d3dpp.BackBufferFormat = Format.X8R8G8B8
d3dpp.BackBufferHeight = Me.Height
d3dpp.BackBufferWidth = Me.Width
d3dpp.SwapEffect = SwapEffect.Discard
d3dpp.PresentationInterval = PresentInterval.Immediate
d3dpp.Windowed = True
d3dpp.EnableAutoDepthStencil = True
d3dpp.AutoDepthStencilFormat = DepthFormat.D24S8
d3ddev = New Direct3D.Device(0, Direct3D.DeviceType.Hardware, Me, CreateFlags.HardwareVertexProcessing, d3dpp)
drawfont = New Direct3D.Font(d3ddev, New System.Drawing.Font("IMPACT", 32, FontStyle.Regular, GraphicsUnit.Pixel))
x = 25
wait = 0
End Sub
Private Sub Run()
Do While gamerun
d3ddev.Clear(ClearFlags.Target Or ClearFlags.ZBuffer, bkcolor, 1, 0)
d3ddev.BeginScene()
drawfont.DrawText(Nothing, "Test", x, 50, Color.DarkCyan)
d3ddev.EndScene()
d3ddev.Present()
If (x > 500) Then
x = 25
Else
If (wait > 10) Then
x +=1
wait = 0
Else
wait += 1
End If
makes windows happy
Windows.Forms.Application.DoEvents()
Loop
End Sub
End Class
Continue reading...
Overload resolution failed because no accessible New accepts this number of arguments for: d3ddev
Overload resolution failed because no accessible New accepts this number of arguments for: drawfont
And
DrawText is ambiguous because multiple kinds of members with this name exist in class Microsoft.DirectX.Direct3D.Fo
nt
Appreciate any help at all
Imports Microsoft.DirectX
Imports Microsoft.DirectX.Direct3D
Imports Microsoft.DirectX.DirectInput
Imports System.Windows
Public Class Test1
Dim RunOnce As Boolean = True
Dim gamerun As Boolean = True
Dim bkcolor As Color = Color.Black
Dim d3ddev As New Direct3D.Device
Dim d3dpp As New PresentParameters
Dim drawfont As New Direct3D.Font
Dim x As Int32
Dim wait As Int32
Private Sub Test1_formClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
gamerun = False
End Sub
Private Sub Test1_KeyDown(ByVal Sender As Object, ByVal e As Forms.KeyEventArgs) Handles Me.KeyDown
If (e.KeyCode = Keys.Escape) Then
gamerun = False
Me.Close()
End If
End Sub
Private Sub Test1_Load(ByVal Sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim pos As Point
pos.X = 0
pos.Y = 0
Me.Location = pos
Me.Height = 1200
Me.Width = 1600
Me.Show()
End Sub
Private Sub Tes1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
If RunOnce Then
RunOnce = False
Init()
Run()
End If
End Sub
Private Sub Init()
d3dpp.DeviceWindow = Me .PictureBox1
Me.PictureBox1.Hide()
d3dpp.BackBufferCount = 1
d3dpp.BackBufferFormat = Format.X8R8G8B8
d3dpp.BackBufferHeight = Me.Height
d3dpp.BackBufferWidth = Me.Width
d3dpp.SwapEffect = SwapEffect.Discard
d3dpp.PresentationInterval = PresentInterval.Immediate
d3dpp.Windowed = True
d3dpp.EnableAutoDepthStencil = True
d3dpp.AutoDepthStencilFormat = DepthFormat.D24S8
d3ddev = New Direct3D.Device(0, Direct3D.DeviceType.Hardware, Me, CreateFlags.HardwareVertexProcessing, d3dpp)
drawfont = New Direct3D.Font(d3ddev, New System.Drawing.Font("IMPACT", 32, FontStyle.Regular, GraphicsUnit.Pixel))
x = 25
wait = 0
End Sub
Private Sub Run()
Do While gamerun
d3ddev.Clear(ClearFlags.Target Or ClearFlags.ZBuffer, bkcolor, 1, 0)
d3ddev.BeginScene()
drawfont.DrawText(Nothing, "Test", x, 50, Color.DarkCyan)
d3ddev.EndScene()
d3ddev.Present()
If (x > 500) Then
x = 25
Else
If (wait > 10) Then
x +=1
wait = 0
Else
wait += 1
End If
makes windows happy
Windows.Forms.Application.DoEvents()
Loop
End Sub
End Class
Continue reading...