• Advertisement

Archived

This topic is now archived and is closed to further replies.

Palette in D3D??

This topic is 5754 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone know how to specify a pallete for a real-time rendering texture I am working on?

Share this post


Link to post
Share on other sites
Advertisement
It''s in the SDK documentation!!:

IDirect3DDevice8::SetPaletteEntries
IDirect3DDevice8::SetCurrentTexturePalette

And:

DirectX 8.1 (C++) ->
DirectX Graphics ->
Programmers Guide ->
Using Direct3D ->
Textures ->
Basic Texturing Concepts ->
Texture Palettes



--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
I turned to the doc as you directed, and tried to set up my own pallete. Here is the code I used:

PALETTEENTRY m_mypal[256];
int index = 0;
for(index; index < 256; index++)
{
m_mypal[index].peRed = 100;
m_mypal[index].peGreen = 100;
m_mypal[index].peBlue = 100;
m_mypal[index].peFlags = 1;
}

if(FAILED(m_pd3dDevice->SetPaletteEntries(16381 ,m_mypal)))
return E_FAIL;

I dunno why the call, m_pd3dDevice->SetPaletteEntries(16381 ,m_mypal) always resulted in a value of E_FAIL. I can''t find anything wrong with this code. And, I have enabled the alpha capability as exactly what doc instructs.

Like this: m_d3dCaps.TextureCaps = D3DPTEXTURECAPS_ALPHAPALETTE;

Can anyone tell me why this code failed???

Share this post


Link to post
Share on other sites

  • Advertisement