www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Does this C callback call look correct?

reply WhatMeWorry <kheaser gmail.com> writes:
// Specification from ALURE documentation

ALURE_API ALboolean ALURE_APIENTRY
alurePlaySourceStream(
ALuint      source,
alureStream *stream,
ALsizei     numBufs,
ALsizei     loopcount,
void        (*eos_callback)(void *userdata, ALuint source),
void        *userdata
)

// My D code, below compiles and links and when I execute it
// I get a beep sound (which is as expected), but ALURE never
// calls my eos_callback function no matter how long I wait.

extern (C) void eos_callback(void *unused, ALuint unused2)
{
     writeAndPause("End Of Streaming");
}

if (alurePlaySourceStream(
source,
stream,
numBuffs,
loopStreamCount,
&eos_callback,    // end of stream callback
cast (void *) 0) == AL_FALSE)


Am I missing something?  I'm using Derelict ALURE.  I've looked 
on github but there seems to be no D code using this technique.
May 27 2016
parent WhatMeWorry <kheaser gmail.com> writes:
Never mind.  D was fine. Needed an alureUpdate() to trigger the 
call back.
May 28 2016