Problem with 1.1

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.
Scionwest
Posts: 15
Joined: Sun Jul 30, 2006 4:01 am

Problem with 1.1

Post by Scionwest »

I compiled the following line with 1.0

Code: Select all

        ''get the resolution
        Dim m_screensize As Dimension2D = getResolution(screenSize)

        ''Create the rendering Device
        device = New IrrlichtDevice(DriverType.DIRECT3D9, m_screensize, 16, bFullScreen, True, True, False, Nothing)
        driver = device.VideoDriver
and it compiles fine. I make NO changes to the code at all and copy the new Irrlicht.Net.dll and Irrlicht.dll 1.1 files over my 1.0 dll's and run the program and I get an error message:

Object Referance not set to an instance of an object.

I don't understand why 1.0 works and 1.1 does not. Any suggestions?

Thanks
shivanraptor
Posts: 40
Joined: Tue Aug 15, 2006 6:01 am
Location: Hong Kong
Contact:

Post by shivanraptor »

i have the exactly same problem with you .
version 1.0 works perfectly for me .
please help !

my config :
Irrlicht 1.1
Microsoft Visual C# Express 2005 , testing Tutorial 2 of examples.NET
.NET Framework 2.0
DirectX 9 SDK June 2006
gabb
Posts: 8
Joined: Tue Aug 08, 2006 8:54 am

Post by gabb »

I get AccessViolation errors instead, also the IrrlichtDevice constructor thats causing it here, apparently trying to access memory outside its Application Domain or something like that.

I'm waiting for a Irrlicht.NET v1.1-final release, this one is buggy and not feature-complete either.
shurijo
Posts: 148
Joined: Sat Feb 21, 2004 3:04 am

Post by shurijo »

I was getting tons of memory access violations with 1.1 (with 0 with 1.0). After thinking about it during my sleep, I figured out my cause. I don't know if it relates to you, but here was my problem.

I had a separate thread that was doing the rendering of the device. During which that thread was still active, I was reDimming (re-initializing) my variable used for the device. Once I put a variable to cancel my render thread, it was able to break out and close that thread, then after re-initalizing my device, I started the thread back up.

I also got this type of error when doing Remove on the root node to remove everything from the scene. Somehow the remove was removing it at the same time the thread was trying to draw it and it was out of sync. Trying to read from memory that wasn't there, etc. Once I stopped that separate render thread, it fixed this also.

I just added a member var of isRunning and exited the render thread when = false. I also made sure that the Render loop/thread didn't start until after I have added all of my scenenodes. Seemed to have a problem of adding/removing scene nodes on a different thread than the rendering.

I don't know if that helps, but if you are using threads like me, then it may help :)
Scionwest
Posts: 15
Joined: Sun Jul 30, 2006 4:01 am

Post by Scionwest »

Thanks for the info! My code however is really basic. I'm just trying to create a device with 1.1. i 'm not messin with threads yet. I'm still at a lose. Anyone else having similar problems?

Oh ya, I'm usingvb.net
shurijo
Posts: 148
Joined: Sat Feb 21, 2004 3:04 am

Post by shurijo »

what line of code is giving you that error msg? Can you post your code or is it too big? If so, can you just ZIP it and upload it somewhere?

It seems like something simple is wrong, but I'll need to look at the code.
shurijo
Posts: 148
Joined: Sat Feb 21, 2004 3:04 am

Post by shurijo »

I think I figured out the problem. Your device create statement is using the wrong set of parameters. You can't pass nothing as a handle. Just remove that last parameter and it will open a new IrrlichtDevice window.
Scionwest
Posts: 15
Joined: Sun Jul 30, 2006 4:01 am

Post by Scionwest »

I tried what you recommended and that did not fix it, I received an unknown error this time. I'm not sure why 1.1 is having this issue and 1.0 does not. I will figure out someway to upload this for you. The ziped file is is 700kb can I email it to you?
Last edited by Scionwest on Thu Aug 17, 2006 1:22 am, edited 1 time in total.
stodge
Posts: 216
Joined: Fri Dec 05, 2003 5:57 pm

Post by stodge »

Did you re-build your program before running it with a different version? You MUST do that, otherwise it most likely won't work.
Scionwest
Posts: 15
Joined: Sun Jul 30, 2006 4:01 am

Post by Scionwest »

Ta, I deleted all of the existing binaries and overwrote my existing 1.0 .dll's with the 1.1 and then compiled. It compiles ok but when it tries to execute the above line of code for the Irrlicht device the engine bails on me
shurijo
Posts: 148
Joined: Sat Feb 21, 2004 3:04 am

Post by shurijo »

Does this work?

Code: Select all

device = New IrrlichtDevice(DriverType.DIRECT3D9, m_screensize, 16, bFullScreen, True, True)
Also, make sure bFullScreen is set to a value.
shivanraptor
Posts: 40
Joined: Tue Aug 15, 2006 6:01 am
Location: Hong Kong
Contact:

Post by shivanraptor »

Code: Select all

DriverType dt = DriverType.DIRECT3D9;
            IrrlichtDevice device = new IrrlichtDevice(dt , new Dimension2D(1024, 768), 32, false, true, true);
I use this code and I receive the error I mentioned before .
I have cleaned up the project and re-compiled the project after i overwrite Irrlicht.NET.dll and Irrlicht.dll with 1.1 version .
it compiled successfully , but prompt me with NullReferenceException in runtime .
Actually , i copied it from Tutorial 2 of examples.NET of version 1.1 .

Please help .
shurijo
Posts: 148
Joined: Sat Feb 21, 2004 3:04 am

Post by shurijo »

I didn't think 32 bit was working. Try changing 32 to 16. Thats pretty much the exact same statement (except I use 16) that I use and its working fine for me.
Scionwest
Posts: 15
Joined: Sun Jul 30, 2006 4:01 am

Post by Scionwest »

Ok, I checked out the wiki and all it's tutorials are in c++. My bFullscreen boolean also defualts to false. I will post my code when I get home tomarrow and show you what I have. It's pretty much the same as above, but I made some changes because the above wasn't working so I'll post it.

oh, also I always run the device at 16bit instead of 32bit.
shurijo
Posts: 148
Joined: Sat Feb 21, 2004 3:04 am

Post by shurijo »

Scionwest wrote:Ok, I checked out the wiki and all it's tutorials are in c++.
Click on Tutorials link on the Wiki. There's tutorials for C# and VB.NET (for Irrlicht version 1.0).
Locked