technomage
19-08-2007, 12:36 PM
Hi
Any ideas on converting this macro to a Delphi function, it's used to specific offsets when using vertex buffer objects which are Interleaved, or serialized under opengl
#define BUFFER_OFFSET(i) ((char*)NULL + (i))
my first attempt is
function BUFFER_OFFSET(i: Integer): Pointer;
begin
Pointer(Longint(Pointer(nil))+i);
end;
comments?
Any ideas on converting this macro to a Delphi function, it's used to specific offsets when using vertex buffer objects which are Interleaved, or serialized under opengl
#define BUFFER_OFFSET(i) ((char*)NULL + (i))
my first attempt is
function BUFFER_OFFSET(i: Integer): Pointer;
begin
Pointer(Longint(Pointer(nil))+i);
end;
comments?