Jump to content

  • Log In with Google      Sign In   
  • Create Account

Plotting Pixels on a Direct3D Texture


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
1 reply to this topic

#1 Phillip Schuster   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 August 1999 - 12:23 AM

Hi all !!

How can I plot pixels on a Direct3D Texture ?? I simply do that:

unsigned char color = 64;

unsigned char* bits = (unsigned char*)TextureSurface;
bits[y*pitch+x] = unsigned char color;

The texture is 8-Bit Palettized. The Texture has a greyscale palette.

On Voodoo cards, this works fine, but on my TNT I get strange colors. I think that is, because the TNT cannot use 8-Bit. How can I plot pixels for the TNT.

If this would work, I only could use 8-Bit. What about 16-Bit Textures, for example RGB565. How can I plot pixels in this texture-format ??


Thanks, Phillip


Sponsor:

#2 NuFAN   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 August 1999 - 12:23 AM

Hi,
I'm not sure, but why not simply use and RGB() struct ? You've got to use an USHORT because of the 16 bit. And remember each color component has the maximum value 31.

code:

#define RGB16BIT(r,g,b) ((b%32)+(g%32)<<5)+((r%32)<<10)

TextureMemory[...] = (USHORT) RGB16BIT(r,g,b);


That should work.

CU

------------------
Skullpture Entertainment
#40842461





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