SDL_CreateRGBSurface from with 16-bit images...

This is a discussion on SDL_CreateRGBSurface from with 16-bit images... within the C++ Programming forums, part of the General Programming Boards category; Ok... I'm using SDL_CreateRGBSurfaceFrom a lot in my application. This is how I'm calling it: Code: SDL_CreateRGBSurfaceFrom(frame, resWidth, resHeight, colorDepth, ...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    55

    SDL_CreateRGBSurface from with 16-bit images...

    Ok... I'm using SDL_CreateRGBSurfaceFrom a lot in my application. This is how I'm calling it:
    Code:
    SDL_CreateRGBSurfaceFrom(frame, resWidth, resHeight, colorDepth, resWidth*colorDepth/8, 0, 0, 0, 0);
    Where frame is the pixel data of a bmp, resWidth and resHeight the resolution of the bmp and colorDepth is the color depth in bits. Well, this works well with 24 or 32 bits bmps. However, it doesn't look good on 16bit bmps. This is how it looks:

    http://img116.imageshack.us/img116/7...escreenmf2.jpg

    Do you know what the colors are like that?

  2. #2
    Registered User
    Join Date
    Apr 2007
    Posts
    55
    BTW, I found out... I had to set the masks like this:

    RMask = 0x7c00;
    GMask = 0x03e0;
    BMask = 0x001f;

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem reading 8 bit greyscale images !
    By Clueless@work in forum C Programming
    Replies: 12
    Last Post: 07-01-2007, 11:07 AM
  2. porting application from 32 bit to 64 bit error
    By gandalf_bar in forum Linux Programming
    Replies: 1
    Last Post: 09-14-2005, 09:20 AM
  3. 16 bit MS-Dos Subsystem Prob
    By darkmessiah in forum Windows Programming
    Replies: 2
    Last Post: 07-10-2005, 11:37 AM
  4. 16 bit colors
    By morbuz in forum Game Programming
    Replies: 13
    Last Post: 11-10-2001, 12:49 AM
  5. Array of boolean
    By DMaxJ in forum C++ Programming
    Replies: 11
    Last Post: 10-25-2001, 11:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21