Page 1 of 2

Problem with 1.1

Posted: Mon Aug 14, 2006 12:09 am
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

Posted: Tue Aug 15, 2006 6:05 am
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

Posted: Tue Aug 15, 2006 11:17 am
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.

Posted: Wed Aug 16, 2006 3:28 am
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 :)

Posted: Wed Aug 16, 2006 3:43 pm
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

Posted: Wed Aug 16, 2006 11:34 pm
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.

Posted: Wed Aug 16, 2006 11:58 pm
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.

Posted: Thu Aug 17, 2006 12:59 am
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?

Posted: Thu Aug 17, 2006 1:02 am
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.

Posted: Thu Aug 17, 2006 1:17 am
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

Posted: Thu Aug 17, 2006 2:25 am
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.

Posted: Thu Aug 17, 2006 2:33 am
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 .

Posted: Thu Aug 17, 2006 2:52 am
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.

Posted: Thu Aug 17, 2006 6:08 pm
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.

Posted: Fri Aug 18, 2006 2:35 am
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).