driver problem..

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
omarb
Posts: 23
Joined: Fri Jul 07, 2006 1:34 pm

driver problem..

Post by omarb »

hi,
i tried this:
this is not crashing but i am getting a grey screen
Try
If device Is Nothing Then
device = New IrrlichtDevice(Irrlicht.Video.DriverType.OPENGL, New Dimension2D(c.Width, c.Height), 32, False, False, False, True, c.Handle)
End If
Catch ex As Exception
End Try
Try
If device Is Nothing Then
device = New IrrlichtDevice(Irrlicht.Video.DriverType.DIRECT3D9, New Dimension2D(c.Width, c.Height), 32, False, False, False, True, c.Handle)
End If
Catch ex As Exception
End Try
Try
If device Is Nothing Then
device = New IrrlichtDevice(Irrlicht.Video.DriverType.DIRECT3D8, New Dimension2D(c.Width, c.Height), 32, False, False, False, True, c.Handle)
End If
Catch ex As Exception
End Try

----------------------------
on this machine when i use this directly the application works:
device = New IrrlichtDevice(Irrlicht.Video.DriverType.OPENGL, New Dimension2D(c.Width, c.Height), 32, False, False, False, True, c.Handle)
any idea why that is happening?
Scionwest
Posts: 15
Joined: Sun Jul 30, 2006 4:01 am

Post by Scionwest »

I believe you need to declare a video driver also

Code: Select all

  Private driver As Irrlicht.Video.IVideoDriver

and then

Code: Select all

Try 
If device Is Nothing Then 
device = New IrrlichtDevice(Irrlicht.Video.DriverType.OPENGL, New Dimension2D(c.Width, c.Height), 32, False, False, False, True, c.Handle) 
driver = device.videodriver
End If 
Catch ex As Exception 
End Try 
and then in your loop

Code: Select all

While RenderingDevice.device.Run()
            If RenderingDevice.device.WindowActive Then
                RenderingDevice.device.VideoDriver.BeginScene(True, True, New Color(0, 100, 100, 255))

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

                RenderingDevice.device.VideoDriver.EndScene()

            End If
        End While

        ''shutdown the renderer
        RenderingDevice.device.CloseDevice()
This renders mine with a blue backdrop. Hope this works, I'm very new to this so I'm not sure if this is what you where needing help with.
Locked