Results 1 to 2 of 2

Thread: Pixel format is read-only?

  1. #1

    Pixel format is read-only?

    From SDL.pas:
    [pascal] // Everything in the pixel format structure is read-only
    PSDL_PixelFormat = ^TSDL_PixelFormat;
    TSDL_PixelFormat = record
    palette: PSDL_Palette;
    BitsPerPixel: UInt8;
    BytesPerPixel: UInt8;
    Rloss: UInt8;
    Gloss: UInt8;
    Bloss: UInt8;
    Aloss: UInt8;
    Rshift: UInt8;
    Gshift: UInt8;
    Bshift: UInt8;
    Ashift: UInt8;
    RMask: UInt32;
    GMask: UInt32;
    BMask: UInt32;
    AMask: UInt32;
    colorkey: UInt32; // RGB color key information
    alpha: UInt8; // Alpha value information (per-surface alpha)
    end;
    [/pascal]

    Why is this entire record stated to be read-only? I'm trying to set up a routine to load an image format not covered by SDL_image, and I need access to the palette. What's going on here, and how can I work around it?

  2. #2

    Pixel format is read-only?

    It's read only because SDL is the only thing that is allowed to change it.

    If you want to manipulate the palette you'll need to do it some other way. If you have a look at the JEDI-SDL demos, you should find a palette example that should hopefully get you started.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

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
  •