Results 1 to 5 of 5

Thread: OpengGL Vertex Buffer Objects

  1. #1

    OpengGL Vertex Buffer Objects

    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

    Code:
    #define BUFFER_OFFSET(i) ((char*)NULL + (i))

    my first attempt is

    [pascal]
    function BUFFER_OFFSET(i: Integer): Pointer;
    begin
    Pointer(Longint(Pointer(nil))+i);
    end;
    [/pascal]

    comments?
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  2. #2

    Re: OpengGL Vertex Buffer Objects

    Quote Originally Posted by technomage
    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

    Code:
    #define BUFFER_OFFSET&#40;i&#41; &#40;&#40;char*&#41;NULL + &#40;i&#41;&#41;

    my first attempt is

    [pascal]
    function BUFFER_OFFSET(i: Integer): Pointer;
    begin
    Pointer(Longint(Pointer(nil))+i);
    end;
    [/pascal]

    comments?
    [pascal]
    function BUFFER_OFFSET(i: Integer): Pointer;
    begin
    result := Pointer(Longint(Pointer(nil))+i);
    end;
    [/pascal]?
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  3. #3

    OpengGL Vertex Buffer Objects

    Code:
    function BUFFER_OFFSET&#40;i&#58; longword&#41;&#58; Pointer;
    var
    ptr&#58; pointer absolute i;
    begin
      result &#58;= ptr;
    end;
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

  4. #4

    OpengGL Vertex Buffer Objects

    That looks OK, but it's the

    Code:
    &#40;char *&#41;null
    bit that gets me.
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  5. #5

    OpengGL Vertex Buffer Objects

    Well my version does not work...

    Delfi - you version appears to do the Job nice work , thank you.
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •