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.

code not working like expected

Postby Mike » Sun Oct 09, 2005 2:41 am

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.
Mike
 

Postby Foole » Sun Oct 09, 2005 7:04 am

Try moving the CloseDevice line OUTSIDE the While loop.
Foole
 
Posts: 87
Joined: Mon Aug 29, 2005 10:08 am

Postby Thorben Linneweber » Sun Oct 09, 2005 12:46 pm

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

Postby Guest » Sun Oct 09, 2005 4:45 pm

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


Return to Irrlicht.NET

Who is online

Users browsing this forum: No registered users and 1 guest