I have checked and double checked that I have all the necessary references and includes. Obviously I am missing something.
Thanks Dick
Imports
SystemImports
System.DrawingImports
System.Windows.FormsImports
Microsoft.DirectXImports
Microsoft.DirectX.Direct3D Public Class Form1 Inherits System.Windows.Forms.Form Dim device As Device ' Our rendering device#
Region "Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer.InitializeComponent()
End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean) If Disposing Then If Not components Is Nothing Thencomponents.Dispose()
End If End If MyBase.Dispose(Disposing) End Sub 'Required by the Windows Form Designer#
End Region Public Function InitializeGraphics() As Boolean Try ' Now let's setup our D3D stuff Dim presentParams As PresentParameters = New PresentParameters()presentParams.Windowed =
TruepresentParams.SwapEffect = SwapEffect.Discard
device =
New Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams) Return True Catch Return False End Try End Function Private Sub Render() If device Is Nothing Then Exit Sub End If 'Clear the backbuffer to a blue colordevice.Clear(ClearFlags.Target, System.Drawing.Color.Blue, 1.0F, 0)
'Begin the scenedevice.BeginScene()
' Rendering of scene objects can happen here 'End the scenedevice.EndScene()
device.Present()
End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not InitializeGraphics() ThenMessageBox.Show(
"Could not initialize Direct3D. This tutorial will exit.") Exit Sub End If Me.Show() ' While the form is still valid, render and process messages Do While Me.CreatedRender()
Application.DoEvents()
Loop End SubEnd
Class
device is ambiguous in the namespace microsoft.directx.direc3d
Lorenzo Colautti