as promised, a lil code teaser... (vb.net)
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.Diagnostics
Module modGenerals
Dim oDB As New DGSDK.CdbAppClass
Dim oDBCore As New DGSDK.CdbCore
Dim oDBB3D As New DGSDK.CdbBasic3D
Dim oDBCam As New DGSDK.CdbCameraClass
Dim oDBDisp As New DGSDK.CdbDisplayClass
Dim oDBImage As New DGSDK.CdbImageClass
Dim sngX, sngY, sngZ As Single
Sub Main()
INIT_DGSDK_NET("modGenerals")
Setup_Environment()
'//////////////////////////////////////////
oDBB3D.MakeObjectPyramid(1, 25)
oDBB3D.PositionObject(1, 0, 0, 0)
oDBCam.PositionCamera(0, 0, -100)
While oDB.LoopSDK()
oDBCore.Sync()
oDBB3D.RotateObject(1, sngX, sngY, sngZ)
sngX += 0.0F
sngY += 1.0F
sngZ += 0.0F
End While
End Sub
Private Sub INIT_DGSDK_NET(ByVal ModuleName As String)
'//REQUIRED - INITIALIZE DB ENGINE////////////////
Dim ptrToAssem As New IntPtr
Dim mdl As System.Reflection.Module
mdl = GetModuleByName(ModuleName)
If Not mdl Is Nothing Then
ptrToAssem = Marshal.GetHINSTANCE(mdl)
oDB.InitializeSDK(ptrToAssem.ToInt32)
Else
MsgBox("Module Not Initialized! Check Module name",MsgBoxStyle.Critical, "Initialization Error")
End
End If
End Sub
Private Function GetModuleByName(ByVal ModName As String) As System.Reflection.Module
Dim oMod As System.Reflection.Module
For Each oMod In Reflection.Assembly.GetExecutingAssembly.GetLoadedModules
If oMod.Assembly.EntryPoint.ReflectedType.Name = ModName Then
Return oMod
End If
Next
End Function
Private Sub Setup_Environment()
oDBDisp.SetWindowTitle("EZS_DGSDK.NET_TESTING - VB.NET (VS2003 - 1.1) ")
oDBDisp.SetDisplayMode(1024, 768, 32)
oDBDisp.SetWindowPosition(128, 100)
oDBCam.AutoCamOff()
oDBCore.SyncOff()
End Sub
End Module
That runs in a vb.net winforms project, with startup object set to sub main. The only other thing needed that you cant see here is the added reference to the dgsdk.net dll. Thats it. See, easy