rs2_erroras parameter. For example this function:
/**
* \brief Creates RealSense context that is required for the rest of the API.
* \param[in] api_version Users are expected to pass their version of \c RS2_API_VERSION to make sure they are running the correct librealsense version.
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored.
* \return Context object
*/
rs2_context* rs2_create_context(int api_version, rs2_error** error);
typedef struct rs2_error rs2_error;
(...)
rs2_error * rs2_create_error(const char* what, const char* name, const char* args, rs2_exception_type type);
rs2_exception_type rs2_get_librealsense_exception_type(const rs2_error* error);
const char* rs2_get_failed_function (const rs2_error* error);
const char* rs2_get_failed_args (const rs2_error* error);
const char* rs2_get_error_message (const rs2_error* error);
void rs2_free_error (rs2_error* error);
rs2_error = integer;
Prs2_error = ^rs2_error;
And I can compile and create a context with any problem (for the moment).var
f: prs2_context;
e: Prs2_error;
begin
f := rs2_create_context(RS2_API_VERSION, e);
rs2_delete_context(f);
end.
Hello, I was playing and I declared as follow:Code: [Select]rs2_error = integer;
Prs2_error = ^rs2_error;
type
Trs2_error = record end;
Prs2_error = ^Trs2_error;
Don't declare it as Integer, declare it as record end as I had mentioned in my post or use TOpaqueData as mentioned by Thaddy.
/** \brief All the parameters required to define a video frame. */
typedef struct rs2_software_video_frame
{
void* pixels;
void(*deleter)(void*);
int stride;
int bpp;
rs2_time_t timestamp;
rs2_timestamp_domain domain;
int frame_number;
const rs2_stream_profile* profile;
float depth_units;
} rs2_software_video_frame;
Hello, I advanced in the wrapper for pascal.I am no C expert but I would try my luck this way
But I found this in code of sdk, that I don't know how to translate to pascal: void(*deleter)(void*);
Here is the code.Code: [Select]/** \brief All the parameters required to define a video frame. */
typedef struct rs2_software_video_frame
{
void* pixels;
void(*deleter)(void*);
int stride;
int bpp;
rs2_time_t timestamp;
rs2_timestamp_domain domain;
int frame_number;
const rs2_stream_profile* profile;
float depth_units;
} rs2_software_video_frame;
It's a record, but how can I translate void(*deleter)(void*);
Any Idea
Thanks
/BlueIcaro
Code: [Select]void(*deleter)(void*);
It's a record, but how can I translate void(*deleter)(void*);
type
TDeleterProc = procedure(arg: Pointer); cdecl;
Thanks!!Code: [Select]void(*deleter)(void*);
It's a record, but how can I translate void(*deleter)(void*);
It's a pointer to a function taking a pointer-to-void as a parameter and returning void (if I read it correctly). In Pascal, define a type for the signature:Code: [Select]type
TDeleterProc = procedure(arg: Pointer); cdecl;
Then in the Pascal record definition, declare the field 'deleter: TDeleterProc'.