Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Some questions about 8-bit mode...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 06 October 1999 - 10:31 AM

I've been playing around with 8-bit mode, and I've got a few questions. First off let me just say that I was playing with a palette that was made by just looping from 0 to 255 and assigning the 0-255 value to each red, green, and blue value. So I basically made a grey-scale palette. Also, I'm using VB 5.0 if that molds your answer any...

1) When I'm calling a function that requires a color value, do I give it a 0-255 value representing an entry in my palette? I did this and it seemed to work, but I just want to make sure I'm not doing it wrong.

2) When I set the backbuffer's forecolor property, I get mixed results using the method in number 1. When I set the color to 0 (black in my palette) it will have black text, yet when i use 255 (white in my palette) I get a grayish color. Any ideas why this happens?

3) How could I go about using a bitmap that has 256 total pixels, each pixel having a particular color i want in my palette, and use that to make a palette in DirectX?


Sponsor:

#2 Facehat   Members   -  Reputation: 696

Like
Likes
Like

Posted 02 October 1999 - 03:52 PM

Don't use pallete entrys 0 and 255, those are reserved.

--TheGoop


#3 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 03 October 1999 - 01:57 AM

I used the allow256 (or whatever the exact syntax is) flag...so shouldn't I be able to use these?

#4 CJ   Members   -  Reputation: 122

Like
Likes
Like

Posted 05 October 1999 - 10:30 PM

The first 10 en last 10 colors are reserved for windows....that's what I know.

And further, it's VB so I don't know

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


#5 Jim Adams   Members   -  Reputation: 440

Like
Likes
Like

Posted 06 October 1999 - 03:09 AM

As long as you define the PC_NOCOLLAPSE inside you palette entries and use DDPCAPS_ALLOW256, you have the full range to use with no problem.

Try using this method to create the palette:

/*
lpdd
= DirectDraw Interface
lpddpal
= DirectDraw Palette Interface
lpddsprimary
= DirectDraw Primary Buffer Interface
*/

PALETTEENTRY pal[256];

memset(pal, 0, sizeof(PALETTEENTRY) * 256);
for(i=0;i<256;i++) {
pal[i].peRed = i;
pal[i].peGreen = i;
pal[i].peBlue = i;
pal[i].peFlags = PC_NOCOLLAPSE;
}

lpdd->CreatePalette(DDPCAPS_8BIT |
DDPCAPS_INITIALIZE | DDPCAPS_ALLOW256,
pal, &lpddpal, NULL);

lpddsprimary->SetPalette(lpddpal);

Jim


#6 SonicSilcion   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 October 1999 - 03:35 AM

__So, you're trying to map a different value of gray to each of the 256 colors. I think you might have a samll problem.
__When running in ture 8-bit color there are only 262,144 colors to work with (an 18-bit pallette.) If I'm correct, you'll see banding in gradients.
__Does anyone know more about how this works in Windows?

[This message has been edited by SonicSilcion (edited October 06, 1999).]


#7 Jim Adams   Members   -  Reputation: 440

Like
Likes
Like

Posted 06 October 1999 - 08:44 AM

If you use the windows palette manager, then it would try to dither it or something to make it look right.

In his case, he couldn't get a full white color, but rather a grayish one when using palette register 255 that he setup previously to a white value.

The thing that I don't know is, with DOS, you have to scale the 8bit value down to 6bit, but I guess DirectX does that automatically when you try to set an 8bit value.

Jim



#8 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 06 October 1999 - 10:31 AM

When I do a bltcolorfill, it look fine (white), but when I try to changed the font color to 255...it is still a greyish color. Are fonts restricted in their color? Or should I ideally be able to set it as any color?

Oh, btw, setting the font to 0 (black) will work just great...





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS