24bit problems

Started by
13 comments, last by Brad8383 24 years, 2 months ago
Have you tried

void SetPixel24(int x, int y, RGB24 color)
{
int PixAddr = (x + x + x) + y * Pitch;
buffer[PixAddr] = color;
}

Pitch being 3 times the width and buffer being a RGB24 *
If that doesn''t work, the only thing I can think of, is somewhere in your code, PixAddr is has been either incremented or decremented, causing the alignment to be off. I believe blue is first, you can try switching it with red.

Domini
Advertisement
Yep ive tried your methods and all the other peoples at xtreme games. Right now the code was set up to plot using 32bits and the last 8 being 0. It works on my friends computer perfectly. I have a stealth 2 s220 and it probably doesnt work right in 24bit. What would happen if i set it in 24bit mode without checking the errors and it didnt support it? Oh yeah and how can i tell if the card needs to use your RGB24 method(using exactly 24bits) and using 32 bits but having the last 8 set to 0?
You have been using 32bit modes, not 24 bit ones. With the 32 bit modes I belive that extra 8 bits is an alpha channel. I don''t have much experience with 32 bit modes, but I''ll see what I can find out.

Domini
Yes but when i tried 24bit with your RGB24 method and the method in TWGPG it gave the same results. Remember on some cards though 24bit is represented with 32 bits cause some cards cant address that way. At least thats what ive read. But anyway it works perfect on my friends computer and I do have an old card. Im not really going to use this anyway but I wanted to put it in my wrapper just to be complete.
I am creating a windows wrapper that handles the overhead and Direct X. It works with 24 and 16 bit modes, so I have a RGB16 and a RGB24 and two sets of my graphics functions. You can do the same thing and call your RGB32 graphics functions if the mode is 32 bpp. I may add RGB32 to my wrapper.

Domini

This topic is closed to new replies.

Advertisement