[ pgavrilo @ 11.09.2009. 17:15 ] @
E ovako preveo sam ovaj kod iz C# u VB prema svojim mjerama da učim DX. Kod koji sam preveo je 1. tutorijal iz Menaged Dokumentacije i ovako glasi: Code: Imports Microsoft.DirectX Imports Microsoft.DirectX.Direct3D Imports System.Windows.Forms Imports System.Drawing Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(400, 300) Me.Text = "D3D Tutorial 01: CreateDevice" 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) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer #End Region Dim device As device Public Function InitializeGraphics() As Boolean ' Try Dim PresentParamns As New Direct3D.PresentParameters() PresentParams.Windowed = True PresentParams.SwapEffect = SwapEffect.Discard device = New Device(0, DeviceType.Software, Me, CreateFlags.SoftwareVertexProcessing, PresentParams) Return True ' Catch e As DirectXException ' MsgBox(e.Message, MsgBoxStyle.Critical, "Error") ' Return False 'End Try End Function Greška se javi u funkciji InitializeGraphics() i to kad se pokuša napraviti objekat device. Može li mi neko reći gde je problem. Unaprijed Hvala! |