Delphi

OpenAL

Delphi OpenAL board

Changing EAX effect

Hi,

I tried to change the environment effect in the EAX demo. But for some strange reason, I can only do this in the formCreate procedure. If I place the 3 'eaxSet' in another procedure, it will crash. For example:

procedure setEAX;
begin
eaxSet(DSPROPSETID_EAX20_ListenerProperties,
DSPROPERTY_EAXLISTENER_ENVIRONMENT or
DSPROPERTY_EAXLISTENER_DEFERRED,
0, @envEffect, sizeof(TALuint));
// Commit settings on source 0
eaxSet(DSPROPSETID_EAX20_BufferProperties,
DSPROPERTY_EAXBUFFER_COMMITDEFERREDSETTINGS,
source, nil, 0);
// Commit Listener settings
eaxSet(DSPROPSETID_EAX20_ListenerProperties,
DSPROPERTY_EAXLISTENER_COMMITDEFERREDSETTINGS, 0, nil, 0);
end;

procedure form1.onFormCreate( ... )
...
// Check for EAX 2.0 support
alIsExtensionPresent('EAX2.0');
FnName := 'EAXSet';
eaxSet := alGetProcAddress(FnName);
FnName := 'EAXGet';
eaxGet := alGetProcAddress(FnName);

env := SOME_EFFECT;
setEAX;
end;


will cause an access violation. How to fix this?

Greetings,
Rick

Posting in forum is disabled ...