On Friday, 22 September 2017 at 04:32:08 UTC, Josh wrote:
As an aside, in that doc it says "The .funcptr property of a
delegate will return the function pointer value as a function
type". So I also tried
Mix_ChannelFinished((&channelDone).funcptr); and this compiled,
but caused a segfault when
On Friday, 22 September 2017 at 03:26:36 UTC, Mike Parker wrote:
On Friday, 22 September 2017 at 02:22:46 UTC, Josh wrote:
src\mixer.d(80,22): Error: function pointer
Mix_ChannelFinished (extern (C) void function(int channel)) is
not callable using argument types (extern (C) void
delegate(i
On Friday, 22 September 2017 at 02:32:56 UTC, Josh wrote:
Why should the binding force nothrow? I don't understand why
you HAVE to not throw exceptions. Is it because of the C -> D
aspect?
Yes, it's because D exceptions are not guaranteed to propagate
through the C callstack. It works on som
On Friday, 22 September 2017 at 02:32:56 UTC, Josh wrote:
Why should the binding force nothrow? I don't understand why
you HAVE to not throw exceptions. Is it because of the C -> D
aspect?
Yes, it's because D exceptions are not guaranteed to propagate
through the C callstack. It works on som
On Friday, 22 September 2017 at 02:22:46 UTC, Josh wrote:
src\mixer.d(80,22): Error: function pointer Mix_ChannelFinished
(extern (C) void function(int channel)) is not callable using
argument types (extern (C) void delegate(int channel))
Code:
void unmuteAfterPlaySound()
{
Mix_Chan
On Friday, 22 September 2017 at 02:18:34 UTC, Mike Parker wrote:
On Thursday, 21 September 2017 at 22:05:22 UTC, Matt Jones
wrote:
On Thursday, 21 September 2017 at 20:21:58 UTC, Josh wrote:
I'm trying to write a callback function for SDL_mixer through
Derelict, but this is the first time I've
On Thursday, 21 September 2017 at 22:05:22 UTC, Matt Jones wrote:
On Thursday, 21 September 2017 at 20:21:58 UTC, Josh wrote:
I'm trying to write a callback function for SDL_mixer through
Derelict, but this is the first time I've tried to use a
function as a parameter, and so I think I'm just m
On Friday, 22 September 2017 at 02:18:34 UTC, Mike Parker wrote:
and use & to reference the function instead of calling it:
Mix_ChannelFinished(&channelDone);
To expand on this, D allows functions to be called without
parentheses. `channelDone` is actually a function call, whereas
in C, it
On Thursday, 21 September 2017 at 22:05:22 UTC, Matt Jones wrote:
On Thursday, 21 September 2017 at 20:21:58 UTC, Josh wrote:
I'm trying to write a callback function for SDL_mixer through
Derelict, but this is the first time I've tried to use a
function as a parameter, and so I think I'm just m
On Thursday, 21 September 2017 at 20:21:58 UTC, Josh wrote:
I'm trying to write a callback function for SDL_mixer through
Derelict, but this is the first time I've tried to use a
function as a parameter, and so I think I'm just making a minor
mistake somewhere.
[...]
Make it a C function, n
I'm trying to write a callback function for SDL_mixer through
Derelict, but this is the first time I've tried to use a function
as a parameter, and so I think I'm just making a minor mistake
somewhere.
The C SDL docs say:
// make a channelDo
11 matches
Mail list logo