Sto provando a eseguire l'esempio OpenGL con Dlang.Passaggio del puntatore alla funzione in Dlang
void onError(int code, const(char)* text) nothrow
{
}
Usage:
glfwSetErrorCallback(&onError);
codice vincolante:
__gshared {
da_glfwSetErrorCallback glfwSetErrorCallback;
...
extern(C) @ nogc nothrow {
alias da_glfwSetErrorCallback = GLFWerrorfun function(GLFWerrorfun);
...
alias GLFWerrorfun = void function(int, const(char)*);
e ottengo il seguente errore del compilatore:
Error: function pointer glfwSetErrorCallback (extern (C) void function(int, const(char)*) nothrow) is not callable using argument types (void function(int code, const(char)* text) nothrow)
Compiler: 2.065.0
Grazie! Ora funziona! – Grigory