Dim cube As DarkGDK.Basic3D.Cube
Dim texture As DarkGDK.Basic2D.Image
' First we will instruct our camera to have a specific background colour
DarkGDK.Camera.DefaultCamera.ColorBackdrop(Color.BlueViolet)
' Instruct DarkGDK.NET to stop automatically positioning and
' angling the camera every time a new object is created.
DarkGDK.Camera.DefaultCamera.AutoCamOff()
' Place the camera just infront of where our cube will first appear
DarkGDK.Camera.DefaultCamera.PositionCurrent(0, 0, -20)
' Tell the camera to point towards the centre of our virtual universe
DarkGDK.Camera.DefaultCamera.PointCurrent(0, 0, 0)
' Create and load a texture into memory which will be used
' to texture the cube
texture = New DarkGDK.Basic2D.Image(New DarkGDK.ResourceAssembly(), "EventHandler.gdk.png")
' Create a cube, 10x10x10 units in size, and wrap the texture
' onto the cube
cube = New DarkGDK.Basic3D.Cube(10, texture)
'
' Loop continuously until StopGDKLoop is called, or the ESC key is pressed.
'
While DarkGDK.Engine.LoopGDK()
' Rotate our cube along it's Y axis
DarkGDK.Camera.DefaultCamera.ControlDefaultUsingArrowKeys(1, 1)
' Also, rotate our cube on all three axi
cube.Rotate(DarkGDK.IO.Mouse.X, 0, DarkGDK.IO.Mouse.Y)
' Tell DarkGDK.NET to render our default camera display
DarkGDK.Core.Sync()
End While
End Sub
This is the standard code, and it just throws a error message saying this:
An unhandled exception of type 'System.AccessViolationException' occurred in DarkGDK.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Keep it simple.
Questions? Mail me