How can I create a device in an UserControl

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
dec
Posts: 4
Joined: Sun Apr 08, 2007 12:17 pm

How can I create a device in an UserControl

Post by dec »

Hi,

I'm trying to create a device into an UserControl in VB 2005 Express. But it's not working.

I'm using following code:

Code: Select all

Public Class _3d_Viewer
    Private Device As Irrlicht.IrrlichtDevice
    Private Driver As Irrlicht.Video.IVideoDriver

    Private Sub _3d_Viewer_Invalidated(ByVal sender As Object, ByVal e As System.Windows.Forms.InvalidateEventArgs) Handles Me.Invalidated
        Driver.BeginScene(True, True, New Irrlicht.Video.Color(255, 10, 200, 24))
        Driver.Draw2DLine(New Irrlicht.Core.Position2D(0, 0), New Irrlicht.Core.Position2D(Width, Height), New Irrlicht.Video.Color(255, 0, 200, 0))
        Driver.EndScene()
    End Sub
    Private Sub _3d_Viewer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Device = New Irrlicht.IrrlichtDevice(Irrlicht.Video.DriverType.DIRECT3D9, New Irrlicht.Core.Dimension2D(Width, Height), 32, False, False, False, True, Me.Handle)
        Driver = Device.VideoDriver
        Driver.BeginScene(True, True, New Irrlicht.Video.Color(255, 10, 200, 24))
        Driver.Draw2DLine(New Irrlicht.Core.Position2D(0, 0), New Irrlicht.Core.Position2D(Width, Height), New Irrlicht.Video.Color(255, 0, 200, 0))
        Driver.EndScene()
    End Sub
End Class
Can someone help me?
Locked