Advertisement

When to set palette???

Started by November 19, 1999 05:21 AM
3 comments, last by frizb 25 years, 2 months ago
I don't really understand... why are you using HBRUSH to define a color in Direct Draw?
William Reiach - Human Extrodinaire

Marlene and Me



I'm not using HBRUSH to define a color in direct draw. I'm just blitting simple rectangles on top of random pixels. One of the RECT parameters takes an HBRUSH. Its just that the color ends up blue instead of gray and I'm wondering if this has anything to do with where I attach the palette at or is it because of something else. Thanks, friz

------------------
Still Learning...

Still Learning...
Advertisement
The brushes specified in the window headers, are al numbers. Everything is just a number in windows. So, if you use the Gray Brush, you will actually use an integer number.

So, if that number is blue in the palette you have set, than you will end up with blue in the place you draw the rectangle.

------------------
Dance with me......


I need to know when I should set the palette.
I created a simple primary surface in my Init() function and then in my Main() I simply plot random pixels and blit random RECT's over top of it. The rect are given an (HBRUSH)GRAY_BRUSH parameter but the rectangles end up blue. I tried setting the palette to my lpddpalette object in the Init() and also at the very end of Main() before it returns. Both ways end up with the same results. Any ideas?

------------------
Still Learning...

Still Learning...

Ahhh, I see. How simple. Thanks a bunch!

------------------
Still Learning...

Still Learning...

This topic is closed to new replies.

Advertisement