Results 1 to 2 of 2

Thread: Getting Graphics.TBitmap's image memory

  1. #1

    Getting Graphics.TBitmap's image memory

    Is there a way of getting the pointer to the Bitmap's data so it can be used with glBitmap ? What i wan't to do is this:

    Bitmap.Width:=128;
    Bitmap.Height:=128;
    Bitmap.Canvas.Rectangle(0,0,128,12;

    glBitmap(Bitmap.Width, Bitmap.Height, 0,0,0,0, ***);
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

  2. #2

    Getting Graphics.TBitmap's image memory

    You could probably use TBitmap.Scanline - I'm not sure how glBitmap works, though, so I can't give you much more info . Make sure that you set your bitmap's PixelFormat to the relevant value too (pf32Bit or whatever is required for glBitmap) - ScanLine gets a bit annoyed if the pixelformat is the default, pfDevice.

    You'd want to pass in the address of the first pixel of the first scanline, I suppose. I'm not sure how the bitmap's orientation (top-down or bottom-up scanlines) would come into the equation either.

    I'm sure someone else around here has more insight than me on this. I'll defer to the next poster. Huzzah for vague posts!
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

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
  •