code not working like expected

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
Mike

code not working like expected

Post by Mike »

the window shows up and disappears...

Code: Select all

 'delcare a new irr device
        Dim device As IrrlichtDevice

        device = New IrrlichtDevice(DriverType.DIRECTX9)

        'set the app window caption
        device.WindowCaption() = "DungeonKeep"

        'load the texture
        Dim images As ITexture = device.VideoDriver.GetTexture("media/2ddemo.bmp")
        device.VideoDriver.MakeColorKeyTexture(images, New Position2D(0, 0))

        While (device.Run())
            If (device.WindowActive) Then

                device.VideoDriver.BeginScene(True, True, New Color(255, 0, 0, 50))

                device.SceneManager.DrawAll()
                device.GUIEnvironment.DrawAll()

                device.VideoDriver.Draw2DImage(images, New Position2D(50, 50), _
                    New Rect(0, 0, 342, 224), New Color(255, 255, 255, 255), True)

                device.VideoDriver.EndScene()

            End If

            device.CloseDevice()

        End While
    End Sub
i am trying to convert the 2d images tutorial from the site. Also, anybody got any ideas on how to make this engine work with 2d tiles, instead of just taking a full image, and drawing the level.
Foole
Posts: 87
Joined: Mon Aug 29, 2005 10:08 am

Post by Foole »

Try moving the CloseDevice line OUTSIDE the While loop.
Thorben Linneweber

Post by Thorben Linneweber »

yes, this should solve your problem... it not a good idead to close the device within the loop
Guest

Post by Guest »

oh, oops... stupid me didnt even notice that...
Locked