I’m new here and maybe this question was already answered but i couldn’t find it.
So here is a small piece of code i use to get event to play:
TheFMODMgr->EVENTproject->getGroupByIndex(EVENTGROUP_SHIPS, true, &group);
group->getGroupByIndex(EVENTGROUP_SHIPS_WEAPONS, true, &subGroup);
subGroup->getEventByIndex(EVENT_WEAPONS_WEAPONS, FMOD_EVENT_DEFAULT, &bufEvent);
Everything is working.
But one thing just keeps me bothering. If i launch it under debugger step by step "bufEvent" address looks like 0x00000001, which i beileve is wrong. But the most strangest is that it works. "group" and "subGroup" variables show their address correctly (i think).
Using: VS PRO 2008 (with all service packs and updates) + FMOD 4.30 (downloaded from main download page).
- ca$per asked 9 years ago
Hi Ca$per, welcome to the forums.
[quote:25heco19]If i launch it under debugger step by step "bufEvent" address looks like 0x00000001[/quote:25heco19]
Yes this is due to our API using handles not pointers. The system will process that handle and translate it into a pointer internally. If you have a handle which is invalid, rather than getting an access violation, the function will return FMOD_ERR_INVALIDHANDLE.
[code:25heco19]FMOD_RESULT result = ((FMOD::Event*)NULL)->start();[/code:25heco19]
will not crash!
For this reason it is critical that you check the FMOD_RESULT returned from [i:25heco19]every[/i:25heco19] FMOD function call you make. It generally easiest to make an ERRCHECK function like what is used in our examples.
- Guest answered 9 years ago
Please login first to submit.