IAttributes problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
mybrainisfull
Posts: 15
Joined: Sun Jul 29, 2007 4:51 pm
Location: State College, PA

IAttributes problem

Post by mybrainisfull »

Whenever I create an attribute object using

Code: Select all

io::IAttributes* me; 
I am unable to work with "me" :) i.e. the program crashes whenever I try to add an attribute to it or in fact every time I have something like

Code: Select all

me->(something)
the program crashes. It gives an access violation error in reading the location. Any help would be appreciated.
Thanks in advance.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

me is a bad pointer. You need to initialized it to point to an actual attributes object. If you want to create attributes to add attributes to, you would write...

Code: Select all

IAttributes* me = device->getFileSystem()->createEmptyAttributes();
Travis
mybrainisfull
Posts: 15
Joined: Sun Jul 29, 2007 4:51 pm
Location: State College, PA

IT WORKS!

Post by mybrainisfull »

:D

Thanks Travis!
Post Reply