I'm having a crazy error with SDL and Irrklang[solved]

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
dec
Posts: 4
Joined: Sun Apr 08, 2007 12:17 pm

I'm having a crazy error with SDL and Irrklang[solved]

Post by dec »

Sorry for my bad english!
however....
I'm having a very curious error while playing a sound with Irrklang in an SDL application.

This is my code:

Code: Select all


/*Main Function*/

......

f32 Posoncircle = 0;
while(Posoncircle < 16*PI)
{
   SDL_BlitSurface(Loading,&BG->clip_rect,Screen,&Screen->clip_rect);
   SDL_Flip(Screen);
   SDL_PollEvent(EVT);
   Engine->setListenerPosition(core::vector3df(0,0,0), core::vector3df(0,0,1));
   Sound->setPosition(vector3df(sinf(Posoncircle)*5.0f,cosf(Posoncircle)*2,0));
   Sound->setMinDistance(5.0f);
   Posoncircle += 0.04f;
   SDL_Delay(100);
   //printf("\rX=%f      y=%f       sinf((double)Posoncircle)*5,sinf((double)Posoncircle)*2.5);
}

.....
On runtime I get an access violation


If I would not comment out the "printf" instruction all would work perfect
The same if i comment out the "SDL_POLLEvent(...)"
The curious thing is: when I replace my printf instruction with 'printf(" ")' I get the same error.

Can anyone give me an answare :?:
Last edited by dec on Wed Apr 11, 2007 11:31 am, edited 1 time in total.
lonesock
Posts: 9
Joined: Sun Jan 14, 2007 12:54 am
Contact:

unrelated?

Post by lonesock »

Whenever I had an error like this, it was actually unrelated to the printf statements. Maybe try checking to see if Sound is not NULL before calling setPosition and setMinDistance?
lonesock
Piranha are people too.
dec
Posts: 4
Joined: Sun Apr 08, 2007 12:17 pm

Post by dec »

I'm getting an access violation with "Engine" and not on Sound. However Engine isn't set to null but to 0x000070 or something like this.
Post Reply