OPENGL problems & strange crash

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
teromt
Posts: 18
Joined: Sat Apr 08, 2006 8:39 am

OPENGL problems & strange crash

Post by teromt »

I have poblems with OPENGL rendering. I'm developing a game and in options the user can choose the preferred redering mode. DirectX 9, DirectX 8 and Software are working ok but when using OPENGL the screen is just black. The rendering is done in a control (via handle), could this have some affect?

Also the game crashed on my friend when the Irrlicht part of the game is showed. When the irrlicht is initialized(device, scenes etc.) evertyhing is working ok. But when the screen is showed the game crash. The error is "Unexpected error occured....". So it is not an exception. Also the strange thing here is that screen is showing a while(second) before crashing.The friend has exactly the same graphic card as I do and he has even newer drivers than me.
teromt
Posts: 18
Joined: Sat Apr 08, 2006 8:39 am

Post by teromt »

More info: I'm using .NET framework 2.0 and irrlicht version is 1.0
Cube3
Posts: 30
Joined: Wed Mar 15, 2006 7:42 pm
Location: http://cube3.helpmy.net

Post by Cube3 »

Are you spawning the renderloop on a second thread by any chance?
Platform 3D Engine using Irrlicht.NET
http://cube3.helpmy.net
teromt
Posts: 18
Joined: Sat Apr 08, 2006 8:39 am

Post by teromt »

Yep, I'm doing that, so is that causing the problems. I'm aware that everything UI specific stuff(changing control state etc.) should be done in the "UI" thread. But with Irrlicht, how can I do that because the rendering is done with the handle, any good ideas?

Also any ideas about the OPENGL problem, thanks
Cube3
Posts: 30
Joined: Wed Mar 15, 2006 7:42 pm
Location: http://cube3.helpmy.net

Post by Cube3 »

Yes, I had that problem too, once it was running the renderloop on a seperate thread, the screen went black.

Next to just spawn the render thread on a seperate thread, I have not tried yet to start the entire engine from a seperate thread.

If you have any luck with that , let us know.
Platform 3D Engine using Irrlicht.NET
http://cube3.helpmy.net
Cube3
Posts: 30
Joined: Wed Mar 15, 2006 7:42 pm
Location: http://cube3.helpmy.net

Post by Cube3 »

With the handle issue, the only way (as far as i can tell) to solve your problem you can add:


public MainForm()
{

InitializeComponent();
CheckForIllegalCrossThreadCalls = false;
}

In your form containing the picturebox. hope that helps.
Platform 3D Engine using Irrlicht.NET
http://cube3.helpmy.net
teromt
Posts: 18
Joined: Sat Apr 08, 2006 8:39 am

Post by teromt »

Also what I could do is to create new thread just to invoke paint events in e.g. every 20 ms. This thread would call some UI component using "Invoke" method. This way the UI is always repainted in UI thread.
teromt
Posts: 18
Joined: Sat Apr 08, 2006 8:39 am

Post by teromt »

I now created "timer" thread that will fire a render event to the UI thread. This corrected the crash problem in my friend computer.

But the OPENGL rendering still doesn't work. Just black screen, nothing else.
Locked